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
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Wed Mar 16, 2005 7:02 pm   

quick #if question
 
heres what i am trying to do
if my exp (to next level) is less than 100k than i want to put on my leveling kit
if my exp (to next level ) is greather than 5 mil i want to put on my other kit
now i want each to only activate once, since i might have like 15mil to level and i wouldnt want to have to wear my other kit and have it spam
my exp to next level shows every round or every command line

heres what it looks like

< 570/570hp 100/100Ma 243/243Mv 7633gold 972149xp Steed: 250/250mv>


heres what ive got so far

#trigger {%nxp} {#if (%1<100000 || %1>5000000) {#class exp 1} {#class exp 0}}

#trigger {%nxp} {#IF (%1<100000) {lkit; eat way; drink cask; drink cask; #class exp 0} || #IF (%1>5000000) {unkit; #class exp 0}} {exp}

will that work?

or in otherword does this makes sense logically?
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Wed Mar 16, 2005 7:29 pm   
 
ok nvm on that last one i have decided something new


< 570/570hp 100/100Ma 243/243Mv 7633gold 972149xp Steed: 250/250mv>

thats the command line
here's the trigger

#trigger {%nxp} {#if (%1<250000) {lkit; eat way; #2 drink cask} }



but for some reason, even when i have well above 250k exp to go , it spamms the hell out of me, what am i doing wrong?
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Wed Mar 16, 2005 7:36 pm   
 
you didnt capture anything for %1 so the if statement always evaluates to true
try

#trigger {(%n)xp} {#if (%1<250000) {lkit; eat way; #2 drink cask} }
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
morgair
Beginner


Joined: 10 Nov 2000
Posts: 24
Location: USA

PostPosted: Wed Mar 16, 2005 7:39 pm   
 
you need another check to check which kit your using so that it doesnt keep repeating eat drink lkit etc
#TRIGGER {%nxp} {#IF (%1<100000) {lkit} {drkit}}
now the alias has the actual checks
#ALIAS {lkit} {#IF (@curkit = "level") {} {#VAR @curkit level;do whatever you do to wear leveling kit}
#ALIAS {drkit} {#IF (@curkit = "damroll") {} {#VAR @curkit damroll;do whatever you do to change to damroll kit}
something along those lines. Im sure theres other ways to do it too. You could also put the check in the first if statement to avoid the alias entirely unless your wearing the wrong kit too like
#TRIGGER {%nxp} {#IF (%1<100000) {#IF (@curkit = "level") {} {lkit}} {#IF (@curkit = "damroll") {} {drkit} then just remove those ifs from the alias either way it should work
_________________
Morgair, Master of the Obvious
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Wed Mar 16, 2005 7:42 pm   
 
NVM all

i think this will work, i dont know until i get more exp but heres what i did

#var exp 101001010110
#trigger {(*)gold (*)xp} {#var exp %2; #IF (@exp<250000) {lkit; eat way; #2 drink cask}


and when i level i got the message, so when that happens ill automatically rewear my damroll kit

i set teh variable initially with that number and it updates correctly and it no longer spams me


if anyone sees a better way then please post it
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Wed Mar 16, 2005 8:16 pm   
 
Hey Appolyon the problem with the trigger as you have it, is that for every prompt you see while your exp is less than 250000
you'll lkit , eat way and drink, which means you wouldnt get anything else done SPAM!
what I'm suggesting is that you save the exp variable just as you've done,
however you only act if the exp is less than 250000 and the exp is not the same as the last time your prompt showed that way it only happens
once when your exp changes.


Code:
#TRIGGER {^< %d/%dhp %d/%dMa %d/%dMv %dgold (%d)xp Steed: %d/%dmv>} {;
#if ((%1 <> @exp) AND (%1 < 250000)) {lkit;eat way; #2 drink cask}
#var exp %1
} "" {prompt}


the pattern for the trigger should more closely match your prompt.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Wed Mar 16, 2005 8:26 pm   
 
thanks dharkael for the heads up


i forgot about the spamming


i just added to it so i t looks like this

#trigger {(*)gold (*)xp} {#var exp %2; #IF (@exp<250000) {lkit; eat way; #2 drink cask; #class exp 0} {exp}

and my trigger once it levels will reactivate the class
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