mIRC Home    About    Download    Register    News    Help

Print Thread
Possible to make the bot leave if it is banned? #256652 07/02/16 01:13 PM
Joined: Dec 2015
Posts: 36
N
Netct25 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2015
Posts: 36
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

Re: Possible to make the bot leave if it is banned? [Re: Netct25] #256653 07/02/16 01:28 PM
Joined: Jun 2015
Posts: 84
F
Fonic_Artes Offline
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
This is for Twitch, but I can hope it gives an idea.

Code:
on *:NOTICE:You are permanently banned*:#: {
/part #
}

Re: Possible to make the bot leave if it is banned? [Re: Fonic_Artes] #256654 07/02/16 01:35 PM
Joined: Dec 2015
Posts: 36
N
Netct25 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2015
Posts: 36
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?

Re: Possible to make the bot leave if it is banned? [Re: Netct25] #256655 07/02/16 01:44 PM
Joined: Dec 2015
Posts: 36
N
Netct25 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2015
Posts: 36
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




Re: Possible to make the bot leave if it is banned? [Re: Netct25] #256656 07/02/16 05:05 PM
Joined: Jul 2015
Posts: 42
J
Joveice Offline
Ameglian cow
Offline
Ameglian cow
J
Joined: Jul 2015
Posts: 42
you need to close it } thats a place to start :P

Re: Possible to make the bot leave if it is banned? [Re: Joveice] #256657 07/02/16 05:09 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Copy paste in the script editor (remotes tab) correctly the code above in order to work.

Re: Possible to make the bot leave if it is banned? [Re: Joveice] #256667 07/02/16 07:03 PM
Joined: Dec 2015
Posts: 36
N
Netct25 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2015
Posts: 36
I have the brackets closed and the script is still not working. I have also placed it in the remotes file as well.

Last edited by Netct25; 07/02/16 07:06 PM.
Re: Possible to make the bot leave if it is banned? [Re: Netct25] #256668 07/02/16 07:09 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
What message you receive if the bot is banned?

Give the full message here.

Re: Possible to make the bot leave if it is banned? [Re: westor] #256669 07/02/16 07:15 PM
Joined: Dec 2015
Posts: 36
N
Netct25 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2015
Posts: 36
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
}



Last edited by Netct25; 07/02/16 07:16 PM.
Re: Possible to make the bot leave if it is banned? [Re: Netct25] #256670 07/02/16 07:25 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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 }


Re: Possible to make the bot leave if it is banned? [Re: westor] #256671 07/02/16 07:31 PM
Joined: Dec 2015
Posts: 36
N
Netct25 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2015
Posts: 36
Yup that fixed it. Thank you Westor. Mind telling me why .part $chr(35) $+ $nick does not work in this case? Thanks again.

Re: Possible to make the bot leave if it is banned? [Re: Netct25] #256672 07/02/16 07:34 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Because $nick was empty.

Re: Possible to make the bot leave if it is banned? [Re: westor] #256673 07/02/16 07:37 PM
Joined: Dec 2015
Posts: 36
N
Netct25 Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2015
Posts: 36
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.