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 Goto page 1, 2  Next
Oracle
Apprentice


Joined: 29 May 2002
Posts: 121

PostPosted: Fri Jun 07, 2002 8:27 am   

General Spell Up Script
 
I have been working on a spellup script and not quite sure if what I am doing is correct or not.

I have created an individual alias for each spell and then put the spells under a class called "Defensive Spells".

Then I created a trigger called lets say spellupdefspell with an exec command for each defensive spell alia. Then the trigger would basically call the 10 defensive spells alias my characters knows. Then all I have to type is spellupdefspell to cast all defensive spells.

Would that be the correct way to do this or is there a better way?

Thanks
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Fri Jun 07, 2002 9:05 am   
 
Heh, thats way to complicated for what your trying to do. Just put all you spells into one alias like this:

#ALIAS spellup {cast shield;cast armor;cast invis;cast haste;etc;etc}

Just put a ';' in between each casting command and that alias will parse it as a seperate command.You dont need to use #exec or anything :)
Reply with quote
Zafrusteria
Wanderer


Joined: 11 Oct 2000
Posts: 94
Location: United Kingdom

PostPosted: Fri Jun 07, 2002 1:39 pm   
 
On your mud is there a way to see what spells are affecting you? As you
really only want to recast those spells that need to be.

For the sake of argument say you have something like, saf is a command to show short affects.

Mud output (for this example)

saf

You are currently affeted by the following spells
spell invis for 24 hours
skill sneak for 30 hours
spell blur for 100 hours
spell blindness for 5 hours
...
...
...
You are currently affected by 30 spells and 5 skills.


For each spell you want to cast you need:
an alias to cast it and a variable to show it needs casting. Keep the name
of the variable the same or similar as the alias it will make it easier when
you have 50 plus spells to cast.

Name: ci
Action: cast invis %1
#var sCI 0

#variable sCI 0


You will need 4 triggers that work when you type in "saf".

trigger 1 "You are currently affeted by the following spells"
this will call an alias to set all the cast spell variables to 1 (on or cast)

trigger 2 ^spell (%w) for * hour
Triggers 2 and 3 coud be combined as only the first word spell or skill is
different, but I split mind as it was easier to maintain. This will run
the trigger script which is really just a big nested it statement to turn the
cast spell variable to zero ie do not cast this spell.

#if (%1=~"invis") {sCI=0}
#if (%1=~"blur") {sCBl=0}
...
...

Any bad spells can also be neutralised at this time too.
#if (%1=~"blindness") {cast "cure blind"}
...
...



trigger 3 ^skill (%) for * hour
this is the same lay out as trigger 2 but for skills.

trigger 4 "You are currently affeted by the following spells"
This shows the end of the text from the saf command originally used. We can now
cast all the spells that have worn off. Again just a log of #if statements

#if (sCI=1) {CI}
#if (sCBL=1) {CBl}
...
...
...


Sorry I'm at work and had to do this from memory, also I don't have zmud here so I will let you work out the zmud syntax.

Hope it helps anyway.


When is Zugg going to fix somer of the existing bugs?

Zaf
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Wed Jun 26, 2002 8:18 pm   
 
the command on my mud used to find out what spells are on me is "affects" it looks like this...
You are affected by:
[detect invis ] : modifies none by 0 for 143 hours.
[detect evil ] : modifies none by 0 for 143 hours.
[stone skin ] : modifies armor class by -40 for 143 hours.
[detect hidden ] : modifies none by 0 for 143 hours.
[detect magic ] : modifies none by 0 for 143 hours.
[detect sneak ] : modifies none by 0 for 143 hours.
[giant strength ] : modifies strength by 4 for 142 hours.
[haste ] : modifies dexterity by 4 for 70 hours.
[protection evil] : modifies save vs spell by -1 for 7 hours.
[sanctuary ] : modifies none by 0 for 3 hours.
[visegrip ] : modifies none by 0 for 3 hours.
[pass door ] : modifies none by 0 for 1 hours.

anyway for it to look for spells that go under 10 hours, nullify them and recast them, but if i fail, to recast until successful?
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Wed Jun 26, 2002 10:39 pm   
 
make a trigger to change a variable

for example
You are surrounded by a white aura. will change the sanctuary variable:
#var sanctuary sanct_on
Your white aura fades into nothing. will change the sanctuary variable:
#var sanctuary sanct_off

then your spellup alias will check the variable
#IF (@sanctuary == sanct_off) {cast sanct}

