mIRC Home    About    Download    Register    News    Help

Print Thread
#181732 30/07/07 04:00 AM
Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
I know how to do on text events, but im trying to do one where i type !kick NICK and it will kick the user. the script that i have got is -----> on 1:TEXT:*!kick $nick*:#: /kick $chan $chan $nick <----- Yet i get nothing. I am assuming that its that /kick part that is wrong. Also, on these message boards, how do you put the script in a code box? i know, newbie question, i know. Thanks for help in advance!

dylaninfd #181738 30/07/07 05:08 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The code should be formated like this
Code:
on @*:text:!kick*:#:{
  if $2 ison $chan {
    kick $chan $2
  }
}

The @ in the on text event means that the client running the code must have ops in the channel.
I used !kick as the command, and the command must be at the start of the line, whereas you have *!kick, which means that the command can be used anywhere in the line.
specifying $nick in the match text section of the on text event, is useless, as it returns the nick of the person issuing the command.
The /kick command only needs the channel name specified once, not twice, as you have it, and I doubt very much that you want the command to kick the person using it, which is what would happen leaving $nick in the /kick command.

As to putting the code into a Code Box, you can press the button above where you write the code, that looks like the # character.

RusselB #181842 31/07/07 11:33 PM
Joined: Dec 2004
Posts: 87
I
Babel fish
Offline
Babel fish
I
Joined: Dec 2004
Posts: 87
why not add a if ($2 == $me ) { return }

dylaninfd #181843 31/07/07 11:46 PM
Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Originally Posted By: dylaninfd
I know how to do on text events, but im trying to do one where i type !kick NICK and it will kick the user. the script that i have got is -----> on 1:TEXT:*!kick $nick*:#: /kick $chan $chan $nick <----- Yet i get nothing. I am assuming that its that /kick part that is wrong.


That's because you of your code. /kick $chan $chan $nick would translate to /kick #<NameOfChannel> #<NameOfChannel> Nick.

Originally Posted By: ik000ike
why not add a if ($2 == $me ) { return }


Well, what if another op wanted to kick him?

Anyways, DylanInfD, I'm going to lecture to you a bit.

Kick is always meant to best used via /kick or /k, and not !kick or !k. The reason being is that ! by default is outputted to the channel.

When I'm op in a channel and someone typed !kick Neal (my nick), and a bot would kick me, I wrote a script to handle that. And if I know the nick of the bot, I added that. That way, when someone typed !kick Neal, I kicked both him AND their bot. When someone typos !deop Neal, I deop them both (if I'm fast enough).

Now, if the user kicked be by using /kick or /k instead of !kick or !k, they would have kicked me, and I wouldn't have kicked them, which they would have been successful. It's to their disadvantage (and yours, if you follow that), to kick via !k*.

Of course, if you're going to whine to me you need other ops to get a bot or yourself to kick a user, they can have their /k alias. Or you can send it to /notice. Such as /notice Bot kick channel nick reason, (or /notice bot pass if they're not opped).

That will solve a lot of your problems.

-Neal.

dylaninfd #181844 31/07/07 11:46 PM
Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Double post.

Last edited by LostShadow; 31/07/07 11:46 PM.

Link Copied to Clipboard