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.
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
Alright I'll check it out thanks man :P
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".
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
}
}
}
Did anyone get this fixed? I would love to do this as well but implement a ban sound audio file
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...
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?
}
}
}
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.
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.
Maybe I should just do
if ($nick == my name) ?
Anyway way I could do
if ($nick == DaGuyFromTv)
and then I could list other mods?
You can use $istok for that.
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.
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 }
And you actually cant ban another OP at twitch ("You cannot ban moderator USER_NAME unless you are the owner of this channel.")
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.
to cover everyone's suggestions which were all good i'll add them in your script
Just to help out
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 } | }
Thanks man, I appreciate it :P
BTW, how do you get the code in a box like you did?
I'm not sure how you to add a mod to the list?
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...
BTW, how do you get the code in a box like you did?
"code" and "/code" in [].
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
try change it to
and check again.
I'm not sure how you to add a mod to the list?
Type "/addmod some_mod_nick" in your bot`s editbox.
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!
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!
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.
hey! did it work with the correction?
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.
try this one i think it will work
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 } | }