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
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 126

PostPosted: Thu Mar 29, 2018 5:19 pm   

help with a capture
 
Im having a problem with a capture with asterisks "*", or other symbols that appear beside numbers/letters.
the function of them appearing and disappearing is based on a skill related to that symbol (*, +, -, etc)

i will show you an example of this, and hopefully someone can show me how to make 1 capture dor when it IS there and when its NOT



CL: [*54.31%] is this CL~:%s~[([*])([0-9.])~%~]

my script for this

#gag
priest.beseech=%pos("*", %1)
priest.cleanse=%2
#IF (@priest.beseech>0&&@combat=="on"&&@priest.cleanse>=98) {beseech}

can someone please show me how to make a capture work for this when the asterisk (any symbol/letter/number) that is not always there?

thanks in advance!
Reply with quote
shalimar
GURU


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

PostPosted: Thu Mar 29, 2018 11:13 pm   
 
For things that may not be there, you need an anonymous variable list that includes a %null value.

In this case: {~*|}
That is a literal asterisk, which may not be there.
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 126

PostPosted: Fri Mar 30, 2018 3:12 am   
 
hrrrm could you show me how to write that out for this capture please?
Reply with quote
shalimar
GURU


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

PostPosted: Fri Mar 30, 2018 3:33 am   
 
#TR {CL: ~[({~*|})([%d.])%~]} {#GAG;#IF (%1) {#IF (%2>=98) {beseech}}}
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 126

PostPosted: Fri Mar 30, 2018 11:38 am   
 
doesn't capture shal
Reply with quote
shalimar
GURU


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

PostPosted: Fri Mar 30, 2018 3:26 pm   
 
#TR {CL: ~[({~*|})([%d.])~%~]} {#GAG;#IF (%1) {#IF (%2>=98) {beseech}}}
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 126

PostPosted: Mon Apr 16, 2018 7:27 pm   
 
I never did get this fixed but i have a similar issue but a bit more complicated only due to the randomness of what is missing and what is showing.
I'll put a bit of it up here:

Quote:
Capture:


there are quite a few other possible item inside this hpbar function as well.

I need a way to use the "[ [ ] ]" and captuire whatever comes whenever it comes, i've yet to make a way to do this. If anyone can help, i'd much appreciate it.

heh i dont understand why double brackets aren't showing when i submit this... [ [ ] ] together... are on both sides of that capture
Reply with quote
shalimar
GURU


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

PostPosted: Tue Apr 17, 2018 3:24 am   
 
But what is the issue with the capture now? It worked on my local testing.

Use the code tags instead of the quote tags to force it to show literal strings and padded whitespace.

#TR {~[~[Capture: (*)~]~]} {do something}
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
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