All pastes #970590 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-04-04 03:50 UTC
rendered paste body
on *:TEXT:!rickrollstats*:#: {
  msg $chan To date, this bot (coded by 646) has checked %totalrr URLs for rickroll. It has found the following number of URLs with these risk levels:
  msg $chan  %totaldef definate rickrolls, %totalhigh "very high" risk, %totalprobable  "probable" risk, %totalpotential  "potential" risk,
  msg $chan and %totalsafe URLs that were deemed to be safe. This bot is clearly absolutley nescessary due to the seriousness of the internet.
}


on *:TEXT:*youtube.*:#: {
  if ($sock(rrdetectoryt)) { sockclose rrdetectoryt }
  set %vid $mid($1-,$calc($pos($1-,v=,1) + 2),11)
  set %rrchan $chan
  var %i = 0
  var %definaterr = false
  inc %totaldef
  while (%i <= $lines(rrvids.txt)) {
    if (%vid == $read(rrvids.txt, %i)) {
      msg $chan 4WARNING!! This youtube link is a definate rickroll. $nick you fail.
      var %definaterr = true
    }
    inc %i
  }
  if (%definaterr == false) {
    msg $chan Youtube link detected! Scanning for rickroll...
    sockopen rrdetectoryt www.youtube.com 80
  }
}

on *:TEXT:*tinyurl.com*: {
  //  if ($sock(rrdetector)) { sockclose rrdetector }
  //  set %rrdet tu
  //  sockopen rrdetector preview.tinyurl.com 80 
}

on *:sockopen:rrdetectoryt:{
  sockwrite -n $sockname GET /watch?v= $+ %vid HTTP/1.0
  sockwrite -n $sockname Host: www.youtube.com
  sockwrite -n $sockname user-agent: Mozilla/??
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname $crlf
}

on *:sockread:rrdetectoryt:{
  if ($sockerr > 0) return
  :nextread
  sockread %temp
  write wholepage.txt %temp
  if ($sockbr == 0) return  
  goto nextread
}

on *:sockclose:rrdetectoryt:{
  var %i = 0
  var %rickroll = 0
  var %rickrollwithspace = 0
  var %astley = 0
  var %giveyouup = 0
  while (%i != $lines(wholepage.txt)) {

    var %rickroll = $calc(%rickroll + $count($read(wholepage.txt,%i),rickroll))
    var %rickrollwithspace = $calc(%rickrollwithspace + $count($read(wholepage.txt,%i),rick roll))
    var %astley = $calc(%astley + $count($read(wholepage.txt,%i),astley))
    var %giveyouup = $calc(%giveyouup + $count($read(wholepage.txt,%i),give you up))

    inc %i
  }
  //  echo -a rickroll: %rickroll 
  //  echo -a rick roll: %rickrollwithspace
  //  echo -a astley: %astley
  //  echo -a give you up: %giveyouup 

  remove wholepage.txt


  var %totalrick = $calc(%rickroll + %rickrollwithspace + %astley + %giveyouup)
  //  echo -a %totalrick

  var %warned = false

    if (%totalrick >= 4) { 
      if (%totalrick >= 15) { 
        if (%totalrick >= 25) { 
          msg %rrchan 4,1WARNING!! This link has tested positively for rickroll. Danger of rickroll is estimated at 4,1VERY HIGH for this link.
          var %warned = true
          inc %totalhigh
        }
        if (%warned != true) {
          msg %rrchan 7,1WARNING!! This link has tested positively for rickroll. Danger of rickroll is estimated at 7,1PROBABLE for this link.
          var %warned = true
          inc %totalprobable
        }
      }
      if (%warned != true) {
        msg %rrchan 8,1WARNING!! This link has tested positively for rickroll. Danger of rickroll is estimated at 8,1POTENTIAL for this link.
        inc %totalpotential
      }
    }
    if (%totalrick < 4) { msg %rrchan 3This link has tested negatively for rickroll. You are cleared to proceed. }

  }
}