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 

modify to make it relay

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


Joined: 05 Aug 2008
Posts: 71

PostPosted: Sun Nov 09, 2008 2:45 am    Post subject: modify to make it relay Reply with quote

Code:
# $Id: spamdetect.tcl, eggdrop-1.6.x 2004/5 awyeah@usa.net Exp $

# Begin - Channel Spam Bot Detector Script v4.58.ab (spamdetect.tcl)
#   Script Version: v4.58.ab
#   Built Date: 24 September 2003, Last Updated: 18 June 2004
#   Copyright © 1999-2004 awyeah (awyeah@usa.net)
#   TCL script was designed to use with eggdrop v1.5.x or higher

# Please *READ* the README.HTML file included in this script package.
# It will guide you through the script setup procedure and instructions.
# Copyright © 1999-2004 awyeah All Rights Reserved
# [Module 1: spamdetect.tcl]

##########################################
### Start editing variables from here! ###
##########################################

#--------------------------------#
#     SETUP SCRIPT VARIABLES     #
#--------------------------------#

#Set channel(s) on which you want to active on. Multiple channels are supported now.
#USAGE: "#chan1 #chan2 #chan3 #mychan #yourchan" (Both of your bots should be on these channels)
#If you have multiple channels, then the channels mentioned in both scripts on both bots should
#resemble each other, i.e. they should all match each other and none should be missing in either script.
#(If you don't have multiple channels to run this script on, you can set one default channel as well)
set cyclechans "#jakarta"

#Set nick of your oped bot, the one which you will set in your other script when editing.
#USAGE: Set the nick of the bot in which you will set the other spamkick.tcl script in
#(This nick can only be one bot! not more than one!)
set spamopbot "heythere"


#----------------------------------#
#     SETUP AUTHORIZATION PINS     #
#----------------------------------#

### IMPORTANT - PLEASE READ ###
#I suggest you change these PINS to any random PINS you would like. Keeping these default settings
#is not recommended. (Remember not to enter any special characters such as ascii codes and etc only
#alphabets and numbers)

#Set a random authorization PIN1. PIN1 must be same as the PIN1 you will enter afterwards in your
#spamkick.tcl (This is a case-sensitive setting)
set spamauthone "L"

#Set a random authorization PIN2. PIN2 must be same as the PIN2 you will enter afterwards in your
#spamkick.tcl (This is a case-sensitive setting)
set spamauthtwo "ES"

#Set a random authorization PIN3. PIN3 must be same as the PIN3 you will enter afterwards in your
#spamkick.tcl (This is a case-sensitive setting)
set spamauththree "O"


#------------------------------------#
#    SETUP CHANNEL CYCLING TIMERS    #
#------------------------------------#

#How many minutes should the bot idle in channel before it parts for a cycle. (mins)
#USAGE: Use a range of: '8 - 30 mins' when setting this. (Don't use below than 5 as the bot will
#be under stress on a big channel and to keeping it more than 30 will make it detect less spammers)
set spamcycleidle "10"

#How many seconds should the bot stay gone from the channel in the cycle before it rejoins the channel. (secs)
#USAGE: Use a range of: '90 - 300 secs' when setting this. (Don't use a less setting than 60 as it might cause
#join part floods on idler/silent channels and keeping it more than 300 will make it detect less spammers)
set spamcyclegone "120"


#---------------------------------------#
#     SETUP SPAM DETECTION WORDLIST     #
#---------------------------------------#

#Set the spam detecting words. If any of these words are matched against a message in the private query
#or notice by a user then that user will be declared as a spammer and would be kicked/banned out of the
#channel. (Note: The words I have currently set should be sufficient to catch almost any spammer)
#USAGE: Add words which spammers mostly use when spamming (wildcards such as "*" are accepted)
set spamwords {
"*# *"
"#*#*#*"
"#* #*"
"#* #* #*"
"#* * #* *"
"#* * #* * #* *"
"join*"
"/join*"
"*join #*"
"*join * #*"
"*/join #*"
"*/join * #*"
"*/join"
"*/join*"
"*join#*"
"*join*#*"
"*/j #*"
"*/j* #*"
"*/j* * #*"
"goto"
"go to*"
"www.*"
"visit*"
"http*"
"ftp*"
"server"
"/s*"
"/j*"
"come"
"come to*"
"*go * #*"
"*to #*"
"*come *#*"
"come to #*"
"come to* #*"
"come #*"
"come /j*"
"come /join*"
"come /join #*"
"come *join #*"
"visit #*"
"visit* #*"
"goto #*"
"goto* www.*"
"goto* #*"
"go to #*"
"go to* #*"
"try #*"
"try* #*"
"*geocities*"
"*angelfile*"
"*.com*"
"*.net*"
"*.org*"
"*.info*"
"*.biz*"
"*.us*"
"*.tv*"
}


