SRL Archive - OSR Help

Inventory hates me?


Swatarianess

2011-12-23 09:22:58

Most of the Inv functions not working for me…

which include and are;


function GetInven(Inven : Integer) : TInvenItem; // by Sky Scripter
// * function GetInventoryArray : array of TInvenItem; // by Sky Scripter
// * function InvBox(i :Integer): TBox; // by Boreas & Ogre
// * function ItemCoords(i: Integer): TPoint; // by RsN
// * Function CoordsToItem(X, Y: Integer): Integer; // by Boreas
// * function GetInvItemBounds(InvSpot: Integer; T: TBox): Boolean; // by Wizzup?
// * procedure InvMouse(InvSlot, Action: Byte); // by EvilChicken!
// * procedure MMouseItem(i: Integer); // by WT-Fakawi & EvilChicken!
// * procedure MouseItem(i: Integer; left: Boolean); // by WT-Fakawi, EvilChicken!, & NaumanAkhlaQ
// * procedure DragItem(Inv1, Inv2: Integer); // by NaumanAkhlaQ
// * function ExistsItem(i: Integer): Boolean; // by RsN
// * function InvCount: Integer; // by RsN
// * function InvEmpty: Boolean; // by WT-Fakawi
// * function InvFull: Boolean; // by RsN
// * function CountItems(identifier: Integer; identifiertype: string; tol: TIntegerArray): Integer; // by WT-Fakawi & Sumilion
// * function ClickAllItemsExcept(identifier: Integer; identifiertype, option: string; SlotIgnores: TIntegerArray; waitnum: Integer; tol: TIntegerArray):Integer; // by WT-Fakawi, Sumilion, & Nava2
// * function ClickAllItems(identifier: Integer; identifiertype, option: string; waitnum: Integer; tol: TIntegerArray):Integer; // by Nava2
// * procedure DropItem(i: Integer); // by Lorax
// * Procedure DropPattern(which: integer); // by Rasta Magician
// * procedure DropAll; // by Rasta Magician
// * procedure DropAllExcept(IgnoreInvSlots: array of Byte); // by R1ch
// * procedure DropItemsByIdentifier; // by EvilChicken!
// * procedure ArrangeInv; // by Cheesehunk
// * function CountItemsBlackLine(Count, Tol: Integer): Integer; // by n3ss3s
// * function ClickAllItemsBlackLine(Count, Tol: Integer; Option: String): Integer; // by n3ss3s
// * function ItemActivated(Slot: Integer): Boolean;

Kyle Undefined

2011-12-23 09:32:12

How are you using them?

kanah

2011-12-23 10:13:10

post a script segment.. show us how your using them.

Swatarianess

2011-12-24 07:50:45


program new;
{$i srl/srl.scar}
var
y,x,Bmp : Integer;
burn: boolean;

