Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;Script Usage: Command: "/get.quake "
- ;;;;Options are not required but should be seperated by space...
- ;;;;Options Are: count help nocheck html lessthanday lessthanweek
- ;;;;(1) count (Displays count of match on display)
- ;;;;(2) help (Displays Help Info|Cannot Be Used With count)
- ;;;;(3) nocheck (Stops it checking if page has changed in list for depth, magnitude or location)
- ;;;;(4) html (Get Data With HTML Included)
- ;;;;(5) lessthanday (Displays only matches listed in last day)
- ;;;;(6) lessthanweek (Display all matches listed in last week)
- ;;;;Your Server DNS/Hostname You Use To Access Your Website...
- on ^*:text:*:#:{
- if (!quakes day isin $strip($stripstyle($1-))) && ($istok(@ . ',$left($nick(#,$me).pnick,1),32)) {
- set %quakechan #
- inc -u100 %quakeflood. [ $+ [ $+($address($nick,1),#) ] ] 1
- privmsg %quakechan GeoNet.org.nz Quake info for New Zealand
- get.quake nocheck keepalive lessthanday
- }
- if (!quakes week isin $strip($stripstyle($1-))) && ($istok(@ . ',$left($nick(#,$me).pnick,1),32)) && (!%quakeflood. [ $+ [ $+($address($nick,1),#) ] ] >= 3) {
- inc -u100 %quakeflood. [ $+ [ $+($address($nick,1),#) ] ] 1
- set %quakechan #
- privmsg %quakechan GeoNet.org.nz Quake info for New Zealand
- get.quake nocheck keepalive lessthanweek
- }
- if (!quakes all isin $strip($stripstyle($1-))) && ($istok(@ . ',$left($nick(#,$me).pnick,1),32)) && (!%quakeflood. [ $+ [ $+($address($nick,1),#) ] ] >= 3) {
- inc -u100 %quakeflood. [ $+ [ $+($address($nick,1),#) ] ] 1
- set %quakechan #
- privmsg %quakechan GeoNet.org.nz Quake info for New Zealand
- get.quake nocheck keepalive
- }
- }
- alias testq {
- get.quake nocheck lessthanweek
- }
- alias quake.dns { return localhost }
- ;;;;Folder & File Name On Your Server....
- alias quake.dir { return $+(/EQ/nz.php,$1) }
- alias quake.window {
- var %window, %l
- %window = @QuakeInfo
- if (!$window(%window)) {
- .window -blMk0ezsS -t40,80,110,130,150,180 +benstx %window ariel 16
- aline -ln %window $chr(1) 15 $+(7Location,15|,7Distance) $chr(9) 3Strength 15(3Magnitude15|3Quake Status15) 15@4 Depth (Km) 2URL
- aline -ln %window $chr(1) 16 $+ $str($chr(160),20)
- }
- return %window
- }
- alias get.quake { .window -c $quake.window | .noop $quake.window | var %sock, %opts, %l | %sock = $+(quakage123,.,$md5($r(11111111,9999999999999999))) | .sockclose %sock | .sockopen %sock $quake.dns 80 | %opts = $q.opts(%sock,$1-) | if (%opts) sockmark %sock $+(?,$v1) | if ($+(keepalive,$chr(61),true) isin %opts) .timerkp $+ %sock -cmo 0 7500 q.keep %sock %opts | return }
- on *:SOCKOPEN:quakage123.*: { if (!$hget($md5($sockname))) .hmake $md5($sockname) | var %sw, %l | .unset %quakereader. [ $+ [ $sockname ] ] | %sw = .sockwrite -n $sockname | %sw GET $quake.dir($sock($sockname).mark) HTTP/1.0 | %sw HOST: $quake.dns | %sw $str($crlf, 2) }
- on *:SOCKREAD:quakage123.*: {
- var %read, %list, %display, %a, %l | sockread %read | %read = $replace(%read,$+(<,/,a,>),$null) | tokenize 32 %read | %list = %quakereader. [ $+ [ $sockname ] ] | %display = %timedisplay. [ $+ [ $sockname ] ]
- if ($gettok(%read,1,58) == Url Control) { .set -u10 %nodis. [ $+ [ $sockname ] ] 1 }
- if ($gettok(%read,1,58) == Starting) { .set -u60 %quakereader. [ $+ [ $sockname ] ] 1 | echo @quakefetch 7Quakeinfo - Starting Lister: Requesting Page: $+(http,:,/,/,$quake.dns,$quake.dir($sock($sockname).mark)) }
- elseif ($gettok(%read,1,58) == Completed) { echo @quakefetch 3Quakeinfo - Completed Task: $gettok(%read,2-,58) | .unset %quakereader. [ $+ [ $sockname ] ] | .sockclose $sockname }
- elseif ($gettok(%read,1,58) == None) { if (!%nodis. [ $+ [ $sockname ] ]) { echo @quakefetch 4Quakeinfo - No Change To Page... } | .unset %quakereader. [ $+ [ $sockname ] ] | .sockclose $sockname }
- elseif (%list == 1) && ($len(%read) > 10) && ($displaycheck(%display, %read) == List) { if ($hget($md5($sockname),$md5($gettok(%read,4,9)))) halt | if ($hget($md5($sockname))) .hadd $md5($sockname) $md5($gettok(%read,4,9)) 1 | %a = $quake.sortlist(%read) | .aline -ln $quake.window 2 $+ %a | privmsg %quakechan $replace(%read,$chr(9),$chr(124)) }
- }
- alias qecho return echo
- alias q.keep {
- if (!$sock($1)) {
- .sockopen $1 $quake.dns 80
- .sockmark $2 $2
- }
- return
- }
- alias strstart {
- var %a, %b, %c, %d, %l
- %a = $1-
- tokenize 32 %a
- %a = $1-
- tokenize 160 %a
- return $replace($1-,$chr(32),$chr(160))
- }
- alias sortkm {
- var %a, %b, %c, %d, %e, %l
- %a = $1-
- %b = $replace(%a,$+(of),$chr(9))
- %c = $gettok(%b,2,9) $gettok(%b,1,9)
- %c = %c Of Local
- return $replace(%c,$chr(32),$chr(160))
- }
- alias quake.sortlist {
- var %in, %match, %out, %bit, %bits, %sout, %data, %l
- %data = $replace($1-,$chr(124),$chr(9))
- %data = $+($gettok(%data,1,9),$chr(9),$gettok(%data,4,9),$chr(9),$gettok(%data,2,9),$chr(9),$gettok(%data,3,9),$chr(9),$gettok(%data,5,9))
- return %data
- }
- alias displaycheck {
- if ($1 == week) && ($numtok($replace($2-,week,$chr(9)),9) > 1) return None
- elseif ($1 == day) && ($numtok($replace($2-,day,$chr(9)),9) > 1) return None
- elseif ($1 == day) && ($numtok($replace($2-,week,$chr(9)),9) > 1) return None
- return List
- }
- alias q.opts { var %opts, %out, %in, %l | %in = $1- | tokenize 32 %in
- if ($istok($2-,html,32)) %opts = html=True | else %opts = html=False
- if ($istok($2-,count,32)) %opts = %opts $+ &info=count | elseif ($istok($2-,help,32)) %opts = %opts $+ &info=help | else %opts = %opts $+ &info=non
- if ($istok($2-,nocheck,32)) %opts = %opts $+ &type=default | else %opts = %opts $+ &type=update
- if ($istok($2-,lessthanday,32)) .set %timedisplay. [ $+ [ $1 ] ] day
- elseif ($istok($2-,lessthanweek,32)) .set %timedisplay. [ $+ [ $1 ] ] week
- else .set %timedisplay. [ $+ [ $1 ] ] none
- if ($istok($2-,keepalive,32)) {
- if ($hget($md5($1))) .hfree $md5($1)
- .hmake $md5($1)
- %opts = %opts $+ &keepalive=True
- }
- else %opts = %opts $+ &keepalive=False
- return %opts
- }
- alias Quaket {
- %a = $1-
- %b = $asctime(%a,d)
- %c = $asctime(%a,m)
- if (%b == $asctime($ctime,d)) && (%c == $asctime($ctime,m)) return Today@ $+ $asctime(%a,h:nntt)
- dec %b
- if (%b == $asctime($ctime,d)) && (%c == $asctime($ctime,m)) return Yesterday@ $+ $asctime(%a,h:nntt)
- %d = 1
- while (%b > 0) {
- inc %d
- dec %b
- if (%c < $asctime($ctime,m)) && (%b == 0) {
- dec %c
- if (%c < 1) goto end
- %b = $asctime(%a,d)
- }
- }
- :end
- return $asctime(%a,ddoo mm yyy|h:nntt)
- }
- menu @Quakeinfo {
- =Clear Screen=:.clear $active
- -
- $$iif($sock(quakage123.*,0), Active Server Connections $+ $chr(58) $v1): .timerkp* off | sockclose quakage123.*
- .-
- $$iif(%keepalive != on, $$iif($sock(quakage123.*, 0) == 0, List Earthquakes [Less Than A Day Old])): get.quake nocheck lessthanday
- $$iif(%keepalive != on, $$iif($sock(quakage123.*, 0) == 0, List Earthquakes [Less Than A Week Old])): get.quake nocheck lessthanweek
- $$iif(%keepalive != on, $$iif($sock(quakage123.*, 0) == 0, List Earthquakes [List All])): get.quake nocheck
- -
- $$iif(%keepalive == on, Stop $+ $Chr(58) Keep Alive, $$iif($sock(quakage123.*, 0) == 0, Start $+ $Chr(58) Keep Alive)): {
- .timerkp* off
- if (!%keepalive) goto on
- if (%keepalive == off) goto on
- .set %keepalive off
- var %sock, %count, %match, %a, %b, %l
- %sock = quakage123.*
- %count = $sock(%sock,0)
- %b = 0
- while (%count > 0) && ($sock(%sock,%count)) {
- %a = $v1
- %match = $md5(%a)
- if ($hget(%match)) {
- inc %b
- .timerkp $+ %a off
- .hfree %match
- }
- .sockclose %a
- dec %count
- }
- halt
- :on
- .set %keepalive on
- get.quake nocheck keepalive lessthanday
- }
- $$iif(%keepalive == on, $$iif($sock(quakage123.*,0) > 0, Restart $+ $chr(58) Keep Alive)): {
- var %sock, %count, %match, %a, %b, %l
- %sock = quakage123.*
- %count = $sock(%sock,0)
- %b = 0
- while (%count > 0) && ($sock(%sock,%count)) {
- %a = $v1
- %match = $md5(%a)
- if ($hget(%match)) {
- inc %b
- .hfree %match
- }
- .sockclose %a
- dec %count
- }
- var %a, %b, %c, %d, %e, %l
- .set %keepalive on
- get.quake nocheck keepalive lessthanday
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement