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 }
}
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
}
}
}
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?
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.