mIRC Home    About    Download    Register    News    Help

Print Thread
#139867 19/01/06 07:05 AM
Joined: Jan 2006
Posts: 6
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2006
Posts: 6
I can't seem to see why this code won't ban all 10 host addresses, any help?

Code:

F4 {
  if ($$1) && ($me isop $active) {
    set %f4.nick $$1
    set %f4.chan $active
    .timer 1 1 say 3...
    .timer 1 2 say 2...
    .timer 1 3 say 1...
    .timer 1 3 ban $chan $$1 $+ *!*@*
    .timer 1 3 kick $chan $$1
    .timer 1 4 f4.loop
  }
}
F4.loop {
  var %x = 0
  while (%x <= 10) {
    ban %f4.chan %f4.nick %x
    inc %x
  }
}


#139868 19/01/06 07:56 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You didn't tell mIRC that f4.loop was an alias

Here's your code with a few alterations. I combined the kick & ban commands into one, using the -k switch that is available on the /ban command.
I also added a check to ensure that the person being kick/banned ($$1) is on the active channel

Code:
 F4 {
  if ($$1 ison $active) && ($me isop $active) {
    .timer 1 1 say 3...
    .timer 1 2 say 2...
    .timer 1 3 say 1...
    .timer 1 3 ban -k %f4.chan $$1
    .timer 1 4 f4.loop $active $1
  }
}
alias F4.loop {
  var %x = 0
  while (%x < 10) {
    ban $1 $2 %x
    inc %x
  }
}
 


Correction made to how the parameters for channel and nick were passed to the F4.loop alias

Last edited by RusselB; 19/01/06 09:15 AM.
#139869 19/01/06 08:34 AM
Joined: Aug 2005
Posts: 24
D
Ameglian cow
Offline
Ameglian cow
D
Joined: Aug 2005
Posts: 24
You are only using 1 nick in your F4 alias, $$1 = first parameter
you would need to use $1-. %f4.nick = $gettok($1-,%x,32)
Your while loop in F4.loop is trying to ban the same nick 10 times. You will need to set %f4.nick inside the while loop. I think you may want to write this as a single alias
Code:
F4 {
  if ($$1) && ($me isop $active) {
    set %f4.chan $active
    var %x = 1
    while (%x <= 10) {
      set %f4.nick $gettok($1-,%x,32)
      .timer 1 1 say 3...
      .timer 1 2 say 2...
      .timer 1 3 say 1...
      .timer 1 3 ban f4.chan %f4.nick %x $+ *!*@*
      .timer 1 3 kick f4.chan %f4.nick %x
      inc %x
    }
   }
}

You are also trying to kick and ban in both aliases

this is not tested hopefully it will help or give you ideas

Last edited by DimWatt; 19/01/06 08:40 AM.
#139870 19/01/06 08:48 AM
Joined: Aug 2005
Posts: 24
D
Ameglian cow
Offline
Ameglian cow
D
Joined: Aug 2005
Posts: 24
guess your a lot faster than me RusselB

wondering how this works, looks like it runs through the first alias fine
then gets into the second and loops with out any parameters
wouldn't it need to loop back to the first alias after the var is increased.

just wondering ?

thanks in advance still learning


TeeJay
#139871 19/01/06 09:18 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The second alias has the parameters passed to it, in my code, but in the original, those same parameters were preset into variables, so they didn't need to be passed to the alias.

Since he's doing a multiple ban (not kick & ban, as you were thinking) in the second alias, the name & channel ($1 & $active) only need to be set/passed once.

#139872 19/01/06 06:27 PM
Joined: Jan 2006
Posts: 6
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2006
Posts: 6
further...

[ 18:10:22 ] [ @Dogetela ] 3...
[ 18:10:22 ] [ @Dogetela ] 2...
[ 18:10:23 ] [ @dogetela ] 1...

[ 18:10:23 ] · · ChanMode : Dogetela sets mode [ +b ] test*!*@*

[ 18:10:23 ] · · Kicks : test was kicked from #tezz by [ Dogetla ] : [ test ]
[ 18:10:45 ] · · ChanMode : Dogetela sets mode [ +b ] *!Blah@cpc2-basf1-4-0-cust157.nott.cable.ntl.com

[ 18:10:47 ] · · ChanMode : Dogetela sets mode [ -b+b ] *!Blah@cpc2-basf1-4-0-cust157.nott.cable.ntl.com *!*Blah@cpc2-basf1-4-0-cust157.nott.cable.ntl.com

[ 18:10:49 ] · · ChanMode : Dogetela sets mode [ -b+b ] *!*Blah@cpc2-basf1-4-0-cust157.nott.cable.ntl.com *!*@cpc2-basf1-4-0-cust157.nott.cable.ntl.com

[ 18:10:51 ] · · ChanMode : Dogetela sets mode [ +b ] *!*Blah@*.nott.cable.ntl.com

[ 18:10:53 ] · · ChanMode : Dogetela sets mode [ -bb+b ] *!*Blah@*.nott.cable.ntl.com *!*@cpc2-basf1-4-0-cust157.nott.cable.ntl.com *!*@*.nott.cable.ntl.com

There are some big delays in the actions... and why is it banning and unbanning the host? confused confused confused

#139873 19/01/06 06:39 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Simple, because the banmask "*!*@*.nott.cable.ntl.com" will override the other masks that was set before that is why it is unsetting the other masks.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#139874 19/01/06 07:43 PM
Joined: Feb 2005
Posts: 185
S
Vogon poet
Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
I used similar code ages ago,

my was similar to that but it banned all 10 hosts with out delay, i have lost the code, but on closer inspection, i see what you mean, would be nice if i could remember how to code it for you.

Maybe you can get rid of the wire loop, use single line specific host bans, but as i dont know what they are, i cant help you...

But i am sure there are users out the that will make amends...


sub-zero.homeip.net:6667

#139875 19/01/06 08:33 PM
Joined: Feb 2005
Posts: 185
S
Vogon poet
Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
any know the ban masks?

like just banning cetain parts of the users host, i know there are 10 of them... Help much apprecialted laugh


sub-zero.homeip.net:6667

#139876 19/01/06 08:39 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
See /help $mask


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#139877 19/01/06 08:41 PM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
1 = *!*ident@some.host.com
2 = *!*@some.host.com
3 = *!*ident@*.host.com
4 = *!*@*.host.com
5 = nick!ident@some.host.com
6 = nick!*ident@some.host.com
7 = nick!*@some.host.com
8 = nick!*ident@*.host.com
9 = nick!*@*.host.com


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#139878 20/01/06 01:24 AM
Joined: Feb 2005
Posts: 185
S
Vogon poet
Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Ahh cheeerz nice one!!!


sub-zero.homeip.net:6667

#139879 21/01/06 12:34 PM
Joined: Feb 2005
Posts: 185
S
Vogon poet
Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Code:
  F4 {
  if ($me isop $chan) {
    set %f4.nick $$1
    set %f4.chan $active
    .timer 1 0 /F2
    .timer 1 1 say 3...
    .timer 1 2 say 2...
    .timer 1 3 say 1...
    .timer 1 3 ban $chan $$1 $+ *!*@*
    .timer 1 3 kick $chan $$1
    .timer 1 4 f4.loop
    .timer 1 5 /F1
  }
}
F4.loop {
  var %x = 0
  while (%x <= 10) {
    ban %f4.chan %f4.nick %x
    inc %x
  }
}

Thats what I have, but i see what you mean with the hosts, only 6 for some reason confused confused confused


sub-zero.homeip.net:6667


Link Copied to Clipboard