mIRC Homepage
Posted By: AllDayGrinding Link Block - 08/04/14 06:24 PM
I am making a Twitch chat bot and I can't seem to find a fully working Link block for all links?
Posted By: Loki12583 Re: Link Block - 08/04/14 06:28 PM
That's funny, because there's a post in this section with that exact text.
Posted By: judge2020 Re: Link Block - 08/04/14 06:56 PM
probably about 5 with link block in it.

Here's my link block, it's not special but works
Code:
on *:text:*.com*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*www.*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*http*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*https*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*.info*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*.uk*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}


the if command will read my allowed list [reglist.txt]
Here the code i use to add/delete my regulars:
Code:
on *:TEXT:!reg add*:#: {
  if ($nick isop #) {
    write reglist.txt $$3
    msg $chan $$3 has been added to the regular list! 
  }
  if ($read(reglist.txt,nw,$nick)) {
    write reglist.txt $$3
    msg $chan $$3 has been added to the regular list! 
  }
}
on *:TEXT:!reg del*:#: {
  if ($nick isop #) {
    if ($read(reglist.txt,nw,$3)) write -dl $+ $readn reglist.txt 
    msg # $$3 has been removed from the regular list!
  }
  if ($read(reglist.txt,nw,$nick)) {
    if ($read(reglist.txt,nw,$3)) write -dl $+ $readn reglist.txt 
    msg # $$3 has been removed from the regular list!
  }
}

and a permit command:
Code:
on *:TEXT:!permit*:#: {
  if ($nick isop #) && ($2) {
    write reglist.txt $2
    msg # $2 has been permited to post a link for 20 seconds
    .timerRemovePermit 1 20 RemovePermit # $2
  }
  if ($read(sreglist.txt,nw,$nick)) && ($2) {
    write reglist.txt $2
    msg # $2 has been permited to post a link for 20 seconds
    .timerRemovePermit 1 20 RemovePermit # $2
  }
}

those two are sreg because i only want special regulars to permit links or add regulars

Hope this helped.
Posted By: AllDayGrinding Re: Link Block - 08/04/14 06:58 PM
So do I just Copy That above or under the Commands?
Posted By: AllDayGrinding Re: Link Block - 08/04/14 07:09 PM
Also Do you have anything for spamming Symbols Like |?|??''#''/..'@:l;[;];'# Or not?
Posted By: judge2020 Re: Link Block - 08/04/14 08:21 PM
Originally Posted By: AllDayGrinding
Also Do you have anything for spamming Symbols Like |?|??''#''/..'@:l;[;];'# Or not?

Not right now.

Originally Posted By: AllDayGrinding
So do I just Copy That above or under the Commands?

If you don't have a file set up, you can go ahead and use "!reg add [name]" in chat and your allowed people list is already.
Alternatively You can copy all of that, but change the file names to your allowed list (change every reglist.txt to yourfilename.txt)
Posted By: AllDayGrinding Re: Link Block - 08/04/14 08:35 PM
I don't really understand this as I am Really new to making twitch bots I copied the Reg thing and it didnt do anthing http://gyazo.com/5ecbfa3b0cf72a282554c2b5e136fa21 http://gyazo.com/66dde907159d51ac6da06047aee2e227
Posted By: Loki12583 Re: Link Block - 08/04/14 08:56 PM
None of the text commands will work from the same server instance you're running the scripts on.
Posted By: AllDayGrinding Re: Link Block - 08/04/14 09:02 PM
What? I dont understand
Posted By: judge2020 Re: Link Block - 08/04/14 09:02 PM
lol ->
Posted By: AllDayGrinding Re: Link Block - 08/04/14 09:05 PM
Can't you just post your Link block and add command stuff for your bot?
Posted By: AllDayGrinding Re: Link Block - 08/04/14 09:09 PM
Originally Posted By: judge2020
lol ->
That is me.
Posted By: judge2020 Re: Link Block - 08/04/14 09:19 PM
Originally Posted By: judge2020
probably about 5 with link block in it.

Here's my link block, it's not special but works
Code:
on *:text:*.com*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*www.*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*http*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*https*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*.info*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*.uk*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}


