mIRC Homepage
Posted By: DaGuyFromTv [Twitch] Ban Command - 28/06/15 09:15 PM
First of all, I'm new to mIrc, well any IRC to be honest.

Now that that is said here's what I'm trying to make. I don't know if it's possible but I'd like to make a command like "!banhammer <name>". What this command would do is say a line in chat like "The ban hammer has hit <Name>" or something like that and then would /ban the user.

Any help would be much appreciated, this command is for my friend at twitch.tv/Brozerian.
Posted By: OrFeAsGr Re: [Twitch] Ban Command - 28/06/15 09:31 PM
This is a very simple script that i'm sure you can write in no time.
Type /help on text
and the mirc help file will open. There you can see how to use the on text event as you like.
Alternative help:
http://en.wikichip.org/wiki/mirc/on_event#On_Text.2C_Action.2C_and_Notice
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 28/06/15 09:34 PM
Alright I'll check it out thanks man :P
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 28/06/15 10:13 PM
I went threw the whole thing but I'm not sure how I would take the name from the command "!banhammer User" and then say it in chat "The banhammer... on the User" and then also do "/ban User".
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 28/06/15 11:17 PM
So far I have made this, but it does not seem to work...

on *:TEXT:!banhammer *:#brozerian: {
var %user $nick
if ($nick isop #) {
if ($2 == null) {
msg $chan /me > Please supply the user you would like to strike with the ban hammer.
}
else {
msg $chan /me > The user $2 has been striked by the ban hammer!
msg $chan /ban $2
}
}
}
Posted By: n3wb Re: [Twitch] Ban Command - 29/06/15 09:17 AM
Did anyone get this fixed? I would love to do this as well but implement a ban sound audio file laugh
Posted By: splinny Re: [Twitch] Ban Command - 29/06/15 09:52 AM
Last example looks fine, but "null" should be "$null". The problem is that there is no specific "problem" - who knows what means "it does not seem to work..." - it doesnt reply at all, or tell mods they arent mods or w\e...
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 29/06/15 10:58 AM
Ok, here's what I got for now. Wjem O type in !banhammer in chat it does nothing though. Also, how to post command lines like this in a box?

on *:text:!banhammer *:#brozerian: {
var %user $nick
if ($nick isop #) {
if ($2 == $null) {
msg $chan /me >: Which user you would like to strike with the ban hammer.
}
else {
msg $chan /me >: The ban hammer has striked on $2 .
msg $chan /ban $2
}
else msg $chan $nick Who do you think you are?
}
}
}
Posted By: sparta Re: [Twitch] Ban Command - 29/06/15 07:22 PM
I would change this part if i was you.

