mIRC Home    About    Download    Register    News    Help

Print Thread
#23528 10/05/03 05:21 PM
Joined: Apr 2003
Posts: 16
Y
yugioh Offline OP
Pikka bird
OP Offline
Pikka bird
Y
Joined: Apr 2003
Posts: 16

alias kb { .mode # +b $1 | .ban # $1 | .msg $bnick are you be banned from

its done ok?

thnx

msg $bnick are you be banned from

it is the right form to do it?

#23529 10/05/03 05:24 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Actually, most of that is wrong. There is no code there that actually does any kicking, instead you set +b 2 times, and $bnick isn't valid in an alias.

kb { .ban # $$1 3 | .kick # $$1 Banned }

#23530 10/05/03 05:27 PM
Joined: May 2003
Posts: 177
P
Vogon poet
Offline
Vogon poet
P
Joined: May 2003
Posts: 177
Why do you prefix ban and kick with a period? It has no effect on those commands at all. It's useless.

#23531 10/05/03 05:31 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
So, big deal? He had them in his original, I included them in mine. Having them there won't hurt anything. I always include them, perhaps somewhere down the road Khaled will make one of those commands display something that a . prevents, why should I go through all my scripts and change it if such a thing happens when I can much more easily just include the . now? It's an extremely moot point. If he doesn't want them, then he can remove them. But seeing as how he had them in his original paste, I'd assume, for whatever reason, he wants them. Perhaps /ban is an alias he created that does something different than the standard mIRC /ban and therefore the . does play a role.

#23532 10/05/03 05:34 PM
Joined: May 2003
Posts: 177
P
Vogon poet
Offline
Vogon poet
P
Joined: May 2003
Posts: 177
Actually there's no big deal. I just think clean code and leaving useless items out are better. That's just my opinion.

#23533 10/05/03 06:31 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Why do ppl use /'s in scripts when its useless.. I for one use the forward slash, and don't deem it "useless". Its not bad to get into some habits, as well as make things more comprehendable. Esp on a long like, the /'s emphasize that its a command, and not just text.


-KingTomato
#23534 10/05/03 07:14 PM
Joined: Apr 2003
Posts: 29
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2003
Posts: 29
kb { .mode # -o+b $1 1 | .kick # $1 $2- }
;This Code U Can Add A Reason, And You Deop The Nick At
; The Same Time.
;Prefix /kb <nick> <reason>
cool

#23535 10/05/03 07:36 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
and it also doesn't work wink

kb { .mode # -o+b $1 $1 | .kick # $1 $2- }

#23536 10/05/03 11:34 PM
Joined: May 2003
Posts: 177
P
Vogon poet
Offline
Vogon poet
P
Joined: May 2003
Posts: 177
It looks more professional not to prefix a command with a / in a script.

#23537 11/05/03 02:48 AM
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
Code:
alias kb {
  if ($left($1,2) == -u) {
    if ($3 isnum 0-9) {
      if ($4 != $null) {
        ban $$1 $chan $$2 $$3
        if ($2 ison $chan) { kick $chan $$2 kb $$4- }
        halt
      }
      else {
        ban $$1 $chan $$2 $$3
        if ($2 ison $chan) { kick $chan $$2 kb $me }
        halt
      }
    }
  }
  if ($left($1,2) == -u) {
    if ($3 != $null) {
      ban $$1 $chan $$2
      if ($2 ison $chan) { kick $chan $$2 kb $$3- }
      halt
    }
    else {
      ban $$1 $chan $$2
      if ($2 ison $chan) { kick $chan $$2 kb $me }
      halt
    }
  }
  if ($2 isnum 0-9) {
    if ($3 != $null) {
      ban $chan $$1 $$2
      if ($1 ison $chan) { kick $chan $$1 kb $$3- }
      halt
    }
    else {
      ban $chan $$1 $$2
      if ($1 ison $chan) { kick $chan $$1 kb $me }
      halt
    }
  }
  if ($2 != $null) {
    ban $chan $$1
    if ($1 ison $chan) { kick $chan $$1 kb $$2- }
    halt
  }
  else {
    ban $chan $$1
    if ($1 ison $chan) { kick $chan $$1 kb $me }
    halt
  }
  halt
}



I use this because it supports all the switches that the /ban command has.

There probably is a simpler way to do it, but I cbf looking around for it.


this is how you use it:


/kb -uN nickname mN reason


the -uN and mN are completely optional, as is the reason.

-uN is the timer for the ban, useage is like this: -u60 (bans for 60 seconds, and then removes the ban).

mN is the mask number, useage is a number between 0-9. read the help file for information on $masks (this will explain the mask type for each number.


for instance if i did this:


/kb -u3600 peter 3 this client sucks


this would ban that nickname with the mask *!*user@*.host for an hour, with the reason "this client sucks"

Last edited by neophyte; 11/05/03 02:55 AM.

--------
mIRC - fun for all the family (except grandma and grandpa)

Link Copied to Clipboard