Gammon Forum
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.
11,018 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.