Greets all,
I'm embarassingly new to scripting and programming of any kind. Everything I've learned of scripting has been learned in the last couple of days, so I may be asking a very basic question.
Anyway, on the MUD I'm playing there are several afflictions (i.e. blindness, nausea, etc.) you can be given via poisons and what not. Each of these afflictions can be cured by eating a certain type of plant. My problem is that you're only allowed to eat a plant every two seconds, but you can be given several different afflictions at once. I need a way to keep track of what I've been afflicted with and then automatically eat the appropriate plants.
For instance, if I'm afflicted with blindness and nausea at the same time, I'll need to have "eat bloodroot" sent to the MUD to cure the blindess and then have "eat ginseng" sent two seconds later to cure the nausea.
What I've done so far is set up variables for each of the afflictions. The name of each of these variables starts with affliction_ followed by the affliction name ,so the variable for blindness is called affliction_blindness. I've set up triggers to change the contents of each of these variables if I've been afflicted with them. So if I'm given blindess, the contents of the affliction_blindness variable will be set to "on" and if I'm cured of the blindness, the contents will be set to "off"
What I need now is a script that can be run that will cycle through each of these afflictions, find all the ones that are "on" and put the appropriate plants into a queue that will send "eat <next plant in queue>" to the mud every 2 seconds until the queue is empty.
If it helps, maybe try giving me a sample script where the afflictions I've been given are blindness, nausea and stupidity. The appropriate plant cures are as follows:
blindness: bloodroot
nausea: ginseng
stupidity: goldenseal
Any help is appreciated and I'll be more than happy to clarify any ambiguities. Thanks!
I'm embarassingly new to scripting and programming of any kind. Everything I've learned of scripting has been learned in the last couple of days, so I may be asking a very basic question.
Anyway, on the MUD I'm playing there are several afflictions (i.e. blindness, nausea, etc.) you can be given via poisons and what not. Each of these afflictions can be cured by eating a certain type of plant. My problem is that you're only allowed to eat a plant every two seconds, but you can be given several different afflictions at once. I need a way to keep track of what I've been afflicted with and then automatically eat the appropriate plants.
For instance, if I'm afflicted with blindness and nausea at the same time, I'll need to have "eat bloodroot" sent to the MUD to cure the blindess and then have "eat ginseng" sent two seconds later to cure the nausea.
What I've done so far is set up variables for each of the afflictions. The name of each of these variables starts with affliction_ followed by the affliction name ,so the variable for blindness is called affliction_blindness. I've set up triggers to change the contents of each of these variables if I've been afflicted with them. So if I'm given blindess, the contents of the affliction_blindness variable will be set to "on" and if I'm cured of the blindness, the contents will be set to "off"
What I need now is a script that can be run that will cycle through each of these afflictions, find all the ones that are "on" and put the appropriate plants into a queue that will send "eat <next plant in queue>" to the mud every 2 seconds until the queue is empty.
If it helps, maybe try giving me a sample script where the afflictions I've been given are blindness, nausea and stupidity. The appropriate plant cures are as follows:
blindness: bloodroot
nausea: ginseng
stupidity: goldenseal
Any help is appreciated and I'll be more than happy to clarify any ambiguities. Thanks!