spells and triggers may vary on your mud, but the format stays the same

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


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Thu Jun 27, 2002 2:20 pm   
 
I've got triggers that will attempt a recast if it wears off of me. But I wanted it to check to see if it had 10 hours or less left. Nullify, then recast. I'll look at what you gave me so far and play around with it. Thanks
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Thu Jun 27, 2002 3:13 pm   
 
if you're unable to cast spells in the middle of combat, recasting spells that are <10 ticks could get unproductive...can you afford to undo sanctuary in a fight if you cant re-cast it without a scroll/potion? ;)


#act {^~[%1 ~] : modifies %2 by %3 for %4 hours.$} {#if (%4 < 10) {cast nullify '%1' self;cast '%1'}}

how did you plan to nullify? you'll need to add the appropriate spell in there :) none of my characters have undo/nullify for specific spells, treat this as untested blahblah, trial and error is my friend :)

Why oh WHY did I have pass door on...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jun 27, 2002 3:14 pm   
 
#TR {~[(*)~] : modifies * for (%d) hours} {#IF (%2 < 10) {nullify '%1';cast '%1'}

I'm sure a script to handle multiple spells will require something more involved, but this should at least give you the principle.

LightBulb
Senior Member
Reply with quote
Psyrex
Beginner


Joined: 28 Jun 2002
Posts: 15
Location: USA

PostPosted: Fri Jun 28, 2002 6:18 am   
 
quote:

make a trigger to change a variable

for example
You are surrounded by a white aura. will change the sanctuary variable:
#var sanctuary sanct_on
Your white aura fades into nothing. will change the sanctuary variable:
#var sanctuary sanct_off

then your spellup alias will check the variable
#IF (@sanctuary == sanct_off) {cast sanct}

spells and triggers may vary on your mud, but the format stays the same

Why oh WHY did I have pass door on...



Only problem I see with this is what happens if the affect of the spell gives the same description as another (i.e. casting weedshield produces = 'You feel someone protecting you.' and casting armor produces the same)

-=Psyrex=-
Reply with quote
Psyrex
Beginner


Joined: 28 Jun 2002
Posts: 15
Location: USA

PostPosted: Fri Jun 28, 2002 6:53 am   
 
quote:

trigger 2 ^spell (%w) for * hour
Zaf



What is the proper syntax for triggering on an affects line that looks like this:
1) Spell: bless modifies save vs spell by -12 for 49 hours.
2) Spell: armor modifies armor class by -20 for 30 hours.


-=Psyrex=-
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jun 28, 2002 7:40 am   
 
#TR {Spell: (*) modifies * for (%d) hours} {#VAR spell {%1};#VAR spelltime {%2}}

As for your first question, in that case you'll either have to find some other way to keep track of those spells or not track them. No solution is perfect.


LightBulb
Senior Member
Reply with quote
Psyrex
Beginner


Joined: 28 Jun 2002
Posts: 15
Location: USA

PostPosted: Fri Jun 28, 2002 8:01 am   
 
Received your solution too late so I didn't get a chance to try it, but i have been sitting here for what seems like forever and I found the pattern: %d~) Spell:(*)modifies (%w) by %d for %d hours. Thanks for the reply though LightBulb :)

-=Psyrex=-
Reply with quote
Psyrex
Beginner


Joined: 28 Jun 2002
Posts: 15
Location: USA

PostPosted: Fri Jun 28, 2002 11:14 am   
 
quote:

You will need 4 triggers that work when you type in "saf".

trigger 1 "You are currently affected by the following spells"
this will call an alias to set all the cast spell variables to 1 (on or cast)

trigger 2 ^spell (%w) for * hour
This will run the trigger script which is really just a big nested it statement to turn the cast spell variable to zero ie do not cast this spell.

#if (%1=~"invis") {sCI=0}
#if (%1=~"blur") {sCBl=0}
...
...
...

trigger 4 "You are currently affected by the following spells"
This shows the end of the text from the saf command originally used. We can now
cast all the spells that have worn off. Again just a log of #if statements

#if (sCI=1) {CI}
#if (sCBL=1) {CBl}
...
...
...
Zaf



Ok I tried this and am very much stuck! For reference I use 6.16. What I have done thus far:
I have aliases set for individual spells
I have variables set for these spells
Trigger1 looks like this:
Pattern: You are affected by:

Value: #var Vcae 1;#var Vcbl 1;#var Vcwe 1;#var Vcsw 1;#var Vcsanc 1;#var Vcfl 1;#var Vcfon 1;#var Vcoa 1;#var Vcac 1;#var Vcmb 1;#var Vcfly 1

