[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Absolute Beginners Guide to a Simple Timer

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Absolute Beginners Guide to a Simple Timer

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Smurfette   (5 posts)  [Biography] bio
Date Fri 20 May 2005 03:52 PM (UTC)  quote  ]
Message
Okay fellas, smart people, and scholars. I have a very simple question which has confused me and I just can't seem to get what I'm doing. I've a very amatuer VBscript writer, but I don't know how to go about doing this:

I want a script that watches for this text from the MUD:
You begin casting a mighty

When the script sees that text, it begins a counter that counts off 30 seconds.
At the end of the thirty seconds, it prints a local echo of:
YOU'RE NOW ABLE TO CAST MIGHTY AGAIN (in bold red text)

This way, I can see when I am able to use this spell again, and nothing extra is sent TO the mud.


As I said, I know it's a very simple process, but I don't know exactly how to script it, and I'm not sure how to put this into the MUSHClient to make it work.

Thanks so much to anyone who can help. I've searched on this problem but other similar solutions are much more complicated!

-Smurfette
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Fri 20 May 2005 08:42 PM (UTC)  quote  ]
Message
Im assuming that after mighty comes other stuff?

Like, You begin casting a mighty (potato) or whatever?
Or at the very least a period? What's the exact text from the server?

<triggers>
  <trigger
   enabled="y"
   match="You begin casting a mighty *"
   send_to="12"
   sequence="100"
  >
  <send>DoAfterSpecial 30, "ColourNote ""red"", ""black"",""YOU'RE NOW ABLE TO CAST MIGHTY AGAIN"" ", 12</send>
  </trigger>
</triggers>


That'll do it (provided things match).
No (real) scripting involved, just the ColourNote (and that just dictates the syntax).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Smurfette   (5 posts)  [Biography] bio
Date Reply #2 on Fri 20 May 2005 09:01 PM (UTC)  quote  ]
Message
okay, I was a bit vague. actually, this would be the exact input it would look for:

You begin casting stoneskin.


30 seconds after that, I want it to tell me locally that I can cast it again in bold red.


Also, I understand how the script you wrote works, but I don't understand how it gets enabled. Do I save this as a VBS file and load in into the scripts section or what? Sorry for such silly questions!

- Smurfette
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #3 on Fri 20 May 2005 10:04 PM (UTC)  quote  ]
Message
That's not a script. That's a trigger.

Copy between (including) <triggers> and </triggers> and then go to the trigger dialog (thats the one with the table/grid of the trigger things) and click the paste button (on the right side) and that should paste itself in there.

You'll can do the whole variable thing.

Change the match text (in the trigger, after it's pasted) to:
You begin casting *.
and then change the send text (that's the stuff that you see, to:
YOU'RE NOW ABLE TO CAST %1 AGAIN.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Smurfette   (5 posts)  [Biography] bio
Date Reply #4 on Fri 20 May 2005 10:22 PM (UTC)  quote  ]
Message
* Sigh *

I guess I'm not doing something right, cause it's still not working. When I do just what you say to do, it tells me:

Send-to-script cannot execute because scripting is not enabled.

So, I go into the trigger and change the "send to:" to "output".

Now, as soon as the the trigger sees the correct words come up, it INSTANTLY pastes into the output:

DoAfterSpecial 30, "ColourNote ""red"", ""black"",""YOU'RE NOW ABLE TO CAST Bedroom stoneskin"" ", 12


There is no timer working, it's instantanious, and there seems to be no reading of this code. Am I a hopeless case, or is there something very obvious I'm missing. by the way, I got the variable thing working, which is nice! Now i just need the timer thingie operating correctly.

-Smurfette
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #5 on Fri 20 May 2005 11:49 PM (UTC)  quote  ]
Message
You need to enable your script (and change it back).

Game > configure > scripting
Check the 'enable scripting' box.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Smurfette   (5 posts)  [Biography] bio
Date Reply #6 on Sat 21 May 2005 12:11 AM (UTC)  quote  ]
Message
It works!!!! Thank you Thank you Thank you!

-Smurfette
[Go to top] top

Posted by Smurfette   (5 posts)  [Biography] bio
Date Reply #7 on Tue 31 May 2005 04:32 AM (UTC)  quote  ]
Message
Okay, I'm having great fun with all these, but I have a new problem. Here's what my trigger is looking for:

Your are completely digested.

Then, the trigger goes "You can eat now" 1 second after that.

I want there to be a message stating "Digested for 1 minute now" to occur after 60 seconds, also.

When I try to make two triggers off the same text, usually only the first one works. When I put the commands in the same trigger, they ALL go off at the same time, every time each of the times has been reached. (if that doesn't make sense, don't worry about it!)

Needless to say, I want to be able to make a trigger execute two or even three specific local echos. Can you help with this? Thankss!!

-Smurfette
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #8 on Tue 31 May 2005 04:47 AM (UTC)  quote  ]
Message
You'll need to use multiple DoAfters, like this:
<triggers>
  <trigger
   enabled="y"
   match="You are completely digested."
   send_to="12"
   sequence="100"
  >
  <send>DoAfterSpecial 1, "ColourNote ""red"", ""black"",""You can eat now"" ", 12
DoAfterSpecial 60, "ColourNote ""red"", ""black"",""Digested for 1 minute"" ", 12</send>
  </trigger>
</triggers>


That does two different DoAfter's each with their own time, and their own message.
Except, you may need to change the match text, since well, I wasn't sure if the 'Your are' was a typo or not.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] 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.


3,344 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]