|
Joined: Mar 2014
Posts: 215
Fjord artisan
|
OP
Fjord artisan
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
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
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
Fjord artisan
|
OP
Fjord artisan
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...
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
Do you have any other scripts starting with ? 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
Fjord artisan
|
OP
Fjord artisan
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.
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
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
on *:text:*:#: {
linkpost $1-
otheralias $1-
}
Or you can just take the parts you want out of the alias and make your own 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
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 215 |
Combine them then. I assume the other commands you set up use aliases as well? Then you can just combine it by
on *:text:*:#: {
linkpost $1-
otheralias $1-
}
Or you can just take the parts you want out of the alias and make your own 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?
|
|
|
|
Joined: Mar 2004
Posts: 359
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 359 |
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
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 215 |
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?
|
|
|
|
Joined: Mar 2004
Posts: 359
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 359 |
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.
Last edited by LostServ; 02/04/14 07:41 PM.
|
|
|
|
Joined: Mar 2014
Posts: 215
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 215 |
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. I took your advice and put it in a different file: 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
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
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
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 215 |
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.
|
|
|
|
Joined: Mar 2014
Posts: 215
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 215 |
tried new remote file and it doesn't fix it
|
|
|
|
Joined: Mar 2014
Posts: 215
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 215 |
This may seem like a awful way to link block, but 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:
|
|
|
|
Joined: Apr 2014
Posts: 33
Ameglian cow
|
Ameglian cow
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
Babel fish
|
Babel fish
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
Babel fish
|
Babel fish
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
Fjord artisan
|
OP
Fjord artisan
Joined: Mar 2014
Posts: 215 |
It should work if you copy and paste it.
|
|
|
|
Joined: Mar 2014
Posts: 72
Babel fish
|
Babel fish
Joined: Mar 2014
Posts: 72 |
Where it says %banlength Do I change "Banlength" to a number?
|
|
|
|
Joined: Apr 2014
Posts: 33
Ameglian cow
|
Ameglian cow
Joined: Apr 2014
Posts: 33 |
in the bot type /set %banlength 30 for 30 seconds /set %banlength 300 for 5 minutes etc
In the remotes click file/new to get a new file. Then file/save as to give it a name to make it easier to track in the future than script6.mrc
|
|
|
|
Joined: Apr 2014
Posts: 7
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Apr 2014
Posts: 7 |
Most of this script works right but instead of not allowing normal users it is not allowing anyone to post even mods. Also the !permit command does not seem to be working. Is my script wrong or am i missing something else?
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.
/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.
/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.
/msg $chan .timeout $nick %banlength
/halt
}
/set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}
|
|
|
|
Joined: Apr 2014
Posts: 191
Vogon poet
|
Vogon poet
Joined: Apr 2014
Posts: 191 |
Because it uses ops hashtable to check op. You need to change this line in entire script
if $hget(ops,$nick) == $null /halt
with
if $nick !isop # { halt }
|
|
|
|
Joined: Apr 2014
Posts: 7
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Apr 2014
Posts: 7 |
ok i changed
if $hget(ops,$nick) == $null /halt
with
if $nick !isop # { halt }
now normal users linking without permission get their links removed, get warning msg, and get timed out. mods do NOT get their links removed but still get the warning and get timed out. Here is the new script.
on 1:TEXT:!permit*:#:{
if $nick !isop # { 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 $nick !isop # { 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.
/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.
/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.
/msg $chan .timeout $nick %banlength
/halt
}
/set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )
}
|
|
|
|
Joined: Apr 2014
Posts: 191
Vogon poet
|
Vogon poet
Joined: Apr 2014
Posts: 191 |
change this line in entire script
if $hget(ops, $nick) {
/halt
}
with
|
|
|
|
Joined: Apr 2014
Posts: 170
Vogon poet
|
Vogon poet
Joined: Apr 2014
Posts: 170 |
is it possible to set this up so that the person you permit is only able to post one link? Rather than have 30 seconds? To prevent them from posting multiple links and/or spamming them?
|
|
|
|
Joined: Apr 2014
Posts: 33
Ameglian cow
|
Ameglian cow
Joined: Apr 2014
Posts: 33 |
If you use my code it automatically removes the permit once a link is posted.
/set %Linkers $remove( %Linkers, $chr(124) $+ $$2 $+ $chr(124) )
Last edited by bl968; 23/04/14 05:08 AM.
|
|
|
|
|