Anti Spam Dialog

By AmyOUfan on Jan 02, 2009

Ok what this code does is give you more control over what websites or urls are posted. You can choose what urls you do not want posted in your room. You may add or delete them at your will.
Make sure you do add a text file named spam.txt to main folder of your script.

menu * {
Spam Kick: { dialog -m SpamKick SpamKick }
}

dialog SpamKick {
title "Spam Kicker"
size -1 -1 197 111
option dbu
list 1, 7 11 125 77, sort size vsbar
box "", 2, 3 3 183 94
button "Add URL", 3, 142 12 37 12
button "Delete URL", 4, 142 28 37 12
button "Ok/Cancel", 5, 142 76 37 12, ok cancel
button "Turn On", 6, 142 44 37 12
button "Turn Off", 7, 142 60 37 12
}

on :dialog:SpamKick:init:: {
/loadbuf -ro SpamKick 1 spam.txt
}

alias spam {
/set %spam $$?="Add Spam URL Here"
/write spam.txt %spam
/loadbuf -ro SpamKick 1 spam.txt
}

on :Dialog:SpamKick:sclick:1: { /set %sel.text $did(1).seltext }
on
:Dialog:SpamKick:sclick:3: { /spam }
on :Dialog:SpamKick:sclick:4: { /write -ds $+ %sel.text spam.txt | /loadbuf -ro SpamKick 1 spam.txt }
on
:Dialog:SpamKick:sclick:*:{
if ($did == 6) { .enable #spamkicker | echo -a Spam Kick Enabled }
if ($did == 7) { .disable #spamkicker | echo -a Spam Kick Disabled }
}

spamkicker on

on :TEXT::#: {
if ($nick !isop $chan) && ($nick !isowner $chan) {
var %i = $lines(spam.txt)
while (%i) {
if ($read(spam.txt,%i) isin $1-) {
kick # $nick :No Spamming.
.raw access # add deny $+(!, $Ial($nick).addr) 1 : $+ %Nick Spamming
}
dec %i
}
}
}
on :ACTION::#: {
if ($nick !isop $chan) && ($nick !isowner $chan) {
var %i = $lines(spam.txt)
while (%i) {
if ($read(spam.txt,%i) isin $1-) {
kick # $nick :No Spamming.
.raw access # add deny $+(!, $Ial($nick).addr) 1 : $+ %Nick Spamming
}
dec %i
}
}
}
on :CTCPREPLY::#: {
if ($nick !isop $chan) && ($nick !isowner $chan) {
var %i = $lines(spam.txt)
while (%i) {
if ($read(spam.txt,%i) isin $1-) {
kick # $nick :No Spamming.
.raw access # add deny $+(!, $Ial($nick).addr) 1 : $+ %Nick Spamming
}
dec %i
}
}
}

spamkicker end

Comments

Sign in to comment.
duckz   -  Jan 27, 2009

Just tells me #SPAMKICKER Unknown command

 Respond  
TravisT   -  Jan 08, 2009

No you misunderstand. Your script can be easily flooded out. Any text response should protect itself from a flood. Especially if you use a while loop in it to scan each line of a text file. (Which you shouldn't ever do)

 Respond  
AmyOUfan   -  Jan 08, 2009

If you want a flood protection I will add one to the snippits

 Respond  
TravisT   -  Jan 07, 2009

Yeah that was my first thought. Better to write down the allowed urls. There are way less allowed urls than urls to kick for. You can't possibly think of all the urls you dont want posted in your room.

Also, I don't think it is wise to do a loop through every line in a text file for every text event.
I also don't see any flood protection. What does this code do during a text flood?

 Respond  
chadbdurham   -  Jan 04, 2009

I think it's specific. As your avatar, PLEASE THINK OF THE BUNNY, don't act stupid either. :)

Had to do it, sorry :>

 Respond  
AmyOUfan   -  Jan 02, 2009

you you dont add www.hawkee.com it dosent kick for it it is URL SPACIFIC, it kicks only the spam urls YOU DO NOT WANT POSTED. Now if you added www. only it will kick for those but if you add www.lameporn.com It will kick that spam url only.

 Respond  
Aucun50   -  Jan 02, 2009

Where you trying to say that it would block "www.", .com, .org, http:, and so on but you can put what ones you don't wont it to block like "www.hawkee.com"?

 Respond  
napa182   -  Jan 02, 2009

lol are you for real? wow i guess you didnt get what i said at all...

 Respond  
Aucun50   -  Jan 02, 2009

I don't get your post napa, if you only added the ones not to kick on then he would have to write all of the ones to kick on his script and make a selection box to or you only put in the ones you don't wont a kick on that more work for him. Also if you selected "www" not to kick but "www." was still in the kick list then they type in channel "www." and get kicked. I guess what I'm trying to say is the way he did it is easier and you would get less errors that just my opinion.

 Respond  
napa182   -  Jan 02, 2009

wouldnt it be easyer to add the ones not to kick for rather then adding a ton to kick on?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.