No, maybe this will explain better. Sry I'm sometimes terrible at explaining things from my point of view.
Simba Code:
function DoubleCheckFunction: Boolean;
begin
result := false;
//Code: Do something here
// If Do Something/c = This happend/1
if (c = 1) then //objective met would go here
result := true
else
begin
//Do something failed
//Code: Now Do this: fail safe
//Below now checks one more time if objective is
//complete w/o having to reenter all the above code
//If I hange c to 2 = error
c := 1; //objective met would go here
if DoubleCheckFunction then
result := true;
end;
end;
here is my actual funtion I'm working on. I made the above function to test that it will output true if the objective wan't met the first time.
FindUrnInInv returns true if 2 are found in inv. So to save coding lines, this should repeat it's self until 2 urns are found in inv. I want it set up this way is because I'm using the same func on other areas.
Simba Code:
//this function is just added so you can understand the bottom func
function FindUrnInInv(move: Boolean): Boolean;
var
ItemSlot: integer;
begin
if CheckLogin then Exit;
result := false;
color := GetACAUrnColor;
count := CountItems('color', color, []);
if (count = 2) then
begin
WriteDebug('Urns found, Checking if in correct spot');
MoveUrns;
result := true;
end else
begin
WriteDebug('At least 2 Urns not found');
Exit;
end;
box := InvBox(1);
if not FindColor(x,y,color,box.x1,box.y1,box.x2,box.y2) then
begin
WriteDebug('Didn''t find urn in inv slot one');
result := true;
end;
end;
// This function shoule repeat twice if inv is empty, once if already have one urn in inv.
function GetBankUrns: Boolean;
var
BankSlot: integer;
Pt: TPoint;
begin
if CheckLogin then Exit;
result := false;
WriteDebug('Searching for urn in bank');
SearchBank(UrnType);
MouseBankSlot(1, 3);
if WaitFunc(@IsUrnUpText,RandomRange(200,220), RandomRange(900,1000)) then
Begin
ClickMouse2(0);
if WaitOptionMulti('thdraw-2', 1000) then
begin
if FindUrnInInv then
result := true;
else GetBankUrns;
end else
begin
WriteDebug('Did not find option to withdraw 2');
end;
end;
end;
This:
Simba Code:
function GetBankUrns: Boolean;
var
BankSlot: integer;
Pt: TPoint;
begin
if CheckLogin then Exit;
result := false;
WriteDebug('Searching for urn in bank');
SearchBank(UrnType);
MouseBankSlot(1, 3);
if WaitFunc(@IsUrnUpText,RandomRange(200,220), RandomRange(900,1000)) then
Begin
ClickMouse2(0);
if WaitOptionMulti('thdraw-2', 1000) then
begin
if FindUrnInInv then
result := true;
else GetBankUrns;
end else
begin
WriteDebug('Did not find option to withdraw 2');
end;
end;
end;
Instead of this:
Simba Code:
function GetBankUrns: Boolean;
var
BankSlot: integer;
Pt: TPoint;
begin
if CheckLogin then Exit;
result := false;
WriteDebug('Searching for pouch in bank');
SearchBank(UrnType);
MouseBankSlot(1, 3);
if WaitFunc(@IsUrnUpText,RandomRange(200,220), RandomRange(900,1000)) then
Begin
ClickMouse2(0);
if WaitOptionMulti('thdraw-2', 1000) then
begin
if FindUrnInInv then
result := true;
else
begin
WriteDebug('Searching for pouch in bank');
SearchBank(UrnType);
MouseBankSlot(1, 3);
if WaitFunc(@IsUrnUpText,RandomRange(200,220), RandomRange(900,1000)) then
Begin
ClickMouse2(0);
if WaitOptionMulti('thdraw-2', 1000) then
begin
if FindUrnInInv then
result := true;
end;
end;
end
end else
begin
WriteDebug('Did not find option to withdraw 2');
end;
end;
end;