Id: 8769; Nick: 646; Timestamp: 2008-04-08 03:01:15; Pasted as: mIRC
Description: youtube rickroll scanner and invisionfree forum notifier in one
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
alias checkforums {
  if ($1 == on) {   
    timerCF -o 0 60 checkforums
    echo -a Forum Post Notification ON
  }
  if ($1 == off) {
    timerCF off
    echo -a Forum Post Notification OFF
  }
  if (!$1) {
    var %setticks = a $+ $ticks
    set %sockets. [ $+ [ %setticks ] ] forum
    sockopen %setticks forums.brumanon.co.uk 80
  }
}
 
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 ($count($1-,?v=) == 0) { 
    ;    msg $chan youtube. is now a meme
  }
  if ($count($1-,?v=) != 0) { 
    inc %totalrr
    set %vid $mid($1-,$calc($pos($1-,v=,1) + 2),11)
    set %rrchan $chan
    var %i = 0
    var %definaterr = false
    while (%i <= $lines(rrvids.txt)) {
      if (%vid == $read(rrvids.txt, %i)) {
        if (%definaterr == false) { msg $chan 4WARNING!! This youtube link is a definate rickroll. $nick you fail. }
        var %definaterr = true
        inc %totaldef
      }
      inc %i
    }
    if (%definaterr == false) {
      msg $chan Youtube link detected! Scanning for rickroll...
      var %setticks = a $+ $ticks
      set %sockets. [ $+ [ %setticks ] ] youtube
      sockopen %setticks www.youtube.com 80
    }
  }
}
 
on *:TEXT:*tinyurl.com*: {
  ; if ($sock(rrdetector)) { sockclose rrdetector }
  ; set %rrdet tu
  ; sockopen rrdetector preview.tinyurl.com 80 
}
 
on *:sockopen:*:{
  if (%sockets. [ $+ [ $sockname ] ] == youtube) {
    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
  }
  if (%sockets. [ $+ [ $sockname ] ] == forum) {
    sockwrite -n $sockname GET /index.php?act=Search&CODE=getactive HTTP/1.1
    sockwrite -n $sockname Host: forums.brumanon.co.uk
    sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
    sockwrite -n $sockname Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    sockwrite -n $sockname Accept-Language: en-gb,en;q=0.5
    sockwrite -n $sockname Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    sockwrite -n $sockname Keep-Alive: 300
    sockwrite -n $sockname Connection: close
    sockwrite -n $sockname $crlf
  }
}
 
on *:sockread:*:{
  if ($sockerr > 0) return
  :nextread
  sockread %temp
  .write  $sockname $+ .txt %temp
  if ($sockbr == 0) return  
  goto nextread
}
 
 
on *:sockclose:*:{
 
  if (%sockets. [ $+ [ $sockname ] ] == youtube) {
    .fopen $sockname $sockname $+ .txt 
    var %totalrick = 0
 
    while (!$feof) { 
      .fseek -r $sockname /rick|astley|give you up/i 
      inc %totalrick $count($fread($sockname),rickroll,rick roll,astley,give you up) 
    }
    .fclose $sockname
    .remove $sockname $+ .txt
    unset %sockets. [ $+ [ $sockname ] ]
 
    var %warned = false
 
    if (%totalrick >= 4) { 
      if (%totalrick >= 25) { 
        if (%totalrick >= 35) { 
          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.
      inc %totalsafe
    }
  }
  if (%sockets. [ $+ [ $sockname ] ] == forum) {
    var %firstline = $read($sockname $+ .txt,w,*td class='row2'*)
    if ($remove($left(%firstline,$calc($pos(%firstline,<br,1)-1)),<td class='row2'>) != %forumlastdate) {
      set %forumlastdate $v1
      var %forumname = $remove(%firstline,$left(%firstline,$calc($pos(%firstline,showuser=,1)+11)),</a></b></b></td>,'>,>)
      var %forumname = $replace(%forumname,&#39;,',&quot;,",&amp,&,&#33;,!)
      var %secondline = $read($sockname $+ .txt,w,*showforum=*)
      var %forumsection = $remove(%secondline,$left(%secondline,$calc($pos(%secondline,showforum=,1)+12)),</a></td>,>)  
      var %thirdline = $read($sockname $+ .txt,w,*showtopic=*)
      if ($pos(%thirdline,</a>  <span class='small'> $+ $chr(40) $+ Pages,0) == 0) {
        var %forumtopic = $remove(%thirdline,$left(%thirdline,$calc($pos(%thirdline,showtopic=,1)+22)),</a> </td>,>)
      }
      if ($pos(%thirdline,</a>  <span class='small'> $+ $chr(40) $+ Pages,0) != 0) {
        var %forumtopic = $remove(%thirdline,$left(%thirdline,$calc($pos(%thirdline,showtopic=,1)+21)),</a> </td>)
        var %forumtopic = $remove($left(%forumtopic,$calc($pos(%forumtopic,</a>  <span class='small'>,1)-1)),>)
      }
      var %forumtopic = $replace(%forumtopic,&#39;,',&quot;,",&amp,&,&#33;,!)
      var %forumurl = $left($mid(%thirdline,$calc($pos(%thirdline,showtopic=,1)+10)),3),3) 
      if ($pos(%forumurl,&,0) != 0) { 
        var %forumurl = $left(%forumurl,2)
      }
      var %forumurl = http://forums.brumanon.co.uk/index.php?showtopic= $+ %forumurl $+ &view=getnewpost
      msg #brumanon 1,15[13,15New forum post1,15][User: %forumname Forum: %forumsection Topic: %forumtopic $+ ]
      msg #brumanon 1,15[Go to %forumurl to read]
    }
    .remove $sockname $+ .txt
    unset %sockets. [ $+ [ $sockname ] ]
  }
  unset %sockets. [ $+ [ $sockname ] ]
}
 
Options: New, Download,
, mIRC Parser;
Copyright © 2006 by Zyberdog - Some rights reserved. (Browse/Disclaimer/Stats/About)