Register forum user name Search FAQ

Gammon Forum

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 ➜ catching a phrase to reset a timer

catching a phrase to reset a timer

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  

Posted by Scouse   (17 posts)  Bio
Date Mon 24 Jan 2005 12:10 AM (UTC)
Message
Im trying to remember how to capture a line from the world to reset a timer.
I need to be able to match on more than one line (propbably 12 or 13) so it should be expandable . I know this is easy , a trigger can do it , I just cant remember how :(
also , how do i set the timer so that the timer sends me my tic warning 5 seconds before it tics ?


thanks
Scouse
Top

Posted by Scouse   (17 posts)  Bio
Date Reply #1 on Mon 24 Jan 2005 03:04 PM (UTC)
Message
erm , i just re read it , i dont mean 12 or 13 lines in a row , I mean for example ..

The night has begun. would be one line .
The sun rises in the east . would be another etc , etc
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #2 on Mon 24 Jan 2005 06:22 PM (UTC)
Message
Put them all into a trigger (as regexps) with | in between them. You can also use a variable and a trigger to do it, which is easier if you need to change it frequently. Details about that can be found here:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4603

To reset a timer, you just call ResetTimer(TimerName).

As for tics, it depends on the timing, you can use the trigger offset to give you a "five second warning" assuming you can syncronize the timer with the server. (Set the timer for 1 minute, with a 5 second offset, if the tics are one minute apart, but youll need a trigger to get it in synch when you connect (and keep it if the server lags, or whatnot)).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Scouse   (17 posts)  Bio
Date Reply #3 on Tue 25 Jan 2005 03:16 AM (UTC)
Message
heh , I got up to page 35 before I discovered most of what you said :)
appreciate the help tho :)
erm , world reset timer goes to command line im assuming ?
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #4 on Tue 25 Jan 2005 05:17 AM (UTC)
Message
Page 35 of what?

No, it goes in a script. Or something that eventually gets to the script engine. So either a subroutine in a script file, or the send box with sendto script.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Scouse   (17 posts)  Bio
Date Reply #5 on Tue 25 Jan 2005 05:25 AM (UTC)
Message
page 35 of questions in this forum :P

so , now the question becomes , how do I reset the timer with what ive triggered from the mud ?
ie , where do I send what ive go to ? and what would the script be ?
Top

Posted by Scouse   (17 posts)  Bio
Date Reply #6 on Tue 25 Jan 2005 04:00 PM (UTC)
Message
WOOT !
I figured it out ...

enabled vbscript
trigger catches "The day has begun" etc
/world.resettimer Tictimer ( where tictimer is the name i gave it ) gets sent to world
tictimer resets :)
simplicity itself no wi know how lol :D

Thanks for the help flannel
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #7 on Tue 25 Jan 2005 05:23 PM (UTC)
Message
The 'real' way of doing it is change the "send to" to script, and then remove your script prefix (/).

And actually, you'd have to send to execute for your current set up to work.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Scouse   (17 posts)  Bio
Date Reply #8 on Tue 25 Jan 2005 06:30 PM (UTC)
Message
^(* bellows 'Midnight, *|The night has begun.|Saving all threads *|The ratter bellows 'Twelve *)

ok , thats what ive got for a trigger , but now when i try and switch it to a regular expression , it says error occured at column 3 .

I switched it as ya said to send to script .

Ste
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #9 on Tue 25 Jan 2005 07:01 PM (UTC)

Amended on Tue 25 Jan 2005 07:04 PM (UTC) by Flannel

Message
Regexps are different than normal triggers.

In a regexp * is a quantifier, not a wildcard.

You need to replace * with .*
You also might try using the convert to regexp function for each line (or for all of them, but then youll have to go through un-escaping the pipes(|)).

A couple of your other characters need to be escaped as well. Such as the periods, you escape it with a slash.
\. will match on "."

You can read up on Regexp syntax in teh VBScript Docs, or plenty of other places, Nick uses PCRE which is a standard form.