For reference my affects list looks like (the numbers in front are included in the mud):
1) Spell: weed shield modifies armor class by -20 for 29 hours.
2) Spell: armor modifies armor class by -20 for 29 hours.
3) Spell: flurry modifies none by 0 for 2 hours.
4) Spell: sanctuary modifies none by 0 for 1 hours.
5) Spell: fly modifies none by 0 for 3 hours.

Trigger2 looks like this:
Pattern: (%n)~) Spell:(*)modifies (%w) by %d for %d hours.

Value: #IF ("%2" =~ "armor") {Vcae=0};#IF ("%2" =~ "bless") {Vcbl=0};#IF ("%2" =~ "weed shield") {Vcwe=0};#IF ("%2" =~ "swiftness") {Vcsw=0};#IF ("%2" =~ "santuary") {Vcsanc=0};#IF ("%2" =~ "flurry") {Vcfl=0};#IF ("%2" =~ "force of nature") {Vcfon=0};#IF ("%2" =~ "adrenaline control") {Vcac=0};#IF ("%2" =~ "mental barrier") {Vcmb=0};#IF ("%2" =~ "fly") {Vcfly=0};#IF ("%2" =~ "oaken armor") {Vcoa=0}

Then i set an alias pup2:
#IF (@cae=1) {cae};#IF (@cbl=1) {cbl};#IF (@cwe=1) {cwe};#IF (@csw=1) {csw};#IF (@csanc=1) {csanc};#IF (@cfl=1) {cfl};#IF (@cfon=1) {cfon};#IF (@cac=1) {cac};#IF (@cmb=1) {cmb};#IF (@cfly=1) {cfly};#IF (@coa=1) {coa}

It either skips spells or doesnt do what i think its suppose to do at all, which in this case set all variable to "needs casting" except weed,armor,flurry,sanctuary, and fly.

Please...any assistance would be greatly appreciated :)

-=Psyrex=-
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Fri Jun 28, 2002 3:35 pm   
 
maybe i'm reading it wrong (getting the hang of "complex" stuff myself), but it looks like trigger1 is redundant and changing everything wether each spell is cast or not...

see what happens if you disable trigger1 for a while...make an alias to change all your variables to "off" or your chosen equivalent too (it'll come in handy one day, especially if you lose link while spelled up etc)

i also use an alias to cast all the spells i have available, its simple and effective - the leading/trailing emote is a signal to whoever i'm with that we're about to start killing something :P



emote stretches his cramped neck, preparing for battle.
#IF (@bless == bless_off) {cast bless}
#IF (@armor == armor_off) {cast armor}
#IF (@fly == walking) {cast fly}
#IF (@stoneskin == stone_off) {cast stone}
#IF (@regen == regen_off) {cast regen}
#IF (@giant == giant_off) {cas giant}
#IF (@frenzy == frenzy_off) {cast frenzy}
#IF (@shield == shield_off) {cast shield}
#IF (@haste == haste_off) {cast haste}
#IF (@protectevil == protectevil_off) {cast pro}
#IF (@protectgood == protectgood_off) {cas 'protection good'}
#IF (@sanctuary == sanct_off) {cast sanct}
#IF (@talon == talon_off) {cast talon}
emote -=~&pea~&ROARS~&misc~&=- with primal ~&blood~&bloodthirsty ~&misc~&power!


it deviates a little from your original request, yes yes...but sometimes simple works just as well as complex :)

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


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Fri Jun 28, 2002 4:11 pm   
 
So if I wanted to create variables for spells that could indicate off or on, how would I do that?

#var sanctuary {sanct_off} {Your white aura fades into nothing.}
??

I'm kinda new to the variables thing. Thanks.
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Fri Jun 28, 2002 4:26 pm   
 
i made two triggers per spell, the casting and the fading. this example is obviously for bless on the main mud i play:



#act {^You feel righteous.$} {#var bless bless_on}
#act {^You feel less righteous.$} {#var bless bless_off}


Why oh WHY did I have pass door on...
Reply with quote
Psyrex
Beginner


Joined: 28 Jun 2002
Posts: 15
Location: USA

PostPosted: Fri Jun 28, 2002 7:48 pm   
 
