Absolute Beginners Guide to a Simple Timer

Posted by Smurfette on Fri 20 May 2005 03:52 PM — 9 posts, 34,109 views.

#0
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
USA #1
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).
#2
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
USA #3
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.
#4
* 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
USA #5
You need to enable your script (and change it back).

Game > configure > scripting
Check the 'enable scripting' box.
#6
It works!!!! Thank you Thank you Thank you!

-Smurfette
#7
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
USA #8
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.