SRL Archive - OSR Help

Why cant it recognise a full invy?


b3astown

2012-05-09 18:20:07

Program B3astchopper;

{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i sps/sps.simba}

Const
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
BreakEvery = 120; //How Many Minutes To break After
BreakFor = 5; //How long to Break For
Version = '1.0';
TREES_TO_CUT = 'willow';
PLAYER_BANK_PIN = '9251';

Var
Logs_Chopped: Integer;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Function CheckAndClick(UpText, Option:string; X,Y:Integer; RClick:Boolean):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUpText(UpText, 1500+random(500)) Then
Begin
Result:=True;
GetMousePos(x, y);
If RClick Then
Begin
Mouse(x, y, 0, 0, False);
Result:=WaitOption(Option, 2000);
If Result Then FFlag(0);
End Else;
Begin
Mouse(x, y, 0, 0, True);
Wait(100+Random(50));
FFlag(0);
End;
End;
End;

Procedure Antiban;
Begin
Case Random(5000) Of
0: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('Woodcutting', False) GameTab(28) End;
1: Begin StatsGuise('AntiBan') SleepAndMoveMouse(8000 + Random(380)); End;
2: Begin StatsGuise('AntiBan') RandomAngle(1); End;
3: Begin StatsGuise('AntiBan') GameTab(Tab_Stats) HoverSkill('random', False); GameTab(28) End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(4000 + Random(400)); GameTab(28) End;
5: Begin Wait(3000) End;
End;
End;

Procedure FailSafe(Reason:String);
Begin
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;

Procedure WalkToTree;

Var
ToTrees:TPointArray;

Begin
if(not(LoggedIn))then
Exit;
FindNormalRandoms;

Writeln('Attempting To Walk To Trees...')
SetupSRL;
SPS_Areas := ['10_9'];
ToTrees:= [Point(4209, 3686), Point(4190, 3735)];
SPS_WalkPath(ToTrees);

Writeln('Found the trees');
Wait(5354+random(254));
End;

Function ChopDown:Boolean;
Var
X, Y, PlusOne, TreeCounter: Integer;
Begin
PlusOne:= InvCount +1;
If FindObjCustom(X, Y, ['Chop', 'down', 'willow'], [2107945, 922899, 723723, 1384477], 30) Then
Begin;
WriteLn('Aww yea! A tree woot@!');
StatsGuise('Aww Yea! A tree woot@!');
GetMousePos(x, y)
StatsGuise('Aww yea! A tree Woot@!');


Case Random(2) Of
0: Mouse (x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
WaitOption('Chop', 400);
End;
End;

Repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
If InvCount=Plusone Then
Writeln('We got a log baby');
Until (InvCount=Plusone)

End;
End;


Procedure WalkToWillows;
Var
walkTree:TPointArray;

begin
SPS_Setup(RUNESCAPE_SURFACE,['10_9','11_9','11_8','9_8','9_9']);
walkTree := [Point(4186, 3668), Point(4184, 3645), Point(4151, 3721)];
SPS_WalkPath(walkTree);
end;

Procedure WalkToBank;
Var
walkBank:TPointArray;

begin
SetupSRL;
SPS_Setup(RUNESCAPE_SURFACE,['10_9','11_9','11_8','9_8','9_9']);
walkBank := [Point(4152, 3698), Point(4202, 3685)];
SPS_WalkPath(walkBank);
end;

Procedure bankLogs;
Var
Logs_Chopped: Integer;
EXP_GAINED: Integer;
begin
if(InvFull) then
begin

WriteLn('Inventory full, Banking');

OpenBankFast('db');
WriteLn('Depositing ' + TREES_TO_CUT + ' logs.');

if(PinScreen) then
WriteLn('Entering Bank PIN: ' + PLAYER_BANK_PIN + '.');
InPin(PLAYER_BANK_PIN);

if(BankScreen) then
DepositAll;
Logs_Chopped := Logs_Chopped + 28;
EXP_Gained := EXP_Gained + 1890;
WriteLn('Deposited ' + TREES_TO_CUT + ' logs.');
WriteLn('Closing Bank');
WriteLn('Logs Chopped: ' + IntToStr(Logs_Chopped));
WriteLn('Gained EXP: ' + IntToStr(EXP_Gained));

CloseBank;
WriteLn('Getting Walk Path');
Wait(2000 + Random(1500));
WriteLn('Found Walk Path');
Wait(1000 + Random(300));
WriteLn('Walking to Willows');

end;
end;

Procedure checkFullInv;
begin
if(InvFull) then
begin
WriteLn('Inventory Full, finding bank path...');
WalkToBank;
Wait(1000 + Random(1500));
WriteLn('Found Bank, Walking to bank...');
bankLogs;
WalkToWillows;
end;
end;

Procedure treeChop;
var x, y: integer;
begin
if not LoggedIn then Exit;

if(InvFull) then exit;
repeat
if FindObj(x, y, 'hop', 3491141, 10) then
Mouse(x, y, 1, 1, false);
ChooseOption('hop');

repeat
wait(1200+random(450));
AntiBan;
CheckFullInv;
Until not(IsUpText('illow')or(InvFull))
until(InvFull);
end;





{------------------------------------------------------------------------------}
begin
ClearDebug;
SetUpSRL;
repeat
WalkToBank;
bankLogs;
WalkToWillows;
ChopDown;


until (Logs_Chopped >= 10000);

end.



This is my first, script, followed mostly Yohojo(thanks so much), but i wanted it to also bank, so i followed another person's guide on walking/banking, but it will never recognise the inv is full.. Help is greatly welcomed, along with any little updates that can improve the script in general!

NKN

2012-05-09 22:15:07

You have way to many InvFulls and such. Try to only add one where it's needed.

It's late here, so I'll look at it tomorrow if you haven't figured it out.

Gucci

2012-05-09 22:22:40

You need to add:

if InvFull then
begin

at the beginning of the chopping procedure in this procedure:

Procedure treeChop;
var x, y: integer;
begin
if not LoggedIn then Exit;

if(InvFull) then exit; // If inv is full it will exit and not do anything else but you don't actually use this procedure
repeat
if FindObj(x, y, 'hop', 3491141, 10) then
Mouse(x, y, 1, 1, false);
ChooseOption('hop');

repeat
wait(1200+random(450));
AntiBan;
CheckFullInv;
Until not(IsUpText('illow')or(InvFull))
until(InvFull);
end;

But in the function you use (ChopDown) you never use a if invfull then command

Function ChopDown:Boolean;
Var
X, Y, PlusOne, TreeCounter: Integer;
Begin
If InvFull then // Added this to the function to call on WalkToBank; when inv is full
WalkToBank;

PlusOne:= InvCount +1;
If FindObjCustom(X, Y, ['Chop', 'down', 'willow'], [2107945, 922899, 723723, 1384477], 30) Then
Begin;
WriteLn('Aww yea! A tree woot@!');
StatsGuise('Aww Yea! A tree woot@!');
GetMousePos(x, y)
StatsGuise('Aww yea! A tree Woot@!');


Case Random(2) Of
0: Mouse (x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
WaitOption('Chop', 400);
End;
End;

Repeat
MarkTime(TreeCounter);
Antiban;
Wait(100);
If InvCount=Plusone Then
Writeln('We got a log baby');
Until (InvCount=Plusone)

End;
End;

b3asts

2012-05-10 07:00:42

ohhh k ty