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


Joined: 19 Nov 2003
Posts: 16
Location: USA

PostPosted: Fri Mar 31, 2006 12:30 am   

#SUB, send, isprompt
 
I'm trying to price items in my shop by using a prompt

vial221988: an elixir of mana (twisted oaken vial) 4 400gp
vial180420: an elixir of frost (twisted oaken vial) 2 600gp
vial222216: an elixir of venom (twisted oaken vial) 2 500gp
vial222230: a caloric salve (twisted oaken vial) 3 500gp


I have a trigger for the above that uses #SUB and send.

PATTERN: (%w)(%d)
VALUE: #SUBSTITUTE {~<send "wp %2|p %2|wear %2|wield %2|get %2|priceitem|put %1%2 in pack|buy %2" "weaponprobe|probe|wear|wield|get|price|store|buy"~>%1%2~</send~>}

#AL priceitem {pricevar=%prompt( , "How much for this item?")
price %1%2 @pricevar}


However, it's not pricing correctly. All I'm getting when I use the price feature is:

H:316 M:410 E:1482 W:1951 <eb> price 400

I know the problem lies in the %1%2 because it's temporary and having a prompt complicates matters.

The end result should be finding a way to temporarily save the text 'vial221988' when I want to price it.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Mar 31, 2006 1:08 am   
 
%1 will be vial
%2 will be 221988

perhaps not what you wanted, you may need to change your pattern.
_________________
Taz :)
Reply with quote
Risca
Beginner


Joined: 19 Nov 2003
Posts: 16
Location: USA

PostPosted: Fri Mar 31, 2006 1:15 am   
 
Not exactly, no. I know that %1 will be vial, and %2 will be 221988. However, when I 'right click' on 'price' it gives me a prompt asking for how much I want to price the item. I input the price, and it doesn't recognize the values in %1 and %2 anymore.

After inputing the number I want in the prompt, I want the following command to show in the mud.

price vial221988 400.

Right now, I'm only getting: price 400
Reply with quote
Risca
Beginner


Joined: 19 Nov 2003
Posts: 16
Location: USA

PostPosted: Fri Mar 31, 2006 1:48 am   
 
I was able to keep the vial number by doing this.

PATTERN: (%w)(%d)
VALUE: #SUBSTITUTE {~<send "wp %2|p %2|wear %2|wield %2|get %2|priceitem;price %1%2 @pricevar|put %1%2 in pack|buy %2" "weaponprobe|probe|wear|wield|get|price|store|buy"~>%1%2~</send~>}

#AL priceitem {pricevar=%prompt( , "How much do you want to price this item?")}

However, the problem now is we're not able to use variables such as @pricevar in mxp <send>.

So now, it's showing up like this.

H:316 M:410 E:1482 W:1951 <eb> price vial221988 @pricevar
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Mar 31, 2006 2:52 am   
 
The prompt is completely unrelated to your problem. You just aren't sending %1 and %2 to the alias when you list it as a menu option in the MXP send.

PATTERN: (%w)(%d)
VALUE: #SUBSTITUTE {~<send "wp %2|p %2|wear %2|wield %2|get %2|priceitem %1 %2|put %1%2 in pack|buy %2" "weaponprobe|probe|wear|wield|get|price|store|buy"~>%1%2~</send~>}
_________________
EDIT: I didn't like my old signature
Reply with quote
Risca
Beginner


Joined: 19 Nov 2003
Posts: 16
Location: USA

PostPosted: Fri Mar 31, 2006 3:18 am   
 
You're right, MattLofton. After looking at the problem, it was a simple fix afterall. I completely overthought the problem. Thanks! It works now.
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