egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

catch users on channel using list

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Wed Jan 25, 2006 1:03 pm    Post subject: catch users on channel using list Reply with quote

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 Smile
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Thu Jan 26, 2006 5:27 am    Post subject: Reply with quote

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 Rolling Eyes
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Thu Jan 26, 2006 12:16 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Jan 26, 2006 9:51 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
rt
Voice


Joined: 08 Jul 2005
Posts: 25

PostPosted: Tue Feb 14, 2006 3:24 pm    Post subject: Reply with quote

Code:
# 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 Very Happy
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Tue Feb 14, 2006 6:21 pm    Post subject: Reply with quote

Thanks rt Smile
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber