PDA

View Full Version : Stats grabber



jhildy
08-20-2007, 11:00 PM
i made this stats grabber for me but i guess other people might want to use it.

program New;

var
// InitForm variables.
frmDesign : TForm;
Bevel1, Bevel2 : TBevel;
lblusername, label1, Label2, Label3, Label4, Label5, Label6, Label7, Label8, Label9, Label10, Label11, Label12, Label13, Label14, Label15, Label16, Label17, Label18, Label19, Label20, Label21, Label22, Label23, Label24, Label25, Label26, Label27, Label28, Label29, Label30, Label31, Label32, Label33, Label34, Label35, Label36, Label37, Label38, Label39, Label41, Label42, Label43, Label44, Label45, Label46, Label47, Label40, Label48 : TLabel;
Button1, Btn_, btngetstats : TButton;
edit1: TEdit;

function overall(play: string): string;
var s: string;
begin
s:=getpage('Http://hiscore.runescape.com/hiscorepersonal.ws?user1='+Play);
s:=between('Overall','Attack',s);
delete(s,1,52);
wait(10);
delete(s,20,1000);
if (getnumbers(s)='') then
result:= 'Not ranked'
else;
result:=getnumbers(s);
end;

Function Getskill(Player,skill: string): string;
var s,ss: string;
begin
s:=getpage('Http://hiscore.runescape.com/hiscorepersonal.ws?user1='+Player);
case lowercase(skill) of
'attack':s:=between('Attack','Defence',s);
'defence':s:=between('Defence','Strength',s);
'strength':s:=between('Strength','Hitpoints',s);
'hitpoints':s:=between('Hitpoints','Ranged',s);
'ranged','range': s:=between('Ranged','Prayer',s);
'prayer':s:=between('Prayer','Magic',s);
'magic':s:=between('Magic','Cooking',s);
'cooking':s:=between('Cooking','Woodcutting',s);
'woodcutting':s:=between('Woodcutting','Fletching' ,s);
'fletching':s:=between('Fletching','Fishing',s);
'fishing':s:=between('Fishing','Firemaking',s);
'firemaking':s:=between('Firemaking','Crafting',s) ;
'crafting':s:=between('Crafting','Smithing',s);
'smithing':s:=between('Smithing','Mining',s);
'mining':s:=between('Mining','Herblore',s);
'herblore':s:=between('Herblore','Agility',s);
'agility':s:=between('Agility','Thieving',s);
'thieving':s:=between('Thieving','Slayer',s);
'slayer':s:=between('Slayer','Farming',s);
'farming':s:=between('Farming','Runecraft',s);
'runecraft':s:=between('Runecraft','Hunter',s);
'hunter':s:=between('Hunter','Construction',s);
'construction':s:=between('Construction','footer', s);
'overall':begin
result:=overall(Player);
exit;
end;
end;
case (Pos('Not Ranked',s)=0) of
true:begin
delete(s,1,52);
ss:=Getnumbers(s);
delete(ss,3,50);
result:=ss;
end;
false: result:='Not ranked';
end;
end;

Procedure getstats(Sender: TObject);
begin
Label9.caption:=getskill(Edit1.text,'attack');
wait(200);
Label10.caption:=getskill(Edit1.text,'defence');
wait(200);
label11.caption:=getskill(edit1.text,'strength');
wait(200);
label12.caption:=getskill(edit1.text,'hitpoints');
wait(200);
label13.caption:=getskill(edit1.text,'range');
wait(200);
label14.caption:=getskill(edit1.text,'prayer');
wait(200);
label15.caption:=getskill(edit1.text,'magic');
wait(200);
label16.caption:=getskill(edit1.text,'cooking');
wait(200);
label25.caption:=getskill(edit1.text,'woodcutting' );
wait(200);
label26.caption:=getskill(edit1.text,'fletching');
wait(200);
label27.caption:=getskill(edit1.text,'fishing');
wait(200);
label28.caption:=getskill(edit1.text,'firemaking') ;
wait(200);
label29.caption:=getskill(edit1.text,'crafting');
wait(200);
label30.caption:=getskill(edit1.text,'smithing');
wait(200);
label31.caption:=getskill(edit1.text,'mining');
wait(200);
label32.caption:=getskill(edit1.text,'herblore');
wait(200);
label41.caption:=getskill(edit1.text,'agility');
wait(200);
label42.caption:=getskill(edit1.text,'thieving');
wait(200);
label43.caption:=getskill(edit1.text,'slayer');
wait(200);
label44.caption:=getskill(edit1.text,'farming');
wait(200);
label45.caption:=getskill(edit1.text,'runecraft');
wait(200);
label46.caption:=getskill(edit1.text,'hunter');
wait(200);
label47.caption:=getskill(edit1.text,'construction ');
wait(200);
label48.caption:=getskill(edit1.text,'overall');
end;

