mIRC Home    About    Download    Register    News    Help

Print Thread
Page 3 of 3 1 2 3
hixxy #185323 08/09/07 05:03 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Er, you lost me. I was using the /kb alias and it was working fine until it buggered.

Mpot #185324 08/09/07 05:08 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
I wasn't replying to you wink

Mpot #185344 08/09/07 09:31 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Please post your current kb alias. If you're not executing this alias out of an editbox, show us the triggering part of code, too.
In what situation did the error occur?

Horstl #185345 08/09/07 09:34 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Code:
; You can add comments to a code - all lines prefixed with a ; will be ignored while processing your code.
; Of course you can remove all these comments if you like

; kickban per editbox command (example)
alias kb {

  ; the window where you entered the command is not a active channel 
  ; [note how the operator "ison" has been negated with an exclamation mark]

  if ($me !ison $acitve) { echo -a kickban: $active is not a channel! }

  ; no first parameter (no nick given)
  ; [using the 'negation-prefix' again, this time to check whether there was a parameter entered]

  elseif (!$1) { echo -a kickban: no nick specified. Syntax: /kb <nick> <optional kick-reason> }

  ; first paramter given is not a nick on that chan

  elseif ($1 !ison $chan) { echo -a kickban: $1 is not a nick on $active }

  ; no sufficient channel rights (only ops, halfops etc can kick or ban a user)
  ; [this line combines two "if" comparisons with "or"]

  elseif (($me isreg $active) || ($me isvoice $active)) { echo -a kickban: Your have no sufficient channel rights on active to kick or ban }

  ; none of the possible errors above occured: perform the ban with "mode" as you liked, followed by a kick. 
  ; [desired banmask "4" via $address(nick,4). "$2-" refers to the 2nd parameter onwards, in this case the kick reason]

  else { 
    mode $active +b $address($1,4)
    kick $active $1 $2-
  }

}


Well. I was doing /kb nick and it gives me " kickban: #mpot is not a channel! "

But it is a channel because I was typing it in that channel window.

And then I tried /kb #channel nick from a different channel and it gave me the same error as above, except for the channel that I typed it in. It didn't error for the channel specified.


Mpot #185349 08/09/07 09:52 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Now I see the problem - sorry, it's been my own typo.
if ($me !ison $acitve)
has to be:
if ($me !ison $active)

In addition, the line "elseif ($1 !ison $chan)" should be "elseif ($1 !ison $active)" (just for conformity)
Note: The alias was only for kickbanning on the editbox's channel, not for providing a channel parameter.

Horstl #185350 08/09/07 10:03 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Works like a dream now. Thanks a bunch!

On a funnier note, I kept trying /kb #channel nick until I looked at the script again and realized that that wasn't a feature. Me and my stupidity. XD

Page 3 of 3 1 2 3

Link Copied to Clipboard