SRL Archive - Reflection Development

GetItemName ..?


Nadeem

2009-07-03 04:59:10

Didn't see this around, may exist IDK. When I looked through in reflection, I only found the function that returns name of selected item… Its simple, very simple, just grabs the item name based on reflection item ID.


function GetItemName(ID: Integer): string;
var Page: string;
begin
ID := ID - 1;
Page := Format('http://itemdb-rs.runescape.com/viewitem.ws?obj=%d', [ID]);
Result := Between(Format('?id=%d" alt="', [ID]), '">', GetPage(Page));
end;



~NS

Da 0wner

2009-07-03 05:38:43

I'm betting there's only a handful of people that know of Format :p.

But I made one one these, it got your whole inventory though.

Nadeem

2009-07-03 06:21:21

From: Da 0wner
I'm betting there's only a handful of people that know of Format :p.

But I made one one these, it got your whole inventory though.


lol, I've already abused format throughout my new script :p Its awesome!

Here is my code to go through the inventory in reflection btw:


function GetInventory: TStringArray;
var I: Integer;
Inv: TInvItem;
begin
for I := 1 to 28 do
if ExistsItem(I) then
begin
Inv := GetInvItemInfo(I);
RID := Inv.ID;
Item := GetItemName(RID);
SetLength(Result, R + 1);
Result[R] := Item;
R := R + 1;
end;
end;

Although thats not my real one :p I used that one for testing this function.

btw, get on msn, we gotta discuss vaio



~NS

ian.

2009-07-03 06:31:10

There aren't any functions/procedures in SRL that connect to anything online.

Nadeem

2009-07-03 07:49:42

From: 99_ aka ian.
There aren't any functions/procedures in SRL that connect to anything online.


What are you talking about…?



~NS

ian.

2009-07-03 08:12:10

There aren't any functions/procedures that connect to anything online, and they're keeping it that way (for now, at least).

Nadeem

2009-07-03 08:30:31

lol ok… How does that effect this? :p It doesn't have to be added to srl or anything, its just there incase someone needs a easy way to get item names based on item id :)



~NS

ian.

2009-07-03 08:32:36

Oh okay, I thought you were trying to get this into SRL :p sowwy <3

Da 0wner

2009-07-03 09:24:02

This won't get items that cannot be sold on the GE though.

Nadeem

2009-07-03 09:26:59

From: Da 0wner
This won't get items that cannot be sold on the GE though.


Thats correct, but it will get a majority of items though. Although we can make a llist easily, in ini format. So we can custom add in the items that are not on the site :)



~NS