|
Joined: Aug 2006
Posts: 469
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 }
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
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
}
|
|
|
|
learn3r
|
learn3r
|
Isn't it because he didn't included the " auser "
|
|
|
|
Joined: Aug 2006
Posts: 469
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.
|
|
|
|
Joined: Oct 2004
Posts: 8,061
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,061 |
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?
|
|
|
|
Joined: Aug 2006
Posts: 469
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.
|
|
|
|
Scripto
|
Scripto
|
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)
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
I still get this error when I click ON * Invalid format: $iif
|
|
|
|
Scripto
|
Scripto
|
.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)
|
|
|
|
Joined: Aug 2006
Posts: 469
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.
|
|
|
|
Scripto
|
Scripto
|
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.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
when I cycle the channel when its turn ON its freezing my irc.
|
|
|
|
Scripto
|
Scripto
|
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.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Yes am sure cause it only freeze when its turn ON
|
|
|
|
Scripto
|
Scripto
|
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?
|
|
|
|
Joined: Aug 2006
Posts: 469
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.
|
|
|
|
Scripto
|
Scripto
|
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
}
}
}
|
|
|
|
Joined: Aug 2006
Posts: 469
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.
|
|
|
|
Scripto
|
Scripto
|
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
|
|
|
|
Joined: Aug 2006
Posts: 469
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
}
|
|
|
|
Scripto
|
Scripto
|
your statement here ~~> on *:open:?:{ ...also refers to a second while loop within its commands spamdetect $nick, must be changed. mIRC cant execute the second loop when the first one is still running, it will crash (freeze) you every time guaranteed. Ill be back tommorrow my friend
|
|
|
|
Scripto
|
Scripto
|
Give this a shot. You will have to test it... Let me know what errors you get, we will go from there.
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
.timer. $+ $nick 1 1 spamdetect $nick
halt
}
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-) {
.timer. $+ $nick 1 1 spamdetect $nick
halt
}
inc %cnt
}
}
}
alias spamdetect {
var %a = $comchan($1,0).op
while (%a > 0) {
ban -ku3600 $comchan($1,%a).op $1 2 14Private Offensive Language
}
dec %a
}
Copy and paste the whole thing, i did change the spamdetect alias a little... its on a timer now, so it wont crash your mIRC. Ill try to watch the board later on, I have some calculus homework to attend to
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
ok thx, got this error * /ban: invalid parameters (line 72, dialog55.op)
Last edited by Garou; 08/02/07 03:19 PM.
|
|
|
|
Scripto
|
Scripto
|
Ok... try changing your spamdetect alias to this
alias spamdetect {
var %a = $comchan($1,0).op
while (%a > 0) {
ban -ku3600 $comchan($1,%a).op $1 14Private Offensive Language
}
dec %a
}
Im not particularly fond of using a while loop to ban and kick, but that is the format you had, so that is what we will use for now. Loops are fast, it could have the potential to flood you off of the server. I prefer to use a .timer -m 250 on an alias to kick, it slows things down a little. But for now, lets just use what you have until it doesnt work... lol
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
same error
* /ban: invalid parameters (line 72, dialog55.op)
|
|
|
|
Scripto
|
Scripto
|
hmm, i havent installed 6.21 (shame on me) but im not sure what the dialog55.op error is referring to. There must be an issue with the $comchan identifier... let me write this loop slightly different, to see if we can go around it.
|
|
|
|
Scripto
|
Scripto
|
alias spamdetect {
var %a = $comchan($1,0)
while (%a > 0) {
if ($me isop $comchan($1,%a)) {
ban -ku3600 $comchan($1,%a) $1 14Private Offensive Language
}
dec %a
}
}
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Cool its working now but its not exempting op anyway to exempt op?
|
|
|
|
Scripto
|
Scripto
|
you mean to not kick other ops?
alias spamdetect {
var %a = $comchan($1,0)
while (%a > 0) {
if ($me isop $comchan($1,%a)) && (($1 !isop $comchan($1,%a)) || ($1 !ishop $comchan($1,%a))) {
ban -ku3600 $comchan($1,%a) $1 14Private Offensive Language
}
dec %a
}
}
This is set up so that ($me isop $chan) and when $nick does not have (ops or halfops)
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Thank you very much bro, All is working fine :P
|
|
|
|
Scripto
|
Scripto
|
cool  youre welcome
|
|
|
|
learn3r
|
learn3r
|
(($1 !isop $comchan($1,%a)) || ($1 !ishop $comchan($1,%a))) why not use alias spamdetect {
var %i = 1
if $comchan($nick,0) {
while $comchan($nick,%i) {
var %c = $v1
if $me isop %c && $nick isreg %c { ban -ku600 %c $nick 2 14Private Offensive Language }
inc %i
}
}
}
|
|
|
|
Scripto
|
Scripto
|
that would work  $nick would have to be $1 though, $nick is evalutated directly in the original script and its identifying value would be lost in transition from timer to alias.
|
|
|
|
learn3r
|
learn3r
|
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
.timer. $+ $nick 1 1 spamdetect
halt
}
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-) {
.timer. $+ $nick 1 1 spamdetect
halt
}
inc %cnt
}
}
}
alias spamdetect {
var %i = 1
if $comchan($nick,0) {
while $comchan($nick,%i) {
var %c = $v1
if $me isop %c && $nick isreg %c { ban -ku600 %c $nick 2 14Private Offensive Language }
inc %i
}
}
}
|
|
|
|
Scripto
|
Scripto
|
"$nick" has to be "$1" in the spamdetect alias... all the way through it. Otherwise it will not identify. The information in "$nick" is lost in the transition from timer to alias.
The isreg identifier wont moderate voiced users. He said he wanted only op exempt and isreg would do that, however, it would not include voiced users on the channel. It would result in the same length of that line to catch voices as well, which is why i submitted it that way.
|
|
|
|
learn3r
|
learn3r
|
did you tried it and didn't worked?
|
|
|
|
Scripto
|
Scripto
|
No, I did not test it, identifiers have always been formatted in that manner. It will not work as $nick. $nick will not retain its value through the transition of time into the .timer's command when set up like this. It will retain it within the original script, but once you use a timer for a custom alias like this, the value of "$nick" is lost and becomes "$1" to the custom alias. Once that timer is set... the value of $1 is filled to that specific timer alias command, until that timer is either performed, or reset, or shut off. In other words, (I'll see if i can explain it a little better) the value of $nick is filled when an event occurs. (join, notice, part.. etc. etc) While commands are being performed under that event, directly in that script, $nick will have whatever value it was filled with. However, when you leave the event, and go onto an alias with a timer (which in this case is 'spamdetect'...and it had to be a timer, to break out of the while loop, because spamdetect is a second loop, two 'while' loops cant operate at the same time) mIRC has no idea what $nick youre talking about... it must drop it, in case other events occur. $nick only holds 1 value within mIRC at a single time. So for instance, if I had said .timer 1 25 spamdetect $nick... And another event occured like a join or a part or a quit, that needed to re-fill $nick with information, then spamdetect would be kicking the newly filled information of $nick. That is why mIRC is set up this way. It stops 'lines' from being crossed. It would have to retain the value of $nick until that timer went off twenty-five full seconds later, It doesnt keep track of it as $nick, because the information was identified as $1, to the alias to free up the $nick identifier. Try it out, write a short alias that does something simple like echo something....
on ^*:JOIN:#:{
echo -a here is the event value of nick ~~> $nick
.timer.testnick 1 5 nickinfo $nick
}
alias nickinfo {
echo -a here is the info of nick ~~> $nick
echo -a here is the info of string 1 ~~~> $1
}
nickinfo will retain whatever $1 is, and/or $2 or $3... etc. identifiers work this way, try it with $chan and $nick both.
on ^*:JOIN:#:{
echo -a here is the event value of nick and chan ~~> $nick joined $chan
.timer.testnick 1 5 nickinfo $nick $chan
}
alias nickinfo {
echo -a here is the info of nick and channel ~~> $nick joined $chan
echo -a here is the info of string 1 and string 2~~~> $1 joined $2
}
|
|
|
|
learn3r
|
learn3r
|
.timer.testnick 1 5 nickinfo $nick i didn't use spamdetect $nick spamdetect only and it's working
|
|
|
|
Scripto
|
Scripto
|
I just tested this, using only an alias with no identifier behind it, and the same result occurs, the information is lost. It does not work. $nick must be $1 or the parameter is empty. Try the two examples I posted. $nick returns $null after the timer, and $1 returns what was in $nick. $nick will not be re-evaluated in the format I explained  $1 is referred to as the parameter string of an alias. type /help aliases
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
|
|
|
|
|