Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Sun Dec 10, 2006 12:04 pm   

Auto Healing Trigger Help Please
 
OK to the patience and great advice from Fang Xianfu I am detecting afflictions and putting them in healing string lists ... now I need to get them to cure on auto

ok this is where I am at so far

Ill give a simple example of amnesia
My triggers for getting it are

#trig {You are having trouble remembering things.}{#additem potioncure1 amnesia}
#trig {You are plagued by a slight form of amnesia.}{#additem potioncure1 amnesia}

Also if I self diagnose (I do and think this needs to be automated to do regularly) I also get this

#tr {You are plagued by a slight form of amnesia.}{#WIN Disease amnesia}

So as you can see now I have my amnesia in a window called disease along with any other ailments which are updated on/off as i get and cure them using diagnose. Also I now have amnesia sitting in my #VAR potioncure1 waiting to be picked up and healed.

I have made an alias abc {amnesiacure1}{asip antidote}
I have made a variable #var {potionsat1}

Ok so now I got two points im stuck with 1st how do i automate this so it runs like this

get sick (usually multiple things)
#trig {You are having trouble remembering things.}{additem potioncure1 amnesia}

check if its ok to sip potion (also here i want to check potion, allheal, smoke and herb saturations)

#var {potionsat1}

See what diseases I got (again looking at the potioncure1, allhealcure1, herbcure1, magicure1 string list variables)

#var {potioncure}{amnesia|vomitting|anorexia}

pick out as much as is possible to heal (am sure i can sip potions, sip allheal, eat herbs and do magic all together)

abc {amnesiacure1}{asip antidote}

Also (I know I am asking alot) how do i stop a loop if say my pipe isnt lit or i have not got that potion out etc

Thanks as always

Semi Auto Stark62 ;)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Dec 10, 2006 12:32 pm   
 
The way I've done this in the past is to use a variable (I'll use drinking a health potion as an example) @CanSip. Your script to automatically drink your health potion will only do so if CanSip is 1. When it tries to drink something, it'll set CanSip to 0. When you get the "You can drink a health or mana potion again" message, it sets CanSip back to 1 so you can drink again.

In a similar manner, you can fix your smoking problem. Have the "your pipe isn't lit" message set CanSmoke to 0, and have the "You light your pipe" message set it back to 1.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Sun Dec 10, 2006 12:54 pm   
 
Yes Ill try that 1 thing on the herbs and therefore smoking (herbs also) there is no actual message to say you can take them again only a message of "it has no beneficial effect" if it didnt work which is of no use as you have already wasted another puff. Apparently the delay is 1 second so is it possible in zmud to trigger it to @Cansip 0 and then some timer to reset it to 1 after 1 second.

Lastly specifically to Fang (and thanks man you are awesome help) I posted a question (creative solution) about using CMUD against ZMUD what you think?
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Sun Dec 10, 2006 2:43 pm   
 
OK Im trying not to be dumb here

I have got the triggers variables and alias for a couple things working and i am sort of understanding it which is good as I think i can now translate this through my ailments etc ok I am left with my last problem I think

Probably the best trigger to check if I have an ailment and then try to cure it is

#trig {(%d)h, (%d)m ([a-z])%p}

which goes off every time anything happens (I got a couple of things working off the letters already)
so if I use (%ismember(amnesia,@potioncure1)) {cure amnesia} as suggested before (another post looking for a creative solution) do I use this for all 41 conditions I know of
eg

(%ismember(amnesia,@potioncure1)) {cure amnesia}
(%ismember(amnesia,@potioncure1)) {cure amnesia}
(%ismember(amnesia,@potioncure1)) {cure amnesia}
(%ismember(amnesia,@potioncure1)) {cure amnesia}

etc etc or is that going to slow me down alot (not sure how long it takes to sort through 41 ailments check 5 curing conditions and cure a few ...... will this cause lag do you think if the trig is going off pretty rapidly?

thanks sorry for the laboured point but if I get this right I can then build complete curing system automated with manual backup
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Dec 10, 2006 3:49 pm   
 
I'd put them into an alias to save on clutter. But if you have an #if (@CanPotion) check before you do all that %ismember processing, the alias won't actually do anything with all of those nested #ifs that're working on cures unless it's actually able to cure them. Once the CanPotion check is false, it won't do anything at all with the true command, and so it won't slow you down :)

And I already posted a reply on CMUD, I thought.

EDIT: Evidently not. I'm not going to type it out again, so just read this. Everything it says there is true (10x speed is a conservative estimate, too. If you update your scripts to take advantage of new syntax, it can get even faster). It's now stable enough to rely on, and I'm told importing your zMUD settings is easy as pie. And as if that wasn't enough, you won't get those horrid corruption bugs that troubled zMUD!

I literally can't use zMUD now - if only for how much better CMUD looks and feels than zMUD. The only drawbacks are that the mapper isn't fully incorporated (it works well enough, but not everything is supported, like #find or some of the %roomxxx functions) and that the scripting syntax is a little more strict. It has to be to get those speed improvements mentioned before, so it's well worth it, but it means the differences can take a little getting used to.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Dec 10, 2006 11:29 pm   
 
One other note about CMUD that just struck me - uploading WILL NOT BE SEAMLESS and it'll take an amount of effort to upgrade your scripts to the new syntax so that they work. The amount of time it'll take depends on the complexity and number of the scripts - most, if not all, of the changes are documented so as long as you're willing to read them you should be okay - plus the compatability report included will guide you through the changes you need to make (though because it only matches RegExes, it can create some false positives). Just don't expect CMUD to do ALL your work for you when you upgrade.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Mon Dec 11, 2006 12:46 am   
 
To be honest Fang I have had my computer looping so much today I am not sure whether it was simpler just dying loads

Ok well maybe ill start from scratch in CMUD but I am not sure I am really up to this I could get some things working but as soon as I tried to automate it it looped and I had to crash the computer to stop.

Anyway thanks for all your time and effort but think its maybe a bit lost on me as I cant even get the thing to cure simple amnesia by smoking a pipe .... god only knows what I would have it doing when i needed a cure to stop being a werewolf especially with furry hand and know way of getting herbs from my pouch

thanks again

Stark
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net