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
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Wed Dec 05, 2001 4:50 am   

Intelligent Alias
 
Wondering how I'd setup an alias to check for active spells and only cast any inactive spells.
I have a set of triggers to edit variables (for example, #act {You feel righteous.} {#var @bless bless_on}) and #act {You feel less righteous.} {#var @bless bless_off} and these work beautifully.
I tried a string of #IF's but i messed it up. zmud reads the first #if, does the task if needed, and skips to the end (spellup complete) but no more #if's in between are checked.

#if {@bless = bless_off} {cast bless}
#if {@armor = armor_off} {cast armor}
etc
say spellup complete.


How would i string the alias together so it will do anything needed?

Thankyas :)

Why oh WHY did I have pass door on...
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Wed Dec 05, 2001 9:07 am   
 
Maybe it's a typo on your part, but the correct syntax for #if in your case would be

#IF (@bless = bless_off) {cast bless}
#IF (@armor = armor_off) {cast armor}

Acaila
Reply with quote
cingulli
Wanderer


Joined: 30 Aug 2001
Posts: 53
Location: Finland

PostPosted: Wed Dec 05, 2001 9:51 am   
 
Yo, itd be prob best to make something like:

#tr {You feel righteous.} {#additem spells_on bless}

ud add all spells casted on @spells_on, i cd look like {bless|regeneration|invisibility}
etc. and then

#tr {You feel less righteous.} {#delitem spells_on bless}

after spell wears out, this will remove it from the list

then make a list of the spell you want to have on ya always
#var spells_wanted {bless|invisibility} etc.

then ya make and alias spellup to check which spells you lack
#FORALL @spells_wanted {#if ismember(%i,@spells_on) {} {#additem spells_to_be_casted %i}}
#t+ spells_spellup;cast %item(@spells_to_be_casted,1)

Now you have a list which has those spells you lack and arnt cast on u

U prob hv somekind of text message in the mud which tells you when you have casted something proprely, like 'you have casted the spell'

so to go trough all @spells_to_be_casted you gotta make to cast the next spell
this assumes that when you start to cast spells you cast only those spells on the @spells_to_be_casted list, if ya cast from one spell from this list, then some other and then again from the list, itll remove three spells from the list, only two of which you have really casted

#tr {you have casted the spell} {#deln spells_to_be_casted 1;#IF (@spells_to_be_casted!=%null) {cast %item(@spells_to_be_casted,1)} {#t- spells_spellup}} {spells_spellup}

that trig belongs to 'spells_spellup' class and is activated when 'spellup' alias is used

its possible that u got bad luck and the spell fucks up(menee päin vittua) and ya fumble, then make a trig

#tr {you fumble the spell} {cast %item(@spells_to_be_casted,1)} {spells_spellup}

thatll again start to cast the spell

prob good to make abort trig too
#alias spells_abort {#var spells_to_be_casted %null;#t- spells_spellup}

hrs the general idea, you can make it to work urself
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Wed Dec 05, 2001 10:29 am   
 
Thanks for the tips :)

I'll try the #if (blah) {blah}, since i call the other variables for things too.

Why oh WHY did I have pass door on...
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