trigger delay in the middle of the trigger

Posted by 223kazin on Thu 26 Jun 2008 02:27 AM — 6 posts, 28,510 views.

#0
I can't seem to figure this out for the life of me(Not very script savvy). What I'm trying to do is make a multi-line trigger and have a delay go off in the middle of it.
Example:

unload clip from rifle
(wait 1.5 seconds) put clip into backpack
get clip from belt
load clip into rifle.

I'm not entirely sure if this is possible, I've been digging around for a while now and have yet to come up with anything.
Australia Forum Administrator #1
See http://mushclient.com/faq point 25.
#2
Gah...I must be doing something wrong, I can't get this to work. No matter how I script it I always get an error after closing the script window to test it our. Chances are it's some miniscule, stupid reason that I'm overlooking completely.
Australia Forum Administrator #3
Please copy the trigger and paste it here. See:

http://mushclient.com/copying

Please copy the error message and paste it here.
#4
Send ("put e-clip in backpack")
wait.time 1
get e-clip from belt
load e-clip into k-1

[string "Script file"]:33: bad argument #1 to 'module' (string expected, got nil)
stack traceback:
[C]: in function 'module'
[string "Script file"]:33: in main chunk

I loaded up the wait.lua script but just can't seem to figure it out.. As I've said, I know almost nothing about scripting, sadly. Thanks for your help Nick, it's really appreciated.
Australia Forum Administrator #5
You didn't exactly copy and paste the trigger as I asked, or I would be seeing <trigger> in your reply. Please follow that link to do that.

As for your code, in the FAQ the example was:


wait.time (1)
Send ("get food bag")


You have:


wait.time 1
get e-clip from belt
load e-clip into k-1


You don't have brackets around the 1, and the other stuff needs to be "sent". So the very least it would need to be is:


wait.time (1)
Send ("get e-clip from belt")
Send ("load e-clip into k-1")


However without seeing your whole script, there might be more problems.

Please paste the whole trigger, it makes it easier to help.