View Full Version : Resting Script
I wrote a script for the Stormfront front end, and I need help with it.
The purpose: To check my mind every 150 seconds. If not "clear as a bell," continue to rest. If "clear as a bell," then log off the game.
The Problem: The script runs, and every 150 seconds, it puts in the "exp" verb and the proper message is displayed, but it seems to be hung in an infinite loop. It does not match the "done" when it sees, "You mind is as clear as a bell." It just conitues to put in "exp" every 150 seconds.
Thanks in advance.
=======================
Script:
start:
put exp
match done Your mind is as clear as a bell.
match notdone Your mind is fresh and clear.
match notdone Your mind is clear.
match notdone Your mind is muddled.
match notdone Your mind is becoming numbed.
match notdone Your mind is numbed.
match notdone Your mind can't take much more of this! You must rest!
match notdone Your mind is completely saturated. It is imperative that you rest immediately!
notdone:
wait 150
goto start
done:
put quit
Remove the periods in the matches, make sure you have no spaces after them. It all looks good, can't see why it's not working.
Thanks. Removed the periods and there are no spaces. Did not work.
==============
Here is the revised script:
start:
put exp
match done Your mind is as clear as a bell
match notdone Your mind is fresh and clear
match notdone Your mind is clear
match notdone Your mind is muddled
match notdone Your mind is becoming numbed
match notdone Your mind is numbed
match notdone Your mind can't take much more of this
match notdone Your mind is completely saturated
notdone:
wait 150
goto start
done:
put quit
Lord Nelek
04-03-2008, 02:47 AM
You're missing a matchwait.
Lord Nelek
04-03-2008, 02:47 AM
Thanks. Removed the periods and there are no spaces. Did not work.
==============
Here is the revised script:
start:
put exp
match done Your mind is as clear as a bell
match notdone Your mind is fresh and clear
match notdone Your mind is clear
match notdone Your mind is muddled
match notdone Your mind is becoming numbed
match notdone Your mind is numbed
match notdone Your mind can't take much more of this
match notdone Your mind is completely saturated
notdone:
wait 150
goto start
done:
put quit
This should be:
start:
match done Your mind is as clear as a bell
match notdone Your mind is fresh and clear
match notdone Your mind is clear
match notdone Your mind is muddled
match notdone Your mind is becoming numbed
match notdone Your mind is numbed
match notdone Your mind can't take much more of this
match notdone Your mind is completely saturated
put exp
matchwait
notdone:
wait 150
goto start
done:
put quit
Haha duh, simplest problem and I missed it.
Oh, OK. For some reason I thought matchwait was only used if there was some sort RT for an action. So matchwait needs to be in every script if I want it to work properly?
Thanks for the help.
TheEschaton
04-03-2008, 10:26 AM
Every time you want to do a match of some sort, you need the combo of:
1. The possible matches and where they go (which you have).
2. The command that could possibly trigger those matches (which you have).
3. The "matchwait" command that will tell the script to check for those possible matches after that command.
-TheE-
Oh, I see. Matchwait is not matching a wait RT, it's matching the matches you establish. Makes sense.
Thanks for the help.
Bobmuhthol
04-03-2008, 11:51 AM
Without the matchwait, here's what your script is interpreted as by SF:
start:
put exp
wait 150
goto start
The matchwait command pauses the script until it finds one of the strings you're trying to match -- in some cases, this could be minutes later. It's also necessary because it's possible to have matches in the same table for matchwait that come from different places in the script.
Cool. That explains why it appeard to be an infinite loop.
Sylvan Dreams
04-03-2008, 06:58 PM
There's no reason to do a script like this. Just use Ctrl+R for restmode and make your script:
waitfor (mind messaging here)
put exit
That's what I do.
Restmode will automatically type in "exp" for you every so often so all your script needs to do is wait for the messaging you want and then exit. I use it pretty often to go from saturated down to "must rest" and sometimes to go from "must rest" to "clear as a bell"
Renian
04-03-2008, 07:15 PM
Dammit, you beat me to it, Sylvan.
I was going to say use PSINET RESTMODE ON instead though.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.