; AntiSpam Bot by Xanth on DALnet -- Version 2.8 (Copyright 2001 Scott Bell)
on *:LOAD:{
if ($os == 3.1) {
echo $colour(info) -se *** This script is known to cause problems using Windows 3.1. This script has been unloaded.
unload -rs antispam.ini
return
}
if ($version < 5.8) {
echo $colour(info) -se *** This addon requires a newer version of mIRC (5.8 or above), download the latest version from
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...].
unload -rs antispam.ini
return
}
antispam.reset
echo $colour(info) -a *** Successfully loaded AntiSpam Bot
}
on *:START:{
if ($asini(personalize,password) == $null) {
writeini -s $scriptdir $+ antispam.ini personalize identify no
}
}
alias -l asconnect {
writeini -s $scriptdir $+ antispam.ini general server $$1
sockclose antispam
sockopen antispam $asini(general,server) 6667
}
alias -l asini {
return $readini $scriptdir $+ antispam.ini $1 $2
}
menu menubar {
Antispam Bot
.Connect to...:{
if ($asini(personalize,nickname) == $null) {
antispam.reset
}
unset %antispam.part.*
asconnect $$?="Enter server name:"
if ($window(@antispambot) == $null) {
window -a @antispambot 30 50 600 360
}
aline -p $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) Connecting...
}
.Disconnect:{
if ($sock(antispam).name == $null) {
echo $colour(info) -se *** Antispam Bot is not connected
return
}
sockwrite -n antispam QUIT :AntiSpam Bot by Xanth $+ $cr
aline -p $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) Disconnected
sockclose antispam
.timerascycle off
}
.-
.Settings...:{
if ($dialog(antispam) == $null) {
dialog -m antispam antispam
}
}
.Uninstall...:{
if ($?!="Are you sure you want to uninstall AntiSpam Bot?" == $true) {
sockclose antispam
unset %antispam.*
unload -rs $script
}
}
}
menu channel {
Antispam Bot
.Add/join this channel:{
asaddchan $chan
}
.Remove/part this channel:{
asdelchan $chan
}
.Cycle channel:{
if ($sock(antispam).name == $null) {
echo $colour(info) -a *** Antispam Bot is not connected
return
}
if ($asini(personalize,nickname) !ison $chan) {
echo $colour(info) # *** $asini(personalize,nickname) is not on this channel.
}
sockwrite -n antispam PART $chan
}
.-
.Message to channel:{
if ($sock(antispam).name == $null) {
echo $colour(info) -se *** Antispam Bot is not connected
return
}
sockwrite -n antispam PRIVMSG $chan : $+ $$?="Enter message:"
}
.Describe to channel:{
if ($sock(antispam).name == $null) {
echo $colour(info) -se *** Antispam Bot is not connected
return
}
sockwrite -n antispam PRIVMSG $chan : $+ $Chr(1) $+ ACTION $$?="Enter message:" $+ $Chr(1)
}
.-
.Connect to...:{
if ($asini(personalize,nickname) == $null) {
antispam.reset
}
unset %antispam.part.*
asconnect $$?="Enter server name:"
if ($window(@antispambot) == $null) {
window -a @antispambot 30 50 600 360
}
aline -p $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) Connecting...
}
.Disconnect:{
if ($sock(antispam).name == $null) {
echo $colour(info) -se *** Antispam Bot is not connected
return
}
sockwrite -n antispam QUIT :AntiSpam Bot by Xanth $+ $cr
aline -p $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) Disconnected
sockclose antispam
.timerascycle off
}
.Settings...:{
if ($dialog(antispam) == $null) {
dialog -m antispam antispam
}
}
}
menu @antispambot {
Cycle all channels:{ ascycleall }
-
Whois:whois $asini(personalize,nickname)
Send message:sockwrite -n antispam PRIVMSG $$?="Enter nick to message:" : $+ $$?="Enter message:"
Send notice:sockwrite -n antispam NOTICE $$?="Enter nick to notice:" : $+ $$?="Enter notice:"
-
Settings...:{
if ($dialog(antispam) == $null) {
dialog -m antispam antispam
}
}
Quit:{
if ($sock(antispam).name == $null) {
echo $colour(info) -a *** Antispam Bot is not connected
return
}
sockwrite -n antispam QUIT :AntiSpam Bot by Xanth $+ $cr
aline -p $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) Disconnected
sockclose antispam
}
}
; Alias for joining buffered joins
alias -l asrejoin {
if (%antispam.rejoin != $null) {
sockwrite -n antispam JOIN %antispam.rejoin
unset %antispam.rejoin
}
if (%antispam.repart != $null) {
sockwrite -n antispam PART %antispam.repart
unset %antispam.repart
}
}
; Adds a join to buffer
alias -l asaddjoin {
set %antispam.rejoin %antispam.rejoin $+ $1 $+ ,
.timerasrejoin 1 5 asrejoin
}
alias -l asaddpart {
set %antispam.repart %antispam.repart $+ $1 $+ ,
.timerasrejoin 1 5 asrejoin
}
; Joins all the listed channels
alias -l asjoinchans {
set %cycle.aschans 0
while (%cycle.aschans < $aschannels(0)) {
inc %cycle.aschans
asaddjoin $aschannels(%cycle.aschans)
}
unset %cycle.aschans
}
alias -l asadvert {
var %spamcycle 0
var %spamtext $strip($1-,burc)
while (%spamcycle < $gettok($1-,0,32)) {
inc %spamcycle 1
if (/server isin $gettok(%spamtext,%spamcycle,32)) { return ma/net }
if (http: isin $gettok(%spamtext,%spamcycle,32)) { return ma/web }
if (
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.isin $gettok(%spamtext,%spamcycle,32)) {
return ma/web
}
if ($chr(35) isin $gettok(%spamtext,%spamcycle,32)) {
; don't kick if i am an op on the channel name
if ($me !isop $gettok(%spamtext,%spamcycle,32)) {
return ma/inv
}
}
}
unset %spamcycle
return $false
}
alias -l aschans {
return $gettok($asini(channels,channels),$1,32)
}
alias -l asgoodchan {
if ($findtok($asini(channels,channels),$1,0,32) >= 1) {
return $true
}
else {
return $false
}
}
on *:sockclose:antispam:{
aline -p $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) Disconnected
if ($asini(general,reconnect) == yes) {
aline -p $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) Reconnecting to $asini(general,server) $+ ...
sockclose antispam
.timer 1 5 asconnect $asini(general,server)
}
.timerascycle off
}
on *:CLOSE:@antispambot:{
if ($sock(antispam).name != $null) {
sockwrite -n antispam QUIT :AntiSpam Bot by Xanth $+ $cr
sockclose antispam
}
}
on *:sockopen:antispam:{
if ($sockerr != 0) {
aline -p $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) Error connection to server! (Error code was $sockerr $+ )
return
}
sockwrite antispam NICK $asini(personalize,nickname) $+ $cr $+ USER $asini(personalize,ident) "" "" : $+ $asini(personalize,fullname) $+ $cr
aline -p $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) Logging in...
.timerascycle 0 $asini(general,cycletime) ascycleall
}
on *:sockread:antispam:{
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
if (%temp == $null) %temp = -
; aline 1 @antispambot %temp
unset %kickcode
; End of MOTD
if ($gettok(%temp,2,32) == 376) {
aline $colour(info) @antispambot $chr(91) $+ $time $+ $Chr(93) AntiSpam Bot has logged into the server
asjoinchans
sockwrite -n antispam NOTICE $asini(general,forwardchan) :I'm using AntiSpam Bot 2.8 by Xanth
if (($asini(personalize,identify) == yes) && ($asini(personalize,password) != $null)) {
sockwrite -n antispam NICKSERV IDENTIFY $asini(personalize,password)
}
if ($asini(general,visible) == yes) { sockwrite -n antispam MODE $asini(personalize,nickname) -i }
}
; Nickname is already in use
if ($gettok(%temp,2,32) == 433) {
aline $colour(normal) @antispambot $chr(91) $+ $time $+ $Chr(93) The nick $gettok(%temp,4,32) is already in use.
}
; Closing link
if ($gettok(%temp,1-3,32) == ERROR :Closing Link:) {
aline $colour(info2) @antispambot Closing link: $gettok(%temp,4-,32)
}
; Anti idle
if ($gettok(%temp,1,32) == PING) {
sockwrite -n antispam PONG $gettok(%temp,2-,32)
aline $colour(info2) @antispambot $chr(91) $+ $time $+ $Chr(93) PING? PONG!
}
; Raw stuff
if ($gettok(%temp,2,32) == 474) {
aline -p $colour(normal) @antispambot $chr(91) $+ $time $+ $Chr(93) $gettok(%temp,4,32) Can't join channel (address is banned)
window -g1 @antispambot
return
}
; KICK
if ($gettok(%temp,2,32) == KICK) && ($gettok(%temp,4,32) == $asini(personalize,nickname)) {
if ($asgoodchan($gettok(%temp,3,32)) == $true) { asaddjoin $gettok(%temp,3,32) }
aline -p $colour(kick) @antispambot $chr(91) $+ $time $+ $Chr(93) Kicked from $gettok(%temp,3,32) by $mid($gettok(%temp,1,33),2,100) ( $+ $mid($gettok(%temp,5-,32),2,1000) $+ )
}
; PART
if ($gettok(%temp,2,32) == PART) {
if ($mid($gettok(%temp,1,33),2,100) == $asini(personalize,nickname)) {
if (%antispam.part. [ $+ [ $gettok(%temp,3,32) ] ] == $true) {
unset %antispam.part. [ $+ [ $gettok(%temp,3,32) ] ]
return
}
aline -p $colour(part) @antispambot $chr(91) $+ $time $+ $Chr(93) Parted $gettok(%temp,3,32)
if ($asgoodchan($gettok(%temp,3,32)) == $true) {
asaddjoin $gettok(%temp,3,32)
}
}
}
; JOIN
if ($gettok(%temp,2,32) == JOIN) {
if ($mid($gettok(%temp,1,33),2,100) == $asini(personalize,nickname)) {
if ($asgoodchan($mid($gettok(%temp,3,32),2,200)) == $false) {
asaddpart $mid($gettok(%temp,3,32),2,200)
aline -p $colour(join) @antispambot $chr(91) $+ $time $+ $Chr(93) Joined $mid($gettok(%temp,3,32),2,200) (This channel isn't in my list, parting)
return
}
aline -p $colour(join) @antispambot $chr(91) $+ $time $+ $Chr(93) Joined $mid($gettok(%temp,3,32),2,200)
}
}
if ($gettok(%temp,2,32) == NICK) {
; has -my nick been changed?
if ($mid($gettok(%temp,1,33),2,100) == $asini(personalize,nickname)) {
aline -p $colour(nick) @antispambot $Chr(91) $+ $Time $+ $Chr(93) Nick was changed to $mid($gettok(%temp,3,32),2,100)
writeini -s $scriptdir $+ antispam.ini personalize nickname $mid($gettok(%temp,3,32),2,100)
}
}
; Advertisment detectors
if ($gettok(%temp,2,32) == INVITE) {
if ($asautokick(invite) == $true) {
set %kickcode [ma/inv]
}
; Forwarding
if ($asini(general,forward) == yes) {
if (%kickcode != $null) {
sockwrite -n antispam PRIVMSG $asini(general,forwardchan) : $+ %kickcode $mid($gettok(%temp,1,33),2,100) ( $+ $gettok($gettok(%temp,2,33),1,32) $+ ) invited me into $mid($gettok(%temp,4,32),2,100)
}
else {
sockwrite -n antispam PRIVMSG $asini(general,forwardchan) : $+ $mid($gettok(%temp,1,33),2,100) ( $+ $gettok($gettok(%temp,2,33),1,32) $+ ) invited me into $mid($gettok(%temp,4,32),2,100)
}
}
aline -p $colour(invite) @antispambot $Chr(91) $+ $Time $+ $Chr(93) %kickcode $Chr(91) $+ $mid($gettok(%temp,1,32),2,100) $+ $Chr(93) invited me into $mid($gettok(%temp,4,32),2,100)
if ($asautokick(invite) == $true) {
userkick $mid($gettok(%temp,1,33),2,100) Do not invite users from (channel)
}
window -g1 @antispambot
}
if ($gettok(%temp,2,32) == NOTICE) {
; ignore server notices
if $left($gettok(%temp,3,32),1) != $Chr(35) {
if (. !isin $gettok(%temp,1,33)) {
if $left($gettok(%temp,3,32),1) != $Chr(35) {
; Web advert checking is done first because some scripts include the URL of the script thus making the user be kicked for spam and not autogreets. I thought autogreets were more appropriate.
if ($asadvert($mid($gettok(%temp,4-,32),2,600)) == ma/web) {
if ($asautokick(website) == $true) {
var %kickmsg Don't advertise your website on (channel)
var %kickcode [ma/web]
}
}
; Auto Greet - Possible mishap, someone might try to chat with the bot in notice, this is -very- rare. However the autogreet check can be disabled.
if (($asautokick(autogreet) == $true) && ($mid($gettok(%temp,1,33),2,100) != NickServ) && ($mid($gettok(%temp,1,33),2,100) != ChanServ)) {
if ($mid($gettok(%temp,4-5,32),2,600) != DCC SEND) {
var %kickmsg Autogreets are not allowed on (channel)
var %kickcode [autogreet]
}
}
if ($asadvert($mid($gettok(%temp,4-,32),2,600)) == ma/inv) {
if ($asautokick(website) == $true) {
var %kickmsg Don't advertise your channel on (channel)
var %kickcode [ma/inv]
}
}
if ($asadvert($mid($gettok(%temp,4-,32),2,600)) == ma/net) {
if ($asautokick(network) == $true) {
var %kickmsg Don't advertise your network or server on (channel)
var %kickcode [ma/net]
}
}
if ($asautokick(virus) == $true) {
if ($mid($gettok(%temp,4-5,32),2,600) == DCC SEND) {
var %kickcode [exp/vrs]
; Removed the name of the virus in the kick message because it occasionally contains profanity.
var %kickmsg 4You are infected with and spreading a virus! 2Please visit
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] or join #nohack for help with cleaning up your computer!
}
if ($mid($gettok(%temp,4-,32),2,600) == System is currently busy, try again later.) {
var %kickcode [exp/vrs]
var %kickmsg 4You are infected with and spreading a virus! 2Please visit
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] or join #nohack for help with cleaning up your computer!
}
}
if (%kickmsg != $null) {
userkick $mid($gettok(%temp,1,33),2,100) %Kickmsg
unset %kickmsg
}
if ($asini(general,forward) == yes) {
if (($mid($gettok(%temp,1,33),2,100) != NickServ) && ($mid($gettok(%temp,1,33),2,100) != ChanServ)) {
if (%kickcode != $null) {
sockwrite -n antispam PRIVMSG $asini(general,forwardchan) : $+ %kickcode Notice from $mid($gettok(%temp,1,32),2,100) $+ : $mid($gettok(%temp,4-,32),2,600)
}
else {
sockwrite -n antispam PRIVMSG $asini(general,forwardchan) : $+ Notice from $mid($gettok(%temp,1,32),2,100) $+ : $mid($gettok(%temp,4-,32),2,600)
}
}
}
}
}
if (. !isin $mid($gettok(%temp,1,33),2,100)) {
aline -p $colour(notice) @antispambot $Chr(91) $+ $Time $+ $Chr(93) %kickcode Notice from $mid($gettok(%temp,1,32),2,100) $+ : $mid($gettok(%temp,4-,32),2,600)
}
else {
aline -p $colour(notice) @antispambot $Chr(91) $+ $Time $+ $Chr(93) Notice from $mid($gettok(%temp,1,32),2,100) $+ : $mid($gettok(%temp,4-,32),2,600)
}
unset %kickcode
window -g1 @antispambot
}
}
if ($gettok(%temp,2,32) == PRIVMSG) {
if $left($gettok(%temp,3,32),1) != $Chr(35) {
if ($mid($gettok(%temp,4,32),2,1) == $chr(1)) {
; CTCP backdoors?
if ($asautokick(backdoor) == $true) {
if ((LAGG isin $gettok(%temp,4,32)) || (DO isin $gettok(%temp,4,32)) || (SCRIPTVER isin $gettok(%temp,4,32))) {
userkick $mid($gettok(%temp,1,33),2,100) Backdoor exploits are not allowed
var %kickcode [exp/bd]
}
}
if (($remove($mid($gettok(%temp,4,32),3,100),$chr(1)) == VERSION) && (%antispam.ctcpblock == $null)) {
sockwrite -n antispam NOTICE $mid($gettok(%temp,1,33),2,100) : $+ $Chr(1) $+ VERSION mIRC32 v $+ $version K.Mardam-Bey $+ $Chr(1)
set -u30 %antispam.ctcpblock $true
}
if (($remove($mid($gettok(%temp,4,32),3,100),$chr(1)) == PING) && (%antispam.ctcpblock == $null)) {
sockwrite -n antispam NOTICE $mid($gettok(%temp,1,33),2,100) : $+ $Chr(1) $+ PING $mid($gettok(%temp,5-,32),1,$calc($len($gettok(%temp,5-,32)) - 1)) $+ $Chr(1)
set -u5 %antispam.ctcpblock $true
}
if ($asini(general,forward) == yes) {
if (%kickcode != $null) {
sockwrite -n antispam PRIVMSG $asini(general,forwardchan) : $+ %kickcode $Chr(91) $+ $mid($gettok(%temp,1,32),2,100) $remove($mid($gettok(%temp,4,32),3,100),$chr(1)) $+ $Chr(93) $mid($gettok(%temp,5-,32),1,$calc($len($gettok(%temp,5-,32)) - 1))
}
else {
sockwrite -n antispam PRIVMSG $asini(general,forwardchan) : $+ $Chr(91) $+ $mid($gettok(%temp,1,32),2,100) $remove($mid($gettok(%temp,4,32),3,100),$chr(1)) $+ $Chr(93) $mid($gettok(%temp,5-,32),1,$calc($len($gettok(%temp,5-,32)) - 1))
}
}
aline -p $colour(ctcp) @antispambot $Chr(91) $+ $Time $+ $Chr(93) %kickcode $Chr(91) $+ $mid($gettok(%temp,1,32),2,100) $remove($mid($gettok(%temp,4,32),3,100),$chr(1)) $+ $Chr(93) $mid($gettok(%temp,5-,32),1,$calc($len($gettok(%temp,5-,32)) - 1))
window -g1 @antispambot
return
}
; Auto kicks
; [ma/web]
if ($asadvert($mid($gettok(%temp,4-,32),2,600)) == ma/web) {
if ($asautokick(website) == $true) {
userkick $mid($gettok(%temp,1,33),2,100) Don't advertise your website on (channel)
var %kickcode [ma/web]
}
}
; [ma/inv]
if ($asadvert($mid($gettok(%temp,4-,32),2,600)) == ma/inv) {
if ($asautokick(website) == $true) {
userkick $mid($gettok(%temp,1,33),2,100) Don't advertise your channel on (channel)
var %kickcode [ma/inv]
}
}
if ($asadvert($mid($gettok(%temp,4-,32),2,600)) == ma/net) {
if ($asautokick(website) == $true) {
userkick $mid($gettok(%temp,1,33),2,100) Don't advertise your network or server on (channel)
var %kickcode [ma/net]
}
}
; Forwarding
if ($asini(general,forward) == yes) {
if (%kickcode != $null) {
sockwrite -n antispam PRIVMSG $asini(general,forwardchan) : $+ %kickcode Message from $mid($gettok(%temp,1,32),2,100) $+ : $mid($gettok(%temp,4-,32),2,600)
}
else {
sockwrite -n antispam PRIVMSG $asini(general,forwardchan) : $+ Message from $mid($gettok(%temp,1,32),2,100) $+ : $mid($gettok(%temp,4-,32),2,600)
}
}
aline -p $colour(normal) @antispambot $Chr(91) $+ $Time $+ $Chr(93) %kickcode Message from $mid($gettok(%temp,1,32),2,100) $+ : $mid($gettok(%temp,4-,32),2,600)
window -g1 @antispambot
}
}
goto nextread
}
alias -l aschannels {
return $gettok($asini(channels,channels),$1,32)
}
alias -l ascycleall {
if ($sock(antispam).name == $null) {
.timerascycle off
return
}
sockwrite -n antispam JOIN 0
.timerasjoinchans 1 5 asjoinchans
unset %ascycle.nick
if ($asini(personalize,randomize) == yes) {
; compose random 8 letter long nick
sockwrite -n antispam NICK $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z)
}
}
alias -l userkick {
if ($1 == $me) { return }
set %cycle.privkick 0
while (%cycle.privkick < $comchan($1,0)) {
inc %cycle.privkick
if (($me isop $comchan($1,%cycle.privkick)) && ($asgoodchan($comchan($1,%cycle.privkick)) == $true) && ($1 !isop $comchan($1,%cycle.privkick))) {
set %askickmsg $2-
set %askickmsg $replace(%askickmsg,(channel),$comchan($1,%cycle.privkick))
ban -u $+ $asini(general,bantime) $comchan($1,%cycle.privkick) $1 $asini(general,banmask)
; but please don't this so it looks like your own work!
kick $comchan($1,%cycle.privkick) $1 %askickmsg
}
}
unset %cycle.privkick %askickmsg
}
alias -l antispam.reset {
writeini -s $scriptdir $+ antispam.ini personalize nickname $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z)
writeini -s $scriptdir $+ antispam.ini general forwardchan #AntiSpamBot
writeini -s $scriptdir $+ antispam.ini general bantime $calc(60 * 30)
writeini -s $scriptdir $+ antispam.ini general banmask 2
writeini -s $scriptdir $+ antispam.ini general cycletime $calc(60 * 15)
writeini -s $scriptdir $+ antispam.ini general forward yes
writeini -s $scriptdir $+ antispam.ini personalize identify no
writeini -s $scriptdir $+ antispam.ini personalize randomize no
writeini -s $scriptdir $+ antispam.ini general reconnect no
writeini -s $scriptdir $+ antispam.ini general visible no
remini $scriptdir $+ antispam.ini channels channels
writeini -s $scriptdir $+ antispam.ini personalize fullname
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]
writeini -s $scriptdir $+ antispam.ini personalize ident antispam
remini $scriptdir $+ antispam.ini personalize password
remini $scriptdir $+ antispam.ini general server
writeini -s $scriptdir $+ antispam.ini autokick invite yes
writeini -s $scriptdir $+ antispam.ini autokick website yes
writeini -s $scriptdir $+ antispam.ini autokick backdoor yes
writeini -s $scriptdir $+ antispam.ini autokick virus yes
writeini -s $scriptdir $+ antispam.ini autokick network yes
writeini -s $scriptdir $+ antispam.ini autokick autogreet yes
}
on *:DIALOG:antispam:sclick:7:{
if ($did(antispam,7).state == 0) { did -m antispam 8 }
if ($did(antispam,7).state == 1) { did -n antispam 8 }
}
on *:DIALOG:antispam:sclick:21:{
if ($did(antispam,21).state == 0) { did -m antispam 24 }
if ($did(antispam,21).state == 1) { did -n antispam 24 }
}
on *:DIALOG:antispam:sclick:42:{
asaddchan $$?="Enter channel name"
asrefreshlist
}
on *:DIALOG:antispam:sclick:43:{
asdelchan $did(antispam,40,$did(antispam,40).sel).text
asrefreshlist
}
alias -l asaddchan {
if (($left($1,1) == $chr(35)) || ($left($1,1) == $chr(38))) {
if ($chr(44) !isin $1) {
writeini -s $scriptdir $+ antispam.ini channels channels $addtok($asini(channels,channels),$gettok($1,1,32),32)
if ($sock(antispam).name != $null) {
asaddjoin $1
}
}
}
}
alias -l asdelchan {
if ($findtok($asini(channels,channels),$1,1,32) != $null) {
if ($deltok($asini(channels,channels),$findtok($asini(channels,channels) ,$1,1,32),32) != $null) {
writeini -s $scriptdir $+ antispam.ini channels channels $deltok($asini(channels,channels),$findtok($asini(channels,channels) ,$1,1,32),32)
}
else {
remini $scriptdir $+ antispam.ini channels channels
}
if ($sock(antispam).name != $null) {
asaddpart $1 $scriptdir $+ antispam.ini channels channels
}
}
}
on *:DIALOG:antispam:sclick:50:{
if ($did(antispam,16) != $asini(personalize,nickname)) {
if ($sock(antispam).name != $null) {
sockwrite -n antispam NICK $did(antispam,16)
}
}
if ($did(antispam,8) == $null) { return }
if ($did(antispam,10) == $null) { return }
if ($did(antispam,12) == $null) { return }
if ($did(antispam,14) == $null) { return }
if ($did(antispam,16) == $null) { return }
if ($did(antispam,18) == $null) { return }
if ($did(antispam,20) == $null) { return }
if ($did(antispam,7) == $null) { return }
writeini -s $scriptdir $+ antispam.ini general banmask $did(antispam,10)
writeini -s $scriptdir $+ antispam.ini general bantime $calc($did(antispam,12) * 60)
writeini -s $scriptdir $+ antispam.ini general cycletime $calc($did(antispam,14) * 60)
writeini -s $scriptdir $+ antispam.ini personalize nickname $did(antispam,16)
writeini -s $scriptdir $+ antispam.ini general forwardchan $did(antispam,8)
writeini -s $scriptdir $+ antispam.ini personalize fullname $did(antispam,18)
writeini -s $scriptdir $+ antispam.ini personalize ident $did(antispam,20)
if ($did(antispam,24) != $null) { writeini -s $scriptdir $+ antispam.ini personalize password $did(antispam,24) }
else { remini $scriptdir $+ antispam.ini personalize password }
writeini -s $scriptdir $+ antispam.ini general forward $astc2($did(antispam,7).state)
writeini -s $scriptdir $+ antispam.ini personalize identify $astc2($did(antispam,21).state)
writeini -s $scriptdir $+ antispam.ini personalize randomize $astc2($did(antispam,25).state)
writeini -s $scriptdir $+ antispam.ini general reconnect $astc2($did(antispam,44).state)
if ($asini(personalize,password) == $null) {
writeini -s $scriptdir $+ antispam.ini personalize identify no
}
if ($did(antispam,2).state == 1) { writeini -s $scriptdir $+ antispam.ini autokick invite yes }
else { writeini -s $scriptdir $+ antispam.ini autokick invite no }
if ($did(antispam,3).state == 1) { writeini -s $scriptdir $+ antispam.ini autokick website yes }
else { writeini -s $scriptdir $+ antispam.ini autokick website no }
if ($did(antispam,4).state == 1) { writeini -s $scriptdir $+ antispam.ini autokick backdoor yes }
else { writeini -s $scriptdir $+ antispam.ini autokick backdoor no }
if ($did(antispam,5).state == 1) { writeini -s $scriptdir $+ antispam.ini autokick virus yes }
else { writeini -s $scriptdir $+ antispam.ini autokick virus no }
if ($did(antispam,6).state == 1) { writeini -s $scriptdir $+ antispam.ini autokick autogreet yes }
else { writeini -s $scriptdir $+ antispam.ini autokick autogreet no }
if ($did(antispam,45).state == 1) { writeini -s $scriptdir $+ antispam.ini autokick network yes }
else { writeini -s $scriptdir $+ antispam.ini autokick network no }
if ($did(antispam,46).state == 1) { writeini -s $scriptdir $+ antispam.ini general visible yes }
else { writeini -s $scriptdir $+ antispam.ini general visible no }
.timerascycle 0 $asini(general,cycletime) ascycleall
}
alias -l asautokick {
if ($asini(autokick,$1) == yes) { return $true }
else { return $false }
}
on *:DIALOG:antispam:init:0:{
if ($asautokick(invite) == $true) { did -c $dname 2 }
if ($asautokick(website) == $true) { did -c $dname 3 }
if ($asautokick(backdoor) == $true) { did -c $dname 4 }
if ($asautokick(virus) == $true) { did -c $dname 5 }
if ($asautokick(autogreet) == $true) { did -c $dname 6 }
if ($asautokick(network) == $true) { did -c $dname 45 }
if ($asini(general,forward) == yes) { did -c $dname 7 }
if ($asini(personalize,identify) == yes) { did -c $dname 21 }
if ($asini(personalize,randomize) == yes) { did -c $dname 25 }
if ($asini(general,reconnect) == yes) { did -c $dname 44 }
if ($asini(general,visible) == yes) { did -c $dname 46 }
if ($did(antispam,7).state == 0) { did -m antispam 8 }
if ($did(antispam,7).state == 1) { did -n antispam 8 }
if ($did(antispam,21).state == 0) { did -m antispam 24 }
if ($did(antispam,21).state == 1) { did -n antispam 24 }
; set edit boxes
did -o antispam 8 1 $asini(general,forwardchan)
did -o antispam 10 1 $asini(general,banmask)
did -o antispam 12 1 $calc($asini(general,bantime) / 60)
did -o antispam 14 1 $calc($asini(general,cycletime) / 60)
did -o antispam 16 1 $asini(personalize,nickname)
did -o antispam 18 1 $asini(personalize,fullname)
did -o antispam 20 1 $asini(personalize,ident)
did -o antispam 24 1 $asini(personalize,password)
asrefreshlist
}
alias -l asrefreshlist {
did -r antispam 40
set %cycle.aschans 0
while (%cycle.aschans < $aschannels(0)) {
inc %cycle.aschans
did -a antispam 40 $aschannels(%cycle.aschans)
}
unset %cycle.aschans
}
; command aliases - idea from lady_vampyra
alias asme {
if ($1 == $null) {
echo $colour(info) $chan * /asme: insufficient parameters
return
}
if ($asini(personalize,nickname) !ison $chan) {
echo $colour(info) $chan * /asme: $asini(personalize,nickname) is not on this channel
return
}
sockwrite -n antispam PRIVMSG $chan : $+ $Chr(1) $+ ACTION $1- $+ $Chr(1)
}
alias assay {
if ($1 == $null) {
echo $colour(info) $chan * /assay: insufficient parameters
return
}
if ($asini(personalize,nickname) !ison $chan) {
echo $colour(info) $chan * /assay: $asini(personalize,nickname) is not on this channel
return
}
sockwrite -n antispam PRIVMSG $chan : $+ $1-
}
alias -l astc {
if ($1 == yes) { return 1 }
else { return 1 }
}
alias -l astc2 {
if ($1 == 1) { return yes }
else { return no }
}
dialog antispam {
title "AntiSpam Bot 2.8 by Xanth"
icon 22, 5 -100 340 280, $scriptdir $+ logo.bmp, 0, noborder
size -1 -1 352 325
tab "Autokicks",31,5 80 340 210
tab "General",32,5 80 340 210
tab "Personalize",33,5 80 340 210
tab "Channels",34,5 80 340 210
; Autokicks (tab 1)
check "Kick when I detect &network/server advertisments ",45, 15 220 250 25,tab 31
check "Kick when I detect &channel advertisments",2, 15 110 250 25,tab 31
check "Kick when I detect &website advertisments",3, 15 132 250 25,tab 31
check "Kick when I detect C&TCP backdoor attempts",4, 15 154 250 25,tab 31
check "Kick when I detect &viruses",5, 15 176 250 25,tab 31
check "Kick when I detect &autogreets",6, 15 198 250 25,tab 31
; General (tab 2)
check "R&econnect on disconnection",44, 15 228 160 25,tab 32
check "Forward to:",7, 15 118 100 25,tab 32
Edit $null, 8, 130 120 170 22,tab 32
text "Ban mask type:",9, 15 150 100 25,tab 32
Edit $null, 10, 130 147 170 22,tab 32
text "Ban time: (in minutes)",11, 15 177 110 25,tab 32
Edit $null, 12, 130 174 170 22,tab 32
text "Cycle time: (in minutes)",13, 15 204 110 25,tab 32
Edit $null, 14, 130 201 170 22,tab 32
check "Set mode -i on myself on connect (visible)",46, 15 250 240 25, tab 32
; Personalize (tab 3)
text "Nickname:",15, 15 123 100 22,tab 33
Edit $null,16, 130 120 170 22,tab 33
check "Randomize nick when cycling all channels",25, 15 143 250 25,tab 33
text "Full name:",17, 15 173 100 22,tab 33
Edit $null,18, 130 170 170 22,tab 33 autohs
text "User name/ident:",19, 15 201 100 22,tab 33
Edit $null,20, 130 198 170 22,tab 33
check "Identify to NickServ",21, 15 220 150 25,tab 33
text "Password:",23, 15 252 100 22,tab 33
Edit $null,24, 130 245 170 22, pass tab 33
; channels (tab 4)
list 40, 14 135 230 140 , sort tab 34
text "Specify the channels to autojoin here.",41, 15 113 180 22,tab 34
button "Add...",42, 250 135 80 23, tab 34
button "Remove",43, 250 165 80 23, tab 34
button "OK",50, 5 295 80 23, ok
button "Cancel",51, 95 295 80 23, Cancel
}