Forum

> > CS2D > Scripts > Error with values
Forums overviewCS2D overview Scripts overviewLog in to reply

English Error with values

5 replies
To the start Previous 1 Next To the start

old Error with values

loadkinger
User Off Offline

Quote
Hello,

I Need help with any values.

See my script

1
2
3
...
print(k)
...


Output
1
2
3
4
5
6
7
8
9
10
5
5
5
5
5
5
5
5
5
5

then

1
2
3
if k:find("5\n 5\n 5\n") then
msg("It works")
end

Is not working, the msg is not showing, why?

old Re: Error with values

loadkinger
User Off Offline

Quote
user Starkkz has written
You misunderstood me.
1
2
3
if k:find("5\n5\n5\n") then
msg("It works")
end


Output :

1
5

-----------


user loadkinger has written
1
2
3
4
5
6
7
8
9
10
5
5
5
5
5
5
5
5
5
5


I Need read somy letters in with find.
The problem is : He is getting new line
Ex :
5
5
5
5
5
5

old Re: Error with values

EngiN33R
Moderator Off Offline

Quote
I haven't a bloody clue as to what you want.

user loadkinger has written
See my script

1
2
3
...
print(k)
...

This is not your script, this is one insignificant line that hardly helps to understand your issue.

CS2D's print function is a bit weird and doesn't support new lines all that well. If you're getting a steady stream of fives, each on a new line, then it means that print is being called multiple times, which implies a recursion or loop of some sort. If that is the case, then every k is actually just a '5' and doesn't contain any newline characters. Therefore, finding '5\n5\n5' will fail.

user loadkinger has written
I Need read somy letters in with find.
The problem is : He is getting new line
Ex :
5
5
5
5
5
5

This makes even less sense that everything you have said up to this point combined. I'm sorry, but you're going to have to explain yourself better.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview