not working
#170307
06/02/07 11:20 PM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Can anyone see why this is not working?
on *:start:{ if !$hget(BadWords) { .hmake BadWords 10 } if $exists(BadWords.hsh) { .hload BadWords BadWords.hsh } } on *:exit:{ .hsave -o BadWords BadWords.hsh } on *:disconnect:{ .hsave -o BadWords BadWords.hsh }
menu menubar { - Private Offensive Message .Turn $iif($hget(BadWords,0),Off,On) : .hadd -m BadWords 0 $iif($hget(BadWords,0),$false,$true .- .Add a word : .hadd -m BadWords $$?="Bad Word to be added" $true .- .Remove a word : .hdel BadWords $$?="Bad Word to be removed" .- .List Spam Words : bad_words_list .- } alias -l bad_words_list { var %a = 1, %b = $hget(BadWords,0).item unset %badwords while %a <= %b { set %badwords $addtok(%badwords,$hget(BadWords,%a).item,32) if $numtok(%badwords,32) + $len(%badwords) > 900 { echo -a $replace(%badwords,$chr(32),$+($chr(44),$chr(32))) unset %badwords } inc %a } if %badwords { echo -a $replace(%badwords,$chr(32),$+($chr(44),$chr(32))) unset %badwords } } on *:open:?:{ if $ulevel != op && $hget(BadWords,0) { var %cnt = 1 while (%cnt <= $hget(BadWords,0).item) { if $hget(BadWords,%cnt).item isin $1- { close -m $nick spamdetect $nick } else { inc %cnt } } } }
on ^*:notice:*:?: { if (!$istok(ChanServ NickServ MemoServ,$nick,32)) && $hget(BadWords,0) { var %cnt = 1 while (%cnt <= $hget(BadWords,0).item) { if $hget(BadWords,%cnt).item isin $1- { spamdetect $nick haltdef } else { inc %cnt } } } }
alias spamdetect { var %a = 1 while $comchan($1,%a).op { ban -ku3600 $v1 $1 2 14Private Offensive Language } inc %a }
|
|
|
Re: not working
[Re: Garou]
#170308
06/02/07 11:44 PM
|
Joined: Oct 2004
Posts: 8,330
Riamus2
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Would you like to explain what exactly isn't working? And are there errors you see? Just as a quick, miscellaneous note... /hmake, /hsave, and /hload are already silent except if there is an error message. So there isn't a need to put a . there. If there IS an error message, it would be good to actually SEE it.  Also, here is your code inside code tags so that it can be read more easily. Please use code tags whenever you post code on the forum. 
on *:start:{
if !$hget(BadWords) { .hmake BadWords 10 }
if $exists(BadWords.hsh) { .hload BadWords BadWords.hsh }
}
on *:exit:{
.hsave -o BadWords BadWords.hsh
}
on *:disconnect:{
.hsave -o BadWords BadWords.hsh
}
menu menubar {
-
Private Offensive Message
.Turn $iif($hget(BadWords,0),Off,On) : .hadd -m BadWords 0 $iif($hget(BadWords,0),$false,$true
.-
.Add a word : .hadd -m BadWords $$?="Bad Word to be added" $true
.-
.Remove a word : .hdel BadWords $$?="Bad Word to be removed"
.-
.List Spam Words : bad_words_list
.-
}
alias -l bad_words_list {
var %a = 1, %b = $hget(BadWords,0).item
unset %badwords
while %a <= %b {
set %badwords $addtok(%badwords,$hget(BadWords,%a).item,32)
if $numtok(%badwords,32) + $len(%badwords) > 900 {
echo -a $replace(%badwords,$chr(32),$+($chr(44),$chr(32)))
unset %badwords
}
inc %a
}
if %badwords {
echo -a $replace(%badwords,$chr(32),$+($chr(44),$chr(32)))
unset %badwords
}
}
on *:open:?:{
if $ulevel != op && $hget(BadWords,0) {
var %cnt = 1
while (%cnt <= $hget(BadWords,0).item) {
if $hget(BadWords,%cnt).item isin $1- {
close -m $nick
spamdetect $nick
}
else { inc %cnt }
}
}
}
on ^*:notice:*:?: {
if (!$istok(ChanServ NickServ MemoServ,$nick,32)) && $hget(BadWords,0) {
var %cnt = 1
while (%cnt <= $hget(BadWords,0).item) {
if $hget(BadWords,%cnt).item isin $1- {
spamdetect $nick
haltdef
}
else { inc %cnt }
}
}
}
alias spamdetect {
var %a = 1
while $comchan($1,%a).op {
ban -ku3600 $v1 $1 2 14Private Offensive Language
}
inc %a
}
Invision Support #Invision on irc.irchighway.net
|
|
|
Re: not working
[Re: Riamus2]
#170316
07/02/07 01:52 AM
|
Joined: Oct 2006
Posts: 342
learn3r
Fjord artisan
|
Fjord artisan
Joined: Oct 2006
Posts: 342 |
Isn't it because he didn't included the " auser "
learn learn learn
|
|
|
Re: not working
[Re: learn3r]
#170326
07/02/07 04:09 AM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Ya sorry its adding auto op to my userlist. I dont need the auser stuff in it but i tink it was there to exempt op but its acting weird on me.
Last edited by Garou; 07/02/07 07:04 AM.
|
|
|
Re: not working
[Re: learn3r]
#170340
07/02/07 02:10 PM
|
Joined: Oct 2004
Posts: 8,330
Riamus2
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
I don't see any reason to use /auser. He's just banning anyone, other than people who have the op user level, who uses specific words.
Again, Garou... what isn't working with it?
Invision Support #Invision on irc.irchighway.net
|
|
|
Re: not working
[Re: Riamus2]
#170349
07/02/07 02:44 PM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
I dont use /auser and thats is whats not working. Its auto adding op that are in my channel to my auto op list and this is my problem I am having.
I also get this error * Invalid format: $iif
Last edited by Garou; 07/02/07 02:51 PM.
|
|
|
Re: not working
[Re: Garou]
#170355
07/02/07 04:42 PM
|
Joined: Dec 2006
Posts: 80
Scripto
Babel fish
|
Babel fish
Joined: Dec 2006
Posts: 80 |
In your alias bad_words_list...
if $numtok(%badwords,32) + $len(%badwords) > 900 <~~~ This line requires the use of the $calc identifier, it will not add without it.
if ($calc($numtok(%badwords,32) + $len(%badwords)) > 900)
Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
|
|
|
Re: not working
[Re: Scripto]
#170358
07/02/07 05:15 PM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
I still get this error when I click ON * Invalid format: $iif
|
|
|
Re: not working
[Re: Garou]
#170359
07/02/07 05:19 PM
|
Joined: Dec 2006
Posts: 80
Scripto
Babel fish
|
Babel fish
Joined: Dec 2006
Posts: 80 |
.hadd -m BadWords 0 $iif($hget(BadWords,0),$false,$true <~~~ close it, on the end here.
The lack of 'close' parenthesis would deem it as having invalid format/parameters.
.hadd -m BadWords 0 $iif($hget(BadWords,0),$false,$true)
Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
|
|
|
Re: not working
[Re: Scripto]
#170360
07/02/07 05:40 PM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Ok cool, why is it when I turn it on it also adds 0 in the listing and when I cycle the channel when its turn ON it freezing my irc.
Last edited by Garou; 07/02/07 05:44 PM.
|
|
|
Re: not working
[Re: Garou]
#170361
07/02/07 05:43 PM
|
Joined: Dec 2006
Posts: 80
Scripto
Babel fish
|
Babel fish
Joined: Dec 2006
Posts: 80 |
Because your line states, hadd -m BadWords 0 $iif($hget(BadWords,0),$false,$true) you have 0 listed as the item behind BadWords, that is format for /hadd. Whatever you list behind BadWords is the item its going to add to, if 0 is not an item, its going to create it as a new item in the table.
Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
|
|
|
Re: not working
[Re: Garou]
#170362
07/02/07 05:46 PM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
when I cycle the channel when its turn ON its freezing my irc.
|
|
|
Re: not working
[Re: Garou]
#170363
07/02/07 05:51 PM
|
Joined: Dec 2006
Posts: 80
Scripto
Babel fish
|
Babel fish
Joined: Dec 2006
Posts: 80 |
I dont see any text, join, or part commands, there is nothing that a cycle would trigger to freeze...
Are you sure its this script doing it?
...usually freezes come from bad loops. Loops are a good place to start looking anyhow. This script doesn't have any that would trigger on a cycle though.
Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
|
|
|
Re: not working
[Re: Scripto]
#170364
07/02/07 05:54 PM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Yes am sure cause it only freeze when its turn ON
|
|
|
Re: not working
[Re: Garou]
#170365
07/02/07 06:04 PM
|
Joined: Dec 2006
Posts: 80
Scripto
Babel fish
|
Babel fish
Joined: Dec 2006
Posts: 80 |
Are you disconnecting, and then connecting, or just doing a channel /hop?
the on notice...
...hmm, let me look... the channel notice, that might be doing it. Is there an onjoin channel notice?
Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
|
|
|
Re: not working
[Re: Scripto]
#170366
07/02/07 06:06 PM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
both, if I cycle or re-login when its turn ON it will freeze my irc. I also got this error now * /ban: invalid parameters (line 73, dialog55.op)
Last edited by Garou; 07/02/07 06:24 PM.
|
|
|
Re: not working
[Re: Garou]
#170368
07/02/07 06:27 PM
|
Joined: Dec 2006
Posts: 80
Scripto
Babel fish
|
Babel fish
Joined: Dec 2006
Posts: 80 |
You are trying to execute two while loops at the same time.
on ^*:notice:*:?: {
if (!$istok(ChanServ NickServ MemoServ,$nick,32)) && $hget(BadWords,0) {
var %cnt = 1
while (%cnt <= $hget(BadWords,0).item) {
if $hget(BadWords,%cnt).item isin $1- {
spamdetect $nick
haltdef
}
else { inc %cnt }
}
}
}
alias spamdetect {
var %a = 1
while $comchan($1,%a).op {
ban -ku3600 $v1 $1 2 14Private Offensive Language
}
inc %a
}
First your !$istok line is not evaluating properly... change it to this:
var %oknames = ChanServ NickServ MemoServ
if ($nick !isin %oknames) && $hget(BadWords,0) {
Then you will have to ban and kick the nick in the first loop. You have spamdetect $nick as a second loop that would be trying to operate while the first one is still working, this will freeze your mIRC.
on ^*:notice:*:?: {
var %oknames = ChanServ NickServ MemoServ
if ($nick !isin %oknames) && $hget(BadWords,0) {
var %cnt = 1
while (%cnt <= $hget(BadWords,0).item) {
if $hget(BadWords,%cnt).item isin $1- {
if ($me isop $chan) {
/ban -ku3600 $chan $nick
halt
}
}
else inc %cnt
}
}
}
Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
|
|
|
Re: not working
[Re: Scripto]
#170369
07/02/07 06:34 PM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
ok cool now i got this error * /ban: invalid parameters (line 77, dialog55.op)
Last edited by Garou; 07/02/07 06:48 PM.
|
|
|
Re: not working
[Re: Garou]
#170371
07/02/07 06:50 PM
|
Joined: Dec 2006
Posts: 80
Scripto
Babel fish
|
Babel fish
Joined: Dec 2006
Posts: 80 |
If you want to kick the user from all the channels youre on, you will have to break out of the while loop before you can use another loop for kicking. You could try to set this up by triggering a timer instead of the /ban -ku. Instead of saying /ban -ku3600 $chan $nick, say: set %kicknick $nick .timer.allkick $comchan($nick,0) 1 kickalias Then just write a kick alias that will kick %kicknick from all channels that youre an op on. It will halt the loop, and start a timer, instead of trying to execute two loops within one another. I would write it out for ya, but i have to get scootin here. If you can't get it, Ill stop back in tomorrow, or perhaps one of the commorades here will jump in and fix this thing up for ya. Its almost there  Good luck
Scripto ---- Life is about the relationships. The correct code being: $replace($them,$you,$me)
|
|
|
Re: not working
[Re: Scripto]
#170372
07/02/07 06:56 PM
|
Joined: Aug 2006
Posts: 469
Garou
OP
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
ok here wat i have so far. on *:start:{
if !$hget(BadWords) { .hmake BadWords 10 }
if $exists(BadWords.hsh) { .hload BadWords BadWords.hsh }
}
on *:exit:{
.hsave -o BadWords BadWords.hsh
}
on *:disconnect:{
.hsave -o BadWords BadWords.hsh
}
menu menubar {
-
Private Offensive Message
.Turn $iif($hget(BadWords,0),Off,On) : .hadd -m BadWords 0 $iif($hget(BadWords,0),$false,$true)
.-
.Add a word : .hadd -m BadWords $$?="Bad Word to be added" $true
.-
.Remove a word : .hdel BadWords $$?="Bad Word to be removed"
.-
.List Spam Words : .bad_words_list
.-
}
alias -l bad_words_list {
var %a = 1, %b = $hget(BadWords,0).item
unset %badwords
while %a <= %b {
set %badwords $addtok(%badwords,$hget(BadWords,%a).item,32)
if ($calc($numtok(%badwords,32) + $len(%badwords)) > 900) {
echo -a $replace(%badwords,$chr(32),$+($chr(44),$chr(32)))
unset %badwords
}
inc %a
}
if %badwords {
echo -a $replace(%badwords,$chr(32),$+($chr(44),$chr(32)))
unset %badwords
}
}
on *:open:?:{
if $ulevel != op && $hget(BadWords,0) {
var %cnt = 1
while (%cnt <= $hget(BadWords,0).item) {
if $hget(BadWords,%cnt).item isin $1- {
close -m $nick
spamdetect $nick
}
else { inc %cnt }
}
}
}
on ^*:notice:*:?: {
var %oknames = ChanServ NickServ MemoServ
if ($nick !isin %oknames) && $hget(BadWords,0) {
var %cnt = 1
while (%cnt <= $hget(BadWords,0).item) {
if $hget(BadWords,%cnt).item isin $1- {
if ($me isop $chan) {
/ban -ku3600 $chan $nick
halt
}
}
else inc %cnt
}
}
}
alias spamdetect {
var %a = 1
while $comchan($1,%a).op {
ban -ku3600 $v1 $1 2 14Private Offensive Language
}
inc %a
}
|
|
|
|
|