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
Xiija
Newbie


Joined: 24 Apr 2018
Posts: 5

PostPosted: Tue Aug 13, 2019 1:11 pm   

help with string capture
 
I have a trigger i can't capture because it has multiple alternatives.

Valid NPC targets here: monster.
Valid NPC targets here: cat effigy.
Valid NPC targets here: cat effigy, monster, wisp bog gas.

How would one separate any of these targets into a list plz?
( or capture them in any fashion )

Thanx for any help :)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4029
Location: Pensacola, FL, USA

PostPosted: Tue Aug 13, 2019 4:20 pm   
 
#TR {Valid NPC targets here: (*).} {targetList=%replace(%1, ", ", "|")}
_________________
Discord: Shalimar#3679
Reply with quote
Xiija
Newbie


Joined: 24 Apr 2018
Posts: 5

PostPosted: Tue Aug 13, 2019 5:21 pm   
 
I was trying that.. got a weird result tho?

line from mud: Valid NPC targets here: cat effigy, monster, wisp bog gas.

captured: cat effigy, monster, wisp bog gas
result: cat effigy

if I do this...

#var trgList %replace( ( %1 ), ", ", "|")

i get this..( with the added braces, not a string list yet )

result: ( cat effigy|monster|wisp bog gas )
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4029
Location: Pensacola, FL, USA

PostPosted: Wed Aug 14, 2019 8:54 pm   
 
my example should give you the following string list:

cat effigy|monster|wisp bog gas
_________________
Discord: Shalimar#3679
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