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.

catch users on channel using list

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

catch users on channel using list

Post by r0t3n »

Ok guys, i have tryied to make a script which onjoin catchs raw 319 to get the channels the user is on. I then did a foreach loop to list the channel to get the ammount of users on each channel, and if they were on 3 or more channels with 100+ users, then the user will be kicked and banned.

Now, i failed badly, as im crap with raws, and mucked up some variables and its a mess. oh well, enough about my attempt to do it.

Could anyone here make this script. The user joins, do a raw 319, then for each channel the user is, do a list (raw 322) and catch the ammount of users on each channel. If the user is on 3 or more channels with 100+ users then the user if to be kickbanned from the channel.

Lots of thanks in advance,
Chris :)
r0t3n @ #r0t3n @ Quakenet
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

I have the feeling that if someone was so kind to do this that it would have your name above it and that you mysteriously made it all by yourself :roll:
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Metroid i already have made a simular script, but i mucked it up, if you think i can't make this script, think again. Its because im busy doing other stuff that i asked if someone could make it.
r0t3n @ #r0t3n @ Quakenet
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Tosser^^ wrote:... as im crap with raws
Visit the IRC/2 Numeric List site.
Tosser^^ wrote:Its because im busy doing other stuff that i asked if someone could make it.
Do what we all do and make the time to do it?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
r
rt
Voice
Posts: 25
Joined: Fri Jul 08, 2005 4:00 pm

Post by rt »

Code: Select all

# cal(cal@e-frag.net) script
# purpose: bans all users that are in 3 channels or less.
# updated: fixed a on start bug + added support to ignore hosts.
# to-do: 
# add a $delete command(just remove the hosts manually in your eggdrop folder hosts.db if nesssesary)
# to make sure hosts aren't added twice

namespace eval minchan {      
    bind JOIN -|-  "*"        [namespace current]::auth
    bind RAW  -|-  319        [namespace current]::raw
    bind PUB  m    "\$add"    [namespace current]::add
    bind PUB  m    "\$delete" [namespace current]::delete

if {![file exists "hosts.db"]} {
        set fs [open "hosts.db" w] 
        puts $fs "Hi, you loaded a script created by cal."  
        set hostname *![getchanhost $::botnick]
        set hostname [lindex [split $hostname @] 1]
        puts $fs "$hostname"
        close $fs
    }  
}

proc minchan::add {nickname hostname handle channel arguments} { 
     set hostname [lindex [split $hostname @] 1]
     minchan::valid $hostname
     if {[string match -nocase $arguments ""]} { 
         putserv "NOTICE $nickname :Syntax: \$add <hostname>"
         return 0
    }
     set fs [open "hosts.db" a+] 
     puts $fs "$arguments"
     close $fs
     putserv "NOTICE $nickname :Done. Added '$arguments' to the hostlist."
}

proc minchan::delete {nickname hostname handle channel arguments} { 
     putserv "NOTICE $nickname :It isnt possible to remove host entries at the moment."
}


proc minchan::valid {arguments} {  
     global test
     set fd [open "hosts.db" r]
     set lines [split [read $fd]]
     close $fd
     set arguments [lindex [split $arguments @] 1]
     foreach line $lines { 
       if {[string match -nocase $line "$arguments"]} { 
             set test(question) "Yes"
       } else {  
             set test(question) "No"
       } 
   }
}

proc minchan::gogo { } { 
     global test  
     utimer 5 [list unset test(question)]
        if {![info exists test(question)]} { return 0 } 
        if {[string match -nocase $test(question) "Yes"]} { 
              return 1
           } else {
             return 0 
            }
}

proc minchan::auth {nickname hostname handle channel} { 
    putquick "WHOIS $nickname"
    set hostname [lindex [split $hostname @] 1]
    minchan::valid $hostname
}

proc minchan::raw {server raw arguments} { 
   global test
   set doo [lrange $arguments 2 end]
   set nick [lindex $arguments 1]
   if {[string match -nocase $nick "Pro"]} { return 0 } 
   foreach chan [channels] {        
        if {[onchan [lindex $arguments 1] $chan] && [llength $doo] < 3 && [string match -nocase [minchan::gogo] "0"]} { 
             putquick "KICK $chan $nick :You don't meet certain criteria to be allowed into this channel."
             putquick "MODE $chan +b *![getchanhost [lindex $arguments 1]]"
             }
    }
}

There you go, you can use that, I don't mind if you rip my script but it'll just proove a point if you did. Lifes goes on, enjoy :D
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Thanks rt :)
r0t3n @ #r0t3n @ Quakenet
Post Reply