mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2013
Posts: 15
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2013
Posts: 15
i have searched a long time and also tried allot different things but i cant get this code to fully work.. i got it from an old post on a forum.

its for timing out people on twitch who post links. that works perfectly fine but when i try to !permit someone it does nothing.
i have tried allot and cant find anything for it.

Code:
on @*:text:*:#:linkpost $1- 
on @*:action:*:#:linkpost $1- 
on @*:notice:*:#:linkpost $1- 
alias -l linkpost { 
    if ((!%p) && (!$hfind(permit,$nick))) { inc -u4 %p 
        var %purge /^!(link\so(n|ff)|(permit))\b/iS 
        var %domain com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk|ly|gl|gd|do|ai|be
        var %link /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS 
        if ($findtok(%chanon,#,1,32)) && ($nick(#,$nick,vr)) && ($regex($1-,%link)) { 
            msg # .timeout $nick 1
            msg # Bad $nick $+ ! Ask a moderator to permit you befor posting links. 
        } 
        elseif (($regex($1-,%purge)) && ($regml(1) = permit) && ($nick isop #) && ($$2 ison #)) { 
            hadd -mz permit $v1 60 | notice $v1 You have 60 seconds to post a link. Starting now! 
        } 
        elseif (($regml(1) = link on) && ($nick isop #)) { 
            goto $iif(!$istok(%chanon,#,32),a,b) | :a | set %chanon $addtok(%chanon,#,32) 
            .msg # My Link Protection Is Now on in: $+($chr(2),#) 
            halt | :b | .msg # $nick $+ , link protection is already on in $& 
            $+($chr(2),#,$chr(2)) ! 
        } 
        elseif (($regml(1) = link off) && ($nick isop #)) { 
            goto $iif($istok(%chanon,#,32),c,d) | :c | set %chanon $remtok(%chanon,#,1,32) 
            .msg # My Link Protection Is Now off in: $+($chr(2),#) 
            halt | :d | .msg # $nick $+ , link protection is already off . $& 
            ! 
        } 
    } 
}


i hope someone could help me.

Last edited by panda_jorstar; 16/10/13 11:27 PM.
Joined: Aug 2013
Posts: 33
F
Ameglian cow
Offline
Ameglian cow
F
Joined: Aug 2013
Posts: 33
Code:
on @*:text:*:#:linkpost $1- 
on @*:action:*:#:linkpost $1- 
on @*:notice:*:#:linkpost $1- 
alias -l linkpost { 
  if ((!%p) && (!$hfind(permit,$nick))) { inc -u4 %p 
    var %purge /^!(link\so(n|ff)|(permit))\b/iS 
    var %domain com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk|ly|gl|gd|do|ai|be
    var %link /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS 
    if ($findtok(%chanon,#,1,32)) && ($nick(#,$nick,vr)) && ($regex($1-,%link)) { 
      msg # .timeout $nick 1
      msg # Bad $nick $+ ! Ask a moderator to permit you before posting links. 
    } 
    elseif (($regex($1-,%purge)) && ($regml(1) = permit) && ($nick isop #) && ($$2 ison #)) { 
      hadd -mz permit $v1 60 | notice $v1 You have 60 seconds to post a link. Starting now! 
    } 
    elseif (($regml(1) = link on) && ($nick isop #)) { 
      goto $iif(!$istok(%chanon,#,32),a,b) | :a | set %chanon $addtok(%chanon,#,32) | msg # My Link Protection Is Now on in: $+($chr(2),#) 
      halt | :b | msg # $nick $+ , link protection is already on. 
    } 
      elseif (($regml(1) = link off) && ($nick isop #)) { 
      goto $iif($istok(%chanon,#,32),c,d) | :c | set %chanon $remtok(%chanon,#,1,32) | msg # My Link Protection Is Now off in: $+($chr(2),#) 
      halt | :d | msg # $nick $+ , link protection is already off.
    } 
  } 
}

How about this?
Though I have no idea what: "$+($chr(2),#)" is supposed to do. Give the channel's name?

Also: Try and remove all the "#"s and change them into: "$chan".

Last edited by Farcrada; 17/10/13 11:18 AM.
Joined: Aug 2013
Posts: 15
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2013
Posts: 15
thanx for the try but that won't be of any help..

the # is the same as $chan so that doesn\'t matter and the "$+($chr(2),#)" is for saying in what channel it is

and the only problem is that the !permit doesn't work all the other stuff works fine

Joined: Aug 2013
Posts: 81
I
Babel fish
Offline
Babel fish
I
Joined: Aug 2013
Posts: 81
Just to be sure, an op is using this command to permit someone on the channel to use links, right? e,g:

Originally Posted By: Example
<@SomeOp> !permit SomeUser

Joined: Aug 2013
Posts: 15
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2013
Posts: 15
yes that is right

Joined: Aug 2013
Posts: 33
F
Ameglian cow
Offline
Ameglian cow
F
Joined: Aug 2013
Posts: 33
Well, then it isn't the script. If the script I posted doesn't work, then it's not the script. I use the same and many more and it works just fine.

And like Lire already said: An Op needs to do the !permit. unless you've changed that, of course.

Joined: Aug 2013
Posts: 15
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2013
Posts: 15
well, i use this script on twitch.. or maybe can it be that i have to reinstall mirc or that i have to change the -l since i use multiple scripts .. i dont rly know actually :P


Joined: Aug 2013
Posts: 33
F
Ameglian cow
Offline
Ameglian cow
F
Joined: Aug 2013
Posts: 33
Honestly... I use 13 different scripts. Have not removed or edited the "-l" part.

Other than that: Have you tried the script I posted?

Joined: Aug 2013
Posts: 15
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Aug 2013
Posts: 15
i just found out the !permit works but it doesn't give me the message like it should so when i permit someone it doesnt say they have 60 seconds to post a link

Joined: Aug 2013
Posts: 33
F
Ameglian cow
Offline
Ameglian cow
F
Joined: Aug 2013
Posts: 33
That's because you use notice. Twitch works with messages.


Link Copied to Clipboard