mIRC Home    About    Download    Register    News    Help

Print Thread
#255509 30/10/15 09:38 PM
Joined: Aug 2015
Posts: 12
A
Airfox Offline OP
Pikka bird
OP Offline
Pikka bird
A
Joined: Aug 2015
Posts: 12
Hello, I've got a problem with my bot. Everything is working except the linkprotection. Sometimes it's working, sometimes not. And mb you've got some new ideas to implement in this Bot. laugh


Code:



on *:text:*!setip*:#:{
if ($nick isop #) { { /set %serverip $2- } { msg # Die ServerIP wurde zu $2- geändert! } } }

on *:text:*!setloop1*:#:{
if ($nick isop #) { { /set %loop1 $2- } { msg # Die Pausetime des Loops wurde auf $2- Sekunden gesetzt! } } }

on *:text:*!setloop2*:#:{
if ($nick isop #) { { /set %loop2 $2- } { msg # Die Pausetime des Loops wurde auf $2- Sekunden gesetzt! } } }

on *:text:*!setloop3*:#:{
if ($nick isop #) { { /set %loop3 $2- } { msg # Die Pausetime des Loops wurde auf $2- Sekunden gesetzt! } } }

on *:text:*!setcmds*:#:{
if ($nick isop #) { { /set %commands $2- } { msg # Die Commands wurden editert auf: $2- ! } } }

on *:TEXT:*!commands*:#: {
  if ((%flood) || ($($+(%,flood.,$nick),2))) { return }
  set -u7 %flood On
msg # Commands sind: %commands $+ }

on *:TEXT:!youtube:#: {
  if ((%flood) || ($($+(%,flood.,$nick),2))) { return }
  set -u7 %flood On
msg # Ragee's Youtubechannel: https://www.youtube.com/user/RageeLP $+ }

on *:TEXT:!steam:#: {
  if ((%flood) || ($($+(%,flood.,$nick),2))) { return }
  set -u7 %flood On
msg # Ragee's Steamgruppe: http://steamcommunity.com/groups/RageeLP $+ }

on *:TEXT:!facebook:#: {
  if ((%flood) || ($($+(%,flood.,$nick),2))) { return }
  set -u7 %flood On
msg # Ragee's Facebookfanpage: https://www.facebook.com/Rageelps-Fanpage-595081593860163/ $+ }

on *:TEXT:*!tradelink*:#: {
  if ((%flood) || ($($+(%,flood.,$nick),2))) { return }
  set -u7 %flood On
msg # Sein Tradelink: https://steamcommunity.com/tradeoffer/new/?partner=37045332&token=sycrVwNB $+ }

on *:TEXT:*!server*:#: {
  if ((%flood) || ($($+(%,flood.,$nick),2))) { return }
  set -u7 %flood On
msg # Die ServerIP ist: %serverip $+ }

on *:TEXT:*!teamspeak*:#: {
  if ((%flood) || ($($+(%,flood.,$nick),2))) { return }
  set -u7 %flood On
msg # Die TS-IP ist: 62.104.20.139:10023 $+ }


on *:JOIN:#: {
  if ($nick == LuftBot ) {
    msg $chan Loop gestartet!
    .timerYoutube 0 %loop1 msg # Ragee's Youtubechannel unbedingt auschecken! https://www.youtube.com/user/RageeLP 
    .timerTrade 0 %loop2 msg # Ihr möchtet ihm etwas legen? https://steamcommunity.com/tradeoffer/new/?partner=37045332&token=sycrVwNB
    .timerCommands 0 %loop3 msg # Commands sind: !youtube - !steam - !facebook - !tradelink - !server - !teamspeak -
  }
}
on *:TEXT:!stopl:#: {
  if ($nick isop #) {
    msg $chan Loop beendet.
    .timerYoutube off
    .timerTrade off
    .timerCommands off
  }
}


on $@*:text:*:#:{
  if ($regex($1-,/.+\.(com|co|uk|net|org|gov|tv|edu|fm|de|ru|xyz|su)/iS)) && ($nick !isop $chan) {
    if (!$istok(%permit,$nick,32)) {
      .timerban 1 1 /msg $chan /timeout $nick 1
      msg # $nick bitte frage ein Moderator für !permit.
    }
  }


  noop $regex($1-,/^!(reg del|reg add|permit)\s(\S+)/iS) { 
    if ($regml(1) == reg add) && ($nick isop $chan) {
      if ($istok(%permit,$regml(2),32)) {
        msg $chan $regml(2) is already on the regular list
      }
      else {
        set %permit $addtok(%permit,$regml(2),32)
        msg $chan $regml(2) You are now always permitted to post links
      }
    }
    if ($regml(1) == permit) && ($nick isop $chan) {
      set %permit $addtok(%permit,$regml(2),32)
      .timerunset 1 60 set %permit $remtok(%permit,$regml(2),1,32)
      msg $chan $regml(2) du hast 60 Sekunden um ein Link zu posten!
    }
    if ($regml(1) == reg del) && ($nick isop $chan) {
      if ($istok(%permit,$regml(2),32)) {
        set %permit $remtok(%permit,$regml(2),1,32)
        msg $chan $regml(2) removed from regular list
      }
      else {
        msg $chan $regml(2) is not on regular list
      }
    }
  }
}



on *:JOIN:#: {
  if ($nick == LuftBot ) {
    timerUptime off
    %uptime = 0
    timerUptime 0 1 inc %uptime
  }
}

on *:PART:#: {
  if ($nick == LuftBot ) {
    timerUptime off
    %uptime = 0
  }
}


on *:text:!uptime:#: {
  msg $chan /me Uptime: $replace($duration(%uptime, 2), hr, $chr(32) Stunden, mins, $chr(32) Minuten).
}



Last edited by Airfox; 30/10/15 10:43 PM.
Airfox #255538 02/11/15 07:34 PM
Joined: May 2015
Posts: 133
K
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
The reason it doesn't work sometimes is due to twitch not receiving the .timeout from your bot.

There are two ways to handle this:

1. Check rawmsg for clearchat
2. Change your .timeout timer to:

Code:
 .timerban 1 3 /msg $chan /timeout $nick 1


Most of the bots use the second option, due to clearchat not being the best way to handle it. I've seen clearchat received from rawmsg's but not actually clear the users chat.

There can be an issue with 2 users posting links at the same time, you can fix this by:

Code:
$+(.timerban.,#,.,$nick) 1 3 .msg $chan .timeout $nick 1

Last edited by keyeslol; 02/11/15 07:50 PM.

twitter @keyeslol

Link Copied to Clipboard