Need help in anti-robot trigger
Posted: Mon Aug 13, 2018 4:47 am
Hello everyone,
I am new to Mudlet, and is now having problem to write a trigger to tackle an in-game anti-robot message.
here is the case:
whenever i type "locate XXX" , it will shows the direction of the item, but the way it shows is kind of graphical, and i have to figure it what is the direction, here is the actual present:
Your Position : Forest
□□□□□□□□
Λ ∴ ● ∴
← > ● <=>
□ □ ∵ □↓
Distance:□□□□□□□□□□□□□□□□□□□□□□□□48
some of the symbol are for illusion, the actual direction is the center symbols, below are sample after removing the fake symbols,
and the direction should be "south + east" ( ● is the arrow body, ∵ is the arrow head)
Your Position : Forest
□□□□□□□□
●
●
∵
Distance:□□□□□□□□□□□□□□□□□□□□□□□□48
this is the first step, and all symbols are generated randomly ( can be ● Λ □ ∴ ,etc) and in different colors.
the only rule is the real symbol is in same color (could be the same as others fake symbols) , and the 2 "arrow body" is the same.
also , the numbers of symbol in each line is not certain, can be 3-5 symbols in one line
My idea is capture the whole picture first, and then try to save individual letter in table (including whitespace) , and try to analysis it afterwards (didnt think of how can do this)
But i face a problem in my first step (capturing the whole picture *cry*)
i have written a trigger like this :
Ticked "Multiline /AND Trigger for 7 line delta" and all in "perl regex"
1) ^Your Position : (\w+)$
2) ^□□□□□□□□$
3) ^(\s+)$ <<<<<<<<< a space line here
4) ^(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))?(?:\s*(.+?))?$
5) ^(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))?(?:\s*(.+?))?$
6) ^(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))?(?:\s*(.+?))?$
7) ^Distance:(.*?)(\d+)
However, when i try to echo the result , line 1,2,3,7 are fine , but 4,5,6 shows the same result as 4
that is, it becomes sth like this in echo:
Your Position : Forest
□□□□□□□□
Λ ∴ ● ∴
Λ ∴ ● ∴
Λ ∴ ● ∴
Distance:□□□□□□□□□□□□□□□□□□□□□□□□48
ps : i use multimatches to show it :
send("say " ..multimatches[1][1])
send("say " ..multimatches[2][1])
send("say " ..multimatches[3][1])
send("say " ..multimatches[4][1])
send("say " ..multimatches[5][1])
send("say " ..multimatches[6][1])
send("say " ..multimatches[7][1])
could anyone help to see what is the problem in my perl regex , or please let me know if there is a better way to do this*******
thank you so much for your help!!!
I am new to Mudlet, and is now having problem to write a trigger to tackle an in-game anti-robot message.
here is the case:
whenever i type "locate XXX" , it will shows the direction of the item, but the way it shows is kind of graphical, and i have to figure it what is the direction, here is the actual present:
Your Position : Forest
□□□□□□□□
Λ ∴ ● ∴
← > ● <=>
□ □ ∵ □↓
Distance:□□□□□□□□□□□□□□□□□□□□□□□□48
some of the symbol are for illusion, the actual direction is the center symbols, below are sample after removing the fake symbols,
and the direction should be "south + east" ( ● is the arrow body, ∵ is the arrow head)
Your Position : Forest
□□□□□□□□
●
●
∵
Distance:□□□□□□□□□□□□□□□□□□□□□□□□48
this is the first step, and all symbols are generated randomly ( can be ● Λ □ ∴ ,etc) and in different colors.
the only rule is the real symbol is in same color (could be the same as others fake symbols) , and the 2 "arrow body" is the same.
also , the numbers of symbol in each line is not certain, can be 3-5 symbols in one line
My idea is capture the whole picture first, and then try to save individual letter in table (including whitespace) , and try to analysis it afterwards (didnt think of how can do this)
But i face a problem in my first step (capturing the whole picture *cry*)
i have written a trigger like this :
Ticked "Multiline /AND Trigger for 7 line delta" and all in "perl regex"
1) ^Your Position : (\w+)$
2) ^□□□□□□□□$
3) ^(\s+)$ <<<<<<<<< a space line here
4) ^(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))?(?:\s*(.+?))?$
5) ^(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))?(?:\s*(.+?))?$
6) ^(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))(?:\s*(.+?))?(?:\s*(.+?))?$
7) ^Distance:(.*?)(\d+)
However, when i try to echo the result , line 1,2,3,7 are fine , but 4,5,6 shows the same result as 4
that is, it becomes sth like this in echo:
Your Position : Forest
□□□□□□□□
Λ ∴ ● ∴
Λ ∴ ● ∴
Λ ∴ ● ∴
Distance:□□□□□□□□□□□□□□□□□□□□□□□□48
ps : i use multimatches to show it :
send("say " ..multimatches[1][1])
send("say " ..multimatches[2][1])
send("say " ..multimatches[3][1])
send("say " ..multimatches[4][1])
send("say " ..multimatches[5][1])
send("say " ..multimatches[6][1])
send("say " ..multimatches[7][1])
could anyone help to see what is the problem in my perl regex , or please let me know if there is a better way to do this*******
thank you so much for your help!!!