mIRC Home    About    Download    Register    News    Help

Topic Options
#263488 - 11/08/18 05:42 AM On *:TEXT: not working
TheGigon Offline
Nutrimatic drinks dispenser

Registered: 11/08/18
Posts: 5
Hello, A little new to mIRC and trying to create a bot for Twitch. On most channels the below script works fine but on others it does not for example it works fine for #hostraffle but on #lanfusion it does not seem to work. Any help would greatly be appreciated

on *:TEXT:"chat text"*:#twitchannel: (.timertwichcahnnel 1 10 msg #twitchcahnnel "text to post in channel" }

Top
#263489 - 11/08/18 06:18 AM Re: On *:TEXT: not working [Re: TheGigon]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1151
You're trying to be unnecessarily vague, so it's hard to tell whether it's due to the syntax errors in this example or due to another cause.

You have mis-spelled cahnnel twice, so it's hard to tell whether that's causing your problem. If you have double quotes in the :matchtext: field, that can also cause the problem. If you use an opening parenthesis instead of an opening curly brace, that's also a problem. If the channel text has color codes in the middle of the match-text, that can also prevent a match. Is there an error in status window when it fails to 'do the right thing'?

Top
#263511 - 13/08/18 05:40 PM Re: On *:TEXT: not working [Re: maroon]
TheGigon Offline
Nutrimatic drinks dispenser

Registered: 11/08/18
Posts: 5
Yeah, sorry about that. I probably shouldn't post to forms at 2am if I want people to be able to understand them.

Below I have copied the script/code from my mIRC client. After doing some more testing I think the issue has to do with how the hosting bot is posting to the chat room b/c in other chats this code works just fine. Its as if the host bot in this channel is posting its announcements in a way that blocks 3rd party applications from seeing the message. I am not getting any errors in the status window.

on *:TEXT:*The raffle selection starts now*:#lanfusion: { .timerlanfusionhost 1 5 msg #lanfusion !hostme }

note: i have tried this code without the * at the start of "the raffle selection starts now" and I get the same results.

Top
#263514 - 13/08/18 07:41 PM Re: On *:TEXT: not working [Re: TheGigon]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1151
first, make sure you don't have another :TEXT: event within that script which intercepts that event, preventing any lower TEXT event handler within that script from seeing the event.

Code:
on *:TEXT:*:#lanfusion: {      echo # test1 $+(<,$nick,>) $1- }
on *:TEXT:*test*:#lanfusion: { echo # test2 $+(<,$nick,>) $1- }

In the above examples, the 2nd event handler is never seen because all events match the 1st handler's text. If the 2nd handler were moved to a different script, then it's possible for something to match both.

Next, try a debug event that shows all text in that channel, so you can see exactly what's being sent by the message you're trying to match. To make sure it doesn't interfere with your existing handler, put the following code in a different remote script file:

Code:
on *:TEXT:*:#lanfusion:{
  noop $regsubex(foo,$parms,,,&temp)
  ; if using older mirc version, instead of above, use:
  ; bset -t &temp 1 $1-
  var %stripped $calc($len($1-) - $len($strip($1-)))
  echo -gc info2 # debug nick len= $nick CtrlCodes= $+ %stripped len $len($parms) as Text: $1-
  echo -gc info2 # debug nick len= $nick $bvar(&temp,0) as Binary: $bvar(&temp,1-999)
  echo -gc info2 # debug nick len= $nick $bvar(&temp,0) as BinHex: $regsubex($bvar(&temp,1-999),/(\d+)/g,$base(\1,10,16,2))
 }


This should show more detail about the message you're trying to match.

Top