Hallo, I wanted to parse numbers like that:
inventory
You are carrying:
[01] a sword
[02] a dagger
[03] a piece of meat [25]
so that I can keep track of pieces of meat I have.
I mean:
*[*] a piece of meat [*]*
and I want the "25" to go into an INTEGER variable, so I can do, say:
pieces_of_meat = integer("%3");
if (pieces_of_meat < 5) world.note("You have to buy meat!!!")
AND
do something like:
* gives you a piece of meat.*
pieces_of_meat = pieces_of_meat + 1;
Is there any way to "get number from string", using JScript in MushClient?
-okram-
inventory
You are carrying:
[01] a sword
[02] a dagger
[03] a piece of meat [25]
so that I can keep track of pieces of meat I have.
I mean:
*[*] a piece of meat [*]*
and I want the "25" to go into an INTEGER variable, so I can do, say:
pieces_of_meat = integer("%3");
if (pieces_of_meat < 5) world.note("You have to buy meat!!!")
AND
do something like:
* gives you a piece of meat.*
pieces_of_meat = pieces_of_meat + 1;
Is there any way to "get number from string", using JScript in MushClient?
-okram-