mIRC Home    About    Download    Register    News    Help

Print Thread
#55473 17/10/03 03:45 PM
Joined: Jun 2003
Posts: 77
O
ozyvent Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Jun 2003
Posts: 77
I need a script to kill anyone with a nick beginning with Guest.

I have a feeling it has to have something to do with while loops and /names (the raw numeric is 353 on this particular server)

If anyone can help pronto, that'd be great


.
#55474 17/10/03 03:53 PM
Joined: Jan 2003
Posts: 148
K
Vogon poet
Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
ok... You can`t kill anyone if youre not an IRCop...

If you are u can use: if (Guest* iswm $nick) { kill $nick ... }

#55475 17/10/03 03:54 PM
Joined: Jun 2003
Posts: 77
O
ozyvent Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Jun 2003
Posts: 77
So that will kill anyone and EVERYone with a nick beginning with Guest based on the output of /names simultaneously?


.
#55476 17/10/03 04:06 PM
Joined: Oct 2003
Posts: 50
T
Babel fish
Offline
Babel fish
T
Joined: Oct 2003
Posts: 50
so you want to do a /names on a channel, and then kill every nick that starts with Guest?

#55477 17/10/03 04:11 PM
Joined: Jun 2003
Posts: 77
O
ozyvent Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Jun 2003
Posts: 77
What I want is to when i type e.g. /killguests it does /names (of the entire network) and kills anyone and everyone with a nick beginning with Guest.


.
#55478 17/10/03 04:37 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Or you could just perm-ban Guest*!*@* and be done with it.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
#55479 17/10/03 04:39 PM
Joined: Jun 2003
Posts: 77
O
ozyvent Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Jun 2003
Posts: 77
Not helpful when Nickserv changes unidentified persons to Guest####


.
#55480 17/10/03 05:16 PM
Joined: Oct 2003
Posts: 50
T
Babel fish
Offline
Babel fish
T
Joined: Oct 2003
Posts: 50
well, this responds to the normal /names (I don't know if there's any difference between a global /names, or a /names on a channel):
Code:
alias killguests { SET %kg 0 | .NAMES $1 }
raw 353:*: {
  IF (%kg == 0) {
    WHILE (%kg != $gettok($4-,0,32)) {
      INC %kg
      VAR %nick = $remove($gettok($4-,%kg,32),+,%,@,!,&,*,~)
      IF (Guest* iswm %nick) { KILL %nick }
    }
  }
  UNSET %kg
}

#55481 17/10/03 05:27 PM
Joined: Jun 2003
Posts: 77
O
ozyvent Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Jun 2003
Posts: 77
Ok, will see how I go, thanks smile


.
#55482 17/10/03 07:06 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
wouldnt increaseing the variable before u do anything miss the very first person in your while loop?

Code:
alias killguests { SET %kg 0 | .NAMES $1 }

raw 353:*: {
  IF (%kg == 0) {
    WHILE (%kg != $gettok($4-,0,32)) {
      VAR %nick = $remove($gettok($4-,%kg,32),+,%,@,!,&,*,~)
      IF (Guest* iswm %nick) { KILL %nick }
      INC %kg
    }
  } 
 UNSET %kg
}


that would be the way id change yours to make it work alil more in order. its not the method id use exactly but thats no big deal either


D3m0nnet.com
#55483 17/10/03 07:17 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
No, since the variable is set at 0 to start with, not 1.

#55484 17/10/03 08:38 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
ok i didnt look closely enough to read that. btw is there any particular reason to adding the variable at zero instead of actually starting at 1? i would think it would speed up the code alil quicker.


D3m0nnet.com
#55485 18/10/03 02:48 AM
Joined: Jun 2003
Posts: 77
O
ozyvent Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Jun 2003
Posts: 77
Didn't work, any other suggestions. Had a suggestion from someone else to force change everyone who's using a Guest* nick to the same nick, and thus causing a nick collision and automatic kill. How would/could that work? the command is /operserv user nickname nick newnickname


.
#55486 18/10/03 03:44 AM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Quote:
i would think it would speed up the code alil quicker

With such small differences, starting with 0 has proven to have the same speed as starting with 1 when benchmarked here. I think it's understandable in this case, since both methods are only different in their order (with 0 you /inc first and use </similar, with 1 you /inc last and use <=/similar), but always execute the same number of calls..

When I benchmarked a lot of loop "styles" involving various situations some time ago, using $0 as the max value for example (actually, whatever the max value was like), the faster one was var %i = $0, (%i), { command | dec %i }.

Edit: In cases that %i's value should be shown increasing itself, either var %i = 0, (%i < $0), { inc %i | command } or var %i = 1, (%i <= $0), { command | inc %i } were the faster ones (when $0 was other more complex identifier, it was faster if set as a variable to use in the condition, or, in some cases, using ($identifier(%i)) as the condition).

Anyone who benchmarked many loop styles too so we can see the results? Unfortunately I don't have my related notes anymore..

(Sorry it's off-topic :tongue:)

Last edited by cold; 18/10/03 03:55 AM.

* cold edits his posts 24/7

Link Copied to Clipboard