This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Kick users with usermode +x

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
H
Hawara
Voice
Posts: 5
Joined: Sat Dec 17, 2005 6:55 pm

Kick users with usermode +x

Post by Hawara »

Can somebody write me a simple script, please?

All i need is that bot kickbans ppl wich has enabled usermode +x (IP encrypting).

Basically - in mirc i can type /who Nick
and server will return:

* Nick Hx nick@N654m.NYMDe.net :0 Nick
Nick End of WHO list.

Where x is that user had enabled +x

The server returns userflags in the seven word of the raw 352 command.

P.S. Sorry for my crappy english. If anyone can help me, please..
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

so how did you know N654m.NYMDe.net isn't a legitimate host?

or rather, that it's cloaked host; in other words, what is it that differentiates a +x cloaked host from real hosts?
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
H
Hawara
Voice
Posts: 5
Joined: Sat Dec 17, 2005 6:55 pm

Post by Hawara »

Well, see:

[06:18:39] * Hawara sets mode: +x
-
[06:18:39] -NickServ- Beware, usermode +x has only partial effect now, older servers will show your real host. This warning will be removed as soon as the upgrade finished.
-
* Hawara Hx hawara@N654m.NYMDe.free.net :0 Hawara
Hawara End of WHO list.
-
[06:18:54] * Hawara sets mode: -x
-
* Hawara H hawara@hawara.45.free.net :0 Hawara
Hawara End of WHO list.
-

x - appears only when usermode is activated - so we can guess masked host using who command
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

bind pub n !kbx foo
bind raw - 352 bar
proc foo {n u h c t} {putserv "who $c"}
proc bar {f k t} {
   foreach {x c x h x n u} [split $t] {break} 
   if ![regexp x $u] return
   pushmode $c +b *!*@$h
   putkick $c $n 
}
I challenge minimalists to shorten that :P
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
H
Hawara
Voice
Posts: 5
Joined: Sat Dec 17, 2005 6:55 pm

Post by Hawara »

Oh great!!! Wonderful!!! Thank you!!!



Just one little detail... please, tell me how to make it run on user join
(i guess i have to add bind join - * foo ) and to make bot rescan channel each 5 minutes to find if someone enabled +x mode?
H
Hawara
Voice
Posts: 5
Joined: Sat Dec 17, 2005 6:55 pm

Post by Hawara »

Yeah! I`ve done it myself!

Code: Select all

set chan "#tlk-r"
bind pub n !kbx foo
bind join - * foobar
bind raw - 352 bar
bind time - "?0 * * * *" barfoo

proc barfoo {n u h c y} {
  global chan
  putserv "who $chan"
}
proc foo {n u h c t} {putserv "who $c"}
proc foobar {n u h c} {putserv "who $c"}
proc bar {f k t} {
   foreach {x c x h x n u} [split $t] {break}
   if ![regexp x $u] return
   pushmode $c +b *!*@$h
   putkick $c $n "mode -x or die!"
} 
and it works :) Yay, my first something in tcl!
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

congrats, glad to see your enthusiasm nowadays when fewer folks bother to learn and help themselves

there is one potential glitch however: doing WHO on join won't yield results every time since modern IRC servers impose command pace limits to clients, say one WHO in 2 seconds
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
H
Hawara
Voice
Posts: 5
Joined: Sat Dec 17, 2005 6:55 pm

Post by Hawara »

thanks :)

That`s why i also scan the channel every 10 minutes :) And also to find smart ppl who join without +x and then turn it on...
Post Reply