SRL Archive - OSR Help

Inventory Problems


lilcmp1

2011-12-25 20:21:41

First of all I can't get InvFull to work. With a full inv of crayfish I try
program New;
{$i SRL\SRL.scar}

begin
SetupSRL;
If InvFull Then
Writeln('FULL');
end.
And never get FULL, the script just keeps running and hovering on inventory tab.


For the real script I took out the If Inv Full Then Dropfish loop at the end because invfull isn't registering for me. With just this in place it clicks the fishing spot (yay!) but when it goes to drop fish it clicks on inventory tab, drops one fish, returns to hover over inventory tab then 3-5 sec later drops next fish. It takes 5 minutes to drop the whole inventory! How do I fix this? P:


program New;
{$i SRL\SRL.scar}

Const
SRLStats_Username = '';
SRLStats_Password = '';
BreakEvery = 120;
BreakFor = 5;
Version = '.01';
NumbOfPlayers = 1;
StartPlayer = 0;


Procedure Fishy;
var
SeX, SeY: Integer;

Begin
If FindObjCustom(SeX, SeY, ['Cage', 'Fishing'], [7956571, 9998731,9406078], 10) Then
WriteLn('Found Spot!');
Begin
Case Random(2) Of
0:Mouse(SeX,SeY, 5,5, True);
1: Begin
Mouse(SeX,SeY,4,4,False);
WaitOption('Cage',Randomrange(100,300));
End;
End;
End;



End;

Procedure DropFish;
Var
SeX, SeY, CrayDTM, I: Integer;
Slotbox:TBox;
CrayPattern:TIntegerArray;

Begin

CrayDTM := DTMFromString('mggAAAHicY2NgYFBlZGAwAWIlIFYBYhkg1gLiPiDuBuIWIJ4FxDOAuBWIM63lgboYMbAkA3aAqRKCIQAA5I4FMw==');
CrayPattern:= [1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28]

For I:=0 To 27 Do
Begin
SlotBox:=InvBox(CrayPattern[I]);
If FindDtm(CrayDTM, SeX,SeY, Slotbox.X1,Slotbox.Y1,Slotbox.X2,Slotbox.Y2) Then
Begin
MouseItem(CrayPattern[I], False);
ChooseOption('Dro');
End;
End;
End;

Begin
SetupSRL;

Fishy;

DropFish;

End.

bud_wis_er_420

2011-12-25 21:17:39

I just made my own, I couldn't get it to work either when I tried it.

function Inv_Full:Boolean;
begin
if(FindColorTolerance(x,y,131072,690,430,715,450,10))then
begin
result:=true;
end else result:=false;
end;

Yanhua

2011-12-25 21:19:46

Hi Lilcmp :)

I'll take a look at InvFull, I don't see why it would be broken.

Will edit this post later with results.

Kyle Undefined

2011-12-25 21:40:18

I haven't seen an issue with this before, but I can take a look later.

lilcmp1

2011-12-27 00:52:58

Anyone had a chance to check this? :S

Kyle Undefined

2011-12-27 02:30:24

Are you making sure the Inventory is showing?

shstiger2009

2011-12-27 02:44:41

I use it in one of my scripts and I'm pretty sure it's working.

Gushers

2011-12-27 03:15:02

You need to add "PlusOne" to your script.

Silent

2011-12-27 03:47:30

Try using

(InvCount > 27)

Instead, and call it in a loop with debug and a little random wait time.

Nebula

2011-12-27 05:41:04

Your just forgetting the parenthesis around InvFull. It should look like this:

If (InvFull) then
writeln('FULL');


Dont forget that when using If…Then statements the part after the "if" has to be in parenthesis. You can also use the words "and" or "or" inside the parenthesis if need be. "and" will only perform the "then" if both statements are true, while "or" will perform the "then" statements if either are true. Examples of both:

if ((Something) or (SomethingElse)) then
writeln('Something Just happened!');

if ((Something) and (SomethingElse)) then
writeln('Something Just happened!');

Justin

2011-12-27 05:44:27

I just checked one of my scripts that uses the InvFull - working 100% for me.

if (InvFull) then
begin
Writeln('We are full... Going to bank!');
TeleportToBank;
end;

Nebula

2011-12-27 05:48:46

From: ~Justin
I just checked one of my scripts that uses the InvFull - working 100% for me.

if (InvFull) then
begin
Writeln('We are full... Going to bank!');
TeleportToBank;
end;


That's because in your script InvFull has parenthesis around it. His does not.

lilcmp1

2011-12-28 00:29:16

Paranthesis! :duh: :duh: :duh: Thanks for the help :D

HardRockers

2011-12-30 12:20:54

ok, I have Parenthesis, and mine still isn't working… It did work, but now it is not recognizing that the inventory is full

lilcmp1

2011-12-30 17:37:36

From: HardRockers
ok, I have Parenthesis, and mine still isn't working… It did work, but now it is not recognizing that the inventory is full


Maybe post thread/code ? It's still working for me

shnk

2011-12-30 18:41:22

same. doesn't work for me but i just made a bitmap of the object i wanted to bank.