world.DoAfter

Posted by Ploppaz on Sat 30 Aug 2003 06:57 AM — 4 posts, 14,782 views.

#0
Hello.

I'm a total newbie to scripts, but I tried to make one of my own.

The script file is as follows:
--
Sub test
world.DoAfter 10, "echome 'Aye"
end sub
--
Am I correct in assuming that this will send the command "echome 'Aye" to the mud in 10 seconds? I have scripting enabled, and the script file selected - do I need to do anything else?

I have also tried running "§world.DoAfter 10, "echome 'Aye"" (§ being my prefix) but this havn't worked either.

What happens is that I enter the command, or run my script §test - and I get no output whatsoever, and no command sent to the mud after 10 seconds.

What have I done wrong here?

Sincerely,
\Ploppaz
Australia Forum Administrator #1
I tested that and it worked, as I would expect. What is wrong? Try something simpler first, like:

§world.Note "test"

You should see "test" appear immediately. If not, something is wrong with scripting. If it does, the DoAfter is not working. DoAfter actually creates a timer. Do you have timers enabled? Also under global preferences, what is the timer interval? 1 second?

Greece #2
Yes, it sounds correct, but the sub should be

Sub test (name, line, wildcards)
world.DoAfter 10, "echome 'Aye"
end sub

otherwise you'd get an error... Since you're not getting anything, I'd try Nick's suggestions, the problem should be there.
Amended on Sat 30 Aug 2003 10:39 AM by Poromenos
#3
Aha! :D

I didn't know you would have to have timers enabled, thank you :) It works now.