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
zex0s
Wanderer


Joined: 29 Jun 2003
Posts: 64

PostPosted: Sun Jul 27, 2003 2:55 am   

Help with some #sub stuff
 
sample output from my shop list command
Code:

  1) A codpiece of power               20     33           [       550 gp]
 20) A brassiere of power              25     50           [       625 gp]
103) A silk robe                       15     1            [     6,375 gp]

I have a trigger that #subs the #) with a mxp tag so I can click the number and have it send a shop identify %1, here is the trigger.
#TR {(%d)~)} {#SUB {~<send 'shop id %1'~>%1~</send~>%ansi(hi,blue)~)}}

It works great, however, there is a side affect, and here is where I need some help.. I cant anchor the text, because obviously, it doesnt always start at the beginning of the line, as shown in the above example.. I tried using a ({%d| %d|<2spaces>%d}) but then it looks for the actual %d instead of a number... any help would be appreciated.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 27, 2003 4:21 am   
 
Okay, so don't anchor it. If someone spoofs you, just don't click on the number.

Even if you do click on a spoof, %1 will always be a number so the worst you could do is send something like "shop id 27". I can't see any way for this to be harmful.
Reply with quote
teknocide
Beginner


Joined: 15 Jul 2003
Posts: 25
Location: Sweden

PostPosted: Sun Jul 27, 2003 5:05 am   
 
You might be able to use a pattern such as:

^??(%d)~)
Reply with quote
zex0s
Wanderer


Joined: 29 Jun 2003
Posts: 64

PostPosted: Sun Jul 27, 2003 1:38 pm   
 
But.. if I dont anchor it, then it modifies other things...
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Jul 27, 2003 5:19 pm   
 
Don't anchor it an include the other text in the pattern:
(%d)~) (*) ~[(*) gp~]

which would also require to include the matched text in the #SUB. Or, you could also allow for the spaces in a stringlist, but this will limit the maximum amount of spaces that the MUD may include in front to how much items you use in the stringlist:
^{| | }(%d)~)
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