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 ➜ General ➜ Timers within Plugins

Timers within Plugins

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

  Refresh page


Posted by Winddancer   (34 posts)  Bio
Date Sun 19 Oct 2025 06:23 PM (UTC)
Message
I started to clear up my huge MCL character file by exporting re-usable stuff into a plugin.
So far, the plugin works.
However, I included an active timer within the plugin which I would like to be able to enable or disabled without having to modify the plugin file or by enabling and disabling the plugin itself.

How would I therefore go about to have an alias?, needs to be most likely added to the plugin itsel, with which I can enable or disabled a timer within the plugin
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 19 Oct 2025 08:44 PM (UTC)
Message
Yes, you would add an alias to the plugin, then it can control any timer inside the plugin.

- Nick Gammon

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

Posted by Winddancer   (34 posts)  Bio
Date Reply #2 on Sun 19 Oct 2025 10:24 PM (UTC)
Message
How would such an alias look like?
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 20 Oct 2025 05:49 AM (UTC)
Message
Something like this:


<aliases>
  <alias
   match="DisableFoo"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
EnableTimer("MyTimer", false)
print ("Timer MyTimer disabled")
  </send>
  </alias>

  <alias
   match="EnableFoo"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
EnableTimer("MyTimer", true)
print ("Timer MyTimer enabled")
  </send>
  </alias>
</aliases>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


You could paste that directly into the plugin file. Change MyTimer to be the name (label) of the timer you want to affect.

- Nick Gammon

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

Posted by Winddancer   (34 posts)  Bio
Date Reply #4 on Mon 20 Oct 2025 06:11 AM (UTC)
Message
Thanks a bunch !
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.


81 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.