mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#244733 24/03/14 12:39 PM
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
I've looked all over the forums for a twitch.tv link block that works but none have.

If someone could make one that would /timeout $nick 1
and have a !permit (nick) [would expect a $$2 in there]


Here is a broken one someone could just fix up if they don't want to make a whole new one http://pastebin.com/1R9S8TY4


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
The code you presented is already fully working.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
When i put it in my script and someone post a link it does not to the person or say the message...


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Do you have any other scripts starting with
Code:
 on *:text:*:#: 
?

This code will interpret any text made in the chat, thus having any code under this code won't ever be interpreted.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
yes, i do have TEXT commands. So you say if the script is above the text commands then it will work? I also don't want to break those commands.


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Combine them then. I assume the other commands you set up use aliases as well?

Then you can just combine it by
Code:
on *:text:*:#: { 
linkpost $1-
otheralias $1- 
}


Or you can just take the parts you want out of the alias and make your own code.

Code:
    var %links /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domains $+ )\b/iS
    if ($regex($1-,%links)) { 
      .msg # /timeout $nick 1

Is quite literally all you'll need to make a link block.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Originally Posted By: Nillen
Combine them then. I assume the other commands you set up use aliases as well?

Then you can just combine it by
Code:
on *:text:*:#: { 
linkpost $1-
otheralias $1- 
}



Or you can just take the parts you want out of the alias and make your own code.

