Id: 5330; Nick: BenSax; Timestamp: 2008-02-07 19:13:03; Pasted as: mIRC
Description: n/a
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
;;;; IP INFO;;;;;
 
on *:TEXT:!ipinfo*:#:{
  if ($2 == on) && ($readini(# $+ .ini ,userlist,$address($nick,1) >= 8)) { 
    writeini # $+ .ini functions ipinfo on 
    notice $nick ipinfo is enable. Use !ipinfo <ip> 
  }
  if ($2 == on) && ($readini(# $+ .ini ,userlist,$address($nick,1) < 8)) { 
    notice $nick You have to be in level 8 to do this command.
  }
  elseif ($2 == off) && ($readini(# $+ .ini ,userlist,$address($nick,1) >= 8)) { 
    writeini # $+ .ini functions ipinfo off 
    notice $nick ipinfo is disable. 
  }
  elseif ($2 == off) && ($readini(# $+ .ini ,userlist,$address($nick,1) < 8)) { 
    notice $nick You have to be in level 8 to do this command.
  }
  elseif ($2 != on) && ($2 != off) && ($readini(# $+ .ini ,functions,ipinfo) == off) { 
    notice $nick ipinfo is disable 
  }
  elseif ($2 == $null) && ($readini(# $+ .ini ,functions,ipinfo) == on) { 
    notice $nick ipinfo is on. Use !ipinfo <ip> to locate a ip-address.
  }
  elseif ($2 == $null) && ($readini(# $+ .ini ,functions,ipinfo) == off) { 
    notice $nick ipinfo is off.
  }
  elseif ($2 != on) && ($2 != off) && ($readini(# $+ .ini ,functions,ipinfo) == on) { 
    sockclose ipinfo
    sockopen ipinfo www.melissadata.com 80
    set %info $2
    set %info.chan $chan
  }
}
alias htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
  return %x
}
on *:sockopen:ipinfo: {
  sockwrite -nt $sockname GET /lookups/iplocation.asp?ipaddress= $+ %info HTTP/1.1
  sockwrite -nt $sockname Host: www.melissadata.com
  sockwrite -nt $sockname $crlf
}
on *:sockread:ipinfo: {
  var %temp
  sockread %temp
  if (*IP Address</td><td><b>*.*.*.* iswm %temp) {
    set %ip $remove($gettok($htmlfree(%temp),3,32),Address)
  }
  if (*City</td><td><b>* iswm %temp) {
    set %city $remove($gettok($htmlfree(%temp),2,32),City)
  }
  if (*State or Region</td><td><b>* iswm %temp) {
    set %region $remove($gettok($htmlfree(%temp),4,32),Region)
  }
  if (*Country</td><td><b>* iswm %temp) {
    set %country $remove($gettok($htmlfree(%temp),2,32),Country)
    if (%region == -) { set %region n/a }
    msg %info.chan IP: $replace(%ip,-,n/a) - City: $replace(%city,-,n/a) - Region: %region - Country: $replace(%country,-,n/a)
    sockclose ipinfo
  }
}
 
 
;;; END IP INFO ;;;;
 
;;; YOUTUBE ;;;;;
 
on *:text:!youtube*:#:{ 
  if ($2 == on) && ($readini(# $+ .ini ,userlist,$address($nick,1) >= 8)) { 
    writeini # $+ .ini functions youtube on 
    notice $nick Youtube is enable. Use !youtube <string> 
  }
  if ($2 == on) && ($readini(# $+ .ini ,userlist,$address($nick,1) < 8)) { 
    notice $nick You have to be in level 8 to do this command.
  }
  elseif ($2 == off) && ($readini(# $+ .ini ,userlist,$address($nick,1) >= 8)) { 
    writeini # $+ .ini functions youtube off
    notice $nick Youtube is disable 
  }
  elseif ($2 == off) && ($readini(# $+ .ini ,userlist,$address($nick,1) < 8)) { 
    notice $nick You have to be in level 8 to do this command.
  }
  elseif ($2 != on) && ($2 != off) && ($readini(# $+ .ini ,functions,youtube) == off) { 
    notice $nick Youtube is disable
  }
  elseif ($2 == $null) && ($readini(# $+ .ini ,functions,youtube) == on) { 
    notice $nick Youtube is on. Use !youtube <string> to search a youtube movie.
  }
  elseif ($2 == $null) && ($readini(# $+ .ini ,functions,youtube) == off) { 
    notice $nick Youtube is off.
  }
  elseif ($2 != on) && ($2 != off) && ($readini(# $+ .ini ,functions,youtube) == on) { 
    set %youtube.chan #
    set %youtube.search $replace($2-,$chr(32),$+($chr(37),20))
    sockclose youtube
    sockopen youtube uk.youtube.com 80
  }
}
on *:sockopen:youtube: {
  sockwrite -nt $sockname GET /results?search_query= $+ %youtube.search $+ &search=Search HTTP/1.1
  sockwrite -nt $sockname Host: uk.youtube.com
  sockwrite -nt $sockname $crlf
}
on *:sockread:youtube: {
  var %data
  sockread %data
  if (%count == 3) {
    sockclose youtube | set %count 0
    msg %youtube.chan $c(Name: %author.0 - %views.0 - %time.0 - Link: http://youtube.com $+ %link.0)
    msg %youtube.chan $c(Name: %author.1 - %views.1 - %time.1 - Link: http://youtube.com $+ %link.1)
    msg %youtube.chan $c(Name: %author.2 - %views.2 - %time.2 - Link: http://youtube.com $+ %link.2)
    unset %youtube.* | unset %author.* | unset %views.* | unset %time.* | unset %link.*
    return
  }
  if (*<a class="newvtitlelink" href="/watch?v=*" rel="nofollow" onclick="_hbLink('*','*');">*</a><br/>* iswm %data) {
    set %author. $+ %count $remove($htmlfree(%data),	)
    set %link. $+ %count $remove($gettok(%data,3,32),href=",")
  }
  if (*<span class="smgrayText" style="font-size: 11px;">Views:</span> *<br>* iswm %data) {
    set %views. $+ %count $remove($htmlfree(%data),	)
  }
  if (*class="runtime">* iswm %data) {
    set %time. $+ %count $remove($htmlfree(%data),	)
    inc %count
  }
}
 
 
;; END YOUTUBE ;;
 
;; GOOGLE ;;
 
on *:TEXT:!google*:#:{
  if ($2 == on) && ($readini(# $+ .ini ,userlist,$address($nick,1) >= 8)) { 
    writeini # $+ .ini functions google on 
    notice $nick ipinfo is enable use: !google <string>. 
  }
  elseif ($2 == $null) && ($readini(# $+ .ini ,functions,google) == on) { 
    notice $nick Google script is on. Use !google <string> to search. 
  }
  elseif ($2 == $null) && ($readini(# $+ .ini ,functions,google) == off) { 
    notice $nick Google script is off. 
  }
  elseif ($2 == off) && ($readini(# $+ .ini ,userlist,$address($nick,1) >= 8)) { 
    writeini # $+ .ini functions google off
    notice $nick Google-search is disable
  }
  elseif ($2 == on) && ($readini(# $+ .ini ,userlist,$address($nick,1) < 8)) { 
    notice $nick You have to be in level 8 to do this command.
  }
  elseif ($2 == off) && ($readini(# $+ .ini ,userlist,$address($nick,1) < 8)) { 
    notice $nick You have to be in level 8 to do this command.
  }
  elseif ($2 != on) && ($2 != off) && ($readini(# $+ .ini ,functions,google) == off) { 
    notice $nick Google-search is disable 
  }
  elseif ($2 != on) && ($2 != off) && ($readini(# $+ .ini ,functions,google) == on) {
    set %google.chan #
    set %google.search $replace($2-,$chr(32),$+($chr(37),20))
    sockclose google
    sockopen google google.com 80
  }
  elseif ($readini($+(#,.ini,),functions,google)) == off) { notice $nick Google search is off! | halt }
}
on *:sockopen:google:{
  if ($sockerr > 0) { return }
  sockwrite -nt $sockname $eval(GET http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=,0) $+ %google.search $+ $eval(&btnI=I%27m+Feeling+Lucky HTTP/1.0,0)
  sockwrite -nt $sockname $crlf
}
on *:sockread:google:{
  var %google
  sockread %google
  if (Location: isin %google) {
    msg %google.chan Google: $remove(%google,Location:) (Query: $replace(%google.search,$+($chr(37),20),$chr(32)) $+ )
  }
}
 
;; END GOOGLE ;;
 
;; ADVETISING SCRIPT ;;
 
on *:text:!adv:#:{
  if ($readini(# $+ .ini ,userlist,$address($nick,1)) >= 8) {
    notice $nick advertising-protection is $readini(# $+ .ini ,advertsing,adv) $+ . Use !adv bantime to set the bantime when advertising.
  }
}
on *:text:!adv on:#:{ 
  if ($readini(# $+ .ini ,userlist,$address($nick,1)) >= 8) && ($readini(# $+ .ini ,advertising,adv) != on) { 
    writeini # $+ .ini advertising adv on 
  }
  else { 
    notice $nick It's already on. 
  }
}
on *:text:!adv off:#:{ 
  if ($readini(# $+ .ini ,userlist,$address($nick,1)) >=8) && ($readini(# $+ .ini ,advertising,adv) != off) { 
    writeini # $+ .ini advertising adv off 
  }
  else { 
    notice $nick It's allready off! 
  }
}
on *:text:!adv bantime*:#:{ 
  if ($3 == $null) { 
    notice $nick The advertising bantime is set to $readini(# $+ .ini,advertising,bantime) minute(s)
  }
  elseif ($3 isnum) { 
    writeini $+(#,.ini,) advertising bantime $3 
  }
  elseif ($3 !isnum) {
    notice $nick Fail. It has to be a number.
  }
}
 
 
on *:text:*:#:{
  if (*www.* iswm $1-) || (*http://* iswm $1-) || (*#* iswm $1-) {
    if ($readini(# $+ .ini,advertising,adv) == on) {
      if ($readini(# $+ .ini,userlist,$address($nick,1)) < 2) || ($readini(# $+ .ini,userlist,$address($nick,1)) == $null) {
        ban -u $+ $calc($readini(# $+ .ini,advertising,bantime) * 60) $+ k $chan $nick 1 Advertising is NOT allowed in here! ( $+ Banned $readini(# $+ .ini,advertising,bantime) minute(s $+ )
      }
    }
  }
}
 
 
;; END ADVERTISING SCRIPT ;;
Options: New, Download,
, mIRC Parser;
Copyright © 2006 by Zyberdog - Some rights reserved. (Browse/Disclaimer/Stats/About)