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 

Ops notice help please

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


Joined: 03 Jan 2007
Posts: 77

PostPosted: Fri Jul 08, 2011 10:43 am    Post subject: Ops notice help please Reply with quote

Code:
set proxycheck_rbls { "dnsbl.dronebl.org" "tor.dnsbl.sectoor.de" "rbl.efnet.org" "dnsbl.swiftbl.org" "opm.blitzed.org" "dnsbl.ahbl.org" }

set proxycheck_lock "isr"
set proxycheck_unlock 30
# Eggdrop's Time in minutes to BAN the proxy. (Note: The ban will last in the banlist of the manual channel).
set proxycheck_bantime 30

# DO NOT TOUCH THE CODE YOU WILL RUIN THE SCRIPT



## CODE
###############################################################################
#add our channel flag
setudef flag proxycheck

#bind our events
bind join - *!*@* proxycheck_join

#swing your pants

# catch joins
proc proxycheck_join { nick host handle channel } {
  #check we're active
  if {![channel get $channel proxycheck]} {
    return 0
  }

  #don't apply to friends, voices, ops
  if {[matchattr $handle fov|fov $channel]} {
    return 0
  }

  #get the actual host
  regexp ".+@(.+)" $host matches newhost
  if [regexp {[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$} $newhost] {
    #it's a numeric host, skip the lookup
    proxycheck_check2 $newhost $newhost 1 $nick $newhost $channel
  } else {
    putloglev d * "proxycheck: doing dns lookup on $newhost to get IP"
    dnslookup $newhost proxycheck_check2 $nick $newhost $channel
  }
}

# first callback (runs RBL checks)
proc proxycheck_check2 { ip host status nick orighost channel } {
  global proxycheck_rbls

  if {$status} {
    putloglev d * "proxycheck: $host resolved DNS to $ip"

    # reverse the IP
    regexp {([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})} $ip matches a b c d
    set newip "$d.$c.$b.$a"

    # look it up in the rbls
    foreach rbl $proxycheck_rbls {
      putloglev d * "proxycheck: looking up $newip.$rbl"
      dnslookup "$newip.$rbl" proxycheck_check3 $nick $host $channel $rbl
    }
  } else {
    putlog "proxycheck: Couldn't resolve $host. (No further action taken.)"
  }
}

# second callback (catches RBL results)
proc proxycheck_check3 { ip host status nick orighost channel rbl } {
  global proxycheck_bantime proxycheck_lock proxycheck_unlock

  if {$status} {
    putlog "proxycheck: got host $host = ip $ip from RBL $rbl ... banning"
    putquick "MODE $channel +$proxycheck_lock"
    putserv "KICK $channel $nick :Reason: OPEN proxy -- Source: $rbl From: $nick"
    putserv "MODE $channel +b *@$orighost"
    utimer $proxycheck_unlock [list putquick "MODE $channel -$proxycheck_lock"]
  }
  #if we didn't get a host, they're not in RBL
}


Hi I have that script and I want to put it, so that if there's a proxyflood on my channel The script should send an ONOTICE to the channel, with a text, I can simply put a variable there to put an onotice, but the thing is that If there are more than one proxy joins, then it will flood the bot, so I want the bot to send the notice only once.... what do you suggest?

Moderated: Edited the post to fix broken code-tags, should make the actual request easier to see.
/NML_375
Back to top
View user's profile Send private message
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