Code:
    var %links /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domains $+ )\b/iS
    if ($regex($1-,%links)) { 
      .msg # /timeout $nick 1

Is quite literally all you'll need to make a link block.

None of my other commands use aliases. So how would i go about this now?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2004
Posts: 359
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
Originally Posted By: judge2020

None of my other commands use aliases. So how would i go about this now?


The easiest way is to just put the link script into a new remote file. (File > New when you're on the Remotes tab)

You can use the View menu option to switch between the different script files in the editor.

Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Originally Posted By: LostServ
Originally Posted By: judge2020

None of my other commands use aliases. So how would i go about this now?


The easiest way is to just put the link script into a new remote file. (File > New when you're on the Remotes tab)

You can use the View menu option to switch between the different script files in the editor.

seems to not be timing people out. Also no error messages come up when a link is posted. help?


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2004
Posts: 359
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
Originally Posted By: judge2020
Originally Posted By: LostServ
Originally Posted By: judge2020

None of my other commands use aliases. So how would i go about this now?


The easiest way is to just put the link script into a new remote file. (File > New when you're on the Remotes tab)

You can use the View menu option to switch between the different script files in the editor.

seems to not be timing people out. Also no error messages come up when a link is posted. help?


Post the code you have, please. smile

Last edited by LostServ; 02/04/14 07:41 PM.
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Originally Posted By: LostServ
Originally Posted By: judge2020
Originally Posted By: LostServ
Originally Posted By: judge2020

None of my other commands use aliases. So how would i go about this now?


The easiest way is to just put the link script into a new remote file. (File > New when you're on the Remotes tab)

You can use the View menu option to switch between the different script files in the editor.

seems to not be timing people out. Also no error messages come up when a link is posted. help?


Post the code you have, please. smile

I took your advice and put it in a different file:
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
    var %link /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %domain $+ )\b/iS 
    if ($findtok(%chanon1,#,1,32)) && ($nick(#,$nick,vr)) && ($regex($1-,%link)) { 
      timeout # $nick | /mode # -b $nick 
      msg # $nick You did not have permission to post a link ask a mod to !permit you 
      msg # .timeout $nick 1
    } 
    elseif (($regex($1-,%purge)) && ($regml(1) = permit) && ($nick isop #) && ($$2 ison #)) { 
      hadd -mz permit $v1 30 | notice $v1 You have 30 seconds to post a link. Starting now! 
      msg # You now have 30 seconds to post a link!
    } 
    elseif (($regml(1) = link on) && ($nick isop #)) { 
      goto $iif(!$istok(%chanon1,#,32),a,b) | :a | set %chanon1 $addtok(%chanon,#,32) 
      .msg # My Link Protection Is Now on in: $+($chr(2),#) 
      halt | :b | .msg # $nick $+ , my link protection is already on in $& 
        $+($chr(2),#,$chr(2)) ! 
    } 
    elseif (($regml(1) = link off) && ($nick isop #)) { 
      goto $iif($istok(%chanon1,#,32),c,d) | :c | set %chanon1 $remtok(%chanon,#,1,32) 
      .msg # My Link Protection Is Now off in: $+($chr(2),#) 
      halt | :d | .msg # $nick $+ , My link protection is already off . $& 
        ! 
    } 
  } 
}

note: i changed /timeout to .timeout since that changed with a api update


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Quote:
note: i changed /timeout to .timeout since that changed with a api update
Where did you hear this? lol.

/timeout and .timeout both work excellent. The .timeout is just so that you won't get notified of the action in your mIRC application.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Originally Posted By: Nillen
Quote:
note: i changed /timeout to .timeout since that changed with a api update
Where did you hear this? lol.

/timeout and .timeout both work excellent. The .timeout is just so that you won't get notified of the action in your mIRC application.

in my recent commands /timeout didn't time the person out, and .timeout did.


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
tried new remote file and it doesn't fix it frown


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
This may seem like a awful way to link block, but
Code:
on *:text:*.com*:#:{
if ($read(textfile.txt,nw,$nick)) return
Msg # .timeout $nick 1
Msg # Stop posting links!
}
on *:text:*www.*:#:{
if ($read(textfile.txt,nw,$nick)) return
Msg # .timeout $nick 1
Msg # Stop posting links!
}

Also other on TEXT commands like http, https, info, uk, etc.

EDIT: the other script gives error LINKPOST unknown command

Last edited by judge2020; 06/04/14 07:52 AM. Reason: EDIT:

#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Apr 2014
Posts: 33
B
Ameglian cow
Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
Since this looks like it is for twitch.tv

ops is a hash table with a list of all of the channel moderators.

on 1:TEXT:!permit*:#:{
if $hget(ops,$nick) == $null /halt
/set %Linkers %Linkers $chr(124) $+ $$2 $+ $chr(124))
/msg $chan $$2 you have %linkdelay seconds to post a link
/timer $+ $$2 1 %linkdelay /set %Linkers $remove(%Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}

on 1:TEXT:!regular*:#:{
if $hget(ops,$nick) == $null /halt
if $hget(regulars,$$2) {
/hdel regulars $$2
/msg $chan $$2 removed from the list of users permitted to always post links
/halt
}
if !$hget(regulars,$$2) {
/hadd -m regulars $$2 $ctime
/msg $chan $$2 added to list of users permitted to always post links
/halt
}
}

on 1:TEXT:*:#:{
/set %linker $chr(124) $+ $nick $+ $chr(124)

if $hget(subscribers,$nick) {
/halt
}
if $hget(regulars,$nick) {
/halt
}
if $hget(ops, $nick) {
/halt
}
if %linker isin %Linkers {
/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)\b) {
/msg $chan You are not permitted to post links $nick $+ ! Either subscribe (Subscribers can always post links), or ask a moderator for permission to post a link first. (Banned from posting for %bandelay seconds)
/msg $chan .timeout $nick %banlength
/halt
}
if http: isin $1- {
/msg $chan You are not permitted to post links $nick $+ ! Ask a moderator for permission first. (Banned from posting for %banlength seconds)
/msg $chan .timeout $nick %banlength
/halt
}
/set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}

on 1:action:*:#:{
/set %linker $chr(124) $+ $nick $+ $chr(124)

if $hget(subscribers,$nick) {
/halt
}
if $hget(regulars,$nick) {
/halt
}
if $hget(ops, $nick) {
/halt
}
if %linker isin %Linkers {
/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)\b) {
/msg $chan You are not permitted to post links $nick $+ ! Either subscribe (Subscribers can always post links), or ask a moderator for permission to post a link first. (Banned from posting for %bandelay seconds)
/msg $chan .timeout $nick %banlength
/halt
}
if http: isin $1- {
/msg $chan You are not permitted to post links $nick $+ ! Ask a moderator for permission first. (Banned from posting for %banlength seconds)
/msg $chan .timeout $nick %banlength
/halt
}
/set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}

Joined: Mar 2014
Posts: 72
A
Babel fish
Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
How do you put code in a different file? I Only put mine in the remote section. Also how do you make new files?

Joined: Mar 2014
Posts: 72
A
Babel fish
Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Could I just copy, paste it into mIRC or will I have to edit any?

Joined: Mar 2014
Posts: 215
J
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
It should work if you copy and paste it.


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Mar 2014
Posts: 72
A
Babel fish
Offline
Babel fish
A
Joined: Mar 2014
Posts: 72
Where it says %banlength Do I change "Banlength" to a number?

Page 1 of 2 1 2

Link Copied to Clipboard