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 02, 2003 5:22 am   

Using #if for checking String Lists
 
Yet another simple problem that I can't seem to figure out.

#if (@test123=~ "string1") {test123=%delitem( "string1", @test123)}
#if (@test123<> "string1") {test123=%delitem( "string2", @test123)}
#if (@test123<> "string1"|"string2") {test123=%delitem( "string3", @test123)}

This deletes all 3 strings. I want to check variable "test123" to see if it has 3 strings. String1 I want to delete first if it is on the list (regardless of placement/position inside the string list itself), then String2, then String3. Order of importance is key here, I do not want String2 or String3 being deleted if String1 is on the list.

String1>String2>String3 in that order. If one of the more important strings is found first, delete it and do nothing else.
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Sat Aug 02, 2003 5:26 am   
 
Note - this string list will most likely have 5-7 strings in it total, not just String1-3.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Aug 02, 2003 1:52 pm   
 
I highly recommend using actual phrases instead of trying to make up generic ones like "string1". It's easier for you, since you don't have to be creative. It's easier for us, because meaningful words require less effort to keep track of. It also gives us insight to the problem, which occasionally allows us to suggest other (possibly better) methods of solving in addition to the one you're asking about.

#IF (%ismember( "string1", @test123)) {#DELITEM test123 {string1}} {#IF (%ismember( "string2", @test123)) {#DELI test123 {string2}} {#DELI test123 {string3}}}
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Sun Aug 03, 2003 5:23 am   
 
Trigger Name: @t eats a bloodroot leaf.
Code: #IF (%ismember( "Paralysis", @Venomlist)) {#DELITEM venomlist {Paralysis}} {#IF (%ismember( "Oily", @venomlist)) {#DELI venomlist {Oily}}}

Sometimes, certain herbs can cure up to 3 different afflictions (only once every time they eat it). There is a hierarchy that they heal in though, so I can accurately remove the highest affliction on my 'venomlist' when i see them eating an herb.

I envenom my Dirk with venoms, then doublestab them, giving them 2 afflictions. What I'm trying to develop is a system to track their afflictions, so I know how close to venom-locking them I am.

There is something called 'herb balance' which means they can only eat a 'balance herb' once every few seconds (lets say its 3 seconds to be exact). Whenever they eat a 'balance herb', my goal is to delete an affliction off my venom list, every time they successfully cure something.

If they can only cure X affliction every 3 seconds, how can I code it so it only deletes the appropriate string when they have 'herb balance'? Maybe with the #COND command?

What I mean is, if I paralyze them, and they eat bloodroot 4 times within 1 second, it will try to delete a related affliction string off the venom list every time they eat that herb (even though they only cured one affliction, remember 3 seconds per balance herb).

So in summary - When I see them eat a balance herb, I want to delete the most important string off the venom list first, then wait 3 seconds before removing any other strings from the venom list.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Sun Aug 03, 2003 11:36 am   
 
In theory, your idea sounds like a great idea. Everyone wants ways to track their own afflictions and a few would like to track their enemy's status, too. However, this has a few problems.

Basically, not every method of curing is easy to discern. Different classes have methods of healing so that you can't tell exactly what they've cured. Some may cast spells, touch a tree tattoo, focus their mind, etc, and you won't know what afflictions they have remaining.

To make an example more relevant to your example, someone could cure "Oily" or slickness with not just bloodroot, but also smoking valerian. You don't know what's in their pipe, so you can't tell if they've smoked skullcap, valerian, elm, or maybe cactus weed. :)

Good idea you have there, but thought I should enlighten you on the difficulties you may face in implementing it.
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Mon Aug 04, 2003 6:10 am   
 
I appreciate your concern but I've been spending a lot of time compiling all the necessary text strings, information about opposing skillsets, etc. I just really need an answer to the question I posted and I'll be able to field test it.

Trigger Name: @t eats a bloodroot leaf.
Code:
#ad bloodrootcounter 1
#if (@bloodrootcounter>1) {#NOOP;bloodrootcounter=0}
#IF (%ismember( "Paralysis", @Venomlist)) {#DELITEM venomlist {Paralysis}} {#IF (%ismember( "Oily", @venomlist)) {#DELI venomlist {Oily}}}

It's only a partial solution though - I need a way to monitor their herb usage in real time.. I.e. every 3 seconds, not based on the amount they eat. The above example fails if they eat 3+ of the same herb in under 3 seconds.
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Mon Aug 04, 2003 6:21 am   
 
As an aside: Thank you to everyone who might be trying to figure this out, LightBulb especially who has answered nearly all my questions.
To Larkin - touching tree, using Focus, etc.. they all heal in a specific manner; it's not random, and I have a near-complete hierarchy of afflictions and the order in which they are cured. Trust me, after all these hours working on this I made sure that this Affliction Tracker was going to be feasible ;)
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