Ok seamer your saying from what i've read (making sure i understand you correctly), make an alias to turn all the spells off (i.e. #VAR Vcae 0 = off for me), then in another alias cast the spell if it is off. The question I have with that is: what if the spell is already cast on you and you told the variable thats it's not cast, your second alias will try to cast a spell on you that is already casted. I want it to look through my affects list and determine what is already cast on me and just cast what I don't have on me.

-=Psyrex=-
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Fri Jun 28, 2002 8:05 pm   
 
Psyrex, I was kinda having the same difficulties. I came up with this from all the examples given in this thread.

#act {You feel righteous.} {#var bless bless_on}
#act {You feel less righteous.} {#var bless bless_off}
#act {You are filled with holy wrath!} {#var frenzy frenzy_on}
#act {Your rage ebbs.} {#var frenzy frenzy_off}
#act {You feel someone protecting you.} {#var armor armor_on}
#act {You feel less armored.} {#var armor armor_off}
#act {You are surrounded by a force shield.} {#var shield shield_on}
#act {Your force shield shimmers then fades away.} {#var shield shield_off}
#act {Your skin turns to stone.} {#var stone stone_on}
#act {Your skin feels soft again.} {#var stone stone_off}
#act {Your muscles surge with heightened power!} {#var giant giant_on}
#act {You feel weaker.} {#var giant giant_off}
#act {You feel yourself moving more quickly.} {#var haste haste_on}
#act {You feel yourself slow down.} {#var haste haste_off}
#act {You turn translucent.} {#var pass pass_on}
#act {You feel solid again.} {#var pass pass_off}
#act {Your eyes glow red.} {#var infra infra_on}
#act {You no longer see in the dark.} {#var infra infra_off}
#act {You fade out of existence.} {#var invis invis_on}
#act {You are no longer invisible.} {#var invis invis_off}
#act {Your feet rise off the ground.} {#var fly fly_on}
#act {You slowly float to the ground.} {#var fly fly_off}
#act {You are surrounded by a white aura.} {#var sanctuary sanctuary_on}
#act {The white aura around your body fades.} {#var sanctuary sanctuary_off}
#act {You couldn't be disarmed by the biggest of giants!} {#var visegrip visegrip_on}
#act {Your hands relax as your grip weakens.} {#var visegrip visegrip_off}
#act {Your awareness improves.} {#var detecth detecth_on}
#act {You feel less aware of your surroundings.} {#var detecth detecth_off}
#act {Your eyes tingle.} {#var detecti detecti_on}
#act {You no longer see invisible objects.} {#var detecti detecti_off}
#act {You begin seeing as you never have before.} {#var detects detects_on}
#act {You no longer see stealthy players.} {#var detects detects_off}


#IF (@bless == bless_off) {cast bless}
#IF (@frenzy == frenzy_off) {cast frenzy}
#IF (@armor == armor_off) {cast armor}
#IF (@shield == shield_off) {cast shield}
#IF (@stone == stone_off) {cast stone}
#IF (@giant == giant_off) {cas giant}
#IF (@haste == haste_off) {cast haste}
#IF (@fly == fly_off) {cast fly}
#IF (@sanctuary == sanctuary_off) {cast sanctuary}
#IF (@visegrip == visegrip_off) {cast visegrip}
#IF (@pass == pass_off) {cast pass}
#IF (@invis == invis_off) {cast invis}
#IF (@infra == infra_off) {cast infra}
#IF (@detecti == detecti_off) {cast 'detect invis'}
#IF (@detecth == detecth_off) {cast 'detect hidden'}
#IF (@detects == detects_off) {cast 'detect sneak'}

You don't even need to type aff to get them to go. Enter all the #ACT's into the command prompt and hit ente to save them. Then make sure no spells are on you, cast all the spells that are in the list. Then cancel or nullify them all. So it see's all the commands it wants too. Then paste all the #IF's into the command line and hit enter. It should go through and try spelling you up. If it fails paste and hit enter again. I then made a button and pasted all those into the button. So, now I can hit the button and it'll look for those spells that aren't casted and cast them. Just something that seems to work for me. Thanks to the people that gave me the ideas.
Reply with quote
Psyrex
Beginner


Joined: 28 Jun 2002
Posts: 15
Location: USA

PostPosted: Fri Jun 28, 2002 8:43 pm   
 
This looks like a kewl idea but the reason I can't do it that way is cause (one example)if i cast armor I get "You feel someone protecting you" and if I cast weed shield I get "You feel someone protecting you". That would cause conflicts :(

-=Psyrex=-
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Sat Jun 29, 2002 1:11 am   
 
