Code: Select all
# This is the global flag which will be used to identify any bots
variable botflag "b|"
Code: Select all
if {[string match -nocase "$request::channel" "$request::reqchan"]} {
putserv "NOTICE $nickname :Nice try, please dont abuse the request system."
return 0
}
Code: Select all
if {[validchan $request:reqchan]} {
Code: Select all
utimer 30 [list request::timeout $nickname [set channel $request::reqchan]]
if {$request::shitlist == "1"} {
set shitlist [open $request::shitfile r]
if {$shitlist == ""} {
putlog "Channel $request::reqchan is not shitlisted."
request::start $nickname [set channel $request::reqchan]
} else {
set data [split [read $shitlist] \n]
if {[llength $data] == "1"} {
if {[string match -nocase $request::reqchan [lindex [split $data] 0]]} {
putserv "NOTICE $nickname :Request failed: $request::reqchan is currently shitlisted."
putlog "Channel $request::reqchan is shitlisted."
close $shitlist
unset data
} else {
close $shitlist
unset data
request::start $nickname [set channel $request::reqchan]
}
} else {
set found "0"
foreach schan [split $data] {
if {$schan == ""} { return }
if {[string match -nocase $request::reqchan [lindex [split $schan] 0]]} {
set found "1"
break
}
}
if {$found == "1"} {
putserv "NOTICE $nickname :Request failed: $request::reqchan is currently shitlisted."
putlog "Channel $request::reqchan is shitlisted."
close $shitlist
unset data
} else {
request::start $nickname [set channel $request::reqchan]
close $shitlist
unset data
}
}
}
} elseif {$request::shitlist == "0"} {
request::start $nickname [set channel $request::reqchan]
}
Code: Select all
if {$request::shitlist} {
set shitlist [open $request::shitfile r]; set lines [split [read $shitlist] \n]; close $shitlist
set found 0
foreach channel $lines {
# I will assume that you atleast know how to write a file properly.
if {[string equal -nocase $channel $request::reqchan]} {
set found 1; break
}
}
if {$found} {
putserv "NOTICE $nickname :Request failed: $request::reqchan is currently shitlisted."
putlog "Channel $request::reqchan is shitlisted."
} else {
start $nickname $request::reqchan
}
} else {
start $nickname $request::reqchan
}
Code: Select all
utimer 10 [list request::request2 $nickname $channel]
Code: Select all
proc request::request2 {nickname channel} {
set request::reqchan $channel
if {![onchan $nickname $request::reqchan]} {
putserv "NOTICE $nickname :Request failed: You are not on $request::reqchan."
channel remove $request::reqchan
set request::request "0"
putlog "$nickname is not at $request::reqchan."
} else {
putlog "$nickname is at $request::reqchan."
utimer 5 [list request::opcheck $nickname $request::reqchan]
}
}
Code: Select all
proc request::accepted {nickname channel} {
set request::reqchan $channel
# Request is now accepted, so you need to send a message to a random bot through a botnet
# please note, if you dont want to send this message though a botnet, then modify this part of the script as required
set rbot [channel get $request::channel rbot]
if {$::request::service} {
if {[onchan L $request::reqchan]} {
set service "L"
} else {
set service "Q"
}
putquick "PRIVMSG $request::adminchan :$rbot requestadd [set text "$request::reqchan $nickname $service"]"
putlog "Request accepted for $request::reqchan by $nickname. Bot $rbot will join. \(Service: $service\)"
} else {
putquick "PRIVMSG $request::adminchan :$rbot requestadd [set text "$request::reqchan $nickname"]"
putlog "Request accepted for $request::reqchan by $nickname. Bot $rbot will join."
}
putserv "NOTICE $nickname :Request accepted: Bot $rbot should join shortly"
putlog "Request: - Accepted - $request::reqchan - $nickname\([getchanhost $nickname $request::reqchan]\) - $rbot will join -"
channel remove $request::reqchan
set request::request "0"
}
Code: Select all
setudef str service
proc requestadd {channel nickname {service ""}} {
if {![validchan $channel]} {
channel add $channel
}
if {[info exists service]} {
channel set $channel service "$service"
}
if {[validuser [nick2hand $nickname]]} {
chattr [nick2hand $nickname] |+almnov $channel
putserv "NOTICE $nickname :Hello $nickname. You are now the owner of $channel. Your handle is [nick2hand $nickname] and you are added with the hostname [getuser [nick2hand $nickname] hosts]."
if {$service != ""} {
putserv "NOTICE $nickname :For me to function properly, please add me to [channel get $channel service] on $channel with +amo. /msg [channel get $channel service] chanlev $channel $::botnick +amo."
}
} else {
set hostname [getchanhost $nickname $channel]
if {[string match -nocase "*users.quakenet.org" "$hostname"]} {
set hostname "*!*@[lindex [split $hostname @] 1]"
} else {
set hostname "*!$hostname"
}
adduser $nickname $hostname
chattr $nickname |+almnov $channel
putserv "NOTICE $nickname :Hello $nickname. You are now the owner of $channel. Your handle is [nick2hand $nickname] and you are added with the hostname [getuser [nick2hand $nickname] hosts]."
if {$service != ""} {
putserv "NOTICE $nickname :For me to function properly, please add me to [channel get $channel service] on $channel with +amo. /msg [channel get $channel service] chanlev $channel $::botnick +amo."
}
}
}
Code: Select all
setudef str service
proc requestadd {channel nickname {service ""}} {
if {![validchan $channel]} {
channel add $channel
}
if {![validuser [set hand [nick2hand $nickname]]]} {
set host [expr {[string match *users.quakenet.org* [set host [getchanhost $nickname]]] ? "*!*@[lindex [split $host @] 1]" : "[string map {~ *} *!$host]"}]
if {![validuser $nickname]} {
adduser [set hand $nickname] $host
} else {
# add a random number from 0-99 to limit the odds of the nickname occuring again
adduser [set hand $nickname[rand 100]] $host
}
}
# we don't need to define +lmno because eggdrop adds that by default upon +n
chattr $hand |+an $channel
putserv "NOTICE $nickname :Hello $nickname. You are now the owner of $channel. Your handle is [nick2hand $nickname] and you are added with the hostname [getuser [nick2hand $nickname] hosts]."
if {[llength $service]} {
# so because you claimed +ao, let's not be lame and ask for +ao.
putserv "NOTICE $nickname :For me to function properly, please add me to $service on $channel with +ao. /msg $service chanlev $channel $::botnick +ao."
channel set $channel $service
}
}
Actually with the exception of your 'shitlist' or whatever you would call it, there was nothing more advanced about it except for the fact that it used alot of procs to do things you could have done with 1 proc very easily.Tosser^^ wrote:actually, that script was written from scratch, i didn't even look at your script. And its my script, so i can use 20,000 or 30,000 if statements if i like. I might have ripped from you before, but i dont rip from your scripts now, i dont even have you script anymore, it was so crap i decided to write this one. More advanced...
Code: Select all
.set errorInfo