shaunthasheep
2006-07-05 21:38:57
{==================================================}
{=============My Gay Useless Functions=============}
{===={Includes: )====}
{===={ 1.Gets Active Users In Forum Count )====}
{===={ 2.Gets Total People Playing Rs )====}
{===={ 3.Gets News. Very 1337 Function :P )====}
{===={ 4.Formats News (Kinda Crappy)^^^^^ )====}
{===={ 5.Gets Player Count In A World )====}
{==================================================}
{=================How To Run?======================}
{===={Instructions: )====}
{===={ 1.Hit Play )====}
{===={ 2.Accept All Of The Popups!!! )====}
{===={ 3.Sit Back And Watch It Return Some )====}
{===={ Numbers :P and Some Text (News) :D )====}
{==================================================}
{==================================================}
program New;
type
News = record
Date,Title,Description : string;
end;
var
LatestNews : News;
i : integer;
function ForumUsersActive : integer;
var
shold : string;
begin
shold := GetPage('http://forum.runescape.com/lang/en/aff/runescape/forums.ws');
shold := Between('Conduct</A></LI> <LI> </LI> <LI><SPAN class=count> ',' active users </SPAN></LI></UL></DIV></DIV><DIV i',shold);
Result := StrToInt(Trim(shold));
end;
function GetNews : News;
var
shold : string;
begin
shold := GetPage('http://www.runescape.com/lang/en/aff/runescape/title.ws');
shold := Between('class="newsdate"',' <td style="padding-left:',shold);
Result.Date := Between('>','</span>',shold);
Result.Title := Between('</span>','</dt>',shold);
Result.Description := Between('vertical-align: top;">','</td>',shold);
end;
function AllPeoplePlaying : integer;
var
shold : string;
begin
shold := GetPage('http://www.runescape.com/lang/en/aff/runescape/title.ws');
shold := Between('alt="RuneScape"><br>There are currently ','people playing!',shold);
Result := StrToInt(Trim(shold));
end;
function GetPeopleInWorld(World : integer) : integer;
var
shold : string;
begin
shold := GetPage('http://www.runescape.com/lang/en/aff/runescape/serverlist.ws?lores.x=385&lores.y=208&plugin=0');
shold := Between('>World ' + IntToStr(World) + '</a> </td><td>',' Players</td> ',shold);
if ((shold = '') or (shold = 'FULL') or (lowercase(shold) = 'offline')) then shold := '2000'
Result := StrToInt(Trim(shold));
end;
begin
ClearDebug;
Writeln('There Are ' + IntToStr(ForumUsersActive) + ' Active People On The Runescape Forums Right Now!');
Writeln('There Are Currentely ' + IntToStr(AllPeoplePlaying) + ' People Playing Runescape Right Now!');
Writeln('There Are Currentely ' + IntToStr(GetPeopleInWorld(72)) + ' People Playing Runescape In World 72!');
Writeln('===============News===============');
LatestNews := GetNews
Writeln(LatestNews.Date);
//Writeln('');
Writeln(LatestNews.Title);
//Writeln('');
for i := 0 to (Length(LatestNews.Description) / 90) do
begin
Writeln(Trim(Copy(LatestNews.Description,i * 90,90)));
//Only If It Didnt Split Some Of The Words In Half. Anyways, This Makes It So It Doesn't
//Stay In One Big Line, Instead, It Formats It, Even Though It Doesnt Work Too Good.
end;
end.
look at top of script. enjoy! (Note: I was bored :P)