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


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Wed Jan 27, 2010 11:11 pm   

If & Alarm question
 
Ok i want to have a variable called @heal true or false
I need an alias lets say sipmed to see if @heal is true or false (not sure which is 1 or 0)

so in long hand

sipmed - if @heal (true) sippotion1 + set @heal to false - if (false) set an alarm for +1 then set @heal to true

hope that makes sense
Reply with quote
xXDELKARRXx
Newbie


Joined: 23 Jan 2010
Posts: 5

PostPosted: Wed Jan 27, 2010 11:59 pm   
 
Code:

#ALIAS sipmed {#IF (@heal == 1) {sippotion1;#VAR heal 0} {#ALARM +1 {sipmed};#VAR heal 1}}
#VAR heal {0} {0}


I hope this is what you mean...

Enjoy!
Reply with quote
stark62
Wanderer


Joined: 04 Apr 2003
Posts: 94
Location: United Kingdom

PostPosted: Thu Jan 28, 2010 12:53 am   
 
nearly i think - not sure if this is right as it sort of works but not faultless

#ALIAS sipmed {#IF (@heal == 1) {sippotion1;#VAR heal 0;{#ALARM +1 {#VAR heal 1}} {null}

does that look right - what i want is basically if
a) if i have sipped any potion i want there to be a 1 sec delay before i can hit another
b) when i sippotion1 or sippotion2 etc for it to sip and then put the 1 sec delay before i can sip another - so if i hit a potion alias before 1 sec nothing happens but doesnt start the 1 sec delay again - eg it should allow me to hit a potion only once a second
Reply with quote
xXDELKARRXx
Newbie


Joined: 23 Jan 2010
Posts: 5

PostPosted: Thu Jan 28, 2010 1:10 am   
 
Oh, I thought you wanted it to run again after 1 second...

Code:

#ONINPUT {^sipmed$} {#IF (@heal == 0) {sippotion1;#VAR heal 1;#ALARM +1 {#VAR heal 0}} {#GAG}} "" {notrig}


Try that one! :D
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Jan 28, 2010 1:52 am   
 
That is close.
This is better.
Code:
#ALIAS sipmed {#IF ((@heal == 1) and (%trigger(sippotion1a)==0)) {sippotion1;#VAR heal 0 1 potions;#T+ sippotion1a}} potions
#Alarm sippotion1a 1 {#VAR heal 1 1 potions;#T- sippotion1a} potions


Note that I placed everything within a class so that they could be better separated.
Also that I am using a permanent Alarm that I am turning on and off. Instead of creating a new one each time.

OnInput really shouldn't be needed for this as I doubt that sipmed is actually a MUD command.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
xXDELKARRXx
Newbie


Joined: 23 Jan 2010
Posts: 5

PostPosted: Thu Jan 28, 2010 1:55 am   
 
Good call,
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