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


Joined: 04 Nov 2003
Posts: 2

PostPosted: Sat Jan 10, 2004 11:49 pm   

Unlocking coded doors with triggers
 
Alright, I play on a mud that allows you to assign codes to doors in order to lock/unlock them. I'm trying to make a code cracking system of triggers that would probably start with a button that did "unlock south 1000", and then triggers would add integers of 1 until the code is correct. After looking for a little over an hour I've reached a point where I'm -completely- stumped and would -greatly- appreciate any help.

Thanks.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Sun Jan 11, 2004 12:27 am   
 
Assuming you have some sort of message when you fail or succeed cracking, then you would need 2 triggers:

#trigger {You succeed in cracking the door!} {#var crackcount 0}
#trigger {The code is wrong. You failed to crack the door} {#add crackcount 1;unlock @dir @crackcount}
#alias crackdoor {#add crackcount 1;unlock %1 @crackcount}
Reply with quote
b0urgeoisie
Newbie


Joined: 04 Nov 2003
Posts: 2

PostPosted: Sun Jan 11, 2004 1:02 am   
 
Awesome, thanks a ton for the help, I had no idea about the #add command. After screwing around with you offered I managed to break it down into two triggers looking like this:

#trigger {unlock (%*) (%*)}{#va dir %1;#va crackcount %2}
#trigger {The keypad display flicks on: 'Invalid access code'}{#add crackcount 1;unlock @dir @crackcount}

Again, I greatly appreciate the help
-Ian
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Sun Jan 11, 2004 1:33 am   
 
Change that first trigger to:
#trigger {unlock (%w) (%d)}{#va dir %1;#va crackcount %2}
Iirc, its dangerous to use %* because it allows others to operate commands on your zmud.
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