#-----------------------------------------#
#     SETUP RANDOM BOT TALK PROCEDURE     #
#-----------------------------------------#

#Set random replies here for the bot's first message to check if the user is a spammer.
#USAGE: Add words such as: "hi", "hello", "hey!" etc. (The ones I have currently added
#should already be sufficient enough)
set spamfirstmsg {
  "hi"
  "hey"
  "heya!"
  "hi!"
  "y0!! :)"
  "hey man"
  "hey dude :p"
  "yooo"
  "hieeee"
  "hiya"
  "hi!"
  "hie"
  "hey!!"
  "hey hey! :)"
  "hiya!"
  "hie!"
  "yo!"
  "hey!"
  "ho ho ho! :))"
  "look whos here!! :)"
  "yo yo man"
  "hiiii"
  "hey its you! :x"
  "hiieeee!!"
  "hi hi!"
  "hey its u!"
  "heeeeeey!"
  "hiya baby :P"
  "yes, hieeeee!"
  "haalooo!"
  "heeeloooo!"
  "yes, hieeee! :x"
  "yoooooo!"
  "hiyya!"
  "hello babeh :)"
  "hello baby!"
  "hiiiiii!"
  "yes, hi"
  "haloooo baby"
  "same to u :D"
  "same to ya"
  "yes, hello!"
  "yahhh!"
  "errr..."
  "who is you??!"
}


#Set random words here for the bot's second message to check if the user is a spammer.
#USAGE: Add words such as: "how are u", "whats up?", "asl plz" etc. (The ones I have currently
#added should already be sufficient enough)
set spamsecondmsg {
  "whats up?!"
  "whats cookin'?"
  "whatcha up to? :))"
  "hey! hows ya??"
  "hows ya!?"
  "hows ya?, mate!"
  "how r u"
  "how are you doing?"
  "how r u?"
  "howdie? :x"
  "howdie? mate!"
  "hows ya doin?"
  "hows ur gf doing?"
  "hows you doin?"
  "whats cookin' mack!? :p"
  "how how, how are you brown cow?"
  "whats your name?!"
  "what have ya been upto? eh?"
  "how are you?"
  "where ya from!?"
  "hows ya been doin? :)"
  "a/s/l?"
  "what do ya do??!"
  "whats ur name?"
  "whats ya name? :/"
  "where do you live?"
  "where are you from?!"
  "how old are ?"
  "how old r u?"
  "a/s/l? plz"
  "are u m/f?"
  "m or f?"
  "male or female?"
  "male/female?"
  "asl plz"
  "asl please :)"
  "how r u doing?"
  "how r you?"
  "how are u?"
  "a/s/l please!"
  "how have u been? :D"
  "where did u go?"
  "where did you go?"
  "what do you do?"
  "what do u do?!"
  "how can i help you?!"
  "what do you need?"
  "what do ya want!"
  "what do you want?"
  "do you know me?!"
  "do i know you?"
  "do u know me?"
  "do i know u? hmm"
  "have we talked before?!"
  "have we met before?"
}


#Set the time in seconds after which a user messages the bot so the bot would reply with its
#first random talk message to the user to check if that user is a spammer or not.
#USAGE: Use a range of: '30 - 90' secs when setting this
set spamfirstmsgtime "60"

#Set the time in seconds when the the bot will message second random talk message to the user,
#after it has messaged the first random message to check if the user is a spammer or not.
#USAGE: Use a range of: '100 - 250' secs when setting this
set spamsecondmsgtime "120"


#-----------------------------------------#
#    SETUP EXEMPTED NICKS/IP ADDRESSES    #
#-----------------------------------------#