if ($nick isop #) {

to

if ($nick isop $chan) { msg $chan thas a no no .. | return }

Reason why.
Not to good if people can start to ban people with op in your channel.

Never been on any twitch servers, but i guess it work almost as a irc server.
Posted By: splinny Re: [Twitch] Ban Command - 29/06/15 07:45 PM
1. "isop" not reliable command for twitch.
2. if you are using bot to ban, why do you need person to be op? use some %variable with list of nicks who arent OPs but can use bot to ban (which IS reliable)
3. absolutly no idea what "sparta" is talking about and what is the difference with "#" and "$chan" in that case.
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 29/06/15 09:29 PM
Maybe I should just do

if ($nick == my name) ?
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 29/06/15 09:30 PM
Anyway way I could do

if ($nick == DaGuyFromTv)

and then I could list other mods?
Posted By: splinny Re: [Twitch] Ban Command - 30/06/15 04:21 AM
You can use $istok for that.
Posted By: sparta Re: [Twitch] Ban Command - 30/06/15 02:41 PM
I just wanted to point out that to be able to ban oped users can be a bad idea. And i used $chan since i always done it that way.
Posted By: splinny Re: [Twitch] Ban Command - 30/06/15 02:55 PM
so, you meant
Code:
$2 isop $chan
Posted By: Loki12583 Re: [Twitch] Ban Command - 30/06/15 02:55 PM
The confusion was in your suggesting to replace if ($nick isop #) with if ($nick isop $chan). These are identical, and it's not what you meant to convey.

The script should be checking if the target is also an op. So if isop were sufficient (it isn't) you would if ($2 isop #) { return }
Posted By: splinny Re: [Twitch] Ban Command - 30/06/15 04:03 PM
And you actually cant ban another OP at twitch ("You cannot ban moderator USER_NAME unless you are the owner of this channel.")
Posted By: n3wb Re: [Twitch] Ban Command - 01/07/15 05:23 PM
I am intersted in this code if you get it working please post it up because I think this will be great for my BANHAMMER sound I created. I used to have a Banhammer button and sound effect when someone was banned. But I had to manually press it when I banned someone. Be nice to have this in the channel for my mods...so everytime they ban someone PERMA..then the sound will trigger the bot and the sound will play.
Posted By: OrFeAsGr Re: [Twitch] Ban Command - 01/07/15 07:59 PM
to cover everyone's suggestions which were all good i'll add them in your script smile Just to help out
Code:
on *:text:!banhammer *:#brozerian: { 
var %user = $nick
;you are not using %user but in case you need it i added the = cause it won't work without it
if ($istok(%mods,$nick,32)) {
if ($2 == $null) {
msg $chan /me >: Which user you would like to strike with the ban hammer.
}
if ($2 isop #) {
msg $chan /me >: You can't ban Ops in $chan
}
elseif ($2 !isop #) {
msg $chan /me >: The ban hammer has striked on $2 .
msg $chan /ban $2
}
}
elseif (!$istok(%mods,$nick,32)) {
msg $chan You are not in my mods list.
}
}
;so this should work.. to add nicks in the mods list which i put in a var you could use a text command or this alias
alias addmod { if (!$1) { echo -at Error: Please input a nick to add in mods list } | elseif ($1) { set %mods $addtok(%mods,$1,32) | echo -at $1 Added to Mods List } | }
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 01/07/15 10:48 PM
Thanks man, I appreciate it :P
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 01/07/15 10:52 PM
BTW, how do you get the code in a box like you did?
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 01/07/15 10:54 PM
I'm not sure how you to add a mod to the list?
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 02/07/15 04:24 AM
Also, the

if ($2 == $null) {
msg $chan /me >: Which user you would like to strike with the ban hammer.
}

part does not seem to work...
Posted By: splinny Re: [Twitch] Ban Command - 02/07/15 05:53 AM
Originally Posted By: DaGuyFromTv
BTW, how do you get the code in a box like you did?

"code" and "/code" in [].
Posted By: splinny Re: [Twitch] Ban Command - 02/07/15 05:54 AM
Originally Posted By: DaGuyFromTv
Also, the

if ($2 == $null) {
msg $chan /me >: Which user you would like to strike with the ban hammer.
}

part does not seem to work...

Not sure, but the reason could be in
Code:
:!banhammer *
try change it to
Code:
:!banhammer*
and check again.
Posted By: splinny Re: [Twitch] Ban Command - 02/07/15 05:55 AM
Originally Posted By: DaGuyFromTv
I'm not sure how you to add a mod to the list?

Type "/addmod some_mod_nick" in your bot`s editbox.
Posted By: n3wb Re: [Twitch] Ban Command - 02/07/15 06:25 AM
GREAT one thing can we add a code to it where a ban sound triggers when someone is banned from the channel? That will make it even cooler!
Posted By: n3wb Re: [Twitch] Ban Command - 02/07/15 09:07 AM
So I created a sound for the ban hammer but I can only get it to play when I type it in

on *:text: The ban hammer *:#:{
splay -w C:\Users\Solo Seven Records\AppData\Roaming\mIRC\sounds\BANNED.wav
}


The bot replies with the same stuff but the issue is that the sound does not play! So i am wondering how can i get the sound to play only when the bot states the text and not the users!
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 02/07/15 06:35 PM
The sound thing would be nice, but the thing is I'm hosting the bot for my friend so if it was to play on his stream, he would have to download it.
Posted By: OrFeAsGr Re: [Twitch] Ban Command - 04/07/15 04:14 PM
hey! did it work with the correction? smile
Posted By: DaGuyFromTv Re: [Twitch] Ban Command - 06/07/15 11:58 AM
Sort of, the could you please specify who you want to strike thing doesn't really work? It asks me the question and then says <no one> has been banned.
Posted By: OrFeAsGr Re: [Twitch] Ban Command - 08/07/15 09:14 PM
try this one i think it will work
Code:
on *:text:!banhammer *:#brozerian: { 
var %user = $nick
if ($istok(%mods,$nick,32)) {
if ($2 == $null) {
msg $chan /me >: Which user you would like to strike with the ban hammer.
}
elseif ($2 != $null) {
if ($2 isop #) {
msg $chan /me >: You can't ban Ops in $chan
}
elseif ($2 !isop #) {
msg $chan /me >: The ban hammer has striked on $2 .
msg $chan /ban $2
}
}
}
elseif (!$istok(%mods,$nick,32)) {
msg $chan You are not in my mods list.
}
}

alias addmod { if (!$1) { echo -at Error: Please input a nick to add in mods list } | elseif ($1) { set %mods $addtok(%mods,$1,32) | echo -at $1 Added to Mods List } | }
© mIRC Discussion Forums