mIRC Homepage
Posted By: Dogetela F4 Wire loop Kicker??? - 19/01/06 07:05 AM
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
  }
}

Posted By: RusselB Re: F4 Wire loop Kicker??? - 19/01/06 07:56 AM
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
Posted By: DimWatt Re: F4 Wire loop Kicker??? - 19/01/06 08:34 AM
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
Posted By: DimWatt Re: F4 Wire loop Kicker??? - 19/01/06 08:48 AM
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
Posted By: RusselB Re: F4 Wire loop Kicker??? - 19/01/06 09:18 AM
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.
Posted By: Dogetela Re: F4 Wire loop Kicker??? - 19/01/06 06:27 PM
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
Posted By: xDaeMoN Re: F4 Wire loop Kicker??? - 19/01/06 06:39 PM
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.
Posted By: Skeletor Re: F4 Wire loop Kicker??? - 19/01/06 07:43 PM
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...
Posted By: Skeletor Re: F4 Wire loop Kicker??? - 19/01/06 08:33 PM
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
Posted By: xDaeMoN Re: F4 Wire loop Kicker??? - 19/01/06 08:39 PM
See /help $mask
Posted By: sparta Re: F4 Wire loop Kicker??? - 19/01/06 08:41 PM
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
Posted By: Skeletor Re: F4 Wire loop Kicker??? - 20/01/06 01:24 AM
Ahh cheeerz nice one!!!
Posted By: Skeletor Re: F4 Wire loop Kicker??? - 21/01/06 12:34 PM
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
© mIRC Discussion Forums