There are 3 parts to sockets. Sockopen, Sockread and Sockclose ON *:SOCKOPEN:socketname:{ sockwrite -nt $sockname GET /url/to/place/to/get/file.html HTTP/1.1 sockwrite -nt $sockname Host: website.url.here sockwrite -nt $sockname Connection: Close sockwrite -t $sockname $crlf } thats an example of a sockopen event. this is where you actually request the data from wherever you want to get data from...this only works for web pages. if you wanna get data from rs hiscores, you'd use something like this. on *:SOCKOPEN:stats:{ sockwrite -nt $sockname GET /lang/en/aff/runescape/hiscorepersonal.cgi?username= $+ %name.var HTTP/1.1 sockwrite -nt $sockname Host: hiscore-web.runescape.com sockwrite -nt $sockname Connection: Close sockwrite -t $str($crlf,2) } REMEMBER FOR THIS TO EVEN FUNCTION YOU MUST ACTUALLY OPEN A SOCKET VIA EITHER AN ALIAS OR ON TEXT EVENT. /sockopen [-d] [bindip]
The /sockopen command initiates a connection to the specified address and port. You can specify either an ip address or a named address (which will be resolved to an ip address). The -d switch means that you specified an ip address as the bind address. (Sockread) This is the part where you get the data and can proceed to parse through it. on *:SOCKREAD:socketname:{ var %varname .sockread %varname other stuff here } where you see other stuff here, you can either write the data to a text file, or if your good enough you can save parts of the data as variables (SockClose) This part, though not always required i use extensively w/ Armadyl and Genie. This section can allow for handling of the data gathered from the sockread event. this doesnt mean parsing but how you want to have the data outputed either to a channel, an individual person or text file. on *:SOCKCLOSE:socketname:{ if (%var.name.hah == whatever) { do something } if (%var.named.hah == something) { do something } else { haltdef } } yes i know the examples for sockread and sockclose events are a bit cheesy but its easier for me to explain that way, wherever you see "do something" inside an if statement, this is where you can have the script do something w/ the data obtained from wherever, manipulation if you will. haltdef is just a fancy form of halt. both end the script if called The sockclose event is triggered when a connection is closed by the remote connection (not you).