Brandon
12-24-2011, 07:02 AM
My original Question has been removed.. By Myself.. I have found a new method of Grabbing Items By ID..
The code below will grab any GE item by ID!! Yes by ID just like reflection.. The problem is that when it comes to finding these items, Simba will NOT find them accurately :S I have absolutely no clue why.. I've been messing with bitmaps, contrasts, brightness, saturations, Masks.. Etc.. And I'm officially giving up on this idea since no one seems to care or knows how to help.. Thus why I'm releasing it now so that the future SRL'ers can work on it..
The items are almost the exact same size as in your bank, Inventory, and Equipped Item Slots.. Infact they are only approx 3 pixels off sometimes.. See below for example Items Grabbed by this plugin.
Example Images:
http://i.imgur.com/uVG8L.png http://i.imgur.com/VCD9Z.png http://i.imgur.com/3ZQic.png <---- Ignore the lines at the tops and left of the images.. thats from my screenshot.. thats y.. It actually does not have those lines.. Just the item alone.. AND the items have a nice transparent background instead of white.. but when converted to BMP, they turn black.. thus I had to code them to be white instead so that it's easier to see.
Original Item As IS!:
http://services.runescape.com/m=itemdb_rs/g=runescape/3583_obj_sprite.gif?id=1521
Image After Converting to Bitmap:
http://i.imgur.com/yWLhl.png
Finally the image that you had previously seen after changing the background to white and removing shadows:
http://i.imgur.com/3ZQic.png
Finally Some Larger Size Images Downloaded (WITHOUT Quality Loss) Even after resizing in simba, the quality is perfect still! Can resize down to 45x45 at MOST! Or else you get a loss of quality:
http://services.runescape.com/m=itemdb_rs/3583_obj_big.gif?id=1521
And Now the Code:
MUST HAVE SIMBA 0.98.2!!! Wizzup released it on 1/4/2012.. without this, FindDeformedBitmapToleranceIn, will NOT WORK!
program ImageProc;
{$loadlib SSecurity}
{$i SRL/SRL.simba}
{$I srl/srl/misc/debug.simba}
Function ImageProc(BMPName: String; ItemID: Integer; Bounds: TBox): String; //Don't touch this function..
var
Image, Path: string;
FP, Item, X, Y, SX, SY: Integer;
V: Extended;
begin
Image:= GetPage('http://services.runescape.com/m=itemdb_rs/g=runescape/3598_obj_sprite.gif?id=' + ToStr(ItemID));
Path:= ScriptPath + BMPName + '.bmp';
Path:= Trim(Path);
FP:= CreateFile(Path);
WriteFileString(FP, Image);
CloseFile(FP);
ImgToBMP(ScriptPath + BMPName + '.bmp');
Item:= LoadBitmap(ScriptPath + BMPName + '.bmp');
GetBitmapSize(Item, Sx, SY);
DebugBitmap(Item);
if FindDeformedBitmapToleranceIn(Item, X, Y, Bounds.X1, Bounds.Y1, Bounds.X2, Bounds.Y2, 5, 0, True, V) then
MMouse(X + SX/2, Y + SY/2, 0, 0);
FreeBitmap(Item);
end;
Begin
SetupSRL;
ImageProc('law', 563, MIBox);
end.
The plugin used (1.72 MB):
http://www.multiupload.com/5F7FKV0ZYI (http://www.multiupload.com/CWQG8F0J12)
The code below will grab any GE item by ID!! Yes by ID just like reflection.. The problem is that when it comes to finding these items, Simba will NOT find them accurately :S I have absolutely no clue why.. I've been messing with bitmaps, contrasts, brightness, saturations, Masks.. Etc.. And I'm officially giving up on this idea since no one seems to care or knows how to help.. Thus why I'm releasing it now so that the future SRL'ers can work on it..
The items are almost the exact same size as in your bank, Inventory, and Equipped Item Slots.. Infact they are only approx 3 pixels off sometimes.. See below for example Items Grabbed by this plugin.
Example Images:
http://i.imgur.com/uVG8L.png http://i.imgur.com/VCD9Z.png http://i.imgur.com/3ZQic.png <---- Ignore the lines at the tops and left of the images.. thats from my screenshot.. thats y.. It actually does not have those lines.. Just the item alone.. AND the items have a nice transparent background instead of white.. but when converted to BMP, they turn black.. thus I had to code them to be white instead so that it's easier to see.
Original Item As IS!:
http://services.runescape.com/m=itemdb_rs/g=runescape/3583_obj_sprite.gif?id=1521
Image After Converting to Bitmap:
http://i.imgur.com/yWLhl.png
Finally the image that you had previously seen after changing the background to white and removing shadows:
http://i.imgur.com/3ZQic.png
Finally Some Larger Size Images Downloaded (WITHOUT Quality Loss) Even after resizing in simba, the quality is perfect still! Can resize down to 45x45 at MOST! Or else you get a loss of quality:
http://services.runescape.com/m=itemdb_rs/3583_obj_big.gif?id=1521
And Now the Code:
MUST HAVE SIMBA 0.98.2!!! Wizzup released it on 1/4/2012.. without this, FindDeformedBitmapToleranceIn, will NOT WORK!
program ImageProc;
{$loadlib SSecurity}
{$i SRL/SRL.simba}
{$I srl/srl/misc/debug.simba}
Function ImageProc(BMPName: String; ItemID: Integer; Bounds: TBox): String; //Don't touch this function..
var
Image, Path: string;
FP, Item, X, Y, SX, SY: Integer;
V: Extended;
begin
Image:= GetPage('http://services.runescape.com/m=itemdb_rs/g=runescape/3598_obj_sprite.gif?id=' + ToStr(ItemID));
Path:= ScriptPath + BMPName + '.bmp';
Path:= Trim(Path);
FP:= CreateFile(Path);
WriteFileString(FP, Image);
CloseFile(FP);
ImgToBMP(ScriptPath + BMPName + '.bmp');
Item:= LoadBitmap(ScriptPath + BMPName + '.bmp');
GetBitmapSize(Item, Sx, SY);
DebugBitmap(Item);
if FindDeformedBitmapToleranceIn(Item, X, Y, Bounds.X1, Bounds.Y1, Bounds.X2, Bounds.Y2, 5, 0, True, V) then
MMouse(X + SX/2, Y + SY/2, 0, 0);
FreeBitmap(Item);
end;
Begin
SetupSRL;
ImageProc('law', 563, MIBox);
end.
The plugin used (1.72 MB):
http://www.multiupload.com/5F7FKV0ZYI (http://www.multiupload.com/CWQG8F0J12)