SRL Archive - RS3 Outdated / Broken Scripts

Function CountItemsInInv(ItemColor:Integer):Integer;


mage of begu

2007-03-26 14:21:56

{*******************************************************************************
Function CountItemsInInv(ItemColor:Integer):Integer;
by: Mage Of Begu
Description: Counts items in your inventory with specified color.
*******************************************************************************}

And heres the function…i hope its usefull…:
Function CountItemsInInv(ItemColor:Integer):Integer;
var ItemsCounted:Integer;
begin
MouseSpeed:=30;
if(FindColor(x,y,ItemColor,569,215,602,245))then //---1---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,606,218,643,247))then //---2---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,648,215,684,245))then //---3---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,693,216,729,247))then //---4---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,568,253,599,281))then //---5---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,608,250,643,280))then //---6---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,650,251,684,280))then //---7---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,693,251,728,282))then //---8---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,568,287,601,317))then //---9---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,609,288,645,319))then //---10---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,651,287,685,318))then //---11---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,693,287,727,318))then //---12---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,569,321,600,354))then //---13---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,612,325,640,353))then //---14---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,652,326,684,351))then //---15---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,692,326,726,353))then //---16---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,571,359,599,390))then //---17---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,607,360,642,390))then //---18---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,652,360,682,388))then //---19---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,694,361,724,390))then //---20---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,570,396,598,425))then //---21---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,610,397,641,425))then //---22---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,653,398,684,424))then //---23---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,694,396,726,426))then //---24---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,570,434,598,460))then //---25---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,611,430,642,461))then //---26---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,650,432,687,461))then //---27---\\
ItemsCounted:=ItemsCounted+1;
if(FindColor(x,y,ItemColor,691,431,727,460))then //---28---\\
ItemsCounted:=ItemsCounted+1;
Result:=ItemsCounted;
end;

And for those who want to know inventory slots co-ordinates:
{---------------------------------------------}
{---------------------------------------------}
{-- INVENTORY SLOT CO-ORDINATES...ENJOY...! --}
{---------------------------------------------}
{---------------------------------------------}

1st inv slot:
(569,215)
(602,245)

2nd inv slot:
(606,218)
(643,247)

3rd inv slot:
(648,215)
(684,245)

4th inv slot:
(693,216)
(729,247)

5th inv slot:
(568,253)
(599,281)

6th inv slot:
(608,250)
(643,280)

7th inv slot:
(650,251)
(684,280)

8th inv slot:
(693,251)
(728,282)

9th inv slot:
(568,287)
(601,317)

10th inv slot:
(609,288)
(645,319)

11th inv slot:
(651,287)
(685,318)

12th inv slot:
(693,287)
(727,318)

13th inv slot:
(569,321)
(600,354)

14th inv slot:
(612,325)
(640,353)

15th inv slot:
(652,326)
(684,351)

16th inv slot:
(692,326)
(726,353)

17th inv slot:
(571,359)
(599,390)

18th inv slot:
(607,360)
(642,390)

19th inv slot:
(652,360)
(682,388)

20th inv slot:
(694,361)
(724,390)

21th inv slot:
(570,396)
(598,425)

22th inv slot:
(610,397)
(641,425)

23th inv slot:
(653,398)
(684,424)

24th inv slot:
(694,396)
(726,426)

25th inv slot:
(570,434)
(598,460)

26th inv slot:
(611,430)
(642,461)

27th inv slot:
(650,432)
(687,461)

28th inv slot:
(691,431)
(727,460)

Boreas

2007-03-26 14:33:49

{*******************************************************************************
function CountItemColor(color: Integer): Integer;
By: based of PPLSUQBAWLZ's InventoryCount by Stupid3ooo
Description: Performs a count of inventory items by color.
*******************************************************************************}

function CountItemColor(color: Integer): Integer;
var
used, i, e: Integer;
begin
GameTab(4);
while (i < 6) do
begin
if (i = 5) and (e < 8) then
begin
i := 0;
e := e + 1;
end;
if (FindColor(x, y, color, (570 + 39 * i), (214 + 35 * e), (609 + 39 * i),
(249 + 35 * e))) then
used := used + 1;
i := i + 1;
end;
Result := used;
end;

Good effort though.

mage of begu

2007-03-26 15:52:08

From: Boreas
{*******************************************************************************
function CountItemColor(color: Integer): Integer;
By: based of PPLSUQBAWLZ's InventoryCount by Stupid3ooo
Description: Performs a count of inventory items by color.
*******************************************************************************}

function CountItemColor(color: Integer): Integer;
var
used, i, e: Integer;
begin
GameTab(4);
while (i < 6) do
begin
if (i = 5) and (e < 8) then
begin
i := 0;
e := e + 1;
end;
if (FindColor(x, y, color, (570 + 39 * i), (214 + 35 * e), (609 + 39 * i),
(249 + 35 * e))) then
used := used + 1;
i := i + 1;
end;
Result := used;
end;

Good effort though.


Yeah…ty anyways…!