procedure BurnLogs;
begin
burn := true;
if Burn then
Bmp := BitmapFromString(20, 16, 'meJx1k+tKAlEUhe01Esuk+8Vudv' +
'tTSWKlZhmKMYqViYSZhEiIREQRET1Bb9s3Ld0OZrCQ8cz69u3sGd1' +
'1sp1vtHX5sll6jhQ6Eae9lm+t5pqIh/WLRw43ik8SHn7xLJ83ArGy' +
'2O3rV3D3vNDBL4nCj3hr4nwl+zCeqIkNnjTAu2HJ3qNk5hXaKb+5u' +
'nknb/i0Fsq0xE6kHzhX5Ra/7++JgDRCwQvJSjBZF4sI+NeMlJRKoM' +
'KZOtRsvDS5lwvEKwJDZ00E7vV3u3PazI0i54/LM7Ei5zQL7t8vqmw' +
'X/EXk13wYF7al9C0UiaaieViouaMrsrujjlfAmZUhsk0fOLIBLqaq' +
'RCA1fqJRBmETdx88gxMHYUPy81d+epSffqnfrjt5/ynWHy3xYCI++' +
'm89JLFuzcn62GFVN+uVIV5KM4Elvl2TNsQaH0AGViXV+BrKGj6U0j' +
'3C0qmxbJf3Zgd2zLuWyssojLVbNtxL2bemVdFUjXU307NX/a/DaZO' +
'C7kZ8PtMPPdNK+g==');
repeat
If (FindBitmapToleranceIn(bmp, X, Y, MIX1, MIY1, MIX2, MIY2, 25)) Then //This will search the screen for the bitmap
begin
writeln('Found Bitmap!')
Mouse(X, Y, 20, 2, false);
ChooseOption('ight')
wait(randomrange(5000,8500))
writeln('lighted')
end;
until not (FindBitmapToleranceIn(bmp, X, Y, MIX1, MIY1, MIX2, MIY2, 25) or not (Invfull));
// Used (InvFull) and just hovered...
FreeBitmap(bmp);
{FindColorSpiralTolerance(x,y,2243922,688,327,721,347,5)
{Not as good as FindcolorSpiral imo >> FindColor(x,y,2179161,688,327,721,347)}
end;



begin
SetupSRL;
BurnLogs;
end.


Example of its use i used it for :/ just hovers then tried adding ExistItem() into my own code but did the same -.-

~Bro433

Gaston7eze

2011-12-24 07:52:24

Same for me.I cant get the things dropped with the methods,what should we do?

Swatarianess

2011-12-24 08:02:45


procedure DropallLogs;
begin
Bmp := BitmapFromString(20, 16, 'meJx1k+tKAlEUhe01Esuk+8Vudv' +
'tTSWKlZhmKMYqViYSZhEiIREQRET1Bb9s3Ld0OZrCQ8cz69u3sGd1' +
'1sp1vtHX5sll6jhQ6Eae9lm+t5pqIh/WLRw43ik8SHn7xLJ83ArGy' +
'2O3rV3D3vNDBL4nCj3hr4nwl+zCeqIkNnjTAu2HJ3qNk5hXaKb+5u' +
'nknb/i0Fsq0xE6kHzhX5Ra/7++JgDRCwQvJSjBZF4sI+NeMlJRKoM' +
'KZOtRsvDS5lwvEKwJDZ00E7vV3u3PazI0i54/LM7Ei5zQL7t8vqmw' +
'X/EXk13wYF7al9C0UiaaieViouaMrsrujjlfAmZUhsk0fOLIBLqaq' +
'RCA1fqJRBmETdx88gxMHYUPy81d+epSffqnfrjt5/ynWHy3xYCI++' +
'm89JLFuzcn62GFVN+uVIV5KM4Elvl2TNsQaH0AGViXV+BrKGj6U0j' +
'3C0qmxbJf3Zgd2zLuWyssojLVbNtxL2bemVdFUjXU307NX/a/DaZO' +
'C7kZ8PtMPPdNK+g==');
repeat
If (FindBitmapToleranceIn(bmp, X, Y, MIX1, MIY1, MIX2, MIY2, 25)) Then //This will search the screen for the bitmap
begin
writeln('Found Bitmap!')
Mouse(X, Y, 5, 5, false);
ChooseOption('rop')
writeln('Dropped')
wait(randomrange(500,1000))
end;
until(not FindBitmapToleranceIn(bmp, X, Y, MIX1, MIY1, MIX2, MIY2, 25));
FreeBitmap(bmp);
end;


My method of dropping but you should change Bmp to whatever item you are dropping.. The dropping method uses Bitmap recognistion built into Simba so its easy to drop and starts at top left then goes down to bottom right until there is not more Of that Bitmap(called bmp) !

Gaston7eze

2011-12-24 08:03:11

Thanks man!Gonna try it :)

Gaston7eze

2011-12-24 08:09:22