Procedure minimize(Sender: TObject);
begin
getapplication.Minimize;
end;

procedure DragForm(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var sx,sy,tx,ty:integer;
begin
getmousepos(tx,ty);
repeat
getmousepos(sx,sy);
frmdesign.Top := frmdesign.Top - (ty-sy);
frmdesign.Left := frmdesign.Left - (tx-sx);
sleep(1);
tx := sx;
ty := sy;
until (not IsMouseButtonDown(True));
end;


procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Position := poDesktopCenter;
frmDesign.BorderStyle := bsnone;
frmDesign.Caption := 'frmDesign';
frmDesign.ClientHeight := 350;
frmDesign.ClientWidth := 510;
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.PixelsPerInch := 96;
frmdesign.onmousedown:= @dragform;
Bevel1 := TBevel.Create(frmDesign);
Bevel1.Parent := frmDesign;
Bevel1.Left := -62;
Bevel1.Top := -10;
Bevel1.Width := 811;
Bevel1.Height := 50;
Bevel2 := TBevel.Create(frmDesign);
Bevel2.Parent := frmDesign;
Bevel2.Left := -156;
Bevel2.Top := -16;
Bevel2.Width := 1022;
Bevel2.Height := 50;
lblusername := TLabel.Create(frmDesign);
lblusername.Parent := frmDesign;
lblusername.Left := 10;
lblusername.Top := 50;
lblusername.Width := 48;
lblusername.Height := 13;
lblusername.Caption := 'Username';
label1 := TLabel.Create(frmDesign);
label1.Parent := frmDesign;
label1.Left := 80;
label1.Top := 130;
label1.Width := 37;
label1.Height := 13;
label1.Caption := 'Attack: ';
Label2 := TLabel.Create(frmDesign);
Label2.Parent := frmDesign;
Label2.Left := 80;
Label2.Top := 150;
Label2.Width := 47;
Label2.Height := 13;
Label2.Caption := 'Defence: ';
Label3 := TLabel.Create(frmDesign);
Label3.Parent := frmDesign;
Label3.Left := 80;
Label3.Top := 170;
Label3.Width := 40;
Label3.Height := 13;
Label3.Caption := 'Strength';
Label4 := TLabel.Create(frmDesign);
Label4.Parent := frmDesign;
Label4.Left := 80;
Label4.Top := 190;
Label4.Width := 44;
Label4.Height := 13;
Label4.Caption := 'Hitpoints:';
Label5 := TLabel.Create(frmDesign);
Label5.Parent := frmDesign;
Label5.Left := 80;
Label5.Top := 210;
Label5.Width := 41;
Label5.Height := 13;
Label5.Caption := 'Ranged:';
Label6 := TLabel.Create(frmDesign);
Label6.Parent := frmDesign;
Label6.Left := 80;
Label6.Top := 230;
Label6.Width := 33;
Label6.Height := 13;
Label6.Caption := 'Prayer:';
Label7 := TLabel.Create(frmDesign);
Label7.Parent := frmDesign;
Label7.Left := 80;
Label7.Top := 250;
Label7.Width := 32;
Label7.Height := 13;
Label7.Caption := 'Magic:';
Label8 := TLabel.Create(frmDesign);
Label8.Parent := frmDesign;
Label8.Left := 80;
Label8.Top := 270;
Label8.Width := 42;
Label8.Height := 13;
Label8.Caption := 'Cooking:';
Label9 := TLabel.Create(frmDesign);
Label9.Parent := frmDesign;
Label9.Left := 130;
Label9.Top := 130;
Label9.Width := 32;
Label9.Height := 13;
Label9.Caption := 'Label9';
Label10 := TLabel.Create(frmDesign);
Label10.Parent := frmDesign;
Label10.Left := 130;
Label10.Top := 150;
Label10.Width := 38;
Label10.Height := 13;
Label10.Caption := 'Label10';
Label11 := TLabel.Create(frmDesign);
Label11.Parent := frmDesign;
Label11.Left := 130;
Label11.Top := 170;
Label11.Width := 38;
Label11.Height := 13;
Label11.Caption := 'Label11';
Label12 := TLabel.Create(frmDesign);
Label12.Parent := frmDesign;
Label12.Left := 130;
Label12.Top := 190;
Label12.Width := 38;
Label12.Height := 13;
Label12.Caption := 'Label12';
Label13 := TLabel.Create(frmDesign);
Label13.Parent := frmDesign;
Label13.Left := 130;
Label13.Top := 210;
Label13.Width := 38;
Label13.Height := 13;
Label13.Caption := 'Label13';
Label14 := TLabel.Create(frmDesign);
Label14.Parent := frmDesign;
Label14.Left := 130;
Label14.Top := 230;
Label14.Width := 38;
Label14.Height := 13;
Label14.Caption := 'Label14';
Label15 := TLabel.Create(frmDesign);
Label15.Parent := frmDesign;
Label15.Left := 130;
Label15.Top := 250;
Label15.Width := 38;
Label15.Height := 13;
Label15.Caption := 'Label15';
Label16 := TLabel.Create(frmDesign);
Label16.Parent := frmDesign;
Label16.Left := 130;
Label16.Top := 270;
Label16.Width := 38;
Label16.Height := 13;
Label16.Caption := 'Label16';
Label17 := TLabel.Create(frmDesign);
Label17.Parent := frmDesign;
Label17.Left := 190;
Label17.Top := 130;
Label17.Width := 34;
Label17.Height := 13;
Label17.Caption := 'Wcing:';
Label18 := TLabel.Create(frmDesign);
Label18.Parent := frmDesign;
Label18.Left := 190;
Label18.Top := 150;
Label18.Width := 46;
Label18.Height := 13;
Label18.Caption := 'Fletching:';
Label19 := TLabel.Create(frmDesign);
Label19.Parent := frmDesign;
Label19.Left := 190;
Label19.Top := 170;
Label19.Width := 36;
Label19.Height := 13;
Label19.Caption := 'Fishing:';
Label20 := TLabel.Create(frmDesign);
Label20.Parent := frmDesign;
Label20.Left := 190;
Label20.Top := 190;
Label20.Width := 28;
Label20.Height := 13;
Label20.Caption := 'Firem:';
Label21 := TLabel.Create(frmDesign);
Label21.Parent := frmDesign;
Label21.Left := 190;
Label21.Top := 210;
Label21.Width := 39;
Label21.Height := 13;
Label21.Caption := 'Crafting:';
Label22 := TLabel.Create(frmDesign);
Label22.Parent := frmDesign;
Label22.Left := 190;
Label22.Top := 230;
Label22.Width := 43;
Label22.Height := 13;
Label22.Caption := 'Smithing:';
Label23 := TLabel.Create(frmDesign);
Label23.Parent := frmDesign;
Label23.Left := 190;
Label23.Top := 250;
Label23.Width := 34;
Label23.Height := 13;
Label23.Caption := 'Mining:';
Label24 := TLabel.Create(frmDesign);
Label24.Parent := frmDesign;
Label24.Left := 190;
Label24.Top := 270;
Label24.Width := 43;
Label24.Height := 13;
Label24.Caption := 'Herblore:';
Label25 := TLabel.Create(frmDesign);
Label25.Parent := frmDesign;
Label25.Left := 240;
Label25.Top := 130;
Label25.Width := 38;
Label25.Height := 13;
Label25.Caption := 'Label25';
Label26 := TLabel.Create(frmDesign);
Label26.Parent := frmDesign;
Label26.Left := 240;
Label26.Top := 150;
Label26.Width := 38;
Label26.Height := 13;
Label26.Caption := 'Label26';
Label27 := TLabel.Create(frmDesign);
Label27.Parent := frmDesign;
Label27.Left := 240;
Label27.Top := 170;
Label27.Width := 38;
Label27.Height := 13;
Label27.Caption := 'Label27';
Label28 := TLabel.Create(frmDesign);
Label28.Parent := frmDesign;
Label28.Left := 240;
Label28.Top := 190;
Label28.Width := 38;
Label28.Height := 13;
Label28.Caption := 'Label28';
Label29 := TLabel.Create(frmDesign);
Label29.Parent := frmDesign;
Label29.Left := 240;
Label29.Top := 210;
Label29.Width := 38;
Label29.Height := 13;
Label29.Caption := 'Label29';
Label30 := TLabel.Create(frmDesign);
Label30.Parent := frmDesign;
Label30.Left := 240;
Label30.Top := 230;
Label30.Width := 38;
Label30.Height := 13;
Label30.Caption := 'Label30';
Label31 := TLabel.Create(frmDesign);
Label31.Parent := frmDesign;
Label31.Left := 240;
Label31.Top := 250;
Label31.Width := 38;
Label31.Height := 13;
Label31.Caption := 'Label31';
Label32 := TLabel.Create(frmDesign);
Label32.Parent := frmDesign;
Label32.Left := 240;
Label32.Top := 270;
Label32.Width := 38;
Label32.Height := 13;
Label32.Caption := 'Label32';
Label33 := TLabel.Create(frmDesign);
Label33.Parent := frmDesign;
Label33.Left := 300;
Label33.Top := 130;
Label33.Width := 30;
Label33.Height := 13;
Label33.Caption := 'Agility:';
Label34 := TLabel.Create(frmDesign);
Label34.Parent := frmDesign;
Label34.Left := 300;
Label34.Top := 150;
Label34.Width := 44;
Label34.Height := 13;
Label34.Caption := 'Thieving:';
Label35 := TLabel.Create(frmDesign);
Label35.Parent := frmDesign;
Label35.Left := 300;
Label35.Top := 170;
Label35.Width := 32;
Label35.Height := 13;
Label35.Caption := 'Slayer:';
Label36 := TLabel.Create(frmDesign);
Label36.Parent := frmDesign;
Label36.Left := 300;
Label36.Top := 190;
Label36.Width := 40;
Label36.Height := 13;
Label36.Caption := 'Farming:';
Label37 := TLabel.Create(frmDesign);
Label37.Parent := frmDesign;
Label37.Left := 300;
Label37.Top := 210;
Label37.Width := 50;
Label37.Height := 13;
Label37.Caption := 'Runecraft:';
Label38 := TLabel.Create(frmDesign);
Label38.Parent := frmDesign;
Label38.Left := 300;
Label38.Top := 230;
Label38.Width := 35;
Label38.Height := 13;
Label38.Caption := 'Hunter:';
Label39 := TLabel.Create(frmDesign);
Label39.Parent := frmDesign;
Label39.Left := 300;
Label39.Top := 250;
Label39.Width := 48;
Label39.Height := 13;
Label39.Caption := 'Construct:';
Label41 := TLabel.Create(frmDesign);
Label41.Parent := frmDesign;
Label41.Left := 350;
Label41.Top := 130;
Label41.Width := 38;
Label41.Height := 13;
Label41.Caption := 'Label41';
Label42 := TLabel.Create(frmDesign);
Label42.Parent := frmDesign;
Label42.Left := 350;
Label42.Top := 150;
Label42.Width := 38;
Label42.Height := 13;
Label42.Caption := 'Label42';
Label43 := TLabel.Create(frmDesign);
Label43.Parent := frmDesign;
Label43.Left := 350;
Label43.Top := 170;
Label43.Width := 38;
Label43.Height := 13;
Label43.Caption := 'Label43';
Label44 := TLabel.Create(frmDesign);
Label44.Parent := frmDesign;
Label44.Left := 350;
Label44.Top := 190;
Label44.Width := 38;
Label44.Height := 13;
Label44.Caption := 'Label44';
Label45 := TLabel.Create(frmDesign);
Label45.Parent := frmDesign;
Label45.Left := 350;
Label45.Top := 210;
Label45.Width := 38;
Label45.Height := 13;
Label45.Caption := 'Label45';
Label46 := TLabel.Create(frmDesign);
Label46.Parent := frmDesign;
Label46.Left := 350;
Label46.Top := 230;
Label46.Width := 38;
Label46.Height := 13;
Label46.Caption := 'Label46';
Label47 := TLabel.Create(frmDesign);
Label47.Parent := frmDesign;
Label47.Left := 350;
Label47.Top := 250;
Label47.Width := 38;
Label47.Height := 13;
Label47.Caption := 'Label47';
Label40 := TLabel.Create(frmDesign);
Label40.Parent := frmDesign;
Label40.Left := 170;
Label40.Top := 100;
Label40.Width := 39;
Label40.Height := 13;
Label40.Caption := 'Overall: ';
Label48 := TLabel.Create(frmDesign);
Label48.Parent := frmDesign;
Label48.Left := 220;
Label48.Top := 100;
Label48.Width := 38;
Label48.Height := 13;
Label48.Caption := 'Label48';
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 480;
Button1.Top := 5;
Button1.Width := 25;
Button1.Height := 22;
Button1.Caption := 'X';
Button1.TabOrder := 8;
button1.modalresult := mrOk;
Btn_ := TButton.Create(frmDesign);
Btn_.Parent := frmDesign;
Btn_.Left := 450;
Btn_.Top := 5;
Btn_.Width := 25;
Btn_.Height := 22;
Btn_.Caption := '__';
Btn_.TabOrder := 9;
btn_.onclick:=@minimize;
edit1 := TEdit.Create(frmDesign);
edit1.Parent := frmDesign;
edit1.Left := 10;
edit1.Top := 65;
edit1.Width := 121;
edit1.Height := 21;
edit1.TabOrder := 10;
edit1.Text := 'Username';
btngetstats := TButton.Create(frmDesign);
btngetstats.Parent := frmDesign;
btngetstats.Left := 10;
btngetstats.Top := 90;
btngetstats.Width := 121;
btngetstats.Height := 25;
btngetstats.Caption := 'Get Stats!!';
btngetstats.TabOrder := 11;
btngetstats.Onclick :=@getstats;
end;

procedure SafeInitForm;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('InitForm', V);
end;

procedure ShowInitFormModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowInitFormModal;
var
V : TVariantArray;
begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowInitFormModal', V);
end;

procedure MainInitForm;
begin
try
SafeInitForm;
SafeShowInitFormModal;
finally
FreeForm(frmDesign);
except
WriteLn('An error seems to have occurred in: InitForm');
end;
end;


begin
disguise('AIM');
Maininitform;
end.

Edit: added form its kinda laggy tho but try it out.

pwnaz0r
08-20-2007, 11:58 PM
Dang these are very handy procedures! Not because it is an extremely stunning procedures( yet it is very good ;) ), but because this would make it a little less detectable to get stats(if they were ranked). It is fairly fast and you could get it without going to the gametab. It would be like any player who knows his skill level and doesn't have to look every 5 minutes someone asks him for it ;)

jhildy
08-21-2007, 12:47 AM
well the procedures didn't have to be super advanced but they work for you right?

pwnaz0r
08-21-2007, 01:39 AM
Yup. Thats what im saying :p

BobboHobbo
08-21-2007, 07:52 AM
Looks good, ill try it out. :)

jhildy
08-21-2007, 10:29 PM
Thanks any ways to make it better or whatever.

drnewheart
08-22-2007, 12:59 AM
Looks good! :p But it won't work if someone stats aren't in the highscores. But anyways very handy! I don't think there is anyway that it can be updated any better seeing it works FLAWLESSLY if someones stats are listed.

My first day of school is tomorrow :eek: I have to go to bed :p

pwnaz0r
08-22-2007, 11:18 PM
With you permission, I'm going to place this in the project ( to find out about the project, go to SRL Members forum and look around...)

jhildy
08-23-2007, 03:15 AM
of course (i havn't looked at the project yet) but as long as theres credit for me it doesn't matter to me.

Santa_Clause
08-24-2007, 09:55 AM
All you care about is credits :p

Nice job Jhildy.

jhildy
08-24-2007, 04:19 PM
i love to see my name places :p