#Set this to the list of exempted nicks, which you would like the bot to ignore and wouldn't
#want to check these nicks for spam. These nicks could be of other spam cycler bots in the channel.
#(If you do not have any 'nick' to exempt to then, please set this empty/blank as "")
#USAGE: "nick1, bot3, user5, robot17, mybot4"
set spamexemptnicks "Chap"

#Set this to the list of exempted ip addresses (user idents and hosts) which you would like the
#bot to ignore when checking users for spam. These hosts or virtual hosts (vhosts) could be of other
#spam cycler bots in the channel usually being run by other ops in the channel on other scripts.
#Please *DO NOT* use wildcards such as: (*, !, *!*, @*.host.com, *@127.0.0.* etc as they maybe risky)
#(If you do not have any 'user@host' to exempt to then, please set this empty/blank as "")
#USAGE: "rules@127.0.0.1, i@am.eleet.com, phear@me.kthx.com, awyeah@ownsyou.com, yeah@baby.yeah.net"
set spamexempthosts ""


#------------------------------------#
#    SETUP SERVICES NOTICE IGNORE    #
#------------------------------------#

#Set the name of your Network's 'channel service' here.
#For example: *ChanServ* on DALnet - *X* on Undernet
#(If your network doesn't have a channel service such as the ones listed above in the examples then
#keep this field empty/blank like: "")
set spamchanserv "ChanServ"

#Set the name of your Network's 'nick service' here.
#For example: *NickServ* on DALnet
#(If your network doesn't have a nick service such as the one listed above in the example then keep
#this field empty/blank like: "")
set spamnickserv "NickServ"

#Set the name of your Network's 'memo service' here.
#For example: *MemoServ* on DALnet
#(If your network doesn't have a memo service such as the one listed above in the example then keep
#this field empty/blank like: "")
set spammemoserv "MemoServ"

#Set the address/host of your Network's Services service here.
#For example: ChanServ, NickServ, MemoServ on DALnet ===> serivce@dal.net - USE: 'dal.net'
#For example: X on Undernet ===> service@undernet.org - USE: 'undernet.org'
#For example: Q on Quakenet ===> service@cserve.quakenet.org - USE: 'cserve.quakenet.org'
#(If your network doesn't have any network service whose host can be entered here, then please leave
#this field empty/blank like: "") (I have set the default host for DALnet users)
set spamnetworkhost "dal.net"


##############################################################################
### Don't edit anything else from this point onwards even if you know tcl! ###
##############################################################################

bind evnt - connect-server spam:reset:inactive
bind evnt - prerestart spam:reset:inactive

set cyclechans [split $cyclechans]
set cyclechanslwr [string tolower $cyclechans]
foreach cyclingchan $cyclechanslwr { channel add $cyclingchan }
if {![string match *spamcycle* [timers]]} { timer $spamcycleidle spam:channel:cycle }

proc spam:reset:inactive {type} {
 global cyclechans
  foreach cyclechan [string tolower $cyclechans] {
  channel set $cyclechan -inactive
  }
 return 0
}

proc spam:channel:cycle {} {
 global botnick cyclechanslwr spamcycleidle spamcyclegone
  foreach cyclechan $cyclechanslwr {
  channel set $cyclechan +inactive
  putlog "CYCLE: Cycling  $cyclechan  every : $spamcycleidle mins . Rejoin desynched on   $cyclechan  to:  $spamcyclegone secs ."
  utimer $spamcyclegone "channel set $cyclechan -inactive"
  }
 if {![string match *spamcycle* [timers]]} {timer $spamcycleidle spam:channel:cycle}
 return 0
}


bind msgm - * private:spam:detector
bind notc - * notice:spam:detector

