Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:op:#: {
- if ( $me == $opnick ) {
- mode $chan -o $me
- notice $nick Do not op me, I do not need it.
- }
- }
- alias ReDoOmnimagaRSS {
- set %lastrss
- OmnimagaRSS
- }
- alias OmnimagaRSS {
- echo Checking Omnimaga
- rssfeed http://www.omnimaga.org/index.php?www;action=.xml;type=rss;sa=recent;limit=1
- if ( %lastrss != $hget(rssfeed,4).item.data ) {
- set %lastrss $hget(rssfeed,4).item.data
- set %linkpath $mid( $hget(rssfeed,4).item.data , 24 )
- set %site www.omnimaga.org
- if ( $sock(get_title) == get_title ) {
- sockclose get_title
- }
- /write -c log New Request
- sockopen get_title omnimaga.org 80
- set %page
- }
- }
- on *:sockopen:get_title:{
- if ($sockerr > 0) {
- echo -a Error: $sock(get_title).wsmsg
- }
- else {
- sockwrite -tn $sockname GET %linkpath HTTP/1.1
- sockwrite -n $sockname Accept: */*
- sockwrite -tn $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 $+ $crlf
- sockwrite -n $sockname Host: omnimaga.org
- sockwrite -n $sockname Connection: close
- sockwrite -n $sockname $crlf $+ $crlf
- }
- }
- on *:sockread:get_title:{
- if ($sockerr > 0) return
- sockread &get_titling
- if ($sockbr == 0) return -
- else {
- write log $bvar( &get_titling , 1 , 9999999999999).text
- }
- }
- on *:sockclose:get_title: {
- set %threadName $read( log , w , *<title>* ) $+ $read( log , $calc( $readn + 1 ) )
- echo %threadName
- set %threadName $mid( %threadName, $calc( $pos( %threadName, <title>) + 7))
- echo %threadName
- set %threadName $mid( %threadName, 0, $calc( $pos( %threadName, </title>) - 1 ))
- echo %threadName
- set %now_this_is_title %threadName
- set %userName $read( log, w, * $+ $mid(%linkPath, $pos(%linkPath,topic)) $+ * )
- set %userName $read( log, w , *View the profile of* , $calc( $readn - 30 )) $+ $read( log, $calc( $readn + 1) )
- echo %userName
- set %userName $mid( %userName, $calc( $pos( %userName, View the profile of) + 20))
- set %userName $mid( %userName, 0, $calc( $pos( %userName, ">) - 1 ))
- set %now_this_is_author %userName
- msg #omnimaga 10New post by 3 $+ %now_this_is_author $+ 10 in4 $iif( $len( %now_this_is_title ) > 31 , $iif( $right( $mid( %now_this_is_title , 1 , 27 ) , 1 ) != $chr(32) ,$mid( %now_this_is_title , 1 , 27 ) $+ ..., $mid( %now_this_is_title , 1 , 26 ) $+ ... ) , %now_this_is_title ) $+ 12 $mid( $hget(rssfeed,4).item.data , 1 , $calc( $pos( $hget(rssfeed,4).item.data , $chr(35) , 1) - 1 ) )
- echo New post by ( $+ 10 $+ %now_this_is_author $+ $+ ) in4 $iif( $len( %now_this_is_title ) > 31 , $iif( $right( $mid( %now_this_is_title , 1 , 27 ) , 1 ) != $chr(32) ,$mid( %now_this_is_title , 1 , 27 ) $+ ..., $mid( %now_this_is_title , 1 , 26 ) $+ ... ) , %now_this_is_title ) $+ 12 $mid( $hget(rssfeed,4).item.data , 1 , $calc( $pos( $hget(rssfeed,4).item.data , $chr(35) , 1) - 1 ) )
- sockclose get_title
- }
- alias CemetechRSS {
- echo -s Checking Cemetech
- rssfeed2 http://www.cemetech.net/forum/rss.php
- if ( %lastCrss != $hget(rssfeed2,<link>3) && %lastCrss != $null ) {
- set %lastCrss $hget(rssfeed2,<link>3)
- set %curtopic $mid( $hget(rssfeed2,<title>3) , $calc( $pos( $hget(rssfeed2,<title>3) , ::) + 3 ))
- if ( $pos( %curtopic, RE: ) ) {
- set %curtopic $mid( %curtopic, 5)
- }
- set %curtopic $mid( %curtopic, 0, 30)
- msg #omnimaga 10New Post by3 $hget(rssfeed2,<dc:creator>1) 10in4 %curtopic 5 $+ $hget(rssfeed2,<link>3)
- }
- }
- alias get_UTI {
- echo Checking UTI
- remove UTI.txt
- if ( $sock(get_UTI) == get_UTI ) {
- sockclose get_UTI
- }
- sockopen get_UTI www.UnitedTI.org 80
- }
- on *:sockopen:get_UTI:{
- if ($sockerr > 0) {
- echo -a Error: $sock(get_UTI).wsmsg
- }
- else {
- sockwrite -tn $sockname GET /forum/index.php?app=core&module=search&do=active&search_filter_app[forums]=1 HTTP/1.1
- sockwrite -n $sockname Accept: */*
- sockwrite -tn $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 $+ $crlf
- sockwrite -n $sockname Host: www.unitedti.org
- sockwrite -n $sockname Connection: close
- sockwrite -n $sockname $crlf $+ $crlf
- }
- }
- on *:sockread:get_UTI:{
- if ($sockerr > 0) return
- sockread &get_UTIposts
- if ($sockbr == 0) return -
- else {
- write UTI.txt $bvar( &get_UTIposts , 1 , 9999999999999).text
- }
- }
- on *:sockclose:get_UTI:{
- set %threadLink $read(UTI.txt,w, *Go to first unread post*)
- set %threadName $read(UTI.txt, $calc( $readn + 3 ))
- set %threadName $mid( %threadName , $calc( $pos( %threadName, View result ) + 13 ) )
- set %threadName $mid( %threadName , 1 , $calc( $pos( %threadName, 1 , </a> ) - 4 ) )
- set %threadName $mid( %threadName , 1 , 30)
- set %threadLink $mid( %threadLink, 12)
- set %threadLink http://www.unitedti.org/forum/index.php? $+ $mid( %threadLink, $pos( %threadLink , showtopic ) )
- set %threadLink $mid( %threadLink , 0 , $calc( $pos( %threadLink, &) - 1))
- set %posterName $read(UTI.txt,w,*<li>By:*, $readn )
- set %posterName $mid( %posterName, $calc( $pos( %posterName , '>) + 2))
- set %posterName $mid( %posterName , 1 , $calc( $pos( %posterName ,</a>) - 1))
- if ( %LastUTIrss = $null ) {
- set %LastUTIrss None
- }
- if ( %threadLink != %LastUTIrss ) {
- set %LastUTIrss %threadLink
- msg #omnimaga 10New Post by3 %posterName 10in4 %threadName 14 $+ %threadLink
- }
- }
- alias get_TIFW {
- echo Checking TIFW
- remove TIFW.txt
- if ( $sock(get_TIFW) == get_TIFW ) {
- sockclose get_TIFW
- }
- sockopen get_TIFW tifreakware.ath.cx 80
- }
- on *:sockopen:get_TIFW:{
- if ($sockerr > 0) {
- echo -a Error: $sock(get_TIFW).wsmsg
- }
- else {
- sockwrite -t $sockname GET /index.php?act=Search&CODE=getactive HTTP/1.1 $+ $crlf
- sockwrite $sockname Accept: text/html $+ $crlf
- sockwrite -t $sockname User-Agent: mIRC $+ $crlf
- sockwrite $sockname Host: tifreakware.ath.cx $+ $crlf
- sockwrite $sockname Connection: Close $+ $crlf
- sockwrite $sockname $crlf $+ $crlf $+ $crlf
- }
- }
- on *:sockread:get_TIFW:{
- if ($sockerr > 0) return
- sockread &get_TIFWposts
- if ($sockbr == 0) return -
- else {
- write TIFW.txt $bvar( &get_TIFWposts , 1 , 9999999999999).text
- }
- }
- on *:sockclose:get_TIFW:{
- set %threadLink $read(TIFW.txt,w, *<!-- Begin Topic Entry*)
- set %threadName $read(TIFW.txt, $calc( $readn + 8 )) $+ $read(TIFW.txt, $calc( $readn + 1 ))
- set %threadLink %threadName
- set %threadLink $mid( %threadLink, $pos( %threadLink, showtop ) )
- set %threadName %threadLink
- set %threadLink $mid( %threadLink, 0 , $calc( $pos( %threadLink, &) - 1 ))
- set %threadLink http://tifreakware.ath.cx/index.php? $+ %threadLink
- set %threadName $mid( %threadName, $calc( $pos( %threadName, '>) + 2))
- set %threadName $mid( %threadName , 1 , $calc( $pos( %threadName ,</a>) - 1))
- set %posterName $read(TIFW.txt,w,*Last Post by:*, $readn ) $+ $read(TIFW.txt, $calc( $readn + 1 ) )
- set %posterName $mid( %posterName , $pos( %posterName, showuser ) )
- set %posterName $mid( %posterName, $calc( $pos( %posterName , '>) + 2))
- set %posterName $mid( %posterName , 1 , $calc( $pos( %posterName , </a> ) - 1) )
- if ( %LastTIFWrss = $null ) {
- set %LastTIFWrss None
- }
- if ( %threadLink != %LastTIFWrss ) {
- set %LastTIFWrss %threadLink
- echo 10New Post by3 %posterName 10in4 %threadName 3 $+ %threadLink
- msg #omnimaga 10New Post by3 %posterName 10in4 %threadName 3 $+ %threadLink
- }
- }
- alias get_MC {
- echo Checking MC
- remove MC.txt
- if ( $sock(get_MC) == get_MC ) {
- sockclose get_MC
- }
- sockopen get_MC junemann.nl 80
- }
- on *:sockopen:get_MC:{
- if ($sockerr > 0) {
- echo -a Error: $sock(get_MC).wsmsg
- }
- else {
- sockwrite -t $sockname GET /maxcoderz/search.php?search_id=newposts HTTP/1.1 $+ $crlf
- sockwrite $sockname Accept: text/html $+ $crlf
- sockwrite -t $sockname User-Agent: mIRC $+ $crlf
- sockwrite $sockname Host: junemann.nl $+ $crlf
- sockwrite $sockname Connection: Close $+ $crlf
- sockwrite $sockname $crlf $+ $crlf $+ $crlf
- }
- }
- on *:sockread:get_MC:{
- if ($sockerr > 0) return
- sockread &get_MCposts
- if ($sockbr == 0) return -
- else {
- write MC.txt $bvar( &get_MCposts , 1 , 9999999999999).text
- }
- }
- on *:sockclose:get_MC:{
- set %threadLink $read(MC.txt,w, *viewtopic.php*)
- set %threadName %threadLink
- set %threadLink $mid( %threadLink, $pos( %threadLink, viewtopic.php ) )
- set %threadName %threadLink
- set %threadLink $mid( %threadLink, 0 , $calc( $pos( %threadLink, &) - 1 )) $+ & $+ $mid( %threadLink, $pos( %threadLink, t=) )
- set %threadLink $mid( %threadLink, 0 , $calc( $pos( %threadLink, &) - 1))
- set %threadLink http://junemann.nl/maxcoderz/ $+ %threadLink
- set %threadName $mid( %threadName, $calc( $pos( %threadName, ">) + 2))
- set %threadName $mid( %threadName , 1 , $calc( $pos( %threadName ,</a>) - 1))
- set %posterName $read(MC.txt,w,*username-coloured*, $readn ) $+ $read(MC.txt, $calc( $readn + 1 ) )
- set %posterName $mid( %posterName , $calc( $pos( %posterName, coloured"> ) + 10) )
- set %posterName $mid( %posterName , 1 , $calc( $pos( %posterName , </a> ) - 1) )
- if ( %LastMCrss = $null ) {
- set %LastMCrss None
- }
- if ( %threadLink != %LastMCrss && %threadName != 500 Internal Server Erro ) {
- set %LastMCrss %threadLink
- echo 10New Post by3 %posterName 10in4 %threadName 3 $+ %threadLink
- msg #omnimaga 10New Post by3 %posterName 10in4 %threadName 7 $+ %threadLink
- }
- }
- alias -l grabdata { if ($regex($1-,(<([^>]+)>)(.+)</\2>)) return $regml(1) $+ $chr(255) $+ $regml(3) }
- alias rssfeed {
- if ($1 == $null) return
- else {
- if ($left($1,7) != http://) echo $color(text) -a Incorrect URL format, please include http:// at the beginning.
- else {
- if ($sock(rssfeed)) sockclose rssfeed
- ; grab the host from $1 and connect to it
- sockopen rssfeed $gettok($1,2,47) 80
- ; store $1 in a sockmark of the rssfeed socket
- sockmark rssfeed $1
- }
- }
- }
- on *:sockopen:rssfeed:{
- if ($sockerr > 0) {
- return
- }
- ; if the hash table rssfeed exists from a previous execution, clear it
- if ($hget(rssfeed)) hfree rssfeed
- ; GET the page using the path after the host in the sockmark
- sockwrite -n $sockname GET / $+ $gettok($sock($sockname).mark,3-,47) HTTP/1.1
- ; specify the host as well from the sockmark
- sockwrite -n $sockname Host: $gettok($sock($sockname).mark,2,47)
- sockwrite -n $sockname Connection: keep-alive
- sockwrite -n $sockname
- }
- on *:sockread:rssfeed:{
- if ($sockerr > 0) return
- :nextread
- sockread %temp
- if (%temp == $null) var %temp = -
- if ($sockbr == 0) {
- return
- }
- if ((</rdf:RDF> isin %temp) || (</rss> isin %temp)) {
- ; if the end of an RSS file is found, end it
- sockclose $sockname
- if (%temp) unset %temp
- return
- }
- if ($grabdata(%temp)) {
- ; if it matches an RSS item type (see the grabdata alias above) store the tag in %item
- var %item = $gettok($grabdata(%temp),1,255)
- ; if there is no item in the hash table that matches that tag, make it the first
- ; -> e.g. <title>1
- if (!$hfind(rssfeed,%item $+ *,0,w)) hadd -m rssfeed %item $+ 1 $gettok($grabdata(%temp),2,255)
- ; if not, loop through it items in the hash table and find the highest matching tag
- ; then save it as an item with a number of one higher than the highest
- ; -> e.g. there's a <title>1 so store it as <title>2
- ; and break out of the loop by setting the looping var higher than the while condition
- else {
- var %x = 1
- while (%x <= $hget(rssfeed,0).item) {
- if ($hfind(rssfeed,%item $+ *,0,w)) {
- var %item = %item $+ $calc($ifmatch + 1)
- hadd -m rssfeed %item $gettok($grabdata(%temp),2,255)
- var %x = $hget(rssfeed,0).item
- }
- inc %x
- }
- }
- }
- goto nextread
- }
- on *:sockclose:rssfeed:{
- ; if the socket is closed by the remote host say so
- }
- alias rssfeed2 {
- if ($1 == $null) return
- else {
- if ($left($1,7) != http://) echo $color(text) -a Incorrect URL format, please include http:// at the beginning.
- else {
- if ($sock(rssfeed2)) sockclose rssfeed2
- ; grab the host from $1 and connect to it
- sockopen rssfeed2 $gettok($1,2,47) 80
- ; store $1 in a sockmark of the rssfeed2 socket
- sockmark rssfeed2 $1
- }
- }
- }
- on *:sockopen:rssfeed2:{
- if ($sockerr > 0) {
- return
- }
- ; if the hash table rssfeed2 exists from a previous execution, clear it
- if ($hget(rssfeed2)) hfree rssfeed2
- ; GET the page using the path after the host in the sockmark
- sockwrite -n $sockname GET / $+ $gettok($sock($sockname).mark,3-,47) HTTP/1.1
- ; specify the host as well from the sockmark
- sockwrite -n $sockname Host: $gettok($sock($sockname).mark,2,47)
- sockwrite -n $sockname Connection: keep-alive
- sockwrite -n $sockname
- }
- on *:sockread:rssfeed2:{
- if ($sockerr > 0) return
- :nextread
- sockread %temp
- if (%temp == $null) var %temp = -
- if ($sockbr == 0) {
- return
- }
- if ((</rdf:RDF> isin %temp) || (</rss> isin %temp)) {
- ; if the end of an RSS file is found, end it
- sockclose $sockname
- if (%temp) unset %temp
- return
- }
- if ($grabdata(%temp)) {
- ; if it matches an RSS item type (see the grabdata alias above) store the tag in %item
- var %item = $gettok($grabdata(%temp),1,255)
- ; if there is no item in the hash table that matches that tag, make it the first
- ; -> e.g. <title>1
- if (!$hfind(rssfeed2,%item $+ *,0,w)) hadd -m rssfeed2 %item $+ 1 $gettok($grabdata(%temp),2,255)
- ; if not, loop through it items in the hash table and find the highest matching tag
- ; then save it as an item with a number of one higher than the highest
- ; -> e.g. there's a <title>1 so store it as <title>2
- ; and break out of the loop by setting the looping var higher than the while condition
- else {
- var %x = 1
- while (%x <= $hget(rssfeed2,0).item) {
- if ($hfind(rssfeed2,%item $+ *,0,w)) {
- var %item = %item $+ $calc($ifmatch + 1)
- hadd -m rssfeed2 %item $gettok($grabdata(%temp),2,255)
- var %x = $hget(rssfeed2,0).item
- }
- inc %x
- }
- }
- }
- goto nextread
- }
- on *:sockclose:rssfeed2:{
- ; if the socket is closed by the remote host say so
- }
- menu status,channel,query {
- Hash Table Editor:hedit
- }
- alias hedit { dialog -m hedit hedit }
- dialog hedit {
- title Hash Table Editor
- size -1 -1 260 142
- option dbu
- edit "Coded By: Imrac", 1, 0 131 260 11, read right autohs
- box "Tables", 2, 2 3 75 125
- list 3, 7 13 65 94, vsbar sort
- button "Add", 4, 7 101 32 11
- button "Remove", 5, 40 101 32 11
- button "Rename", 6, 7 113 32 11
- button "Clear", 7, 40 113 32 11
- box "Items", 8, 80 3 178 125
- list 9, 85 13 65 102, vsbar sort
- button "Add", 10, 85 113 32 11
- button "Remove", 11, 118 113 32 11
- box "Data", 12, 155 9 98 63
- text "Item", 13, 158 17 50 9
- edit "",14, 158 25 92 11, autohs
- text "Data", 15, 158 37 50 9
- edit "", 16, 158 45 92 11, autohs
- button "Update", 17, 189 58 30 11
- box "Search", 18, 155 74 98 51
- check "Data", 19, 179 83 24 9
- check "Table", 20, 207 83 24 9
- edit "", 21, 158 95 92 11, autohs
- check "Regular Ex.", 22, 158 111 35 9
- button "Clear", 23, 215 109 35 11
- }
- on *:Dialog:hedit:*:*:{
- if ($devent == init) {
- var %x = $hget(0)
- did -o $dname 2 1 Tables $+($chr(40),%x,$chr(41))
- did -b $dname 5-23
- while (%x) {
- did -a $dname 3 $hget(%x)
- dec %x
- }
- did -f $dname 3
- }
- if ($devent == sclick) {
- var %tb = $did($dname,3).seltext
- var %it = $did($dname,9).seltext
- If ($did == 1) { did -j $dname 3 }
- ; // Click On Table List //
- If ($did == 3) && (%tb) {
- did -e $dname 5-10
- did -u $dname 9
- iu
- If ($did($dname,21).text) { itemsearch }
- did -o $dname 1 1 Table: ' $+ %tb $+ ' Items: $hget(%tb,0).item Size: $hget(%tb).size
- }
- ; // Click On Item List //
- If ($did == 9) && ($did($dname,$did).seltext) {
- did -e $dname 11-17
- var %t = $did($dname,3).seltext
- var %i = $did($dname,9).seltext
- did -o $dname 14 1 %i
- did -o $dname 16 1 $hget(%t,%i)
- }
- ; // ADD NEW HASH TABLE BUTTON //
- If ($did == 4) {
- var %n = $input(Hash Table Name:,equd,New Hash Table)
- If (%n == $null) { derror -c No Name Given }
- ElseIf ($regex(%n,/ /)) { derror -c Hash Table Name Can Not Contain Spaces }
- ElseIf ($hget(%n)) { derror -c Hash Table Name Already Exists }
- Else {
- var %s = $input(Hash Table Size:,equd,New Hash Table,100)
- If (%s == $null) { derror -c No Size Specified }
- ElseIf (%s !isnum 1-) || (%s != $int(%s)) { derror -c Invalid Size Specified }
- Else {
- hmake %n %s
- did -o $dname 1 1 Success: Made Hash Table.
- did -a $dname 3 %n
- did -o $dname 2 1 Tables $+($chr(40),$hget(0),$chr(41))
- }
- }
- }
- ; // Remove Hash table //
- If ($did == 5) {
- If ($input(Are You Sure You Want To Remove Hash Table ' $+ %tb $+ ', wudy, Remove Table)) {
- hfree %tb
- did -o $dname 1 1 Success: Removed Hash Table.
- did -d $dname 3 $did($dname,3).sel
- did -r $dname 14,16,9,21
- did -b $dname 5-23
- did -o $dname 2 1 Tables $+($chr(40),$hget(0),$chr(41))
- did -o $dname 8 1 Items
- }
- }
- ; // Rename Hash Table
- If ($did == 6) {
- var %n = $input(Hash Table's New Name:,equd,Rename Hash Table)
- If (%n == $null) { derror -r No New Name Specified }
- ElseIf ($regex(%n,/ /)) { derror -r Hash Table Name Can Not Contain Spaces }
- Else {
- did -o $dname 1 1 Success: Renamed Hash Table.
- hrename %tb %n
- did -d $dname 3 $did($dname,3).sel
- did -ac $dname 3 %n
- }
- }
- ; // Clear Hash Table //
- If ($did == 7) {
- var %c = $input(Are You Sure You Want To Clear All Items From ' $+ %tb $+ '?, wudy, Clear Table)
- If (%c) { hdel -w %tb * | iu | did -o $dname 1 1 Success: Removed Hash Table. }
- }
- ; // Add item to table //
- If ($did = 10) {
- var %ni = $input(New Item Name:,equd,Add Item)
- If (%ni == $null) { derror -a No Item Name Specified }
- ElseIf ($regex(%ni,/ /)) { derror -a Item Name Can Not Contain Spaces }
- ElseIf ($hget(%tb,%ni)) { derror -a Item Already Exists }
- Else {
- var %nd = $input(New Item Data:,equdv,Add Item)
- If (%nd == $cancel) { derror -a Cancelled }
- Else {
- hadd %tb %ni %nd
- did -o $dname 1 1 Success: Added Item.
- itemsearch
- }
- }
- }
- ; // Remove an item from the table //
- If ($did = 11) {
- var %yn = $input(Are You Sure You Want To Delete ' $+ %it $+ '.,wdyu,Remove Item)
- if (%yn) {
- hdel %tb %it
- itemsearch
- did -o $dname 1 1 Success: Removed Item.
- }
- }
- ; // Update an item //
- If ($did == 17) {
- var %ni = $did($dname,14).text
- If (%ni == $null) { derror -u No Item Name Given }
- ElseIf ($regex(%ni,/ /)) { derror -u Item Name Can Not Contain Spaces }
- Else {
- did -o $dname 1 1 Success: Updated Item.
- hdel %tb %it
- hadd %tb %ni $did($dname,16).text
- did -d $dname 9 $did($dname,9).sel
- did -ac $dname 9 %ni
- If ($did($dname,21).text) { itemsearch }
- }
- }
- If ($did == 19) { if ($did($dname,21).text) { itemsearch } }
- If ($did == 20) { if ($did($dname,21).text) { itemsearch } }
- If ($did == 22) { if ($did($dname,21).text) { itemsearch } }
- If ($did == 23) { did -r $dname 21 | did -u $dname 19,20,22 | itemsearch }
- }
- If ($devent == edit) {
- If ($did = 21) { itemsearch | did -f $dname 21 }
- }
- }
- alias -l itemsearch {
- If ($did($dname,21).text) {
- var %t = $did($dname,3).seltext
- var %sel = $did($dname,9).seltext
- var %f = $iif($did($dname,22).state,r,w)
- var %f = $iif($did($dname,20).state,$upper(%f),$lower(%f))
- var %d = $iif($did($dname,19).state,.$true,)
- var %s = $did($dname,21).text
- var %x = $iif(%d,$hfind(%t,%s,0,%f).data,$hfind(%t,%s,0,%f))
- did -o $dname 8 1 Items $+($chr(40),%x,/,$hget(%t,0).item,$chr(41))
- did -r $dname 9
- while (%x) {
- if (%d) var %st = $hfind(%t,%s,%x,%f).data
- else var %st = $hfind(%t,%s,%x,%f)
- did -a $dname 9 %st
- dec %x
- }
- If (%sel) && ($didreg($dname,9,/^ $+ %sel $+ $/)) { did -c $dname 9 $v1 }
- Else {
- did -r $dname 14,16
- did -b $dname 11-17
- }
- }
- Else {
- iu
- }
- }
- alias -l iu {
- var %tb = $did($dname,3).seltext
- var %it = $did($dname,9).seltext
- var %x = $hget(%tb,0).item
- did -r $dname 9
- did -o $dname 8 1 Items $+($chr(40),%x,$chr(41))
- did -e $dname 18-23
- while (%x) { did -a $dname 9 $hget(%tb,%x).item | dec %x }
- If (%it) && ($didreg($dname,9,/^ $+ %it $+ $/)) { did -c $dname 9 $v1 }
- Else {
- did -r $dname 14,16
- did -b $dname 11-17
- }
- }
- alias hrename {
- var %t1 = $1, %t2 = $2
- hmake %t2 $hget(%t1).size
- var %x = $hget(%t1,0).item
- while (%x) {
- hadd %t2 $hget(%t1,%x).item $hget(%t1,%x).data
- dec %x
- }
- hfree %t1
- }
- alias -l derror {
- If ($1 == -c) { did -o $dname 1 1 Error: Unable To Create Hash Table. ( $+ $2- $+ ) }
- ElseIf ($1 == -r) { did -o $dname 1 1 Error: Unable To Rename Hash Table. ( $+ $2- $+ ) }
- ElseIf ($1 == -a) { did -o $dname 1 1 Error: Unable To Add Item. ( $+ $2- $+ ) }
- ElseIf ($1 == -u) { did -o $dname 1 1 Error: Unable To Update Item. ( $+ $2- $+ ) }
- }
- alias tinyurl {
- var %c $iif($isid,return,echo -a)
- if ($1) && (!$com(u)) && (!$sock(tinyurl)) {
- if ($regex($1,/^(?:(?:f|ht)tps?:\/\/|[^<>\/:\s])+[^<>.:\/\s]+(?:\.[^\/:<>.\s]{2,6})+(?:\/.*?)?$/i)) {
- sockopen tinyurl www.tinyurl.com 80
- sockmark tinyurl /create.php?url= $+ $remove($1-,$chr(32))
- .comopen u Wscript.Shell
- .comclose u $com(u,run,1,bstr*,$(%comspec%,) /c ping.exe -n 2 127.0.0.1 >nul,uint,0,bool,true)
- %c $iif(%tinyurl,$v1,No result.)
- }
- else %c Invalid URL!
- }
- else %c $iif($1,Please be patient...,Input a URL!)
- }
- on *:sockopen:tinyurl: {
- if ($sockerr) {
- set -u3 %tinyurl Error connecting: $sock($sockname).wsmsg
- sockclose $sockname
- }
- else {
- sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
- sockwrite -n $sockname Host: tinyurl.com
- sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8)
- sockwrite -n $sockname $crlf
- }
- }
- on *:sockread:tinyurl: {
- if ($sockerr) {
- set -u3 %tinyurl Error connecting: $sock($sockname).wsmsg
- sockclose $sockname
- }
- else {
- var %x
- sockread %x
- if ($regex(%x,/<blockquote><b>(.*?)<\/b><br>/)) {
- set -u3 %tinyurl $regml(1)
- sockclose $sockname
- }
- }
- }
- on $*:TEXT:/^[.!@]tiny(url)? .*?$/Si:#: {
- if (!%tinyurl. [ $+ [ $2 ] ]) {
- var %c = $tinyurl($2)
- msg $chan $iif(error !isin %c && invalid !isin %c,TinyURL converted: %c $+([,From $len($2) to $len(%c) chars,]),%c)
- set -u5 %tinyurl. $+ $2 1
- }
- }
Add Comment
Please, Sign In to add comment