Link block error - 28/05/14 03:51 AM
I did not think I would find myself here over a script that I had working 2 days ago, but my link blocking script started to not respond earlier today. After recoding it 6 times and reorganizing it over 4+ ways, I have finally come to and decided that it may be better to receive some assistance.
What it is doing:
It currently kicks the user if they post a link when !linkblock is enabled. That works completely fine, but if someone that is not a moderator or above posts a link when !linkblock is disabled, it does not kick the user which it is supposed to do, but it actually deletes the link and leaves plain text: "<deleted link>"; not a hyperlink as usual. It should allow them to post a link I would think since it halts when linkblock is off, but it does nothing but remove the link at all times if the user is not a higher rank than bot(op) and even when I !allow them to post a link; that is the line that checks for the user's allowance:
My left hand fingers are tired of typing this thing out over and over attempting to debug since I don't have a right hand to type with. Hopefully someone can shine the light on the solution.
What it is doing:
It currently kicks the user if they post a link when !linkblock is enabled. That works completely fine, but if someone that is not a moderator or above posts a link when !linkblock is disabled, it does not kick the user which it is supposed to do, but it actually deletes the link and leaves plain text: "<deleted link>"; not a hyperlink as usual. It should allow them to post a link I would think since it halts when linkblock is off, but it does nothing but remove the link at all times if the user is not a higher rank than bot(op) and even when I !allow them to post a link; that is the line that checks for the user's allowance:
Code:
if ($readini(clientvars.ini,$chan,$+($nick,.,link)) == 1) { /remini clientvars.ini $chan $+($nick,.,link) | /halt }
My left hand fingers are tired of typing this thing out over and over attempting to debug since I don't have a right hand to type with. Hopefully someone can shine the light on the solution.
Code:
on *:TEXT:*:#:{ if ($readini(clientvars.ini,$chan,linkblock) != on) { /halt } if $hget(moderators, $nick) { /halt } if ($nick == %developer) { /halt } if ($nick == $readini(clientvars.ini,$chan,broadcaster)) { /halt } if ($readini(clientvars.ini,$chan,$+($nick,.,link)) == 1) { /remini clientvars.ini $chan $+($nick,.,link) | /halt } if $regex(url, $1-, \b[a-zA-Z0-9._%+-]+\.(?:[a-zA-Z]{2}|aero|asia|biz|cat|com|coop|eus|gal|info|int|jobs|mobi|museum|name|net|org|post|pro|tel|travel|xxx|edu|gov|mil|tv)\b) { if (!%linkabuse. [ $+ [ $nick ] $+ . $+ [ $chan ] ]) { set -u480 %linkabuse. [ $+ [ $nick ] $+ . $+ [ $chan ] ] 0 } if (%linkabuse. [ $+ [ $nick ] $+ . $+ [ $chan ] ] != $null) && (%linkabuse. [ $+ [ $nick ] $+ . $+ [ $chan ] ] <= 2) { msg $chan .timeout $nick 1 echo 4 Timeout $nick - posted link if ($readini(clientvars.ini,$chan,stealth) == off) { msg $chan $nick $+ -> $read(timemsg.ini) $+ ! [warning] inc %linkabuse. [ $+ [ $nick ] $+ . $+ [ $chan ] ] /halt } } else { msg $chan .timeout $nick 360 echo 4 Timeout $nick - posted link if ($readini(clientvars.ini,$chan,stealth) == off) { msg $chan $nick $+ -> You have posted too many links. Please take 6 minutes away from chat. /halt } } }