I think this problem might/could be something similar to this problem:

Originally Posted by
Janilabo;
I think this problem could be caused by the moment when the (shop) stack amount is getting updated - example below:
Code:
STACK
2544 [moment 1] - now we use Choose Option, with Buy 10 for this!
25__ [moment 2] - last 2 digits getting updated, but they will be shown as blank space (or something between 44 and 34) for a very short moment, right before new quantity is added in, so quantity would be detected as "25" now...
2534 [moment 3] - that new quantity has been updated to screen.
The "moment 2" is shown in screen for maybe 16 milliseconds, something that you don't really notice with human-eye... But even that is enough for SCAR to pick it up incorrectly sometimes, obviously.
So, for version 0.30 I added in a workaround for this case, hoping it will get rid of this issue finally for good.

(Note: This quoted post doesn't exist in SRL-forums)
So basically, when your HP goes automatically up by 1, and when it will update only the latter digit of it (that second digit), it will pick it up as just single digit value (not empty str!), before that new second digit value is added in...
If your Simba is scanning screen at that very same moment, while second digit from HP is getting updated, it will pick up your HP incorrectly and eat some food when its not even needed.
Any HP change could cause this issue, like for example: It could be happening either when you lose HP (get damaged by NPC's/players) or when you gain it automatically from game system OR manually from eating some food.
When the whole value changes, these issues wont be happening, because it will be picked up as -1, as it will be updating both HP digits and that way it will be detected as -1 (due to invalid str).
Incase anyone wants to add similar quantity validation for Simba scripts aswell, then here are the script's source codes:
---0.32---
Code:
program ShopAndHop;
{========Shop and Hop===========
=======A universal buyer========
Version: 0.32
Release Date: 3.16.2013
Version Date: 5.14.2013
Description: Purchases stackable items from any shop and hops world to repeat.
Instructions: Setup lines 28-36 with npc colors, name and shop items you would like to purchase.
===============================}
{$DEFINE SMART} // Comment out to use webbrowser.
var
i, curworld, worldcount: Integer;
compassangle: Extended;
npccolors, slotstobuy, buylimit, excludeworlds: TIntArray;
npcname, npctradecommand, uname, pword: string;
didswitch, success: Boolean;
bmp: TSCARBitmap;
const
NEW_QUANTITY_METHOD = True; // Use new or old way? Test which works better. True = NEW, False = OLD
QUANTITY_VALIDATION = 3; // Amount of checkups/scans that each GetShopQuantityEx() requires to validate the result (quantity)? Recommended to keep as 3-6.
procedure Setup;
begin
uname := 'username';
pword := 'password';
npccolors := [0, 0]; // Remember to clear the 0's out and then add your own colors in.
npcname := 'NPC NAME';
npctradecommand := 'Trade';
compassangle := 0.0; // Change if needed. ..example compass angles: http://i.imgur.com/V5kCu4Y.png
slotstobuy := [0, 1, 2];
buylimit := [0, 50, 100];
excludeworlds := [301, 302, 308, 316];
bmp := TSCARBitmap.Create('deNrjYuBi+D9DHo487IzREFCQAQYwFUBkPR1MgAjCJigLNwQuC2QASbheuDIIgkjBDUHWi2w+mhXIJiPLIjOQFeCSRRMEAN2QVj0=');
if (High(slotstobuy) <> High(buylimit)) then
begin
WriteLn('Number of parameters for slots to buy and item limits do not match!');
TerminateScript;
end;
end;
{$DEFINE RS07}
{$I OSI\OSI.scar}
{$I MSSL\MSSL.scar}
procedure ScriptTerminate;
begin
Bmp.Free;
MSSL_Unsetup;
FreeOSI;
end;
{$IFNDEF MSSL_1.11(+)}
begin
ClearDebug;
WriteLn('MSSL is OUTDATED! Please update it with Includes Manager.');
end.
{$ENDIF}
function GetShopSlotFromID(i: Integer): TBox;
var
col, row: Integer;
begin
col := (i mod 8);
row := Floor(i / 8);
Result := Box((80 + col * 47), (69 + row * 47), (111 + col * 47), (100 + row * 47));
end;
function IsShopOpen: Boolean;
var
x, y: Integer;
a: TBox;
begin
case RS07_LoggedIn of
True:
begin
a := Box(68, 297, 80, 309);
case RS07_PreventChooseOptionCollision(a) of
True: Result := FindBitmap(x, y, bmp, a.X1, a.Y1, a.X2, a.Y2);
False: Result := False;
end;
end;
False: Result := False;
end;
end;
function GetShopQuantityFromIDEx(i: Integer; colors: TIntArray): Integer;
var
c, t, s, q, v: Integer;
slotbox: TBox;
b: TSCARBitmap;
tmpClient: TSCARClient;
tmp: string;
accept: TCharArray;
e: Boolean;
begin
if ((Length(colors) > 0) and RS07_PreventChooseOptionCollision(RS07_GameActionBx) and IsShopOpen) then
begin
accept := MSSL_TIAToTCA(MSSL_TIAByRange(48, 57));
slotbox := GetShopSlotFromID(i);
t := GetSystemTime;
Result := -1;
case (QUANTITY_VALIDATION > -1) of
True: s := QUANTITY_VALIDATION;
False: s := 0;
end;
repeat
if not IsShopOpen then
Exit;
v := -1;
b := GetClient.Capture;
ReplaceColors(b, colors, 62208);
tmpClient := MSSL_SetBitmapAsClient(b);
case NEW_QUANTITY_METHOD of
True:
begin
tmp := GetTextAtEx((slotbox.X1 + 1), (slotbox.Y1 + 3), 0, RS07_TradeFont, False, False, 0, 0, 62208, 4, True, tr_Digits);
if MSSL_TCAContains(accept, tmp[1]) then
v := StrToIntDef(GetNumbers(tmp), -1);
tmp := '';
end;
False:
begin
e := False;
for c := 4 downto 1 do
if not e then
begin
tmp := GetTextAtEx((slotbox.X1 + 1), (slotbox.Y1 + 3), 0, RS07_TradeFont, False, False, 0, 0, 62208, c, True, tr_Digits);
if MSSL_TCAContains(accept, tmp[1]) then
begin
v := StrToIntDef(tmp, -1);
e := (v > -1);
end;
tmp := '';
end;
end;
end;
SetClient(tmpClient).Free;
b.Free;
if (v > Result) then
Result := v;
if (Result > -1) then
Inc(q);
MSSL_Wait(0);
until (((GetSystemTime - t) > 10000) or (q > s));
end else
Result := -1;
end;
function GetShopQuantityFromID(i: Integer): Integer;
begin
Result := GetShopQuantityFromIDEx(i, [65535, 1679010]);
end;
function BuyFromShop(i, lim: Integer): Boolean;
var
t, q, f, b: Integer;
slot: TBox;
u: TStrArray;
begin
if (InRange(i, 0, 39) and IsShopOpen) then
begin
slot := GetShopSlotFromID(i);
repeat
if not IsShopOpen then
Exit;
q := GetShopQuantityFromID(i);
if (q > 0) then
begin
b := (q - lim);
Result := (b < 1);
if not Result then
begin
case (b > 9) of
True: u := ['Buy 10', 'Buy 5', 'Buy 1'];
False:
case (b > 4) of
True: u := ['Buy 5', 'Buy 1'];
False: u := ['Buy 1'];
end;
end;
case RS07_ChooseOptions(Point((slot.X1 + 5 + Random((slot.X2 - slot.X1) - 5)), (slot.Y1 + 2 + Random((slot.Y2 - slot.Y1) - 3))), u) of
True:
begin
f := 0;
t := GetSystemTime;
repeat
if not IsShopOpen then
Exit;
MSSL_Wait(0);
until (not RS07_ChooseOptionAvailable or ((GetSystemTime - t) > 3000));
MSSL_Wait(200 + Random(100));
t := GetSystemTime;
repeat
if not IsShopOpen then
Exit;
MSSL_Wait(0);
q := GetShopQuantityFromIDEx(i, [65525]);
until (((GetSystemTime - t) > 20000) or (q > -1));
Result := ((q = 0) or ((q > -1) and (q <= lim)));
end;
False:
begin
Result := ((q = 0) or ((q > -1) and (q <= lim)));
if RS07_ChooseOptionAvailable then
begin
if not RS07_ChooseOptionContains('Buy 1') then
Inc(f);
RS07_HideChooseOption;
end;
end;
end;
end;
end else
Result := (q = 0);
if not Result then
MSSL_Wait(0);
until (Result or (f > 2));
end;
end;
function CloseShop: Boolean;
var
t, m, r: Integer;
xbox: TBox;
p: TPoint;
begin
xbox := Box(477, 31, 491, 51);
Result := not IsShopOpen;
if (not Result and RS07_PreventChooseOptionCollision(xbox)) then
begin
m := GetSystemTime;
p := Point((xbox.X1 + Random(xbox.X2 - xbox.X1)), (xbox.Y1 + Random(xbox.Y2 - xbox.Y1)));
repeat
Result := not IsShopOpen;
if not Result then
begin
case MSSL_MouseNearPt(p, 2) of
True:
if (((GetSystemTime - m) > 25) and ((GetSystemTime - t) > (250 + r)) and RS07_WaitUpText('Close', um_IsUpText, 30)) then
begin
RS07_Click(mbLeft);
t := GetSystemTime;
r := Random(250);
end;
False:
begin
RS07_MoveMouse(p.X, p.Y);
m := GetSystemTime;
end;
end;
MSSL_Wait(0);
end;
until Result;
end;
end;
function OpenShop: Boolean;
var
h, i, t: Integer;
p: TPointArray;
c: TPoint;
a: T2DPointArray;
begin
Result := IsShopOpen;
if not Result then
repeat
if not RS07_LoggedIn then
Exit;
Result := IsShopOpen;
if (not Result and RS07_SetCompass(compassangle)) then
case MSSL_FindColorsTolExCS(p, npccolors, RS07_GameActionBx.X1, RS07_GameActionBx.Y1, RS07_GameActionBx.X2, RS07_GameActionBx.Y2, 3, MSSL_CTS1) of
True:
begin
a := SplitTPA(p, 10);
SortATPAByMeanEx(a, BoxCenter(RS07_GameActionBx));
SetLength(p, 0);
h := High(a);
for i := 0 to h do
begin
c := TPACenter(a[i]);
RS07_MoveMouse(c.X, c.Y);
MSSL_Wait(25);
if RS07_WaitUpText(('Talk-to ' + npcname), um_IsUpText, 25) then
begin
GetMousePos(c.X, c.Y);
case (RS07_OpenChooseOption(c.X, c.Y) and RS07_ChooseOptionUse(npctradecommand)) of
True:
begin
t := GetSystemTime;
repeat
if not RS07_LoggedIn then
Exit;
MSSL_Wait(0);
Result := IsShopOpen;
until (Result or ((GetSystemTime - t) > 10000));
end;
False: RS07_HideChooseOption;
end;
Break;
end;
end;
end;
False:
begin
RS07_MoveMouse(255, 175);
MSSL_Wait(25);
if RS07_WaitUpText(('Talk-to ' + npcname), um_IsUpText, 25) then
begin
GetMousePos(c.X, c.Y);
case (RS07_OpenChooseOption(c.X, c.Y) and RS07_ChooseOptionUse(npctradecommand)) of
True:
begin
t := GetSystemTime;
repeat
if not RS07_LoggedIn then
Exit;
MSSL_Wait(0);
Result := IsShopOpen;
until (Result or ((GetSystemTime - t) > 10000));
end;
False: RS07_HideChooseOption;
end;
end;
end;
end;
until Result;
end;
begin
SetUpOSI;
MSSL_Setup;
Setup;
worldcount := Length(RS07_Worlds);
curworld := Random(worldcount);
didswitch := False;
repeat
case RS07_LoggedIn of
False:
case RS07_AtLoginScreen of
True:
case didswitch of
False:
begin
repeat
curworld := ((curworld + 1) mod worldcount);
until not TIAContains(excludeworlds, RS07_Worlds[curworld]);
case RS07_ValidWorld(RS07_Worlds[curworld]) of
True:
begin
WriteLn(MSSL_TheTime + ': Switching to ' + IntToStr(RS07_Worlds[curworld]));
didswitch := RS07_SwitchWorld(RS07_Worlds[curworld]);
end;
False:
begin
WriteLn(MSSL_TheTime + ': Woah, that was weird... How did that happen?');
curworld := Random(worldcount);
WriteLn(MSSL_TheTime + ': Switching to ' + IntToStr(RS07_Worlds[curworld]));
end;
end;
end;
True:
begin
if RS07_LogIn(uname, pword) then
RS07_SetCameraAngleH;
didswitch := False;
end;
end;
False:
case RS07_AtWorldSelection of
False:
case RS07_AtWelcomeScreen of
False:
begin
WriteLn(MSSL_TheTime + ': Not logged in and cannot access world switch.. Terminating script!');
TerminateScript;
end;
True: RS07_Play;
end;
True:
begin
WriteLn(MSSL_TheTime + ': Woah... That was weird. Avoided getting stuck on world selection.');
didswitch := RS07_CancelWorldSwitch;
end;
end;
end;
True:
begin
for i := 0 to High(slotstobuy) do
case RS07_LoggedIn of
True:
begin
success := False;
repeat
if OpenShop then
begin
success := BuyFromShop(slotstobuy[i], buylimit[i]);
if not success then
MSSL_Wait(0);
end;
until (success or not RS07_LoggedIn);
end;
False: i := (High(slotstobuy) + 1);
end;
CloseShop;
repeat
success := not RS07_LoggedIn;
if (not success and not RS07_LogOut) then
MSSL_Wait(0);
until success;
end;
end;
MSSL_Wait(0);
until False;
end.
..and...
---0.32 [CTS]---
Code:
program ShopAndHop;
{========Shop and Hop===========
=======A universal buyer========
Version: 0.32 [CTS]
Release Date: 3.16.2013
Version Date: 5.14.2013
Description: Purchases stackable items from any shop and hops world to repeat.
Instructions: Setup lines 33-41 with npc colors, name and shop items you would like to purchase.
===============================}
{$DEFINE SMART} // Comment out to use webbrowser.
{$DEFINE RS07}
{$I OSI\OSI.scar}
{$I MSSL\MSSL.scar}
var
i, curworld, worldcount: Integer;
compassangle: Extended;
npccolors: MSSL_TColorDataArray;
slotstobuy, buylimit, excludeworlds: TIntArray;
npcname, npctradecommand, uname, pword: string;
didswitch, success: Boolean;
obj: RS07_TObj;
bmp: TSCARBitmap;
const
NEW_QUANTITY_METHOD = True; // Use new or old way? Test which works better. True = NEW, False = OLD
QUANTITY_VALIDATION = 3; // Amount of checkups/scans that each GetShopQuantityEx() requires to validate the result (quantity)? Recommended to keep as 2-5.
procedure Setup;
begin
uname := 'username';
pword := 'password'; // READ EVERYTHING => Remember to EDIT the MSSL_ColorSettings2() (you can add unlimited amount of these, but having only 1 of em is highly recommended, to maintain as fast speed as possible).
npccolors := [MSSL_ColorData(MSSL_ColorSettings2(1, 0.00, 0.00), 16777215, 3)]; // Parameters: 1. CTS-mode [1], 2. Hue modifier [0.00], 3. Saturation modifier [0.00], 4. Color [16777215], 5. Tolerance [3]! - NOTE: If you use CTS0 or CTS1, then just keep the modifier parameters (hue&saturation) as 0 or 0.00.
npcname := 'NPC NAME'; // CASE-SENSITIVE!
npctradecommand := 'Trade'; // CASE-SENSITIVE!
compassangle := 0.0; // Change if needed. ..example compass angles: http://i.imgur.com/V5kCu4Y.png
slotstobuy := [0, 1, 2];
buylimit := [0, 50, 100];
excludeworlds := [301, 302, 308, 316];
bmp := TSCARBitmap.Create('deNrjYuBi+D9DHo487IzREFCQAQYwFUBkPR1MgAjCJigLNwQuC2QASbheuDIIgkjBDUHWi2w+mhXIJiPLIjOQFeCSRRMEAN2QVj0=');
if (High(slotstobuy) <> High(buylimit)) then
begin
WriteLn('Number of parameters for slots to buy and item limits do not match!');
TerminateScript;
end;
obj := RS07_ToObj(MSSL_ToObjectData(npccolors, bm_Split, 10), Point(0, 0), MSSL_IntRange(0, 0), MSSL_IntRange(0, 0), [('Talk-to ' + npcname)], um_IsUpText);
end;
{$IFNDEF MSSL_1.11(+)}
begin
ClearDebug;
WriteLn('MSSL is OUTDATED! Please update it with Includes Manager.');
end.
{$ENDIF}
procedure ScriptTerminate;
begin
Bmp.Free;
MSSL_Unsetup;
FreeOSI;
end;
function GetShopSlotFromID(i: Integer): TBox;
var
col, row: Integer;
begin
col := (i mod 8);
row := Floor(i / 8);
Result := Box((80 + col * 47), (69 + row * 47), (111 + col * 47), (100 + row * 47));
end;
function IsShopOpen: Boolean;
var
x, y: Integer;
a: TBox;
begin
case RS07_LoggedIn of
True:
begin
a := Box(68, 297, 80, 309);
case RS07_PreventChooseOptionCollision(a) of
True: Result := FindBitmap(x, y, bmp, a.X1, a.Y1, a.X2, a.Y2);
False: Result := False;
end;
end;
False: Result := False;
end;
end;
function GetShopQuantityFromIDEx(i: Integer; colors: TIntArray): Integer;
var
c, t, s, q, v: Integer;
slotbox: TBox;
b: TSCARBitmap;
tmpClient: TSCARClient;
tmp: string;
accept: TCharArray;
e: Boolean;
begin
if ((Length(colors) > 0) and RS07_PreventChooseOptionCollision(RS07_GameActionBx) and IsShopOpen) then
begin
accept := MSSL_TIAToTCA(MSSL_TIAByRange(48, 57));
slotbox := GetShopSlotFromID(i);
t := GetSystemTime;
Result := -1;
case (QUANTITY_VALIDATION > -1) of
True: s := QUANTITY_VALIDATION;
False: s := 0;
end;
repeat
if not IsShopOpen then
Exit;
v := -1;
b := GetClient.Capture;
ReplaceColors(b, colors, 62208);
tmpClient := MSSL_SetBitmapAsClient(b);
case NEW_QUANTITY_METHOD of
True:
begin
tmp := GetTextAtEx((slotbox.X1 + 1), (slotbox.Y1 + 3), 0, RS07_TradeFont, False, False, 0, 0, 62208, 4, True, tr_Digits);
if MSSL_TCAContains(accept, tmp[1]) then
v := StrToIntDef(GetNumbers(tmp), -1);
tmp := '';
end;
False:
begin
e := False;
for c := 4 downto 1 do
if not e then
begin
tmp := GetTextAtEx((slotbox.X1 + 1), (slotbox.Y1 + 3), 0, RS07_TradeFont, False, False, 0, 0, 62208, c, True, tr_Digits);
if MSSL_TCAContains(accept, tmp[1]) then
begin
v := StrToIntDef(tmp, -1);
e := (v > -1);
end;
tmp := '';
end;
end;
end;
SetClient(tmpClient).Free;
b.Free;
if (v > Result) then
Result := v;
if (Result > -1) then
Inc(q);
MSSL_Wait(0);
until (((GetSystemTime - t) > 10000) or (q > s));
end else
Result := -1;
end;
function GetShopQuantityFromID(i: Integer): Integer;
begin
Result := GetShopQuantityFromIDEx(i, [65535, 1679010]);
end;
function BuyFromShop(i, lim: Integer): Boolean;
var
t, q, f, b: Integer;
slot: TBox;
u: TStrArray;
begin
if (InRange(i, 0, 39) and IsShopOpen) then
begin
slot := GetShopSlotFromID(i);
repeat
if not IsShopOpen then
Exit;
q := GetShopQuantityFromID(i);
if (q > 0) then
begin
b := (q - lim);
Result := (b < 1);
if not Result then
begin
case (b > 9) of
True: u := ['Buy 10', 'Buy 5', 'Buy 1'];
False:
case (b > 4) of
True: u := ['Buy 5', 'Buy 1'];
False: u := ['Buy 1'];
end;
end;
case RS07_ChooseOptions(Point((slot.X1 + 5 + Random((slot.X2 - slot.X1) - 5)), (slot.Y1 + 2 + Random((slot.Y2 - slot.Y1) - 3))), u) of
True:
begin
f := 0;
t := GetSystemTime;
repeat
if not IsShopOpen then
Exit;
MSSL_Wait(0);
until (not RS07_ChooseOptionAvailable or ((GetSystemTime - t) > 3000));
MSSL_Wait(200 + Random(100));
t := GetSystemTime;
repeat
if not IsShopOpen then
Exit;
MSSL_Wait(0);
q := GetShopQuantityFromIDEx(i, [65525]);
until (((GetSystemTime - t) > 20000) or (q > -1));
Result := ((q = 0) or ((q > -1) and (q <= lim)));
end;
False:
begin
Result := ((q = 0) or ((q > -1) and (q <= lim)));
if RS07_ChooseOptionAvailable then
begin
if not RS07_ChooseOptionContains('Buy 1') then
Inc(f);
RS07_HideChooseOption;
end;
end;
end;
end;
end else
Result := (q = 0);
if not Result then
MSSL_Wait(0);
until (Result or (f > 2));
end;
end;
function CloseShop: Boolean;
var
t, m, r: Integer;
xbox: TBox;
p: TPoint;
begin
xbox := Box(477, 31, 491, 51);
Result := not IsShopOpen;
if (not Result and RS07_PreventChooseOptionCollision(xbox)) then
begin
m := GetSystemTime;
p := Point((xbox.X1 + Random(xbox.X2 - xbox.X1)), (xbox.Y1 + Random(xbox.Y2 - xbox.Y1)));
repeat
Result := not IsShopOpen;
if not Result then
begin
case MSSL_MouseNearPt(p, 2) of
True:
if (((GetSystemTime - m) > 25) and ((GetSystemTime - t) > (250 + r)) and RS07_WaitUpText('Close', um_IsUpText, 30)) then
begin
RS07_Click(mbLeft);
t := GetSystemTime;
r := Random(250);
end;
False:
begin
RS07_MoveMouse(p.X, p.Y);
m := GetSystemTime;
end;
end;
MSSL_Wait(0);
end;
until Result;
end;
end;
function OpenShop: Boolean;
var
t: Integer;
c: TPoint;
begin
Result := IsShopOpen;
if not Result then
repeat
if not RS07_LoggedIn then
Exit;
Result := IsShopOpen;
if (not Result and RS07_SetCompass(compassangle)) then
case RS07_FindMainScreenObj(c, obj) of
True:
case (RS07_OpenChooseOption(c.X, c.Y) and RS07_ChooseOptionUse(npctradecommand)) of
True:
begin
t := GetSystemTime;
repeat
if not RS07_LoggedIn then
Exit;
MSSL_Wait(0);
Result := IsShopOpen;
until (Result or ((GetSystemTime - t) > 10000));
end;
False: RS07_HideChooseOption;
end;
False:
begin
RS07_MoveMouse((255 + RandomRange(-10, 11)), (175 + RandomRange(-10, 11)));
MSSL_Wait(25);
if RS07_WaitUpText(('Talk-to ' + npcname), um_IsUpText, 25) then
begin
GetMousePos(c.X, c.Y);
case (RS07_OpenChooseOption(c.X, c.Y) and RS07_ChooseOptionUse(npctradecommand)) of
True:
begin
t := GetSystemTime;
repeat
if not RS07_LoggedIn then
Exit;
MSSL_Wait(0);
Result := IsShopOpen;
until (Result or ((GetSystemTime - t) > 10000));
end;
False: RS07_HideChooseOption;
end;
end;
end;
end;
until Result;
end;
begin
SetUpOSI;
MSSL_Setup;
Setup;
worldcount := Length(RS07_Worlds);
curworld := Random(worldcount);
didswitch := False;
repeat
case RS07_LoggedIn of
False:
case RS07_AtLoginScreen of
True:
case didswitch of
False:
begin
repeat
curworld := ((curworld + 1) mod worldcount);
until not TIAContains(excludeworlds, RS07_Worlds[curworld]);
case RS07_ValidWorld(RS07_Worlds[curworld]) of
True:
begin
WriteLn(MSSL_TheTime + ': Switching to ' + IntToStr(RS07_Worlds[curworld]));
didswitch := RS07_SwitchWorld(RS07_Worlds[curworld]);
end;
False:
begin
WriteLn(MSSL_TheTime + ': Woah, that was weird... How did that happen?');
curworld := Random(worldcount);
WriteLn(MSSL_TheTime + ': Switching to ' + IntToStr(RS07_Worlds[curworld]));
end;
end;
end;
True:
begin
if RS07_LogIn(uname, pword) then
RS07_SetCameraAngleH;
didswitch := False;
end;
end;
False:
case RS07_AtWorldSelection of
False:
case RS07_AtWelcomeScreen of
False:
begin
WriteLn(MSSL_TheTime + ': Not logged in and cannot access world switch.. Terminating script!');
TerminateScript;
end;
True: RS07_Play;
end;
True:
begin
WriteLn(MSSL_TheTime + ': Woah... That was weird. Avoided getting stuck on world selection.');
didswitch := RS07_CancelWorldSwitch;
end;
end;
end;
True:
begin
for i := 0 to High(slotstobuy) do
case RS07_LoggedIn of
True:
begin
success := False;
repeat
if OpenShop then
begin
success := BuyFromShop(slotstobuy[i], buylimit[i]);
if not success then
MSSL_Wait(0);
end;
until (success or not RS07_LoggedIn);
end;
False: i := (High(slotstobuy) + 1);
end;
CloseShop;
repeat
success := not RS07_LoggedIn;
if (not success and not RS07_LogOut) then
MSSL_Wait(0);
until success;
end;
end;
MSSL_Wait(0);
until False;
end.
Obviously you wont be able to compile those with Simba at all, but you could always take some ideas from it and that way possibly convert/create similar kinds of functions to Simba with it. 
Live and learn!