having an alias for turning your spells to "off" after a linkdead session etc means your spellup alias will cast them all yes, but for a reason...do you want to manually reset each spellfield to off? spellup alias wont know that you were linkdead, and zmud remembers spells as active even if they wear off over something crazy - 30 seconds of alias writing have saved me a few times :)

trigger1 was filling all your spells to an "on" value (as determined by the way you use it with the spellup alias), so naturally things werent rolling too well from that aspect.

as for the multiple spells with the same returns...have the alias take the spell to be the most powerful spell (whichever gives better ac/hitroll/damroll etc), with so much automation for spelling up, you could use a forced cast of the weaker spell whenever you call the alias - its what i would do :)

death:
put the #if's into an alias, that way you save a lil effort :)

theres one more alias in this setup...i may put up a full script of what i use, is it worth it?



#alias {checkspells} {
#if (@bless == bless_off) {#say need bless};
#if (@armor == armor_off) {#say need armor};
#if (@fly == walking) {#say need fly};
#if (@sanctuary == sanct_off) {#say need sanct};
#if (@talon == talon_off) {#say need talon};
#if (@haste == haste_off) {#say need haste};
#if (@stoneskin == stone_off) {#say need stone};
#if (@regen == regen_off) {#say need regen};
#if (@protectevil == protectevil_off) {#say need pro evil};
#if (@protectgood == protectgood_off) {#say need 'protection good'};
#if (@giant == giant_off) {#say need giant};
#if (@frenzy == frenzy_off) {#say need frenzy};
#if (@shield == shield_off) {#say need shield}}


Why oh WHY did I have pass door on...


Edited for readability - Iljhar

Edited by - iljhar on 07/17/2002 00:51:12
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Mon Jul 01, 2002 2:25 pm   
 
so you just have all those if's in an alias. and if it needs it, it will say the message then cast it? or do u run a trigger of the message? Thanks, looks like a good idea.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jul 01, 2002 6:21 pm   
 
Psyrex,
Although there may be some spells where you won't be able to use this, such as weed shield and armor, you could still use it for all the other defensive spells that do have unique messages.

You could, of course, use aliases to set the variables for armor and weed shield along with any other problem spells. You could also pick them up from your affects list. The point is, you shouldn't dismiss the entire approach simply because you have one or two problem spells.

LightBulb
Senior Member
P.S. Seamer, please remove the code tags you put in your post. They prevent the forum from using its word-wrap and make this thread approximately six screens wide for me. I'd really prefer not having to scroll sideways six times on every line.
Reply with quote
Psyrex
Beginner


Joined: 28 Jun 2002
Posts: 15
Location: USA

PostPosted: Mon Jul 01, 2002 9:39 pm   
 
I configured Cyrn's AutoSpell up to use with my spells and it works great.. If only I could figure a way to make it work (the recast if fizzle and store the spell up in a list) for using while i bot for people. That way if many ppls use my castable spells on themselves I don't have to get respammed with previous spells they already typed cause of a fizzle (12 different fizzle msgs) and still not interfere with my spelling up trigger

-=Psyrex=-
Reply with quote
Psyrex
Beginner


Joined: 28 Jun 2002
Posts: 15
Location: USA

PostPosted: Wed Jul 17, 2002 4:02 am   
 
Pattern: (*)~) Spell:(*)modifies (*) by (*) for (*) hours.

Value: #if (%ismember( %2, @spellsfound)) {} {#break;#if (%ismember( {%2}, @spellstocast)) {#delitem spellstocast {%2};#additem spellsfound {%2}}};#IF (%2 = bless) {#delitem spellstosay {ebless}};#IF (%2 = swiftness) {#delitem spellstosay {eswift}}

Question from above: The first #if's work fine however: #IF (%2 = bless) {#delitem spellstosay {ebless}} isn't working correctly. Meaning it will delete ebless from my list even if it isn't in my aff list.

What I want it to do is if bless is found when aff (affects) is typed it removes ebless (<-what i have to say to my bot to get bless) from my spellstosay variable list.

Thanks in advance for advice :)

-=Psyrex=-
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jul 17, 2002 4:47 am   
 
I don't think subtraction (%2 - bless) works with strings. Even if it does, the expression would always be true EXCEPT when %2 is bless (the opposite of what you want).
#IF ("%2" = "bless") {#DELITEM spellstosay ebless}
#IF ("%2" = "swiftness") {#DELITEM spellstosay eswift}

LightBulb
Senior Member
Thanks, Iljhar
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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