Edit:
If you're creating this from an alias, you can use the MakeRegularExpression function to convert things to a regexp before you append them. You don't need to worry about this I dont think, since I believe you're hard coding the trigger. But just so you know.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Vallick   USA  (14 posts)  Bio
Date Reply #10 on Thu 23 Nov 2006 01:00 AM (UTC)
Message
Hi, Im not great at programming, all I know is html and Vbasic From about... 13 years ago or so? Anyways, not asking for you guys to do the work for me, but if you could point me to the right starting points, I think this is the best place to ask what im looking for.

K, I want a 60 sec tic timer that gives me a 10 second tic warning through the method of a tell in the mud using the command "Gtell <<<-!Tic in 10 seconds!->>>"

I need the commands that reset the ticcer/sink it to the mud to be allong the lines of

"dakina closes her prayer book" but instead of dakina, I need it to work if anyone in the room closes the book, also same for the gender,

And that would be something the mud would output (I think Im using all the terms correctly at the moment)

Can you help me with how I would set this up? Where I would find how I can learn to set this up? ive set allot of things in mushclient so far and am really likeing it, espessially since I've attached sounds to actions, but this is probable the desiding facter here on figuring out not only tic timers, but also what I think are called wild cards or variables.

Thanks for the time.

Vallick Arc'Haven,
Member of the Solamnic Knighthood,
Krynn, Anaslon
(longuriel@yahoo.com)
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #11 on Thu 23 Nov 2006 03:51 AM (UTC)
Message
My initial reaction is that you need a trigger that matches on something like:


* closes * prayer book



That does a "send to script" along the lines of:


DoAfter (50, "Gtell <<<-!Tic in 10 seconds!->>>")


See: http://www.gammon.com.au/scripts/doc.php?function=DoAfter

It seems to me that if you want a 10-second warning before 60 seconds is up, you need a 50-second timer.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Vallick   USA  (14 posts)  Bio
Date Reply #12 on Wed 29 Nov 2006 01:25 AM (UTC)
Message
OK, dont know if I explained it well. lets try again.

A tick is 60 seconds, because the mud is laggy and tics can exceed 60 seconds sometimes, I need triggers to reset my tick timmer such as


"the sun lights the sky"
"closes * spellbook"
"Closes * prayer book"
"you are hungry"
"you are thirsty"

Im not sure how to put this into the timer so it resets the count to 60 seconds from one of these events occuring.

I think the way to get my 10 second warning is to have a 60 second timer with a 10 second offset command to the mud of gtell tic in 10ish seconds.


Im just not sure how?where to insert the triggers that effect the timmer. i Downloaded the arctic mud timmer made by someone or the other thats listed on this sight, its a jave script file with xmp (I think) as the file type. I currently have it active on the mud but its not working correctly, I think because I dont have it set right in the timmer file or something, but dont know java script so dont know how to add to it or correct it.


A sample of what I want to see on the mud is:

123h 123v 1x 1c news> (this is the command prompt)
You tell the group "tic in 10 seconds"
(10 seconds latter)
You close your prayer books with a content smile on your face.
tic timmer reset
(50 seconds latter)
You tell the group "Tic in 10 seconds" (and so fourth)

Vallick Arc'Haven,
Member of the Solamnic Knighthood,
Krynn, Anaslon
(longuriel@yahoo.com)
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #13 on Wed 29 Nov 2006 05:04 AM (UTC)
Message
Quote:

I think the way to get my 10 second warning is to have a 60 second timer with a 10 second offset command to the mud of gtell tic in 10ish seconds.


What was wrong with my idea of having the timer go off after 50 seconds?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Vallick   USA  (14 posts)  Bio
Date Reply #14 on Wed 29 Nov 2006 08:16 AM (UTC)
Message
Are you saying have the timer be 50 seconds, or the offset? I thought what the offset does is warn you X seconds before timer ticks over

Vallick Arc'Haven,
Member of the Solamnic Knighthood,
Krynn, Anaslon
(longuriel@yahoo.com)
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.


53,458 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.