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
Loto
Apprentice


Joined: 05 May 2003
Posts: 194

PostPosted: Sun Feb 15, 2004 7:49 pm   

Greater than, Less than, and Mana
 
MUD prompt looks like this:

<220hp 128m 220mv>

How would I write a script to make it so if mana is greater than 100 it sends "wake;c 'enchant weapon' sword" to the mud, and if it is less it sends "sleep".

I think it uses #IF, but that's all I know how to do it.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sun Feb 15, 2004 8:44 pm   
 
#trigger {^~<(%d)hp (%d)m (%d)mv~>} {#if %2>100 {wake;c 'enchant weapon' sword} {sleep}

I do not recommend this as to if your in a battle and your mana drops to low you will become a narcoleptic
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Feb 15, 2004 8:54 pm   
 
#TR enchant {~<%dhp (%d)m %dmv~>} {#IF (%1 < 100) {sleep};#IF (%1 > 100) {wake;c 'enchant weapon' sword}} {} {nocr|prompt}
#COND {} {#CR} {Wait|Param=2000}

NOTES:
1. I gave the trigger an ID so that it can easily be disabled (#T- enchant) or removed (#UNTR enchant) when you get tired of enchanting your sword
2. I only put () around the second %d, so mana is %1 and hp and moves aren't available from this trigger
3. Since this is based on a prompt, I used the "prompt" option. I also used the "nocr" option to prevent it from firing twice on the same prompt -- once when the prompt block is received and a second time when an end-of-line is received or sent.
4. I used the condition to provide a 2-second delay (2000 milliseconds), so that the trigger won't fire on the prompts received for the sleep, wake, or cast commands, and a new prompt will be provided at the end of those two seconds. Adjust the delay to allow sufficient time to complete your cast.
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