mIRC Home    About    Download    Register    News    Help

Print Thread
#14437 07/03/03 12:28 PM
Joined: Dec 2002
Posts: 76
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 76
i cant kick a user with this script:
Code:
alias akick {
  var %reason = [All Channel]
  if #* iswm $1 && $2 ison $1 {
    var %chan = $1
    var %nick = $2
    %reason = %reason $3-
  }
  elseif $1 ison $active {
    var %chan = $active
    var %nick = $1
    $reason = %reason $2-
  }
  else return
  var %i = $comchan(%nick,0)
  while (%i) {
    var %chan = $comchan(%nick,%i)
    .raw $+(KICK %chan %nick %reason)
    dec %i
  }
}

pls help

#14438 07/03/03 12:52 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Code:
alias akick {
  var %reason = [All Channel]
  if ((#* iswm $1) && ($2 ison $1)) {
    var %chan = $1
    var %nick = $2
    %reason = %reason $3-
    goto AKick
  }
  if ($1 ison $active) {
    var %chan = $active
    var %nick = $1
    [color:red]%[/color]reason = %reason $2-
    goto AKick
  }
  halt
  :AKick
  var %i = $comchan(%nick,0)
  while (%i) {
    var %chan = $comchan(%nick,%i)
    .raw -q KICK %chan %nick %reason
    dec %i
  }
}


Firstly, you had $reason instead of %reason = %reason $2-

Secondly, I have changed it a bit to the way I prefer, don't know if it makes any difference (or if it even works!!)

If this helps, it's a bit of script I've got in my popups (nicklist)
Code:
.Kick all rooms:{
  set %kick.comchans $comchan($$1,0)
  var %xkick = 1
  while %xkick <= %kick.comchans {
    .raw -q kick $comchan($$1,%xkick) $$1 SluT
    inc %kick
    inc %xkick
  }
  unset %xkick %kick.comchan
}

Hope it's of some use smile

Also, I do remember something about using .raw KICK... Something like it doesn't accept more than one word in the reason...Not sure if this is correct, but I would presume the server would require the parameters:
$1 = Do what? (KICK)
$2 = $Channel (#ThisChannel)
$3 = $Nick (ThisNick)
$4 = Reason (SluT)
[question]Could you use $4- = Reason Reason Reason ?[/question]

Don't know if this is true, can't remember and can't get on a server to check frown sorry!


Aubs.
cool

#14439 07/03/03 01:21 PM
Joined: Dec 2002
Posts: 76
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 76
wont work with command
  • /akick nick reason
    /akick #channel nick reason

#14440 07/03/03 02:43 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
I've just ran into something I find confusing!

When you type:

/akick #Channel Nick Becaise I want you OUT!

Do you only want it to kick them from that ONE channel or all channels?


Aubs.
cool

#14441 07/03/03 02:48 PM
Joined: Dec 2002
Posts: 76
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 76
u'r right

#14442 07/03/03 03:17 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
That's easier then (I think)!
I think this should work:
Code:
alias akick {
  if ((#* iswm $1) && ($2 ison $1)) { .raw -q KICK $1 $2 $3- | halt }
  if ($1 ison $active) {
    var %i = $comchan($1,0)
    while (%i) { .raw -q KICK $comchan($1,%i) $1 [All Channel] $2- | dec %i }
  }
}


Aubs.
cool

#14443 07/03/03 03:27 PM
Joined: Dec 2002
Posts: 76
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 76
have problem agian ...

when i use /akick nick
-> * You were kicked by Lupin ([All)
when i use /akick nick reason
-> * You were kicked by Lupin ([All)
when i use /akick #channel nick
-> * You were kicked by Lupin (Luipn)
when i use /akick #channel nick reason
-> * You were kicked by Lupin (reason)

why reason [All Channel] not show ?

Last edited by aZnLupin; 07/03/03 03:36 PM.
#14444 07/03/03 04:13 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
Code:
  
alias akick {
  if (($1 ischan) && ($2 ison $1)) { .raw -q KICK $1 $2 : $+ $3- | halt }
  if ($1 ison $active) {
    var %i = 1
    while ($comchan($1,0)) { .raw -q KICK $ifmatch $1 :[All Channel] $2- | inc %i }
  }
}


Code:
//if ( khaled isgod ) echo yes | else echo no
#14445 07/03/03 05:04 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Comments in code (green)

Code:
alias akick {
  if (($1 ischan) && ($2 ison $1)) { .raw -q KICK $1 $2 : $+ $3- | halt }
  if ($1 ison $active) {
    var %i = 1
[color:green]    ;What does the var %i do?[/color]
    while ($comchan($1,0)) { .raw -q KICK $ifmatch $1 :[All Channel] $2- | inc %i }
[color:green]    ;If the server is slow, you may try kicking the user many times before[/color]
[color:green]    ;you actually get the on KICK event...[/color]
[color:green]    ;because $comchan(nick,0) will still return a channel intil Nick is kicked [/color]
  }
}


Don't know if I am right, just asking wink


Aubs.
cool

#14446 07/03/03 05:14 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Slight rewrite:
Code:
  
alias akick {
  if $2 ison $1 {
    .raw KICK $1 $2 : $+ $iif($3, $3-, Get out!)
    halt
  }
  var %i = 1
  while $comchan($1, %i) { 
    var %chan = $ifmatch
    if ($me isop %chan) .raw KICK %chan $1 :[All Channels] $2-
    inc %i 
  }
}
Notes:
  • In the if condition, $1 will have to be a channel if $2 is on it. ($1 ischan) is therefore redundant.
  • .raw (silenced with .) and -q (old style silence) are redundant.
  • Since they might not have provided a $3 and you have provided the kick message colon, you should provide a default message. Either that or just use mIRC's built-in /kick which doesn't require the colon.
  • Unless you /updatenl after each kick, $comchan($1, 0) will return the same number of common channels as when the alias starts; thus, you have an infinite loop.
  • You should check to ensure that you're opped on each common channel to prevent error messages.
My $0.02 worth. smile


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard