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
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Sat Aug 16, 2003 6:34 pm   

Coding Exact Redundency
 
As you may have guessed I play Achaea, and one Affliction within that game world involves Stupidity. When you have stupidity you have a chance to randomly execute a 'bad emote' or some other unwanted action instead of your actual command.

My question is this: Is there any way to code it to repeat your commands until they go through properly?

If you Eat Goldenseal too much (the herb which cures it), you lose Insomnia - which is bad. Which is why I don't want to just put eat goldenseal;eat goldenseal;eat goldenseal and then pray for it to execute correctly and not make me lose insomnia. %lastcom fails simply because of Lag, or any other automated action happening a split second before the actual one I want to execute.

Btw I got the stringlist working properly LightBulb, you rock Smile

Sample stupidity trigger:
Your mind feels slower and more plodding.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat Aug 16, 2003 6:46 pm   
 
As you know what you want to do, you should know what the mud out put is that verifies the action.

When you desire to "eat goldenseal" then have a #TEMP trigger to verify that did it with in a certain of lines and have that trigger do the delete item from the list.

I don't know how the mut output flow is to know if checking within 2-5 lines is adequate or fast enough for that mud. If it isn't fast enough then you'll need a trigger that looks for a bad emote which then re-requests the command to be sent again (in this case eat goldenseal).

My rule of thumb for these kinds of issues is to only add/delete things from the lists/queues when the mud output verifies it. Then periodically use the command/spell/whatever to find out my reported status and update the lists/queues.
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Sat Aug 16, 2003 7:11 pm   
 
During combat it is usually spammy, so basing it off of the bad emotes would probably be best. But what if the Temp trigger doesn't fire as well? Adding a temp trigger to all bad emotes would have the same ill effect; i try to execute 3 commands at once for example, and get 3 bad emotes which makes me eat goldenseal 3 times in a row.

I have no way of dictating the quantity of the lines sent to me during a battle, so I think it would be faulty to base it off of something as dynamic as that.

Bad emote sample:
You flap your arms madly.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat Aug 16, 2003 8:14 pm   
 
You'll have to discern a way to figure out the result of an action and make a value judgement.

I haven't played one of Matt's games in years to give you a concrete example. Perhaps you can lock on to a "^You*" kind of pattern and make a great guess based on lag, command history and previous results.
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Sun Aug 17, 2003 3:16 am   
 
#TRIGGER {^Your mind feels slower and more plodding.} {#if (@balherb=0) {ego};Cstupidity2;#VAR stupidcheck 1}
#COND {} {#if (@stupidcheck=1) {ego}} {Wait|Param=500}
#COND {} {#if (@stupidcheck=1) {ego}} {Wait|Param=500}
#COND {} {#if (@stupidcheck=1) {ego}} {Wait|Param=500}

Cstupidity2 is just the alias I use to set stupidity 'true' in my herb variable. The cure message sets @stupidcheck to 0

Any thoughts? Improvements?
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Sun Aug 17, 2003 4:34 pm   
 
#AL eg {eat goldenseal;eat goldenseal;eat goldenseal;outr goldenseal;#IF (@arena) {insomnia}}
When in the arena, you'll eat goldenseal 3 times each time, since the herbs stay in your inv rather than sliding down your throat... hence when fighting in the arena, always make sure you put insomnia back up whenever you eat goldenseal... mind you, thats gotta suck if you don't have the skill and have to eat cohosh, I guess.

Still, the arena is only playing about anyway, the real thing is outside, and this system works fine outside. Just dont forget to have one goldenseal outr-ed before you start fighting, else yer screwed.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Mon Aug 18, 2003 3:21 pm   
 
I have a fairly nice working solution for curing stupidity in a couple different ways, though almost any combat system could always use improvement. [8D]

What I did is I setup a single list variable to store all afflictions that I have, based on scores of triggers that simply #additem and #delitem the names of the afflictions. Then, I have several expression triggers to attempt to cure any afflictions that I have, in priority order.

The expression triggers are based off of if anything is in the afflictions list variable and several other state variables (am I sleeping? stunned? prone? etc.). I've got one trigger for each type of cure: herbs, salves, elixirs, focusing, smoking, etc. This means that if there is more than one way to cure something, I'll attempt them all in the hopes that if one fails, another will succeed.

For stupidity, this means that I'll eat goldenseal and also focus my mind. If the goldenseal succeeds, the focus has no effect. If the goldenseal fails, the focus is likely to work. If both fail, the affliction is still on my list and the expression trigger will attempt the cure again.

I only remove afflictions from my list when they are cured, and I only add them to the list when I'm afflicted with them. There are some anti-illusion checks and dozens of diagnose triggers to help keep the afflictions list accurate.

Hope this makes sense and helps you a bit. I'm not sure if I'd be able to post a set of triggers that would work, but if you need further clarification, I could give it a shot and leave it to you to figure out some of the details. Wink

Larkin
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