1

I'm trying to create an on-text script that when phrase "A" is typed in the channel, text output "B" is auto posted.

What I have so far that isn't working:

on 1:text:*Swagger's troops are home:*:/msg $chan psst! @Swagger your troops are home!

Now the actual text that's being posted (by another bot) is:

9UPDATE!! -->4 Swagger's troops are home!! (4Army 1,7 1g)

(The numbers are for colours, im not sure if they impact mirc scripts?)

When I manually type in Update!! --> Swagger's troops are home!! the autoresponder works, but when the bot posts, i get nothing

See image for how the output is working: https://i.stack.imgur.com/RlWlP.png

Any idea where I'm messing up?

ijirving
  • 21
  • 2

2 Answers2

2

on text event will match the exact text
there are 2 ways to do this

one is using regex
which is efficient and faster

on $*:text:/\bSwagger's troops are home\b/iS:#:{
msg $chan Swagger your troops are home!
}

the other way is stripping the $1-

on *:text:$($iif(*Swagger's troops are home* iswm $strip($1-),$1-)):#:{
msg $chan Swagger your troops are home! 
}
Sirius_Black
  • 471
  • 3
  • 11
1

Like you mentioned, the line the bot messages contains colour codes. Your script looks for a message that matches your search exactly, and it's not expecting colours.

A relatively easy way to fix this would be by inserting another wildcard where you would expect the colour change: *Swagger's*troops are home!!*. Anything could be where the asterisk is; including colours.

Patrickdev
  • 2,341
  • 1
  • 21
  • 29