MIRC (misc examples): Difference between revisions

→‎MArray Snippet: {{Lines_too_long}}
No edit summary
 
(→‎MArray Snippet: {{Lines_too_long}})
 
(3 intermediate revisions by 2 users not shown)
Line 1:
These [[mIRC]] code snippets are not associated with any programming task.
#
 
=MArray Snippet=
Author: sm0kie_
{{Lines_too_long}}
Release: unknown
'''mIRC Array Snippet'''
File: phone.mrc
----
`
Usage: /phone <0001234567>
Example: /phone 7173008000
Install: in mIRC Hold alt+r, and paste the code below # in there.
Description: Receives someones info from the PhoneBook.
 
/*_____________________________________________________________________________
#
|/
/ Array snippet by Haso "sm0kie_" Keric <Osah@comcast.net>
#Socket
| Version 0.1, released 11/06 -- support on #script/irc.gamesurge.net
on 1:SOCKOPEN:phone:{
| Use/modify however you want, but please keep my name in it. Thank you!
wsock x001 $decode(R0VUIC9zZWFyY2g/aGw9ZW4mbHI9JnBiPWYmcT0=,m) $+ %number $+ &pb=f&btnG= $+ $decode(U2VhcmNoK1Bob25lQm9vayBIVFRQLzEuMQ==,m)
|
wsock x110 $decode(SG9zdDogd3d3Lmdvb2dsZS5jb20=,m)
| Keywords: Database, Storage, Array
wsock x918 $decode(VXNlci1BZ2VudDogTW96aWxsYS81LjAgKFdpbmRvd3M7IFU7IFdpbmRvd3MgTlQgNS4xOyBlbi1VUzsgcnY6MS43LjgpIEdlY2tvLzIwMDUwNTExIEZpcmVmb3gvMS4wLjQ=,m)
|
wsock F0C3 $decode(S2VlcC1BbGl2ZTogMzAw,m)
| This add-on provides a set of identifiers that can be useful to scripts
wsock 19300101 $decode(Q29ubmVjdGlvbjoga2VlcC1hbGl2ZQ==,m)
| that deal with Databases. And methods to store things.
wsock byte6 $decode(UmVmZXJlcjogaHR0cDovL3d3dy5nb29nbGUuY29tLw==,m)
|
var %1010010101001010101 x0010x89_hexeditor $decode(VEhJUyBJUyBPRkZJQ0lBTExZIE1BREUgQlkgU01PS0lF,m)
| The script defines the following commands/identifiers:
wsock byte4x1 $crlf
|
| $array_create(<arrayname>,<How Many Columns>,<How Many Rows>)
| Example: $array_create(myarray,10,10)
|
| Creates a new Array file with an empty database.
|
| $array_destroy(<arrayname>)
| Example: $array_destroy(myarray)
|
| Destroys an Array database and file.
|
| $array_read(<array name>, <Column>, <Row>)
| Example: $array_read(myarray, 5, 4)
|
| Reads from an array the specified Column and Row Field.
|
| $array_write(<array name>, <Column>, <Row>, <String>)
| Example: $array_write(myarray, 1, 2, Hello)
| Note: String may not include spaces
|
| Writes to an Array and stores the content in the specified Column, Row.
|
| Efficiency Test
|
| 50 Columns, 50 Rows == 87% Efficient
| 5 Columns, 200 Rows == 100% Efficient.
| The less Columns, the more efficient will the readings be.
|
\
_\_____________________________________________________________________________
*/
alias -l array_version return 0.1 Osah-Framework.
alias -l array_extension return .ray
alias -l array_url return www.hasokeric.com
alias -l array_dir return $mircdir
alias -l array.f return $array_dir $+ $1 $+ $array_extension
alias -l array.rows return $lines($array.f($1))
alias -l array.new .timer_array $3 0 write $array_dir $+ $1 $str(NUL $+ $chr(32),$2)
alias -l array.read return $read($array.f($1),$calc($3 +1))
alias array_write write -l $+ $calc($3 +1) $array.f($1) $puttok($array.read($1,$2,$3),$4,$2,32) | return * Array changed
alias array_create {
if ($2 == $null) || ($3 == $null) { return * Error, Not enough parameters. }
if ($2 > 100) { return * Error, Too many columns. > 70 | halt } | if ($file($1 $+ $array_extension) != $null) { return * Error, Array file exists. | halt }
write $1 $+ $array_extension $ctime $+ @ $+ $2 $+ : $+ $3 $+ @OSAHFRAMEWORK | array.new $1 $+ $array_extension $2 $3 | return * Created Array $1
}
alias array_destroy if ($file($array.f($1))) { remove $array.f($1) } | else return * Array not found | return * Destroyed Array $1
on 1:SOCKREAD:phone:{
alias array_read if ($gettok($read($array.f($1),$calc($3 +1)),$2,32)) { return $gettok($read($array.f($1),$calc($3 +1)),$2,32) } | else return * Nothing stored at specified Column and Row
.sockread %driver.read
if (%driver.read == $null) { halt }
if (make isin %driver.read) && (sure isin %driver.read) { .echo -a * No match found | halt | sockclose phone }
if ($left(%number,3) isin %driver.read) && ($right(%number,4) isin %driver.read) && (%driver.read != $null) { .parsex $remove($nohtml(%driver.read), ,Google Search:,Web,Images,Groups,News,Froogle,Local,more&raquo;,Preferences,Residential,Phonebook,Results,1 - 1 of 1,for) | halt }
}
#Alias
alias wsock /sockwrite -n phone* $2-
alias phone {
.set %number $1-
.sockclose phone*
.sockopen phone www.google.com 80
}
#HTML Removing
alias -l nohtml {
var %a,%b
%b = $regsub($1,/[^<]*>|<[^>]*>|<[^>]*/g,$chr(32),%a)
return %a
}
#Parse
alias parsex {
if ($1- == $null) { halt }
if ($len($1-) < 14) { halt }
else { echo -a $mid($remove($1-, $+ %number $+ ,GoogleMaps,-,Yahoo!Maps,-),3) }
}
#eof
Anonymous user