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)
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)