|
parvez
|
parvez
|
The original whois code is ON *:SNOTICE:*did a /whois on you.*:/echo -a 0,4=>12,0 $1- I was wondering, if someone can make me a code that will kill a user who whois me for 5times repeatedly! Like for example, this user will whois me 5times and will receive an auto-kill from me with a msg like "DOnt whois me that many times" Thats all! thanks
|
|
|
|
Joined: Apr 2006
Posts: 399
Fjord artisan
|
Fjord artisan
Joined: Apr 2006
Posts: 399 |
I'm not an IRC op for too many servers, and I don't use +W, so, I wouldn't know where his name would be, but, you can set his name to a variable, and use inc %variable, once it hits 5, do what you want  !
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
I tried to test this code, but for some reason (which the network administration is trying to figure out), I'm not getting the snotice when someone does a /whois on me (even though I am an IRCop), so I think this is correct. If I find that it's not correct later, I'll amend or repost as necessary. on *:snotice:*did a /whois on you*:{
$iif(!$($+(%,whois,.,$1),2),set $+(%,whois,.,$1) 1,.inc $+(%,whois,.,$1))
if $($+(%,whois,.,$1),2) > 4 {
kill $1 Don't /whois me that many times
unset $+(%,whois,.,$1)
}
}
|
|
|
|
parvez
|
parvez
|
hmm i get this message in status window
Last edited by parvez; 08/07/06 12:03 AM.
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
OK...in that case, try replacing $1 in the code with $2 (all occurences (sp?))
|
|
|
|
parvez
|
parvez
|
yayy!! lol it worked. THANKS a lot
|
|
|
|
parvez
|
parvez
|
One thing.. what did you mean by (all occurences (sp?)) ? I didn't get that.
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
The (sp?) means that I wasn't sure of the spelling of the word before it. You were probably able to figure out the word by just by sounding it out from the spelling I did give (even if it's not the correct spelling)
|
|
|
|
DaveC
|
DaveC
|
You should really put some auto expiring control on the variables, otherwise its open to exploitation RusselB logs off DaveC renames to RusselB and whois the ircop 4 times, then renames back RusselB logs back on DaveC mentions in channel how IRCops have extra info in there whois, and suggest RusselB does it on said IRCop maybe... on *:snotice:*did a /whois on you*:{
inc -u21600 $+(%,whois,.,$2)
if ($($+(%,whois,.,$2),2) > 4) {
kill $2 Don't /whois me that many times
unset $+(%,whois,.,$2)
}
} still exploitable, but atleats if u dont come back for 6 hours its reset.
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
on *:snotice:*did a /whois on you*:{
$iif(!$($+(%,whois,.,$2),2),set $+(%,whois,.,$2) 1,.inc $+(%,whois,.,$2))
if $($+(%,whois,.,$2),2) > 4 {
kill $1 Don't /whois me that many times
}
}
on *:snotice:*client exiting*:{
unset $+(%,whois,.,$6)
}
What do you think about that alternative, DaveC?
|
|
|
|
parvez
|
parvez
|
hm what exploit are you guys talking about? About this lil code? =\ how is it exploitable?
|
|
|
|
Joined: Aug 2004
Posts: 7,168
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,168 |
What's being referred to as an exploit, is the fact that I didn't have anything in the script to track if Person A was to /whois you 3 times, then leave the network, and Person B change to Person A's nick, /whois you once, then change back to Person B and get Person A to /whois you again. With the original version of my script, that would make the tracker think that Person A had /whois'd you 5 times, when in fact they only did it 4 times.
My second version of the code resets the counter when Person A disconnects from the network (which you, as an IRCop, can monitor via the client exiting snotice).
|
|
|
|
Joined: Oct 2005
Posts: 1,671
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,671 |
@ whoever is interested: How about something like this:
on *:snotice:*did a /whois on you*:{
var %nick = $2
set -u6 %ghlist $addtok(%ghlist,%nick,44)
.userhost %nick
}
raw 302:*:{
; REGEX: (nick)(*=+-)(ident)@(host)
if ($regex(gh,$2-,/([^*=+]+)([*=+]+)([^*=+]+)@([^*=+]+)/)) {
if (!$istok(%ghlist,$regml(gh,1),44)) return
set -u8 %ghlist $remtok(%ghlist,$regml(gh,1),1,44)
if (* isin $regml(gh,2)) return
inc -u[color:red]10[/color] $+(%,whois.,$regml(gh,4))
if ($($+(%,whois.,$regml(gh,4)),2) > 4) { kill $regml(gh,1) Do not /whois me that many times }
echo 3 -a $regml(gh,1) ( $+ $regml(gh,3) $+ @ $+ $regml(gh,4) $+ ) has /whois'd you $($+(%,whois.,$regml(gh,4)),2) times
}
halt
}
This code will keep track of how many times you are /whois'd from the same hostmask (doesn't consider ident at all). If you are /whois'd more than 4 times from the same hostmask, the last person to perform the /whois will be killed. IRCOps are always ignored (it's not a good idea to go killing other IRCOps :tongue: ). You can adjust how fast the users must /whois you in order to be counted. If the user does a /whois on you with less than 10sec between each /whois, the count will be maintained.If you want to use the values of the userhost command, they are as follows: $regml(gh,1) = nick $regml(gh,2) = *+- (* = IRCOp, + = here, - = away) $regml(gh,3) = ident (before the @) $regml(gh,4) = hostmask (after the @) -genius_at_work
|
|
|
|
|