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


Joined: 14 May 2003
Posts: 9

PostPosted: Wed May 14, 2003 11:13 pm   

trigger
 
basically i upgraded from 6.16 to 6.6 and now a groupcheck trigger I had is not working. I was wondering if anyone could give me some help...this is the trigger
It was working prior to the upgrade don't know if anything changed command wise. I would really appreciate any help. Ohh and as of right now it's coloring everything red. The wierd thing about it is that all the variables except hitper are working for some reason hitper is just not getting calculated. Any help would once again be appreciated.

pattern: {(}&gpos{)} &hit/&maxhit hit, &mov/&maxmov move, &mana/&maxmana mana &name


#math hitper %trim( @hit)*100/%trim( @maxhit)
#IF (@hitper >= 95) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL bold,green
}
#IF (@hitper < 95) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL brown
}
#IF (@hitper < 90) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL yellow
}
#IF (@hitper < 80) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL bold,magenta
}
#IF (@hitper < 50) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL magenta
}
#IF (@hitper < 30) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL bold,red
}
#IF (@hitper <= 0) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health -= MORTED =-"
#COL blink,bold,red
}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 15, 2003 3:07 am   
 
Whenever you intend using numbers to perform calculations, it's best to start with numbers rather than strings. This can be accomplished using either %d (if the number will always be positive or zero) or %n (if the number might go negative or include commas). It does make it difficult to read the variable names (&hit/&maxhit becomes &%nhit/&%dmaxhit), which is one of the reasons I prefer to assign variables in the Value rather than the Pattern. Since all your numbers will now be Numeric variables instead of String variables, you won't need to use %trim.

pattern: {(}&gpos{)} &%nhit/&%dmaxhit hit, &%nmov/&%dmaxmov move, &%nmana/&%dmaxmana mana &name

#MATH hitper {(@hit * 100)/@maxhit}
#IF (@hitper >= 95) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL bold,green
}
#IF (@hitper < 95) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL brown
}
#IF (@hitper < 90) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL yellow
}
#IF (@hitper < 80) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL bold,magenta
}
#IF (@hitper < 50) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL magenta
}
#IF (@hitper < 30) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health"
#COL bold,red
}
#IF (@hitper <= 0) {
#SU "("@gpos") "@hit"/"@maxhit" hit, "@mov"/"@maxmov" move, "@mana"/"@maxmana" mana "@name" @==== "@hitper"% health -= MORTED =-"
#COL blink,bold,red
}

LightBulb
Advanced Member
Reply with quote
sarim
Newbie


Joined: 14 May 2003
Posts: 9

PostPosted: Thu May 15, 2003 3:35 am   
 
ok copied and pasted exactly still same problem hitper not getting calculated but hit and all the other variables are getting recorded does the amount of spaces in between in the pattern matter?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 15, 2003 3:49 am   
 
Yes, the number of spaces matters. I recommend using %s if you don't know exactly how many spaces there will be.

The only changes I made were to the pattern and the #MATH command. The rest is just a straight cut-and-paste of what you posted.

LightBulb
Advanced Member
Reply with quote
sarim
Newbie


Joined: 14 May 2003
Posts: 9

PostPosted: Thu May 15, 2003 3:55 am   
 
ok so &%s%dhit for example?
Reply with quote
sarim
Newbie


Joined: 14 May 2003
Posts: 9

PostPosted: Thu May 15, 2003 4:54 am   
 
ok this is the problem
if you want to help me free to but I can't figure it out
This is what it normally looks like
( Head) 1102/1035 hit, 167/167 move, 313/313 mana Keko
(Front) 625/625 hit, 270/270 move, 190/520 mana Kimah
the problem i am having with the above triggers are that the spaces are mest up basically I can't get it to work for people with four digits of hp at the same time as 3 digits of hp help...thanks
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 15, 2003 5:15 am   
 
No, %s&%dhit for example.

Thanks for the examples, they make it much easier to understand.

pattern: pattern: {(}&gpos{)}%s&%nhit/&%dmaxhit%s~hit,%s&%nmov/&%dmaxmov%smove,%s&%nmana/&%dmaxmana%smana &name

NOTE: I added ~ in front of hit because the forum's censorship code won't accept hit following %s, with no spaces between. It comes out as %****. The ~ won't interfere with zMUD, you can leave it in or take it out as you prefer.

LightBulb
Advanced Member
Reply with quote
sarim
Newbie


Joined: 14 May 2003
Posts: 9

PostPosted: Thu May 15, 2003 7:18 am   
 
thanks alot it works perfectly now I had tried moving the %s's around but couldn't get it to work. Thanks
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