mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#253699 28/06/15 09:15 PM
D
DaGuyFromTv
DaGuyFromTv
D
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.

#253700 28/06/15 09:31 PM
Joined: Feb 2015
Posts: 241
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 241
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

D
DaGuyFromTv
DaGuyFromTv
D
Alright I'll check it out thanks man :P

D
DaGuyFromTv
DaGuyFromTv
D
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".

Last edited by DaGuyFromTv; 28/06/15 10:15 PM.
#253706 28/06/15 11:17 PM
D
DaGuyFromTv
DaGuyFromTv
D
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
}
}
}

#253711 29/06/15 09:17 AM
N
n3wb
n3wb
N
Did anyone get this fixed? I would love to do this as well but implement a ban sound audio file laugh

#253713 29/06/15 09:52 AM
Joined: May 2015
Posts: 245
S
Fjord artisan
Offline
Fjord artisan
S
Joined: May 2015
Posts: 245
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...

#253716 29/06/15 10:58 AM
D
DaGuyFromTv
DaGuyFromTv
D
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?
}
}
}

#253727 29/06/15 07:22 PM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
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.

#253728 29/06/15 07:45 PM
Joined: May 2015
Posts: 245
S
Fjord artisan
Offline
Fjord artisan
S
Joined: May 2015
Posts: 245
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.

D
DaGuyFromTv
DaGuyFromTv
D
Maybe I should just do

if ($nick == my name) ?

D
DaGuyFromTv
DaGuyFromTv
D
Anyway way I could do

if ($nick == DaGuyFromTv)

and then I could list other mods?

Last edited by DaGuyFromTv; 29/06/15 09:30 PM.
#253736 30/06/15 04:21 AM
Joined: May 2015
Posts: 245
S
Fjord artisan
Offline
Fjord artisan
S
Joined: May 2015
Posts: 245
You can use $istok for that.

Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
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.

Joined: May 2015
Posts: 245
S
Fjord artisan
Offline
Fjord artisan
S
Joined: May 2015
Posts: 245
so, you meant
Code:
$2 isop $chan

Joined: Jan 2004
Posts: 1,330
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,330
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 }

Joined: May 2015
Posts: 245
S
Fjord artisan
Offline
Fjord artisan
S
Joined: May 2015
Posts: 245
And you actually cant ban another OP at twitch ("You cannot ban moderator USER_NAME unless you are the owner of this channel.")

N
n3wb
n3wb
N
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.

#253754 01/07/15 07:59 PM
Joined: Feb 2015
Posts: 241
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 241
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 } | }

D
DaGuyFromTv
DaGuyFromTv
D
Thanks man, I appreciate it :P

Page 1 of 2 1 2

Link Copied to Clipboard