Log in

View Full Version : Need Help with Inventory SRL



live4evil
08-17-2010, 07:56 PM
{ type TInvenItem;
Description: Holds data regarding an inventory item }
type
TInvenItem = record
Width, Height : Integer; // the width and height of the item
Count : Integer; // the count of the item
ItemBox : TBox; // the exact box around the item
CenterPoint: TPoint; // the center point inside the item
ExistsItem : Boolean; // to define the item Exists
end;
TInvenItemArr = array of TInvenItem;
Failed when compiling
Line 35: [Error] (22626:1): Duplicate identifier 'TInvenItem' in script C:\Documents and Settings\Irmuun\Desktop\SCAR 3.23 Beta\includes\SRL\SRL\Core\Inventory.scar

It keeps failing and saying Duplicate identifier even though SRL made it and i should work

Frement
08-17-2010, 07:57 PM
You cannot re-declare it, you need to use the type SRL has provided, just make a new variable: var MyInventoryItem: TInvenItem;

And fill that.

live4evil
08-17-2010, 08:07 PM
But what do you fill it with?

live4evil
08-17-2010, 08:33 PM
RawBeefCount: Integer;
var
RawBeef : Integer;
MyInventoryItem: TInvenItem;
Begin
MyInventoryItem:=
RawBeef := BitmapFromString(7, 7, 'beNpbtLBDVgSCVi5aCEdwQWR' +
'xZEH8CKviLWvXrFq8GM2oQ7t27du2FSi1ZukSqCwA/oA7DQ==');
GameTab(tab_Inv);
Result:= CountItems('bitmap', RawBeef, [BMPTol]);
FreeBitmap(RawBeef);
End;
Make it work please help

Frement
08-17-2010, 08:34 PM
Use InFight instead of "IsFighting".

live4evil
08-17-2010, 08:49 PM
I meant i need assistance with making my rawbeef counter to work

Rich
08-18-2010, 09:07 AM
RawBeefCount: Integer;
var
RawBeef : Integer;

Begin
RawBeef := BitmapFromString(7, 7, 'beNpbtLBDVgSCVi5aCEdwQWR' +
'xZEH8CKviLWvXrFq8GM2oQ7t27du2FSi1ZukSqCwA/oA7DQ==');
GameTab(tab_Inv);
Result:= CountItems('bitmap', RawBeef, [BMPTol]);
FreeBitmap(RawBeef);
End;

This?

Tniffoc
08-19-2010, 04:35 AM
Read the tutorials. But, for the sake of encouragement...

NOTE: You may have to tweak the '20' if it only works some of the time. This is how much change in color is allowed. IIRC, Jagex changes the colors slightly trying to throw us off.


function CountRawBeef: Integer;
var
BeefBMP: Integer;
begin
RawBeef := BitmapFromString(7, 7, 'beNpbtLBDVgSCVi5aCEdwQWR' +
'xZEH8CKviLWvXrFq8GM2oQ7t27du2FSi1ZukSqCwA/oA7DQ==');
GameTab(tab_Inv);
Result := CountItems('bitmap',BeefBMP,[20]);
FreeBitmap(BeefBMP);
end;