Hello Again,
Thanks to your excellent help on here my script progressed to quite an excellent working level, esp with Nimue's help.
Heres the script that I've been using and its been going quite well other than a few problems.
As you can see from the script, in a nutshell I have 3 text files which contain words layed out as:
*grossurl.com*
depending on which file that has been added too by anyone in our #admin channel the bot will either ban, mute or just warn the person.
The problems I have at the moment are that for some reason new entries to the ban listing whlst being written out to the text file don't seem to be active in the hash table unless i unload/reload the script. Very odd, as it was working fine until about the 30th entry in the textfile/hash table. Ive tried all combinations of clearning, initialisting and restarting/reloading the hash tables but I cant get it to work smoothly as it was

.
If someone also types one of the listed triggers in a
/me says grossurl.com
the bot doesnt trigger. Admitingly I'll rtfm 'on *' a tad more, but seeing im posting I might as well ask here

The other thing which is annoying but doesnt seem to stop functionality is that when sending messages to the user, admin channel or even myself (for logging what the bot is doing) I always seem to get it 2x. This has me stumped I can't work out why its doing this. For example, when a user triggers the bot on a badword, this gets sent to me in a PM (as it should, but only once):
<me> Banned 1337user for grossurl.com spam @ 00:40:01 26/04/2003 on #users
<me> Banned 1337user for grossurl.com spam @ 00:40:01 26/04/2003 on #users
Anyway, if any of you kind souls would be kind enough to pick over my script and see if you can spot fault Id be more than happy.
Things todo are to merge the repeat spamming scipt section at the bottom with the main ban/mute script to give the users 2 warnings before actually activating a ban/mute.
Anyway, the script which others might also find helpfull in its current form:
; Start Up and Init section
on *:start:{
hfree -sw chanban
hfree -sw chanmute
hfree -sw chanwarn
hmake chanban 200
hload -sn chanban chanban.txt
hmake chanmute 200
hload -sn chanmute chanmute.txt
hmake chanwarn 100
hload -sn chanwarn chanwarn.txt
}
on me:*:quit:{
hsave -son chanban chanban.txt
hsave -son chanmute chanmute.txt
hsave -son chanwarn chanwarn.txt
}
; Admin Section
on *:TEXT:!listban:#testing,#admin:{
play $nick c:\mirc\chanban.txt
msg $mnick Admin: $nick requested chan ban list @ $time $date on $chan
}
on *:TEXT:!listmute:#testing,#admin:{
play $nick c:\mirc\chanmute.txt
msg $mnick Admin: $nick requested chan mute list @ $time $date on $chan
}
on *:TEXT:!listwarn:#testing,#admin:{
play $nick c:\mirc\chanwarn.txt
msg $mnick Admin: $nick requested chan warning list @ $time $date on $chan
}
on *:TEXT:!helpbot:#testing,#admin:{
msg $nick AdminBot v1.2 - Simple Help
msg $nick -=-=-=-=-=-=-=-=-=-=-=-=-=-
msg $nick !addban matchtext - Will ban anyone saying matchtext
msg $nick !delban matchtext - Will remove matchtext from the ban list
msg $nick !addmute matchtext - Will mute anyone saying matchtext
msg $nick !delmute matchtext - Will remove matchtext from the mute list
msg $nick !addwarn matchtext - Will warn with T&C URL on saying matchtext
msg $nick !delwarn matchtext - Will remove matchtext from the warning list
msg $nick !listban !listmute and !listwarn echo lists to you in a PM
msg $mnick Admin: $nick requested Adminbot Help @ $time $date on $chan
}
; BAN SECTION
on *:TEXT:!???ban &:#admin,#testing:{
if $1 == !addban {
var %a = $+(*,$2,*)
if !$read(chanban.txt,w,%a) {
write chanban.txt %a
msg # $2 has been added to the chan banlist
msg $mnick Admin: $2 has been added to the chan banlist by $nick @ $time $date
}
else msg # Sorry $2 is already listed on the chan banlist
}
if $1 = !delban {
var %a = $+(*,$2,*)
if $read(chanban.txt,w,%a) {
write -dl $+ $readn chanban.txt
msg # $2 has been removed from the chan banlist
msg $mnick Admin: $2 has been removed from the chan banlist by $nick @ $time $date
}
else msg # Sorry $2 is NOT on the chan banlist
}
if $hget(chanban) { hload -sn chanban chanban.txt }
}
; MUTE SECTION
on *:TEXT:!???mute &:#admin,#testing:{
if $1 == !addmute {
var %a = $+(*,$2,*)
if !$read(chanmute.txt,w,%a) {
write chanmute.txt %a
msg # $2 has been added to the chan Mute list
msg $mnick Admin: $2 has been added to the chan mutelist by $nick @ $time $date
}
else msg # Sorry $2 is already listed on the chan Mute list
}
if $1 = !delmute {
var %a = $+(*,$2,*)
if $read(chanmute.txt,w,%a) {
write -dl $+ $readn chanmute.txt
msg # $2 has been removed from the chan Mute list
msg $mnick Admin: $2 has been removed from the chan mutelist by $nick @ $time $date
hfree -sw chanmute
hmake chanmute 200
hload -sn chanmute chanmute.txt
}
else msg # Sorry $2 is NOT on the chan Mute list
}
if $hget(chanmute) { hload -sn chanmute chanmute.txt }
}
; Warnings SECTION
on *:TEXT:!???warn &:#admin,#testing:{
if $1 == !addwarn {
var %a = $+(*,$2,*)
if !$read(chanwarn.txt,w,%a) {
write chanwarn.txt %a
msg # $2 has been added to the chan Warning Only list
msg $mnick Admin: $2 has been added to the chan warnlist by $nick @ $time $date
}
else msg # Sorry $2 is already listed on the chan Warning Only list
}
if $1 = !delwarn {
var %a = $+(*,$2,*)
if $read(chanwarn.txt,w,%a) {
write -dl $+ $readn chanwarn.txt
msg # $2 has been removed from the chan Warning Only list
msg $mnick Admin: $2 has been removed from the chan warnlist by $nick @ $time $date
hfree -sw chanwarn
hmake chanwarn 200
hload -sn chanwarn chanwarn.txt
}
else msg # Sorry $2 is NOT on the chan Warning Only list
}
if $hget(chanwarn) { hload -sn chanwarn chanwarn.txt }
}
on *:TEXT:*:#users,#testing:{
if $hfind(chanban,$1-,1,W).data {
/msg $nick You have been BANNED for pasting that Inappropriate link/text/word into chan. (This is an Auto BAN)
/msg $mnick Banned $nick for $1- spam @ $time $date on $chan
/msg #admin Bot has Banned $nick ( $mask($fulladdress,3) ) for: $1- @ $time $date on $chan
/msg chanserv BAN $chan $nick
}
if $hfind(chanmute,$1-,1,W).data {
/msg $nick You have been MUTED for pasting that Inappropriate link/text/word into chan. (This is an Auto BAN)
/msg $mnick Muted $nick for $1- spam @ $time $date on $chan
/msg #admin Bot has Muted $nick ( $mask($fulladdress,3) ) for: $1- @ $time $date on $chan
/msg chanserv MUTE $chan $nick
}
if $hfind(chanwarn,$1-,1,W).data {
/msg $nick Please do not repeat what you have Just said in chan (This is an Auto Warning)
/msg $nick If you keep posting the same thing, you will be BANNED!
/msg $mnick Warned $nick for $1- spam @ $time $date on $chan
/msg #admin Bot has Warned Only $nick ( $mask($fulladdress,3) ) for: $1- @ $time $date on $chan
}
}
; Repeat Spamming Section
on @*:TEXT:*:#testing: {
; If the user is repeating, increase the counter
if ( $hget($+(repeattext,$cid,$chan),$address) == $1- ) {
inc -u300 $+(%,repeatcount,$cid,$chan,$address)
; If the user is repeating more than three times, take action
if ( $eval($+(%,repeatcount,$cid,$chan,$address),2) > 3 ) {
; Increase the number of warnings and store the number to %warnings
; Warnings will be remembered for an hour (3600 seconds)
inc -u3600 $+(%,repeatwarnings,$cid,$chan,$address)
var %warnings = $eval($+(%,repeatwarnings,$cid,$chan,$address),2)
if ( %warnings > 2 ) {
msg chanserv BAN $chan $nick
msg $chan $nick has been Banned for Repeat Spamming after %warning warning (AutoBan)
msg $mnick Kicked & Banned $nick ( $mask($fulladdress,3) ) for Flooding @ $time $date on $chan
}
else {
msg chanserv MUTE $chan $nick
msg $chan $nick Stop Repeat Spamming $nick We Get the Point! (AutoMute Warning!)
}
}
}
else {
; If the user isn't repeating, reset the variables
; Set the time limit to five minutes (300 seconds)
hadd -mu300 $+(repeattext,$cid,$chan) $address $1-
; /set and /inc need the -u switch only to clean unneeded variables
set -u300 $+(%,repeatcount,$cid,$chan,$address) 1
}
}