the if command will read my allowed list [reglist.txt]
Here the code i use to add/delete my regulars:
Code:
on *:TEXT:!reg add*:#: {
  if ($nick isop #) {
    write reglist.txt $$3
    msg $chan $$3 has been added to the regular list! 
  }
  if ($read(reglist.txt,nw,$nick)) {
    write reglist.txt $$3
    msg $chan $$3 has been added to the regular list! 
  }
}
on *:TEXT:!reg del*:#: {
  if ($nick isop #) {
    if ($read(reglist.txt,nw,$3)) write -dl $+ $readn reglist.txt 
    msg # $$3 has been removed from the regular list!
  }
  if ($read(reglist.txt,nw,$nick)) {
    if ($read(reglist.txt,nw,$3)) write -dl $+ $readn reglist.txt 
    msg # $$3 has been removed from the regular list!
  }
}

and a permit command:
Code:
on *:TEXT:!permit*:#: {
  if ($nick isop #) && ($2) {
    write reglist.txt $2
    msg # $2 has been permited to post a link for 20 seconds
    .timerRemovePermit 1 20 RemovePermit # $2
  }
  if ($read(sreglist.txt,nw,$nick)) && ($2) {
    write reglist.txt $2
    msg # $2 has been permited to post a link for 20 seconds
    .timerRemovePermit 1 20 RemovePermit # $2
  }
}

those two are sreg because i only want special regulars to permit links or add regulars

Hope this helped.


this is my link block
Posted By: AllDayGrinding Re: Link Block - 08/04/14 09:21 PM
So DO I just put that above the On:Text stuff and It will all work? or do I have to do something else
Posted By: judge2020 Re: Link Block - 08/04/14 09:27 PM
yes,
Code:
on *:text:*.com*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*www.*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*http*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*https*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*.info*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}
on *:text:*.uk*:#:{
  if ($read(reglist.txt,nw,$nick)) return
  Msg # .timeout $nick 1
  Msg # Stop posting links!
}

this will work, and ops will not be timed out (but will get the message)

Try adding a reg again, do you get a error message on the status window?
Posted By: AllDayGrinding Re: Link Block - 09/04/14 07:55 AM
I have this is and it is not working for me --> http://gyazo.com/3b1c10b6ebe6a46716f45d6d53182ac0
Posted By: AllDayGrinding Re: Link Block - 09/04/14 07:58 AM
Do I have to put the Link block,Regular list and Permit in Remote or a different one? http://gyazo.com/5897549edb38791ce753583ab732ae5d
Posted By: AllDayGrinding Re: Link Block - 09/04/14 02:46 PM
Everything works but when a mod or the Owner Post's a Link it still Says Stop Posting Links. Can you help me out with this?
Posted By: judge2020 Re: Link Block - 09/04/14 02:55 PM
go into your mirc directory [C:\Users\ME\AppData\Roaming\mIRC] and see if there is a reglist.txt there. If not, make one and add their names manually [one name every line]
ex:
reglist.txt:
theyoungergamer
paintballbot
name1
name2
Posted By: Loki12583 Re: Link Block - 09/04/14 02:55 PM
Code:
if ($nick(#,$nick,a,r)) return
Posted By: AllDayGrinding Re: Link Block - 09/04/14 03:46 PM
What is that for?
Posted By: AllDayGrinding Re: Link Block - 09/04/14 03:47 PM
Do you have skype so I can call you on it so you can help me??
Posted By: patrickplays Re: Link Block - 09/04/14 09:11 PM
Originally Posted By: Loki12583
Code:
if ($nick(#,$nick,a,r)) return


my explanation :p
$nick(in your bot's current channel,check each $nick,of all viewers,who is regular)

you probably want it to use like that
Code:
if ($nick(#,$nick,a,r)) return
else { timeout .. ask for permission (your code here)..
Posted By: Loki12583 Re: Link Block - 09/04/14 09:23 PM
Your usage is correct. Just throw it at the top of functions you only want to match regular users on.

$nick(current channel,current nick,include all users, exclude regular users)

Just look it up in the help files.
Posted By: seshu Re: Link Block - 17/07/15 12:35 AM
Any ways to whitelist links with this script? I'd like to allow https://osu.ppy.sh links without taking http and https block off.
© mIRC Discussion Forums