mIRC Homepage
Hi guys,

I was hoping to know if there is a way that I could make it to where if the bot detects that it is banned in the channel, it leaves the channel. Any help with this would be much appreciated.

Thanks,
Netct25
This is for Twitch, but I can hope it gives an idea.

Code:
on *:NOTICE:You are permanently banned*:#: {
/part #
}
Oh I see how this works. So it is listening for that specific message and if it seen, it will part the channel. Thanks so much for your help. So NOTICE is a function that is listening for messages?
This doesn't seem to work. Any ideas why? Here is what I have

Code:

 on *:NOTICE:You are permanently banned*:#: {
    .part $chr(35) $+ $nick



you need to close it } thats a place to start :P
Copy paste in the script editor (remotes tab) correctly the code above in order to work.
I have the brackets closed and the script is still not working. I have also placed it in the remotes file as well.
What message you receive if the bot is banned?

Give the full message here.
So I did some debugging. Did a simple echo back script to see if the function was working and it is. However it doesn't part the channel. I am confused. Any way here is the full message: -tmi.twitch:#channelnamehere You are permanently banned from talking in #channelnamehere


Code:

on *:NOTICE:You are permanently banned*:#: {
  .part $chr(35) $+ $nick
echo this works
}


Thats because you did not copy paste correctly the first code that gave it to you.

Try use this:

Code:
on *:NOTICE:*You are permanently banned from talking in*:#: { .part $chan }

Yup that fixed it. Thank you Westor. Mind telling me why .part $chr(35) $+ $nick does not work in this case? Thanks again.
Because $nick was empty.
Oh that makes since! Since there was no stored data in the variable $nick it couldn't recognize which channel to part from so it did nothing.. Can't believe I didn't recognize this. Glad I have an extra eye to see what the issue was. Thanks Westor.
© mIRC Discussion Forums