mIRC Home    About    Download    Register    News    Help

Print Thread
#248739 21/10/14 04:32 AM
Joined: Oct 2014
Posts: 8
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Oct 2014
Posts: 8
So I have been making a link block for my custom bot and found this
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!
}
on *:text:*.net*:#:{
if ($read(reglist.txt,nw,$nick)) return
Msg # .timeout $nick 1
Msg # Stop posting links!
}
on *:text:*.org*:#:{
if ($read(reglist.txt,nw,$nick)) return
Msg # .timeout $nick 1
Msg # Stop posting links!
}
However I havent tested it to make sure it works yet, if someone has another that works then please send it. ALSO I am not sure how to make a !permit (name) command so someone can post a link... can someone help? Thanks

Joined: Apr 2014
Posts: 170
Vogon poet
Offline
Vogon poet
Joined: Apr 2014
Posts: 170
Can't remember exactly where I got it from but I know it was on here :P


Code:
on *:text:!links*:#: {
  if ($nick isop #) {
    if ($2 == on) {
      if (%links) {
        msg # Link protection is already enabled
        return
      }
      else {
        msg # Link protection enabled
        set %links On
        return
      }
    }
    if ($2 == off) {
      if (%links) {
        msg # Link protection disabled
        unset %links on
        return
      }
      else {
        msg # Link protection is already disabled
        return
      }
    }
    else { msg # ' $+ $2 $+ ' is not a valid function. use '!links on' to enable link protection and '!links off' to disable it again. }
  }
}

on *:text:!permit*:#: {
  if ($nick isop #) {
    if (%links) {
      set -u60 %permit $addtok(%permit,$2,32)
      msg $chan You have 1 minute to post a link, $2
    }
  }
}

on +201:text:*:#: {
  if ($nick isop #) { return }
  if ($read(reglist.txt,nw,$nick)) { return }
  if ($istok(%permit,$nick,32)) { return }
  if (%links) {
    if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) {
      .ruser 201 $nick
      msg # /timeout $nick 86400
      msg # $nick - Stop posting links! [24h]
      return
    }
  }
}
on +200:text:*:#: {
  if ($nick isop #) { return }
  if ($read(reglist.txt,nw,$nick)) { return }
  if ($istok(%permit,$nick,32)) { return }
  if (%links) {
    if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) {
      .ruser 200 $nick | .auser 201 $nick | .timermsg 1 3600 .ruser 201 $nick
      msg # /timeout $nick 600
      msg # $nick -> No links please. [10m]
      return
    }
  }
}
on *:text:*:#: {
  if ($nick isop #) { return }
  if ($read(reglist.txt,nw,$nick)) { return }
  if ($nick == YOURUSERNAMEHERE) { return }
  if ($istok(%permit,$nick,32)) { return }
  if (%links) {
    if (*www.* iswm $1- || *http://* iswm $1- || *.com* iswm $1- || *.tv* iswm $1- || *.nl* iswm $1- || *.sh* iswm $1- || *.net* iswm $1- || *.me* iswm $1-) {
      msg $chan /timeout $nick 1
      msg $chan Don't do that, $nick [Warning]
      .auser 200 $nick | .timermsg 1 3600 .ruser 200 $nick
      return
    }
  }
} 




Do [!links on] to start the protection, and !permit to give a user 1 minute to post. It's easy to edit if you don't like the times. Also, don't forget to change it to your user name...

Bramzee #248741 21/10/14 11:01 AM
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard