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
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Wed Dec 29, 2004 9:16 pm   

capuring numbers into a variable?
 
I'm trying to put this into a variable

unlock code : 5467
I want the 5467 into a variable ie @code = 5467

the unlock code : is the line I recieve
_________________
stupid computers always messing up my.....
Reply with quote
Hibio
Beginner


Joined: 19 Mar 2004
Posts: 22

PostPosted: Wed Dec 29, 2004 9:24 pm   
 
#trigger {unlock code ~: (%d)} {#var code %1}
Reply with quote
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Wed Dec 29, 2004 10:10 pm   
 
hmmm ok heres the thing

Ship Password : 5732

trigger should

open @ship @code
@ship = shipinquestion
@code = 5732

the above didn't work so far
_________________
stupid computers always messing up my.....
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Thu Dec 30, 2004 1:49 am   
 
Try this
#TRIGGER (^%x* ~: (%d)} {#VARIABLE code {%1}}
Reply with quote
Hibio
Beginner


Joined: 19 Mar 2004
Posts: 22

PostPosted: Thu Dec 30, 2004 2:04 am   
 
First of all, you do have to clarify your question and what you want to do clearly

You wanted 'unlock code : 5467' and for the variable code to get the number 5467, the trigger I gave you works fine, I even tested it.

Then next thing you show up with 'ship password : 5732' and saying the trigger doesn't work. Of course it doesn't work.. 'unlock code' and 'ship password' are totally different. You should state what you want clearly and what some of the things that might show up. Like if you want the 'unlock code : 5467' and 'Ship Password : 5732' to work under 1 trig, you should say so.
Reply with quote
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Thu Dec 30, 2004 3:48 am   
 
sorry bout that realy I am After reading it myself I felt pretty stupid
_________________
stupid computers always messing up my.....
Reply with quote
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Thu Dec 30, 2004 4:12 am   
 
ok Her is the whole line I can't get either trigger to work


[ Ship Password : 7961 ]

the four digits change /ship
I want the trigger to act on ship password and put the xxxx into a var

and the var should be @code

so when I get the code it will automaticly input the command

open @ship @code

heres my plan

I have a button it givs a promt that makes the @ship var then inputs
codecrack @ship
time passes
then I get the [ Ship Password : 7961 ]
now the trigger should kick in
open @ship @code
ie open falcon 0101

I hope this is a lil more clear and I do appologize for any confusion
_________________
stupid computers always messing up my.....
Reply with quote
Falan
Wanderer


Joined: 17 Aug 2004
Posts: 98
Location: OK, USA

PostPosted: Thu Dec 30, 2004 6:40 am   
 
#TR {Ship Password ~: &code} {open @ship @code}

Note: if there are multiple spaces before and/or after the colon (:) then add %s to the pattern.

#TR {Ship Password%s~:%s&code} {open @ship @code}

Used Pretty Print
Syntax Colourizer
_________________
zMUD 7.05a
Reply with quote
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Thu Dec 30, 2004 4:03 pm   Now thats what I'm talking about!!!
 
Falan it worked smooth and beautifuly

thank you ever so much

this opens up a whole new world for me
_________________
stupid computers always messing up my.....
Reply with quote
fasad
Beginner


Joined: 07 Dec 2003
Posts: 16
Location: USA

PostPosted: Thu Dec 30, 2004 4:12 pm   
 
hmmm is there a way to put the @ship and the now found @code into a db
off the same trigger as above?

I'm totaly database stupid and actualy never have used the zmud db before so please be gentle

basicly start listing the ships I get codes for

otherwise I'll just save them in a text file
_________________
stupid computers always messing up my.....
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Thu Dec 30, 2004 9:46 pm   
 
Actually a data record might be a something to start off with depending on how big it will get
#TR {Ship Password ~: &code} {open @ship @code;#addkey scodes @ship @code}
_________________
Zmud Support Library
Zmud Knowledge Base
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