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 ➜ Lua ➜ How to create a timer that sends to Script?

How to create a timer that sends to Script?

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


Posted by Eloni   (28 posts)  Bio
Date Wed 22 Jan 2014 12:37 AM (UTC)
Message
I can create a timer that sends to the mud rather easily using this:


AddTimer ("soulsteal", 0, 0, 1.5, "TryAgain = true", 
          timer_flag.Enabled + timer_flag.OneShot, "")


But I can't figure out how to make one that will process "TryAgain = true" as a script. This option is available in MUSHclient's GUI. I just can't figure out how to do it with the AddTimer function.
Top

Posted by Eloni   (28 posts)  Bio
Date Reply #1 on Wed 22 Jan 2014 12:59 AM (UTC)
Message
After carefully rereading this a few times I see that it says the fifth argument is something you specifically send to the mud... Is there a way to have it send to script?

The last argument is "the name of a script subroutine" but I honestly don't know what that means :D
Top

Posted by Eloni   (28 posts)  Bio
Date Reply #2 on Wed 22 Jan 2014 01:06 AM (UTC)
Message
I figured it out. I had to make a function that changed the variable "tryAgain = true" and put the name of the function as the last argument in AddTimer
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 22 Jan 2014 11:15 AM (UTC)
Message
Template:function=ImportXML ImportXML

The documentation for the ImportXML script function is available online. It is also in the MUSHclient help file.



You could use that to make (import) a timer that had the "send to" field set to "script" and thus the timer "send" would be any script command(s).

However in general in this case, you could make a timer in advance, and just enable or disable it, thus not needing to create it from scratch at all.

- Nick Gammon

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

Posted by Eloni   (28 posts)  Bio
Date Reply #4 on Fri 24 Jan 2014 02:01 AM (UTC)
Message
Thanks! I didn't know understand import/export xml. I used them for the first time just now and I'm sure I will get a lot of usage out of it. I appreciate the tip!
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.


15,285 views.

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.