This script is meant to go on a bot to protect a channel. There is more to come slowly
Thanks to all who helped. Thanks typo for the advertisement part. I promise I'll learn sooner or later xD
on *:LOAD: {
if (!%Nick) { set set %Nick $$?="Please enter the bots main nick." }
if (!%pass) { set %pass $$?*="Please enter the bots password here." }
if (!%network) { set %network $$?="Enter the network you want the bot to run on." }
if (!%channel) { set %channel $$?="Please enter the bots channel starting with the pound sign #" }
if (!%botmaster) { set %botmaster $$?="Enter your nick or the head administrators nick." }
auser 5 %botmaster
}
on *:connect:%network:{
nick %Nick
ns identify %pass
}
on *:disconnect:%network:{
timer 1 60 server %network
}
On *:TEXT:*:%channel: {
If (bitch isin $1-) || (fuck isin $1-) || (whore isin $1-) || (nigger isin $1-) || (slut isin
$1-) || (cunt isin $1-) || (kike isin $1-) {
Msg %channel Do not cuss $nick
.timer 1 4 ban %channel $nick
.timer 1 3 Kick %channel $nick
}
on *:text:*:%channel:{
var %numofwords 1
while (%numofwords <= $0) {
if ($left($($chr(36) $+ %numofwords,2),1) == $chr(35)) {
Msg %channel no advertisments $nick
ban %channel $nick 300
kick %channel $nick
}
inc %numofwords
}
}
You have used 'set' twice..
set set %Nick $$?="Please enter the bots main nick."
Add a timer with an -u switch..
ban %channel $nick 300
Add a -k switch to perform a kickban..
.timer 1 4 ban %channel $nick
.timer 1 3 Kick %channel $nick
You want to reconnect the server after 60 seconds? Silence timer(s)...
on *:disconnect:%network:{
timer 1 60 server %network
}
Having trouble sleeping and noticed this script so figured I would comment.
You need to try and slow down a little bit man.
Your releasing better quality stuff than before because it shows that your thinking now and you arent ripping anything which is great but your still in a hurry to release things and you should be taking more time with your codes.
For one your title says complete channel protection and this is far from that.
Like mountaindew said, the way your processing the cusswords is wrong. Your using && instead of || which will make it so all the words must be present instead of just one of them. This shows a real lack of testing.
Your second on text event is a really bad way to catch channel advertisements. The only ones it will catch are when the channel is the first word in the sentence. The best way is regex but thats a little too complicated for you so instead I will show you a way you can do it with coding you know.
The idea here is to individually process each word in the entered text and see if the left character is a pound sign.
on *:text:*:#testing1234:{
var %numofwords 1
while (%numofwords <= $0) {
if ($left($($chr(36) $+ %numofwords,2),1) == $chr(35)) {
Msg %channel no advertisments $nick
Tban %channel $nick 300
kick %channel $nick
}
inc %numofwords
}
}
You really need to take a little more time with the coding before release and always test test test. It's a waste of everyones time when you make them tell you that your script doesnt even work right. We all miss some errors now and again but missing the scripts basic functions not working shows a complete lack of any testing.
Anyhow I'm going go figure out if I want to try and sleep or just give up and plan for a nap later. Keep up the improving. :)
On *:TEXT:*:%channel: {
If (bitch isin $1-) || (fuck isin $1-) || (whore isin $1-) || (nigger isin $1-) || (slut isin $1-) || (cunt isin $1-) || (kike isin $1-) { Msg %channel Do not cuss $nick
.timer 1 4 Tban %channel $nick 300
.timer 1 3 Kick %channel $nick
}
should be
On *:TEXT:*:%channel: {
If (bitch isin $1-) || (fuck isin $1-) || (whore isin $1-) || (nigger isin $1-) || (slut isin $1-) || (cunt isin $1-) || (kike isin $1-) {
Msg %channel Do not cuss $nick
.timer 1 4 Tban %channel $nick 300
.timer 1 3 Kick %channel $nick
}
}