Sleep Healing Monitor plugin
Posted: Fri Apr 22, 2016 10:40 am
So, normally when I start a mud, I only worry about scripting the big stuff. A do/then is pretty standard for me. Adding/correcting a mapper is also pretty crucial. I usually don't get down into this level of stuff for quite a while. However, the grind here is extreme, so I've had some time to work on these small plugins.
So, here it is. Galaban's Sleep Monitor plugin:
https://github.com/galaban/ShatteredIsles_SleepMonitor
Overview
The idea behind this is that when you need to rest, just go to sleep. (That improves your heal rate, right?) Anyways, sleeping fires off a timer that will start checking your prompt every few seconds, looking for a change. Once it detects a change, it will fire off every 20 seconds until there is no longer any change.
At that point, the plugin then broadcasts a message that the healing is complete, and stops the timer.
So what?
Alright, so this is a fairly pointless plugin. However, if you like to sleep to heal, this will help you not wait five minutes to check that you are healed. It just helps you be more efficient at resting.
How to use the plugin
This plugin is just a base plugin. That is, it needs to be modified or hooked into to be highly useful. An example of this would be to play a sound when the healing is complete. (That's what I do.) Another one would be to perform an action (such as quitting if a flag is set, for example).
To modify the plugin, look for the "healingComplete()" function:
In there, you can add a call to "Sound", for example
Just throw that at the bottom of the function and it will play that file.
To hook into the plugin, you will have to write another plugin that listens for the plugin broadcast and then performs the action. If you're not familiar with plugin writing, stick with modifying the plugin.
Cheers
So, here it is. Galaban's Sleep Monitor plugin:
https://github.com/galaban/ShatteredIsles_SleepMonitor
Overview
The idea behind this is that when you need to rest, just go to sleep. (That improves your heal rate, right?) Anyways, sleeping fires off a timer that will start checking your prompt every few seconds, looking for a change. Once it detects a change, it will fire off every 20 seconds until there is no longer any change.
At that point, the plugin then broadcasts a message that the healing is complete, and stops the timer.
So what?
Alright, so this is a fairly pointless plugin. However, if you like to sleep to heal, this will help you not wait five minutes to check that you are healed. It just helps you be more efficient at resting.
How to use the plugin
This plugin is just a base plugin. That is, it needs to be modified or hooked into to be highly useful. An example of this would be to play a sound when the healing is complete. (That's what I do.) Another one would be to perform an action (such as quitting if a flag is set, for example).
To modify the plugin, look for the "healingComplete()" function:
Code: Select all
function healingComplete()
Note("Healing complete. No longer monitoring.")
stopSleeping()
BroadcastPlugin(1, "healcomplete")
endCode: Select all
Sound("E:\\Mushclient\\sounds\\alert1.wav")
To hook into the plugin, you will have to write another plugin that listens for the plugin broadcast and then performs the action. If you're not familiar with plugin writing, stick with modifying the plugin.
Cheers