mIRC Home    About    Download    Register    News    Help

Print Thread
#209143 05/02/09 02:07 AM
Joined: Nov 2007
Posts: 20
D
Drai Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2007
Posts: 20
Alright, so I know this is a script that allows me to respond to a /me with a /me of my own.
Code:
on *:ACTION:whatever action they do:#channel: {


  .timer -m 1 100 describe $chan whatever my response is
} 


However, what would the script look like if I were to respond to someone kicking someone from the channel by kicking them myself.

For instance, somebody (person A) has a script that kicks another person (person B) if person B does a particular action. Being the channel founder I would like to kick person A if they kick somebody from the channel.

Thanks

Last edited by Drai; 05/02/09 02:12 AM.
Joined: Feb 2007
Posts: 234
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
so if somenick says /me blah and othernick kicks somenick because somenick said /me blah you want to kick othernick?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You're looking for the ON KICK event

In that event:
$nick is the name of the person that did the kicking
$knick is the name of the person that was kicked
$chan is the channel name
$1- is the reason for the kick

You'd have to be careful that you didn't kick PersonA if they kicked PersonB for breaking the rules, as that would be punishing PersonA for enforcing the channel rules. Not a good idea.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Quote:
what would the script look like if I were to respond to someone kicking someone from the channel by kicking them myself?

You use the on kick event. For instance:
Code:
on !*:KICK:#:kick $chan $nick | msg $chan $knick was kicked by $nick

Excuse me if I have misunderstood you.

Joined: Nov 2007
Posts: 20
D
Drai Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2007
Posts: 20
Originally Posted By: RusselB
You're looking for the ON KICK event

In that event:
$nick is the name of the person that did the kicking
$knick is the name of the person that was kicked
$chan is the channel name
$1- is the reason for the kick

You'd have to be careful that you didn't kick PersonA if they kicked PersonB for breaking the rules, as that would be punishing PersonA for enforcing the channel rules. Not a good idea.

I'm the channel founder so I basically make the rules, but thanks for the warning, I'll be sure to only implement it in this channel.
Originally Posted By: MTec007
so if somenick says /me blah and othernick kicks somenick because somenick said /me blah you want to kick othernick?

Correct

And thanks Tomao.

Joined: Feb 2007
Posts: 234
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
im not sure how you are going to know the reasoning behind othernick's kick. if somenick said /me says hello and then said /msg #chan (something obscene and offensive) and othernick kicked somenick, how are you going to know why othernick kicked him? i have been trying to logically reason this out, but i just can not figure out a way to accurately code it.

Joined: Nov 2007
Posts: 20
D
Drai Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2007
Posts: 20
You know, I was thinking, and if I just went one step ahead, and kicked that specific person when someone did the action that he kicks them for, it would work just as well.

I'm not the greatest at coding though, but I believe that would make it a lot easier.

For instance: on action:the thing he kicks them for | (insert whatever command I need to kick a specific person)

Last edited by Drai; 08/02/09 08:53 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
On most (if not all) IRCd's, the /kick command requires a reason, which can be referenced using $1- in the ON KICK event.

eg:
Code:
on @!*:kick:#:{
  if !$read(offense.txt,s,$1-) {
    .kick $chan $nick Offense $1- not found as a valid reason for kicking
  }
}

Create a text file called offense.txt and place it in your mIRC active directory (as returned by //echo -a $mircdir).
In that text file, list the various allowed reasons for kicking from the channel.

NOTE: Use this with caution, as one or more people/bots using the same or similar scripts could cause sufficient problems that an IRCop and/or the channel founder may have to step in and ban the clients that are fighting.

Joined: Nov 2007
Posts: 20
D
Drai Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2007
Posts: 20
Originally Posted By: RusselB
On most (if not all) IRCd's, the /kick command requires a reason, which can be referenced using $1- in the ON KICK event.

eg:
Code:
on @!*:kick:#:{
  if !$read(offense.txt,s,$1-) {
    .kick $chan $nick Offense $1- not found as a valid reason for kicking
  }
}

Create a text file called offense.txt and place it in your mIRC active directory (as returned by //echo -a $mircdir).
In that text file, list the various allowed reasons for kicking from the channel.

NOTE: Use this with caution, as one or more people/bots using the same or similar scripts could cause sufficient problems that an IRCop and/or the channel founder may have to step in and ban the clients that are fighting.

I'll take note of that, thank you very much.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
If there is a line in the file that is equal to $1-, $read(file,s,$1-) would still return $null (look up $read and/or experiment if you don't see why this is).

I would suggest either replacing the s switch with w or checking $readn as well.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Yeah.. I thought I had used the w rather than the s, as I know that the s would return $null.. simply a typo that I missed.


Link Copied to Clipboard