SRL Archive - Reflection Development

ID Grabber Tool!


Lee Lok Hin

2008-09-03 06:21:19

Program ID_Grabber;

const
WhatBeItem = 'partyhat';

function GetWebPage(Queryis:string;which:boolean):string;
var
Hm:string;

begin
if which then
Hm:= 'http://itemdb-rs.runescape.com/p=kKmok3kJqOeN6D3mDdihco3oPeYN2KFy6W5--vZUbNA/results.ws?query='+Queryis+'&price=all&members='
else
Hm:= 'http://itemdb-rs.runescape.com/p=kKmok3kJqOeN6D3mDdihco3oPeYN2KFy6W5--vZUbNA/viewitem.ws?obj=' + Queryis;
try
Result:= GetPage(Hm);
except
end;
end;

procedure GiveGE(QueryIs:string);
var
HTSML,TempID,TempMon,TempName,Min,Max:string;
i:integer;
t,tp,plz:integer;


begin
writeln('Query is :'+Queryis);
HTSML:= GetWebPage(QueryIs,true);
i:= Pos('_obj_sprite',HTSML);
if i > 0 then
begin
TempID:= copy(HTSML, i, i);
i := Pos('"',TempID);
t := Pos('<td>',TempID);
TempMon := TempID;
if t > 0 then
begin
tp := Pos('stay',Tempmon);
Delete(TempMon,tp,Length(TempMon));
TempName:= Between('alt="','">',TempMon);
writeln('Name of Found Item is :'+TempName);
end;
if i > 0 then
begin
delete(TempID,i,Length(tempID));
Plz:= strtoint(GetNumbers(TempID));
//writeln('Id is '+ GetNumbers(TempID));
writeln('Id is '+ GetNumbers(TempID));
end;
end else
begin
writeln('Not Found Item :'+QueryIs);
Exit;
end;
HTSML:= GetWebPage(inttostr(plz),false);
Delete(HTSML,1,Pos('Current market price range:',HTSML) + 64); // + Length(TempMon) + 38
i:= pos('</span>',HTSML) - 1;
Min := Left(HTSML,i);
//writeln(Min + 'is min');
Delete(HTSML,1,i);
Delete(HTSML,1,56);
i:= pos('</span>',HTSML) - 1;
TempMon := Left(HTSML,i);
Delete(HTSML,1,i);
Max := Between('</b>','</span>',htsml);
TempMon := Left(Min, Length(Min) - 1) +' - '+ Left(TempMon, Length(TempMon) - 1) +' - '+ Max;
writeln('Money is: '+TempMon);
end;

begin
cleardebug;
GiveGE(whatbeitem);
end.

Yep, this grabs object IDs from the Grand Exchange Database! Just input WhatBeItem, and it will output in the debug box!

For the new obj finders!

Sample:
Query is :partyhat
Name of Found Item is :Blue partyhat
Id is 1042
Money is: 361.0m - 380.0m - 399.0m

Successfully executed

Narcle

2008-09-03 07:07:28

Got it working good now? :p

Lee Lok Hin

2008-09-03 07:08:25

Yep. It even works on IRC tahnks to Yakman's bot! :p

Sp0rky

2008-09-03 09:21:46

Wow, very nice, very useful, great job.

Naike

2008-09-03 16:38:20

Thaank you for this :D

Will help me alot ^^

Harry

2008-09-03 16:39:55

Good work.

One suggestion is to remove the /p=………/ in the URL.

Nava2

2008-09-21 13:08:45

function GiveGE(QueryIs:string): Integer;

var
HTSML, TempID,TempMon, TempName, Minimum, Maximum:string;
I, Spot:integer;
t, tp, plz:integer;
NewItem, LastItem : Boolean;

Label
Retry;

begin
writeln('Query is :'+Queryis);
HTSML:= GetWebPage(QueryIs,true);
Spot:= 0;
Retry:
Spot := PosEx('_obj_sprite', HTSML, Spot);
if NewItem then
begin
Spot := PosEx('_obj_sprite', HTSML, Spot + 1);
if Spot <= 0 then
begin
Writeln('Could not find Item. Useing first item, please be aware it may be wrong.');
Spot := Pos('_obj_sprite', HTSML);
LastItem := true;
end;
end;
if Spot > 0 then
begin
TempID:= copy(HTSML, Spot, Spot);
i := Pos('"',TempID);
t := Pos('<td>',TempID);
TempMon := TempID;
if t > 0 then
begin
tp := Pos('stay',Tempmon);
Delete(TempMon,tp,Length(TempMon));
TempName:= Between('alt="','">',TempMon);
writeln('Name of Found Item is :'+TempName);
if (LowerCase(TempName) <> LowerCase(QueryIs)) and not LastItem then
begin
NewItem := True;
Writeln('Item ' + TempName + ' did not match our Query, moving to next item.');
Writeln('');
Goto Retry;
end;
end;
if i > 0 then
begin
delete(TempID,i,Length(tempID));
Result := strtoint(GetNumbers(TempID));
writeln('Item ID is '+ GetNumbers(TempID) + '.');
end;
end else
begin
writeln('Not Found Item :'+QueryIs);
Exit;
end;
HTSML:= GetWebPage(inttostr(Result),false);
Delete(HTSML,1,Pos('Current market price range:',HTSML) + 64); // + Length(TempMon) + 38
i:= pos('</span>',HTSML) - 1;
Minimum := Left(HTSML,i);
//writeln(Minimum + 'is min');
Delete(HTSML,1,i + 56);
i:= pos('</span>',HTSML) - 1;
TempMon := Left(HTSML,i);
Delete(HTSML,1,i);
Maximum := Trim(Between('</b>','</span>',htsml));
TempMon := Left(Minimum, Length(Minimum) - 1) +' - '+ Left(TempMon, Length(TempMon) - 1) +' - '+ Maximum;
SetLength(TempMon, Length(TempMon) - 1);
writeln('Market Range is: '+TempMon);
end;

Updated and fixed so that it returns the Exact search query. If not, then it will just return the first one.

Yeah, thanks for the tool! :D Hope my addition can help as well.

mariofan12

2008-11-11 22:59:14

This tool works for inventory item finding, except you must add 1 to whatever the I.D. you get…