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: Mon Feb 12, 2007 3:36 pm   

working from a stringlist
 
Ok latest thing is trying to use some info i am capturing in string variable

ok my variable looks like this now

ok my trigger has pattern


#addkey trial001 {test1=%1|test2=%2|test3=%3}
#addkey trial002 {test1=%4|test2=%5|test3=%6}

this gives me a load of variables which are data records with 2 columns

so at @trial001
test1 | 4
test2 | 5
test3 | 4

@trial002
test1 | 14
test2 | 345
test3 | 0

etc etc I am using the test1 test2 etc as simple text
it is the 2nd column in the data records that change constantly

so my question is how do I reference jus the 2nd column eg 4, 5, 4, 14, 345 and 0.

I want to be able to make some more alias that do things like

eg

#if (the number at trail002 test2) eg 345 > (the number at trial001 test1) eg 4 then do this
#if (the number at trail002 test2) eg 345 = (the number at trial001 test1) eg 4 then do that
#if (the number at trail002 test2) eg 345 < (the number at trial001 test1) eg 4 then do the other

if not clear am sorry hope you can help Very Happy
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Mon Feb 12, 2007 3:47 pm   
 
If this isn't clear I'll explain more.

Code:
#if (%db(@trial002,test2)=%db(@trial1,test1)) {do this} {#if (%db(@trial002,test2)>%db(@trial1,test1)) {do this} {do that}}
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Feb 12, 2007 3:53 pm   
 
Post deleted because I don't enjoy making a tit of myself.

VV Apparently not enough :(


Last edited by Fang Xianfu on Mon Feb 12, 2007 4:06 pm; edited 1 time in total
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Mon Feb 12, 2007 4:04 pm   
 
Urm Fang, that is legal syntax he is using. The question was how do you reference a key value pair. The answer being.

%db(@Variable,Keyname) or @Variable.Keyname

#var trial001 {test1=%1|test2=%2}

Creates a STRING LIST that you cannot reference the way he is describing.

Did you sleep last night man? *offers you a pillow*
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
stark62
Wanderer


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

PostPosted: Mon Feb 12, 2007 6:43 pm   
 
guess as usually I am doing something wrong or missing something
first im wondering if i am capturing it wrong my trigger text as above
produces a data record the left column of this is test1 test2 test3 as above
and the right column is the numbers that change

if I use
alias name ztest
(value below)

#if (%db(@trial001,test1)=%db(@trial002,test1)) {say test equal} {#if (%db(@trial001,test1)>%db(@test002,test2)) {say test1 greater} {say test2 greater}}

doesnt work so i guess i need a different reference at (@trial001,test1) etc or change trigger


ps I dont need to create variables for test1 test2 etc do I as the appear in data record?
Reply with quote
stark62
Wanderer


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

PostPosted: Mon Feb 12, 2007 6:48 pm   
 
ah hang on do i need more than say test equal to make me actually say something
Reply with quote
stark62
Wanderer


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

PostPosted: Mon Feb 12, 2007 6:54 pm   
 
sorry I am a dumbass i needed to make it #show test equal not say test equal thanks and wow i actually have something working now cool
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