mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#253699 28/06/15 09:15 PM
Joined: Jun 2015
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2015
Posts: 13
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.


I'm a noob, please do not judge and any help is greatly appreciated.
Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
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

Joined: Jun 2015
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2015
Posts: 13
Alright I'll check it out thanks man :P


I'm a noob, please do not judge and any help is greatly appreciated.
Joined: Jun 2015
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2015
Posts: 13
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.

I'm a noob, please do not judge and any help is greatly appreciated.
Joined: Jun 2015
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2015
Posts: 13
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
}
}
}


I'm a noob, please do not judge and any help is greatly appreciated.
Joined: Jun 2015
Posts: 9
N
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
N
Joined: Jun 2015
Posts: 9
Did anyone get this fixed? I would love to do this as well but implement a ban sound audio file laugh

Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
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...


Dont give a fish - teach to fish!
Joined: Jun 2015
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2015
Posts: 13
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'm a noob, please do not judge and any help is greatly appreciated.
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
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.


Dont give a fish - teach to fish!
Joined: Jun 2015
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2015
Posts: 13
Maybe I should just do

if ($nick == my name) ?


I'm a noob, please do not judge and any help is greatly appreciated.
Joined: Jun 2015
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2015
Posts: 13
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.

I'm a noob, please do not judge and any help is greatly appreciated.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
You can use $istok for that.


Dont give a fish - teach to fish!
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
so, you meant
Code:
$2 isop $chan


Dont give a fish - teach to fish!
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
And you actually cant ban another OP at twitch ("You cannot ban moderator USER_NAME unless you are the owner of this channel.")


Dont give a fish - teach to fish!
Joined: Jun 2015
Posts: 9
N
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
N
Joined: Jun 2015
Posts: 9
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.

Joined: Feb 2015
Posts: 243
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
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 } | }

Joined: Jun 2015
Posts: 13
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Jun 2015
Posts: 13
Thanks man, I appreciate it :P


I'm a noob, please do not judge and any help is greatly appreciated.
Page 1 of 2 1 2

Link Copied to Clipboard