Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Nut
Newbie


Joined: 27 May 2007
Posts: 8

PostPosted: Sun May 27, 2007 1:04 pm   

%pick problems
 
Im new to cmud an been trying to write a script

ok here my problem
Variable: sellcomod = Alloys| AntiMatter| Clays| Controllers| Crystals| Explosives| GAsChips| Generators| Gold| Hides| Lasers| Meats| Monopoles| Nanos| Nickel| Nitros| Petrochemicals| Polymers| Powerpacks| Propellants| Radioactives| RNA| Semiconductors| Spices| Tools| Xmetals
this is defined earlier in my script

now here is my problem if i type this in the command line it shows up properly, but when executed in script the box pops up blank

#var @comod %pick("P:What comodity do you want to sell",@sellcomod)

dont know what im doing wrong I just want the box to popup so i can select one item from the SELLCOMOD an put that into COMOD

Thanks, Im sure this will be my first of many


Last edited by Nut on Sun May 27, 2007 2:04 pm; edited 1 time in total
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun May 27, 2007 1:56 pm   
 
Just one thread will do! ;)

You're probably not going to get the result you desire here. @comod is your long string list (which you probably don't want to have those leading spaces, but it's up to you). You haven't told us what the value of @sellcomod.

Your script there will set the result of the pick as the sole value of @comod, replacing that long string list. Is this what you wanted? It sounds like you mean to choose one item from @comod and set it as the sole value of @sellcomod - for which, you just need to swap the variables around.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Nut
Newbie


Joined: 27 May 2007
Posts: 8

PostPosted: Sun May 27, 2007 2:06 pm   
 
Sorry lag must be reason 3 posts. edited msg comod should of been sellcomod.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun May 27, 2007 2:15 pm   
 
This must be an issue with the scope of the variable, because I just tried it with your exact code and it worked like a charm.

Open the package editor and browse to the alias or whatever that's calling the %pick function. @sellcomod could be highlighted in blue - click on it and it'll take you to the variable @sellcomod that the alias is looking at. If that variable isn't the right one, or if it's highlighted in red rather than blue, then we know that's the problem.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Nut
Newbie


Joined: 27 May 2007
Posts: 8

PostPosted: Sun May 27, 2007 2:22 pm   
 
#var sellcomod ""
#var comod ""
di exchange
#var @comod %pick("P:What comodity do you want to sell",@sellcomod)

here is the whole thing i have so far.I have it on a button
@comod an @sellcomod is blue
%pick is pink
"P:What comodity do you want to sell" is green

if i type in copy an paste into command line works great
buy when i press button or as an alias i get the box to popup but its blank
Reply with quote
Nut
Newbie


Joined: 27 May 2007
Posts: 8

PostPosted: Sun May 27, 2007 2:24 pm   
 
Sorry for all this when i read it i just figured it out .. removed the #var sellcomod "" an works great.. man i feel stupid
Reply with quote
Nut
Newbie


Joined: 27 May 2007
Posts: 8

PostPosted: Sun May 27, 2007 2:37 pm   
 
grrrrrr the variable comod is blank after selecting from list any ideas what im doing wrong
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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