Imperian curing system

Posted by Ren0 on Sat 10 Jul 2004 10:53 AM — 4 posts, 24,435 views.

#0
I'm sitting here, everything but a newbie at programming, and trying to make a script to cure afflictions in Imperian. The way I decided to create the script was create variables that are either 0 or 1, and then have the script cure on herb balance, whatever I deem to be the most dangerous affliction (such as making a list with the afflictions in order of most dangerous to least dangerous).

I have a few problems with this, mostly the fact that I need MUSHclient to practically continuously check what afflictions i have on me, so that it actually initiates the curing process so that I get the herb balance message. I could use a timer that checks each second, but that seems like an excess. Also, if indeed you super intelligent coders out there think I should use a timer, then I need to know how to script the timer to make it check what variables are set to "1". A thought hit me, out of the blue, saying that this would be so much easier if you could put variables in groups, as well as triggers. In that case, you could check if, for example, world.variablegroup ("affliction", "stupid", "1") is true, perhaps even scrollable by a counter with every variable being assigned a number. Perhaps something worth pondering, Nick? This could also make it easy to make lists, even if they wouldn't look like ordinary lists.
Amended on Sat 10 Jul 2004 10:55 AM by Ren0
USA #1
Just assign your variables numbers instead of names.

You could also script your variable checking a little, and achieve your grouping. Just have two parts to your variables, strung together with an underscore. Its been covered in the past if I remember correctly. Or at least, someone talked about it in the past, you could probably find the code if you searched for it.

You could also use an array. If you preset your afflictions in a certain order, then the array name would be your 'variable group' and youd have an indexed list already.

Are you sure theres no other way? Is there a score/status/whatever screen to tell you? and then does it give wear off (or whatever) messages? Id hate to think a timer would be the only way.
Greece #2
Could you tell us a bit about how afflictions work? I have no idea what they are...
Canada #3
Is this thread appropriate for you too?

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4347&page=1