Does anyone know how to count the amount of a specific item in the inventory?
All help appreciated!
Does anyone know how to count the amount of a specific item in the inventory?
All help appreciated!
GetAmountBox(InvBox(i))
i = inventory slot number
Do u mean this?
Creds to DannyRS for this wonderful sig!
INACTIVE
How-to: Make S.M.A.R.T. less laggy
Sell me your Maple Shieldbows (u)! Up to 95gp ea!
My Scripts:
Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
99 x78 |
99 x10 |
99 x2 |
99 x12
Use the REPORT tags when posting progress reports to make life easier (:
[REPORT]Put progress report in here![/REPORT]
Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]
Simba Code:GetAmountBox(InvBox(25)); // Gets the amount of an item in the specified inventory slot
I'm not sure if there is an 07Scape adaptation in DannyRS's include, worth a try(: If not look up reading text with a bitmap
Simba Code:function GetAmountBox(box: TBox): integer;
var
Col: TIntegerArray;
X, Y, I: Integer;
B: TBox;
TPA: TPointArray;
S: String;
begin
Result := 0;
If Not FindColor(X, Y, srl_outline_black, box.x1, box.y1, box.x2, box.y2) then
Exit;
Inc(Result);
Col := [65535, 65278, 16777215, 8453888];
For I := 0 to High(Col) do
If FindColor(X, Y, Col[I], box.x1, box.y1, box.x2, box.y2)then
begin
FindColors(TPA, Col[i], box.x1, box.y1, box.x2, box.y2);
B := GetTPABounds(TPA);
//SMART_DrawBoxEx(False, b, clYellow);
B := IntToBox(b.x1-2, b.y1-2, b.x2+2, b.y2+2);
S := GetTextAtExWrap(b.x1, b.y1, b.x2, b.y2, 0, 1, 1, Col[i], 0, StatChars);
Result := StrToIntDef(GetNumbers(S), 1);
Case I of
2: Result := Result * 1000;
3: Result := Result * 1000000;
end;
Exit;
end;
end;
^This is the function from SRL
'd me while typing guys :P
Thanks!
Last edited by Press Play; 03-02-2013 at 05:13 AM. Reason: realised, not released, lol
INACTIVE
How-to: Make S.M.A.R.T. less laggy
Sell me your Maple Shieldbows (u)! Up to 95gp ea!
My Scripts:
Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
99 x78 |
99 x10 |
99 x2 |
99 x12
Use the REPORT tags when posting progress reports to make life easier (:
[REPORT]Put progress report in here![/REPORT]
Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]
w1:=GetAmountBox(InvBox(2));
Returns 0, instead of 973!?
Do you know where I can get p07 Stat chars?
Just edit the boxes, are you using @DannyRS's include?
Yes, please inform me on how to do that,!
Thanks, One more question, how does inttobox work?
INACTIVE
How-to: Make S.M.A.R.T. less laggy
Sell me your Maple Shieldbows (u)! Up to 95gp ea!
My Scripts:
Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
99 x78 |
99 x10 |
99 x2 |
99 x12
Use the REPORT tags when posting progress reports to make life easier (:
[REPORT]Put progress report in here![/REPORT]
Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]
I've tried:
ItemSlot2 := IntToBox(601,209,635,243);
w1:=GetAmountBox(InvBox(2));
WriteLn(w1);
Returns 0
_______________
ItemSlot2 := IntToBox(601,209,635,243);
w1:=GetAmountBox(Itemslot2);
WriteLn(w1);
Returns 0
Looks like it's not finding the black outline of the item in your inventory. Try colour-picking the black outline of the item and putting that into the function:
Simba Code:If Not FindColor(X, Y, srl_outline_black, box.x1, box.y1, box.x2, box.y2) then
Exit;
//Change to:
If Not FindColor(X, Y, {PUT YOU COLOR HERE}, box.x1, box.y1, box.x2, box.y2) then
Exit;
E: Are you using DannyRS's 07 include?
INACTIVE
How-to: Make S.M.A.R.T. less laggy
Sell me your Maple Shieldbows (u)! Up to 95gp ea!
My Scripts:
Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
99 x78 |
99 x10 |
99 x2 |
99 x12
Use the REPORT tags when posting progress reports to make life easier (:
[REPORT]Put progress report in here![/REPORT]
Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]
Yeah, im using @DannyRs include
INACTIVE
How-to: Make S.M.A.R.T. less laggy
Sell me your Maple Shieldbows (u)! Up to 95gp ea!
My Scripts:
Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
99 x78 |
99 x10 |
99 x2 |
99 x12
Use the REPORT tags when posting progress reports to make life easier (:
[REPORT]Put progress report in here![/REPORT]
Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]
Okay, had a look at the include. Those functions don't exist ahah. Try this:
Simba Code:function P07_GetAmountBox(box: TBox): integer;
var
Col: TIntegerArray;
X, Y, I: Integer;
B: TBox;
TPA: TPointArray;
S: String;
begin
Result := 0;
If Not FindColor(X, Y, P07_outline_black, box.x1, box.y1, box.x2, box.y2) then
Exit;
Inc(Result);
Col := [65535, 65278, 16777215, 8453888];
For I := 0 to High(Col) do
If FindColor(X, Y, Col[I], box.x1, box.y1, box.x2, box.y2)then
begin
FindColors(TPA, Col[i], box.x1, box.y1, box.x2, box.y2);
B := GetTPABounds(TPA);
//SMART_DrawBoxEx(False, b, clYellow);
B := IntToBox(b.x1-2, b.y1-2, b.x2+2, b.y2+2);
S := GetTextAtExWrap(b.x1, b.y1, b.x2, b.y2, 0, 1, 1, Col[i], 0, StatChars);
Result := StrToIntDef(GetNumbers(S), 1);
Case I of
2: Result := Result * 1000;
3: Result := Result * 1000000;
end;
Exit;
end;
end;
If the statChars are the same, then you should be sweet. Otherwise... we can play the waiting game![]()
INACTIVE
How-to: Make S.M.A.R.T. less laggy
Sell me your Maple Shieldbows (u)! Up to 95gp ea!
My Scripts:
Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
99 x78 |
99 x10 |
99 x2 |
99 x12
Use the REPORT tags when posting progress reports to make life easier (:
[REPORT]Put progress report in here![/REPORT]
Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]
There are currently 1 users browsing this thread. (0 members and 1 guests)