What i am doing bad here???
program New;
{$i srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{$i SRL\SRL\Misc\Stats.simba}
var x, y, rx, ry: Integer;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=' ';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
Procedure ChopTree;
Var
x,y: Integer;
Begin;
Repeat
If FindObj(x,y,'hop',1785912, 35)Then
Begin
Mouse(x,y,0,0, true);
ChooseOption('Hop')
Repeat
Wait(1200+random(250));
Until not IsUpText('willow')or InvFull
Wait(3000)
Repeat
Wait(3000+random(250));
Until not IsUpText('willow')or InvFull
end;
Until(False);
End;
Procedure DropLog;
Var
x,y,I:Integer;
begin
for I := 2 to 28 do

DropItem(I);
Wait(50 + Random(100));
end;


procedure DropallLogs;
begin
Logs := BitmapFromString(20, 16, 'meJx1k+tKAlEUhe01Esuk+8Vudv' +
'tTSWKlZhmKMYqViYSZhEiIREQRET1Bb9s3Ld0OZrCQ8cz69u3sGd1' +
'1sp1vtHX5sll6jhQ6Eae9lm+t5pqIh/WLRw43ik8SHn7xLJ83ArGy' +
'2O3rV3D3vNDBL4nCj3hr4nwl+zCeqIkNnjTAu2HJ3qNk5hXaKb+5u' +
'nknb/i0Fsq0xE6kHzhX5Ra/7++JgDRCwQvJSjBZF4sI+NeMlJRKoM' +
'KZOtRsvDS5lwvEKwJDZ00E7vV3u3PazI0i54/LM7Ei5zQL7t8vqmw' +
'X/EXk13wYF7al9C0UiaaieViouaMrsrujjlfAmZUhsk0fOLIBLqaq' +
'RCA1fqJRBmETdx88gxMHYUPy81d+epSffqnfrjt5/ynWHy3xYCI++' +
'm89JLFuzcn62GFVN+uVIV5KM4Elvl2TNsQaH0AGViXV+BrKGj6U0j' +
'3C0qmxbJf3Zgd2zLuWyssojLVbNtxL2bemVdFUjXU307NX/a/DaZO' +
'C7kZ8PtMPPdNK+g==');
repeat
If (FindBitmapToleranceIn(Logs, X, Y, MIX1, MIY1, MIX2, MIY2, 25)) Then //This will search the screen for the bitmap
begin
writeln('Found Bitmap!')
Mouse(X, Y, 5, 5, false);
ChooseOption('rop')
writeln('Dropped')
wait(randomrange(500,1000))
end;
until(not FindBitmapToleranceIn(bmp, X, Y, MIX1, MIY1, MIX2, MIY2, 25));
FreeBitmap(Logs);
end;

Procedure AntiBan;
Begin
If(Not LoggedIn)then
Exit;
Case Random(8)of
0:
Begin;
HoverSkill('Woodcutting',false)
Wait(2453+random(432));
End;
1: Wait(100);
2 : PickUpMouse;
End
If(FindColorTolerance(x,y,857114,MMX1, MMY1, MMX2, MMY2, 5))then
begin
Mouse(x,y,5,5,true);
End;
end;
Procedure Start;
Begin
MakeCompass('N');
Wait(100+random(133));
MakeCompass('S');
Wait(50+random(133));
MakeCompass('N')
End;

begin;
Smart_Server := 1;
Smart_Members := False;
Smart_Signed := false;
Smart_SuperDetail := False;
ClearDebug;
SetUpSRL;
ActivateClient;
DeclarePlayers;
ChopTree;
Start;
end.

kanah

2011-12-24 13:10:51

Findobj only checks the main screen. Idk what problem most of you are having, but I would avoid using bitmaps to find objects. Instead use dtms or color. There should be a function like findobj that you can use to look for an ittem in your inventory. Try findobjex


From: Gaston7eze
What i am doing bad here???
program New;
{$i srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{$i SRL\SRL\Misc\Stats.simba}
var x, y, rx, ry: Integer;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=' ';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
Procedure ChopTree;
Var
x,y: Integer;
Begin;
Repeat
If FindObj(x,y,'hop',1785912, 35)Then
Begin
Mouse(x,y,0,0, true);
ChooseOption('Hop')
Repeat
Wait(1200+random(250));
Until not IsUpText('willow')or InvFull
Wait(3000)
Repeat
Wait(3000+random(250));
Until not IsUpText('willow')or InvFull
end;
Until(False);
End;
Procedure DropLog;
Var
x,y,I:Integer;
begin
for I := 2 to 28 do

DropItem(I);
Wait(50 + Random(100));
end;


procedure DropallLogs;
begin
Logs := BitmapFromString(20, 16, 'meJx1k+tKAlEUhe01Esuk+8Vudv' +
'tTSWKlZhmKMYqViYSZhEiIREQRET1Bb9s3Ld0OZrCQ8cz69u3sGd1' +
'1sp1vtHX5sll6jhQ6Eae9lm+t5pqIh/WLRw43ik8SHn7xLJ83ArGy' +
'2O3rV3D3vNDBL4nCj3hr4nwl+zCeqIkNnjTAu2HJ3qNk5hXaKb+5u' +
'nknb/i0Fsq0xE6kHzhX5Ra/7++JgDRCwQvJSjBZF4sI+NeMlJRKoM' +
'KZOtRsvDS5lwvEKwJDZ00E7vV3u3PazI0i54/LM7Ei5zQL7t8vqmw' +
'X/EXk13wYF7al9C0UiaaieViouaMrsrujjlfAmZUhsk0fOLIBLqaq' +
'RCA1fqJRBmETdx88gxMHYUPy81d+epSffqnfrjt5/ynWHy3xYCI++' +
'm89JLFuzcn62GFVN+uVIV5KM4Elvl2TNsQaH0AGViXV+BrKGj6U0j' +
'3C0qmxbJf3Zgd2zLuWyssojLVbNtxL2bemVdFUjXU307NX/a/DaZO' +
'C7kZ8PtMPPdNK+g==');
repeat
If (FindBitmapToleranceIn(Logs, X, Y, MIX1, MIY1, MIX2, MIY2, 25)) Then //This will search the screen for the bitmap
begin
writeln('Found Bitmap!')
Mouse(X, Y, 5, 5, false);
ChooseOption('rop')
writeln('Dropped')
wait(randomrange(500,1000))
end;
until(not FindBitmapToleranceIn(bmp, X, Y, MIX1, MIY1, MIX2, MIY2, 25));
FreeBitmap(Logs);
end;

Procedure AntiBan;
Begin
If(Not LoggedIn)then
Exit;
Case Random(8)of
0:
Begin;
HoverSkill('Woodcutting',false)
Wait(2453+random(432));
End;
1: Wait(100);
2 : PickUpMouse;
End
If(FindColorTolerance(x,y,857114,MMX1, MMY1, MMX2, MMY2, 5))then
begin
Mouse(x,y,5,5,true);
End;
end;
Procedure Start;
Begin
MakeCompass('N');
Wait(100+random(133));
MakeCompass('S');
Wait(50+random(133));
MakeCompass('N')
End;

begin;
Smart_Server := 1;
Smart_Members := False;
Smart_Signed := false;
Smart_SuperDetail := False;
ClearDebug;
SetUpSRL;
ActivateClient;
DeclarePlayers;
ChopTree;
Start;
end.

Kyle Undefined

2011-12-24 13:22:46

Not to be a dick, but your drop procedure is in need of something better. You don't need a bmp of the item. Same thing goes for your Burn procedure.


procedure Drop();
var
I : Integer;
begin
for I := 1 to 28 do
begin
// Check inventory slot for item using color or mousing over and uptext, then drop if it's what you want to drop
end;
end;

TheJokester117

2011-12-24 22:24:04

DTMs work extremely well for dropping, I would use that instead of a bitmap. Plus I find them easy to create and write into your script.

Swatarianess

2011-12-25 09:32:06

Yeh just want to work at different angles of Simba to get the hang of different ways to do stuff :/ atm Invent dont work for me at all so finding other ways ^^ its basic but works nicely

From: Kyle Undefined
Not to be a dick, but your drop procedure is in need of something better. You don't need a bmp of the item. Same thing goes for your Burn procedure.


procedure Drop();
var
I : Integer;
begin
for I := 1 to 28 do
begin
// Check inventory slot for item using color or mousing over and uptext, then drop if it's what you want to drop
end;
end;


also if you could show me a tut how to use Tboxes then i could make my own array or use the ones in Inventory.scar somewhere :/ Yeh i know i could've done something like that and dw ur not being a dick just telling us easier ways to drop items ^^

Kyle Undefined

2011-12-25 23:48:00

I can do examples later, I am on my phone and can't do them.

Swatarianess

2011-12-27 10:27:17

From: Kyle Undefined
I can do examples later, I am on my phone and can't do them.


kk thanks ok i think they are working now >.< well a few like Invcount and Invmouse i'll try other as i go on hopefully its gonna be noob friendly guide :stirthepot: