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.
 Entire forum ➜ MUSHclient ➜ General ➜ help with making a delayed trigger

help with making a delayed trigger

You need to log onto the forum to reply or create new threads.

  Refresh page


Posted by Rubriccode   (4 posts)  Bio
Date Tue 08 Oct 2024 05:44 PM (UTC)
Message
i have searched through the forum and I am completely lost, and the scripting tutorial doesn't show what I want to do or I just don't understand it.

I am trying to make a trigger that does something after 5 seconds. when I tried to do the send to world(speedwalk) and having speedwalk set to 5000 miliseconds it didn't fire at all.

so I am trying to do it through a script

in the script file I have the follow I got from another post on the forum changed to fit what I need.

sub OnLax(tname, line, wildcards)
world.DoAfter 5, "tug light"
end sub

and it gives me an error i dont understand
Error number: 0
Event: Compile error
Description: [string "Script file"]:1: '=' expected near 'OnLax'
Called by: Immediate execution


i have the trigger set to send to world
the label field is tug
the script field is OnLax
enabled is checked

I do not know what I am doing so do not know what I am doing wrong.

please help
Top

Posted by Rubriccode   (4 posts)  Bio
Date Reply #1 on Tue 08 Oct 2024 06:24 PM (UTC)
Message
I think I figured it out finally. I was got a little confused

so in the send box I put
DoAfter(5,"myText")

and had it send to script. but the trigger would not fire. then I put

world.DoAfter(5,"myText")

and the trigger fired.
Top

Posted by Nick Gammon   Australia  (23,100 posts)  Bio   Forum Administrator
Date Reply #2 on Wed 09 Oct 2024 09:50 AM (UTC)

Amended on Wed 09 Oct 2024 09:51 AM (UTC) by Nick Gammon

Message
In Lua, if that is your scripting language, function arguments have to go inside brackets, with the exception of a single string. For example:


print "hello"

or:

print ("hello")


However for other things, like multiple arguments, you must use brackets, eg.


print (2 + 2)
print (a, b)
print ("foo", "bar")

- Nick Gammon

www.gammon.com.au, www.mushclient.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.


337 views.

You need to log onto the forum to reply or create new threads.

  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.