SRL Archive - Help

Need Help with Inventory SRL


live4evil

2010-08-17 15:56:37

{ 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

2010-08-17 15:57:40

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

2010-08-17 16:07:27

But what do you fill it with?

live4evil

2010-08-17 16:33:00

 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

2010-08-17 16:34:45

Use InFight instead of "IsFighting".

live4evil

2010-08-17 16:49:48

I meant i need assistance with making my rawbeef counter to work

Rich

2010-08-18 05:07:07

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

2010-08-19 00:35:21

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;