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
Equinox
Newbie


Joined: 11 Feb 2002
Posts: 1

PostPosted: Mon Feb 11, 2002 7:52 pm   

Upgrading triggers from 3.62 to 6.16
 
I decided to steup up to the a newer version of Zmud, but to my dismay my triggers from 3.62 don't work. I had a spellup trigger that would check for which spells were not cast on me and would cast them.

Here is a sample of the triggering text.

Current affects:
You are invisible.
You are seeing truly.
You are protected by Sanctuary.
You feel protected.
Your eyes are glowing red.
Your body is irregularly refractive.
You are surrounded by an electrostatic field.
You are protected from evil.
You are protected from the undead.
You are protected from fire.
You are protected against magic.
You can endure extreme cold.
You are moving very fast.
You feel extremely righteous.
You are shielded by divine intervention.
Your adrenaline is pumping.
You feel very confident.

I would set my variable to trigger off of Current affects
Pattern: Current affects
Script #var armarm=1var sancsanc=1

My triggers for determining which spell need to be cast was set up like this

pattern: You feel protected.
script: arm=arm-1

etc for each spell

Then I triggered off of the last line to start if statments

trigger : You feel very confident.
script : #if (dvin>0) {cast 'divine intervention'}
#if (blpr>0) {blesspray}
#if (pre>0) {cast 'protection from evil'}
#if (ref>0) {alter 'refrac' ankyrin}
#if (prm>0) {prom}
#if (elec>0) {ef}
#if (prc>0) {cast 'endure cold'}
#if (prfr>0) {prof}
#if (arm>0) {cast 'armor' me}
#if (see>0) {ts}
#if (pud>0) {proud}
#if (snct>0) {sanc}

Any help would be appreciated
Equinox
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Mon Feb 11, 2002 8:03 pm   
 
Except in certain cases, variables must be prefixed with the symbol @. Also, the command separator is now a semi-colon. Also zMUD will only perform math within the context of an appropriate command or function (#MATH, #ADD, %eval)

pattern: You feel protected.
script: #MATH arm (@arm-1)



trigger : You feel very confident.
script : #if (@dvin>0) {cast 'divine intervention'}
#if (@blpr>0) {blesspray}
#if (@pre>0) {cast 'protection from evil'}
#if (@ref>0) {alter 'refrac' ankyrin}
#if (@prm>0) {prom}
#if (@elec>0) {ef}
#if (@prc>0) {cast 'endure cold'}
#if (@prfr>0) {prof}
#if (@arm>0) {cast 'armor' me}
#if (@see>0) {ts}
#if (@pud>0) {proud}
#if (@snct>0) {sanc}

Pattern: Current affects
Script #var armarm=1var sancsanc=1

Declaring the variable before assigning it is not required. This would be appropriate now:

#VAR arm 1; #VAR sanc 1



Troubadour
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Feb 12, 2002 7:35 pm   
 
One other thing, instead of #MATH arm (@arm-1), you could just set @arm to 0. #VAR arm 0 or arm=0

LightBulb
All scripts untested unless otherwise noted
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: Tue Feb 12, 2002 10:27 pm   
 
Another suggestion, if you're just doing addition/subtraction, just use #add:

#add arm -1
#add arm 1

Iljhar
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