SRL Archive - C/C++ Help and Tutorials

Two internet questions...


R0b0t1

2007-11-09 18:25:46

Well, first one is this: Does C++ have a library to interact with HTTP pages? Like SCAR's GetPage function or something?

Second: I once heard there was a program-friendly version of the RS highscores. Where it just had like no HTML or anything…


Yep, thats it. Thanks!

Yakman

2007-11-10 17:27:15

i dont think there is a GetPage method, you would probably have to make the whole http interaction with sockets

like in windows, you would use a library called WinSock, then send "GET index.html" to the server, and read to get the html source,

this would be the scar equivalent. (might not compile)


var
socket: Integer;
source: string;

begin
socket:= OpenConnection('www.google.com', 80, 15000);
SendConnectionData(socket, 'GET index.html');
ReadConnectionData(socket, source);
FreeConnection(socket);
writeln(source);
end.

that should work…

R0b0t1

2007-11-10 22:01:04

Ok, thanks.


Anyone know if there's a program-friendly RS highscores though?

Method

2007-11-10 22:11:22

From: R0b0t1
Ok, thanks.


Anyone know if there's a program-friendly RS highscores though?


Yep, Jagex has conveniently made one for us:

http://hiscore.runescape.com/index_lite.ws?player=UserNameHere

R0b0t1

2007-11-10 22:47:55

The freak? How the hell am I supposed to decode that!?!?!

NxTitle

2007-11-10 22:49:20

From: Yakman
i dont think there is a GetPage method, you would probably have to make the whole http interaction with sockets

like in windows, you would use a library called WinSock, then send "GET index.html" to the server, and read to get the html source,

this would be the scar equivalent. (might not compile)

ScarScript:By Drunkenoldma [LEFT]var socket: Integer; source: string; begin socket:= OpenConnection('www.google.com', 80, 15000); SendConnectionData(socket, 'GET index.html'); ReadConnectionData(socket, source); FreeConnection(socket); writeln(source); end. [/LEFT]

that should work…

It wouldn't work, as you're missing the host name and the HTTP version.

A proper HTTP GET request would look like this:

GET / HTTP/1.0
Host: www.google.ca
User-Agent: Cyber Banana (optional)
(extra line)

Then it would return HTTP headers and the body.

For more info about HTTP, search "rfc 2616" on google. It's kinda complicated, but it's very detailed.

Method

2007-11-10 22:51:03

From: R0b0t1
The freak? How the hell am I supposed to decode that!?!?!


Overall Rank, Skill Total, Total Experience, Skill Rank, Skill Level, Skill Experience (and on for the other skills).

NxTitle

2007-11-10 22:51:47

From: R0b0t1
The freak? How the hell am I supposed to decode that!?!?!


Well, what I would do is look at zezima's highscore list and match each level with each number. I would be very surprised if they don't have a guide to that, so maybe google will help there.