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


Joined: 03 Nov 2001
Posts: 7
Location: USA

PostPosted: Sun Apr 21, 2002 8:11 pm   

Button that does a Trigger
 
I haven't coded for a long time so i am rusty! I want to create a button that if my magic points is more that 30 it will cast a spell.

WhatnoW??
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Apr 21, 2002 10:26 pm   
 
Is it a button you want or a trigger?
Buttons are usually used for things that you DON'T want to happen automatically. Triggers are for things that you DO want to happen automatically. For a trigger (I'm assuming you have a prompt which provides MP's):

#TR {(%d)MP} {#IF (%1 > 30) {cast spell}}

For a button, you could use something like this alias as the button's command (it assumes that you have the number of MP in a variable):
#AL buttonspell {#IF (@MP > 30) {cast spell}}

LightBulb
Vague questions get vague answers
Reply with quote
Jabnky
Newbie


Joined: 03 Nov 2001
Posts: 7
Location: USA

PostPosted: Sun Apr 21, 2002 11:02 pm   
 
Thanks lightbulb for the info., and the button thing, i would like to use it to turn on the trigger. Is this possible because i don't want my mage stuff mixing in with my other characters.

WhatnoW??
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Apr 22, 2002 1:51 am   
 
Sure. Just assign the trigger to a class and then use the button to toggle the class.
#TR {(%d)MP} {#IF (%1 > 30) {cast spell}} {mage}
#BUTTON mage1 {NonMage} {#T+ mage} {Mage} {#T- mage}


I don't use buttons much, but I think that will work.

LightBulb
Vague questions get vague answers
Reply with quote
sp000n
Novice


Joined: 04 Jul 2001
Posts: 32

PostPosted: Mon Apr 22, 2002 7:46 am   
 
Also.. if the triggered action is something you want to be able to occasionally do manually, define it as an alias. Tie the button to the alias.
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