Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ VBscript
➜ Adding to variables.
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Scarn
(47 posts) Bio
|
Date
| Tue 26 Jul 2005 01:08 PM (UTC) |
Message
| Hi,
I have a varible for the amount of gold I am carrying that shows in the info bar...
this is the string i use to get that variable:
Gold: (.*) Encumbrance: (.*)
setvariable "Gold", "%1"
setvariable "Weight", "%2"
infoclear
world.InfoFont "Courier", 10, 1
world.infocolour "red"
info "Health: " & getvariable("Health") & " Energy: " & getvariable("Energy") & " Gold: " & getvariable("Gold") & " Weight: " & getvariable("Weight")
i want to be able to add to this figure as i get more gold .... rather than having to check my nventory to update it, here is the emote for getting gold.
You put * gold in your pockets.
could some help me by telling me the script to add * to the "Gold" variable?
Thanks,
-Scarn | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #1 on Tue 26 Jul 2005 03:06 PM (UTC) |
Message
| You'll obviously need a trigger to match, and you can use this script to update the variable:
setvariable "Gold", getvariable("Gold") + %1
(you'll then have to update your info bar).
Since you'll be doing that, you might want to do something like this:
dim gold
gold = getvariable("Gold") + %1
setvariable "Gold", gold
[and then you can use 'gold' to set your infobar line, which removes the need to use another getvariable, which will perform better] |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Scarn
(47 posts) Bio
|
Date
| Reply #2 on Tue 26 Jul 2005 08:14 PM (UTC) |
Message
| it doesnt work...heres the trigger:
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="You put * gold in your pockets."
regexp="y"
send_to="12"
sequence="100"
>
<send>dim gold
gold = getvariable("Gold") + %1
setvariable "Gold", gold</send>
</trigger>
</triggers>
| Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #3 on Tue 26 Jul 2005 09:12 PM (UTC) |
Message
| What doesn't work about it? Are you sure you're matching? (turn on trace, or color the line)
Is it instead appending the number to the original value? What isn't working? |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
14,748 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top