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
➜ General
➜ Teacher, can I have some homework?
|
Teacher, can I have some homework?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| MushclientNewbie
USA (33 posts) Bio
|
| Date
| Sun 16 Mar 2003 05:04 AM (UTC) |
| Message
| Alright, I utterly love your client Nick G. but, I have had no experience with any of the scripts (vb, java, and pearl). All of my mudding experience in the past has been with Gmud and the past month has been like stepping from pre-algerbra into calc III. Now, I'll get on with the meat of my post.
I want Mushclient to work its wonderful magic for me to roll a character on a mud. But, aside from choosing the trigger I want it to fire from - I'm lost. I will go ahead and post the output and, if somneone could, read through it and explain what I can do. Okay, here's the output - its a single line and I'll explain more as I go along:
[40] Cmds: help, end, roll, add, rem>
And, my trigger looks like this:
[*] Cmds: help, end, roll, add, rem>
Now, I want Mushclient to read the number in the wildcard and do two things. One, if it is equal to or higher than some number then I want it to beep and disable the trigger. If not, then it will 'roll.' Two, I want Mushclient to record the wildcard and keep track of the highest wildcard and display that high number.
Please, when you explain it, record every step so I can try to re-produce what you do. I don't want to have to come here for every single little thing I need ;) . Also, if there is some basic script site out there or here, that I've missed, I would love being directed towards that.
Thanks, Matt. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Sun 16 Mar 2003 10:20 PM (UTC) Amended on Thu 08 May 2003 09:36 AM (UTC) by Nick Gammon
|
| Message
| You basically need to have your trigger call a small script. Go the configuration for the world, enable scripting, language VBscript, and choose a script file (you can use the existing exampscript.vbs file if you want).
Then add to the bottom of this file your script subroutine, like this:
sub OnRoll (name, line, wildcards)
dim roll
'
' Find the amount rolled (wildcard 1) and convert to integer
'
roll = CInt (wildcards (1))
if roll < 40 then ' choose your number here
world.DoAfter 1, "roll" ' roll again a second later
else
world.EnableTrigger "mytrigger", 0 ' disable your trigger
world.Sound "ding.wav" ' get the exact path here
end if
end sub
Save this, answer "yes" if it asks you to reprocess the script file. If no errors, change your trigger to have the "script" field have "OnRoll".
That should do it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MushclientNewbie
USA (33 posts) Bio
|
| Date
| Reply #2 on Tue 06 May 2003 09:03 PM (UTC) |
| Message
| Okay, I still have a problem. Mushclient won't recognize the trigger unless I use just the first two characters:
[*
Then, the wildcard isn't an interger... I don't know what to do. I tried using a regular expression, but since I know nothing about regular expressions I didn't have much sucess. Could I have a little more help?
The script, I think, will work fine. I just had to add an end sub. Otherwise, I'm pretty sure that the only problem here is getting Mushclient to see and process this trigger the way we want:
[*] Cmds: help, end, roll, add, rem>
I'm stumped.
Matt. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Thu 08 May 2003 09:37 AM (UTC) |
| Message
| Sounds like there might be something else on the line, try this:
[*] Cmds: help, end, roll, add, rem>*
Make sure you get the spacing right, copy from the output window and paste into the trigger.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MushclientNewbie
USA (33 posts) Bio
|
| Date
| Reply #4 on Sun 06 Jul 2003 04:23 AM (UTC) |
| Message
| | Thanks, that was it. There were a few spaces after the ">" that kept the trigger from activating. | | 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.
18,089 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top