proc private:spam:detector {nick uhost hand text} {
 global botnick cyclechanslwr spamwords spamopbot spamauthone spamauthtwo spamauththree spamfirstmsgtime spamsecondmsgtime spamchanserv spamnickserv spammemoserv spamnetworkhost spamexemptnicks spamexempthosts
  if {([string match -nocase *$spamexemptnicks* $nick]) || ([string match -nocase *$spamexempthosts* $uhost]) || ([string match -nocase *$spamnetworkhost* $uhost]) || ([string equal -nocase $nick $spamchanserv]) || ([string equal -nocase $nick $spamnickserv]) || ([string equal -nocase $nick $spammemoserv]) || ([matchattr $hand mnof|mnof]) || ($nick == $botnick)} { return 0 }
  if {($nick != $botnick)} {
   utimer $spamfirstmsgtime [list spam:first:msg $nick]; utimer $spamsecondmsgtime [list spam:second:msg $nick]
   set spamnick $nick; set spamaddress $uhost; set spammsg $text; set spamtype MESSAGE
    foreach i [string tolower $spamwords] {
      if {[string match *$i* [string tolower $text]]} {
        foreach cyclechan $cyclechanslwr {
         if {(![isop $nick $cyclechan]) && (![isvoice $nick $cyclechan])} {
          putserv "PRIVMSG $spamopbot :$spamauthone $spamauthtwo $spamauththree  *MESSAGE*:  $spamaddress $spamnick MSG: ==>  $spammsg "; return 0
          }
        }
      }
    }
  }
}
# (i am eleet... kthx)


proc spam:first:msg {nick} {
 global spamfirstmsg
  putserv "PRIVMSG $nick :[lindex $spamfirstmsg [rand [llength $spamfirstmsg]]]"
  return 1
}

proc spam:second:msg {nick} {
 global spamsecondmsg
  putserv "PRIVMSG $nick :[lindex $spamsecondmsg [rand [llength $spamsecondmsg]]]"
  return 1
}

proc notice:spam:detector {nick uhost hand text {dest ""}} {
 global botnick cyclechanslwr spamwords spamopbot spamauthone spamauthtwo spamauththree spamfirstmsgtime spamsecondmsgtime spamchanserv spamnickserv spammemoserv spamnetworkhost spamexemptnicks spamexempthosts
  if {([string match -nocase *$spamexemptnicks* $nick]) || ([string match -nocase *$spamexempthosts* $uhost]) || ([string match -nocase *$spamnetworkhost* $uhost]) || ([string equal -nocase $nick $spamchanserv]) || ([string equal -nocase $nick $spamnickserv]) || ([string equal -nocase $nick $spammemoserv]) || ([matchattr $hand mnof|mnof]) || ($dest != $botnick)} { return 0 }
  if {($dest == $botnick)} {
   utimer $spamfirstmsgtime [list spam:first:notc $nick]; utimer $spamsecondmsgtime [list spam:second:notc $nick]
   set spamnick $nick; set spamaddress $uhost; set spammsg $text; set spamtype NOTICE
    foreach i [string tolower $spamwords] {
     if {[string match *$i* [string tolower $text]]} {
       foreach cyclechan $cyclechanslwr {
        if {(![isop $nick $cyclechan]) && (![isvoice $nick $cyclechan])} {
          putserv "PRIVMSG $spamopbot :$spamauthone $spamauthtwo $spamauththree  *NOTICE*:  $spamaddress $spamnick NOTC: ==>  $spammsg "; return 0
          }
        }
      }
    }
  }
}
# (*awyeah* rules!)


proc spam:first:notc {nick} {
 global spamfirstmsg
  putserv "NOTICE $nick :[lindex $spamfirstmsg [rand [llength $spamfirstmsg]]]"
  return 1
}

proc spam:second:notc {nick} {
 global spamsecondmsg
  putserv "NOTICE $nick :[lindex $spamsecondmsg [rand [llength $spamsecondmsg]]]"
  return 1
}

putlog "\[LOADED\] Spam Detector Script v4.58.ab by \002awyeah (awyeah@usa.net)\002"
putlog "\002\***ACTIVATED***\002 Spam Dectector Bot \002(Channel Cycler Bot: *$nick*)\002 on:\002 $cyclechans\002"

return


this is awyeah tcl currently it relay the spam it gets to the opped bot in channel,however i want it to actually relay it to my specified channel. i jus wan it to cycle detect spam and relay to my specific channel. thanks

Moderated: Moved to the proper category in the forum, and placed the code within a code-block.
/NML_375
Back to top
View user's profile Send private message
scarpa
Voice


Joined: 12 Nov 2006
Posts: 11

PostPosted: Sun Nov 09, 2008 11:17 am    Post subject: Reply with quote

That already has a option to relay the code to a specified channel via the spamkick.tcl. If you use a bot that isnt oped you can get the same results without the oped bot kicking/banning.
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