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
Davos
Adept


Joined: 30 Jan 2003
Posts: 228
Location: USA

PostPosted: Fri Aug 29, 2003 9:40 am   

parsing I think
 
ok i have this

#ALIAS g%copy( %selword, 1, 4) {
get %delete( %selword, 1, 4) from pack
wield %delete( %selword, 1, 4)
} dolls
#ALIAS p%copy( %selword, 1, 4) {
put %delete( %selword, 1, 4) in pack
} dolls

in a speed menu right click

I would click on something like
doll12345

it makes the alias with the right name of gdoll and pdoll
but inside the aliases it doesnt parse out the %delete and give me the numbers off the end... anyone have a idea how to fix this? Thanks
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Aug 29, 2003 12:42 pm   
 
Force the expansion with this trick:
#EXEC {%concat("#ALIAS g," %copy(%selword, 1, 4), " {get ", %delete(%selword, 1, 4), " from pack;wield ", %delete(%selword, 1, 4), "} dolls")}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Aug 29, 2003 4:01 pm   
 
Since this will only work for items with 4-letter names, you probably only intend to use it with dolls? If that's the case, why not make the aliases permanent and use the menu to set variables?
#ALIAS gdoll {
get @dollnumber from pack
wield @dollnumber
} dolls
#MENU setdoll {#VAR dollnumber %delete( %selword, 1, 4)}

NOTE: Those are for command-line entry
Reply with quote
Davos
Adept


Joined: 30 Jan 2003
Posts: 228
Location: USA

PostPosted: Sun Aug 31, 2003 9:07 pm   
 
#ALIAS g%copy( %word( %selline, 7), 1, 4) {
get [%delete( %selword, 1, 4)] from pack
wield [%delete( %selword, 1, 4)]
} dolls
#ALIAS p%copy( %word( %selline, 7), 1, 4) {
put [%delete( %selword, 1, 4)] in pack
} dolls

This is how I came up with a Solution, The line I am Clicking off of looks like this....

"doll109012" a living vodun doll of Linus

So it pulls the first 4 letters off the actual Name 'Linus' in this case so the aliases made are
gLinu and pLinu
This works perfectly, thanks
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