comma replacing

Posted by Helpless on Mon 24 Jun 2013 06:59 PM — 3 posts, 13,743 views.

#0
im trying to make a JScript to keep track of how much gold i deposit throughout the day.
the problem is the comma in the deposit amount is messing it up...i've tried messing with
the replace function (provided in the mushclient helpfiles) and didnt get anywhere (im a newb).

sometimes the results of depositing 1,000 coins were "01000" and if repeated deposit, sometimes would say "51201000". it would never add the amounts though.

<trigger
enabled="y"
match="*You deposit * coins in the bank."
send_to="12"
sequence="100"
>

<send>
money = GetVariable ("money");

if (money == null)
money = "0";
world.SetVariable ("money", parseInt (money) + %2);
</send>
</trigger>

as long as the amount i deposit doesn't have a comma, it works fine.
(my attempts to mess with Replace aren't shown here...they failed and yours
will most likely work :P)
Amended on Mon 24 Jun 2013 07:00 PM by Helpless
#1
all these people viewing my post and no one wants to help? why :/
Australia Forum Administrator #2
Quote:

(my attempts to mess with Replace aren't shown here...they failed and yours
will most likely work :P)


Because you failed to show your attempts.

Don't cross post, I'll lock this thread.