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.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ VBscript
➜ High Score Tracking
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Xyborg
Canada (47 posts) Bio
|
Date
| Thu 09 Oct 2003 09:08 AM (UTC) Amended on Thu 09 Oct 2003 09:09 AM (UTC) by Xyborg
|
Message
| Ok. I want to track the highest score from playing the slots in a mud. The triggers is "You have won # dollars!"
Now. I think I know how to write this, but I'm not entirely sure, hence the reason I'm posting here.
<triggers>
<trigger
enabled="y"
match="You have won * dollars!"
script="OnWin"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
</triggers>
<script>
<![CDATA[
sub OnWin (sName, sLine, wildcards)
dim new
dim last
dim highest
<!-- Little foggy around this area. Don't know how to get %1 from the trigger. -->
if (new > last) then
SetVariable "highest", "new"
end if
End Sub
]]>
</script>
Other than the part I don't know how to do, I think I have it right. Any help would be great help. |
We offer power to those willing to take it. Sadly, few are unburdened enough by their prejudices to accept. | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #1 on Thu 09 Oct 2003 12:05 PM (UTC) |
Message
| %1 in the script is wildcards(1) |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Reply #2 on Thu 09 Oct 2003 04:27 PM (UTC) |
Message
| Personally, I would just do:
Sub OnWin (sName, sLine, wildcards)
if CInt(Wildcards(1)) > CInt(World.GetVariable("HighScore")) Then World.SetVariable "HighScore", Wildcards(1)
End Sub
CInt converts the value to an integer. If your numbers can be very large, you might want to switch to a Long Integer. [CLng] |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | 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.
12,660 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top