mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#253699 - 28/06/15 10:15 PM [Twitch] Ban Command
DaGuyFromTv Offline
Pikka bird

Registered: 28/06/15
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.

Top
#253700 - 28/06/15 10:31 PM Re: [Twitch] Ban Command [Re: DaGuyFromTv]
OrFeAsGr Offline
Fjord artisan

Registered: 01/02/15
Posts: 243
Loc: Greece
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
_________________________
Humanity Bot Services Download & mIRC Scripting Help
http://humanity.ucoz.com

Top
#253701 - 28/06/15 10:34 PM Re: [Twitch] Ban Command [Re: OrFeAsGr]
DaGuyFromTv Offline
Pikka bird

Registered: 28/06/15
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.

Top
#253705 - 28/06/15 11:13 PM Re: [Twitch] Ban Command [Re: OrFeAsGr]
DaGuyFromTv Offline
Pikka bird

Registered: 28/06/15
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".


Edited by DaGuyFromTv (28/06/15 11:15 PM)
_________________________
I'm a noob, please do not judge and any help is greatly appreciated.

Top
#253706 - 29/06/15 12:17 AM Re: [Twitch] Ban Command [Re: DaGuyFromTv]
DaGuyFromTv Offline
Pikka bird

Registered: 28/06/15
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.

Top
#253711 - 29/06/15 10:17 AM Re: [Twitch] Ban Command [Re: DaGuyFromTv]
n3wb Offline
Nutrimatic drinks dispenser

Registered: 29/06/15
Posts: 9
Did anyone get this fixed? I would love to do this as well but implement a ban sound audio file laugh

Top
#253713 - 29/06/15 10:52 AM Re: [Twitch] Ban Command [Re: n3wb]
splinny Offline
Fjord artisan

Registered: 14/05/15
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!

Top
#253716 - 29/06/15 11:58 AM Re: [Twitch] Ban Command [Re: DaGuyFromTv]
DaGuyFromTv Offline
Pikka bird

Registered: 28/06/15
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.

Top
#253727 - 29/06/15 08:22 PM Re: [Twitch] Ban Command [Re: DaGuyFromTv]
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
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,.) }

Top
#253728 - 29/06/15 08:45 PM Re: [Twitch] Ban Command [Re: DaGuyFromTv]
splinny Offline
Fjord artisan

Registered: 14/05/15
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!

Top
#253730 - 29/06/15 10:29 PM Re: [Twitch] Ban Command [Re: splinny]
DaGuyFromTv Offline
Pikka bird

Registered: 28/06/15
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.

Top
#253731 - 29/06/15 10:30 PM Re: [Twitch] Ban Command [Re: splinny]
DaGuyFromTv Offline
Pikka bird

Registered: 28/06/15
Posts: 13
Anyway way I could do

if ($nick == DaGuyFromTv)

and then I could list other mods?


Edited by DaGuyFromTv (29/06/15 10:30 PM)
_________________________
I'm a noob, please do not judge and any help is greatly appreciated.

Top
#253736 - 30/06/15 05:21 AM Re: [Twitch] Ban Command [Re: DaGuyFromTv]
splinny Offline
Fjord artisan

Registered: 14/05/15
Posts: 249
You can use $istok for that.
_________________________
Dont give a fish - teach to fish!

Top
#253738 - 30/06/15 03:41 PM Re: [Twitch] Ban Command [Re: splinny]
sparta Offline
Planetary brain

Registered: 22/02/03
Posts: 3432
Loc: Sweden/Borlänge
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,.) }

Top
#253739 - 30/06/15 03:55 PM Re: [Twitch] Ban Command [Re: sparta]
splinny Offline
Fjord artisan

Registered: 14/05/15
Posts: 249
so, you meant
Code:
$2 isop $chan
_________________________
Dont give a fish - teach to fish!

Top
#253740 - 30/06/15 03:55 PM Re: [Twitch] Ban Command [Re: sparta]
Loki12583 Online
Hoopy frood

Registered: 22/01/04
Posts: 1244
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 }

Top
#253743 - 30/06/15 05:03 PM Re: [Twitch] Ban Command [Re: Loki12583]
splinny Offline
Fjord artisan

Registered: 14/05/15
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!

Top
#253753 - 01/07/15 06:23 PM Re: [Twitch] Ban Command [Re: splinny]
n3wb Offline
Nutrimatic drinks dispenser

Registered: 29/06/15
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.

Top
#253754 - 01/07/15 08:59 PM Re: [Twitch] Ban Command [Re: DaGuyFromTv]
OrFeAsGr Offline
Fjord artisan

Registered: 01/02/15
Posts: 243
Loc: Greece
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 } | }
_________________________
Humanity Bot Services Download & mIRC Scripting Help
http://humanity.ucoz.com

Top
#253755 - 01/07/15 11:48 PM Re: [Twitch] Ban Command [Re: OrFeAsGr]
DaGuyFromTv Offline
Pikka bird

Registered: 28/06/15
Posts: 13
Thanks man, I appreciate it :P
_________________________
I'm a noob, please do not judge and any help is greatly appreciated.

Top
Page 1 of 2 1 2 >