KillerTHC
2010-11-26 17:15:24
R_ChooseOptionMulti is not working for some reason, it won't work in my script it will only open the menu but not select and option. It also doesn't work in the banking procedures that come with the reflection package. This problem also extends to R_ChooseOption because it uses R_ChooseOptionMulti.
My Script(In the making)
My Script(In the making)
program FaladorChefR;
{$I SRL/SRL/misc/SMART.scar}
{$I SRL/SRL.scar}
{$I Reflection/Reflection.simba}
var
x, y, LoadsToDo, LoadsCompleted, DoorIDOpen, DoorIDClosed, RangeID: Integer;
WalkToCook, WalkToBank, TempTA: TTileArray;
CookTile, BankTile: TTile;
DoorObj, RangeObj: TRSObject;
TP: TPoint;
const
SmartWorld = 121;
Members = False;
SignedClient = True;
HighDetail = False;
procedure DeclarePlayers; //Player setup
begin
LoadsToDo := 1;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Pin := '';
Players[0].Nick := '';
Players[0].Active := True;
end;
procedure AntiBan;
begin
FindNormalRandoms;
case Random(10) of
0: HoverSkill('Random',False);
1: PickUpMouse;
2: BoredHuman;
3: ExamineInv;
4: RandomAngle('up');
end;
end;
procedure ProgressReport;
begin
if(HowManyPlayers = 1)then
begin
WriteLn('=============Falador Chef Using Reflection=============');
WriteLn(Players[0].Name + ' has cooked ' + IntToStr(LoadsCompleted) + ' loads of food');
end else
if(HowManyPlayers >= 2)then
begin
end;
end;
procedure Init;
begin
ClearDebug;
SetupSRL;
SetupReflectionEx(True);
DeclarePlayers;
LoginPlayer;
ClearDebug;
WriteLn('Welcome to FaladorChefR By KillerTHC');
WriteLn('Waiting 10s to ensure RuneScape has loaded');
Wait(10000);
end;
procedure ResetMS;
begin
WriteLn('Setting MS to highest angle and facing North');
SetAngle(True);
Wait(1000);
MakeCompass('North');
Wait(1000);
end;
procedure MainLoop;
begin
RangeID := 2728;
DoorIDOpen := 11708;
DoorIDClosed := 11707;
BankTile := Tile(3013,3355);
CookTile := Tile(2989,3365);
WalkToCook := [Tile(3012,3361), Tile(3004,3364), Tile(2993,3370), Tile(2989,3368)];
WalkToBank := [Tile(2994,3368), Tile(3003,3364), Tile(3012,3355)];
ResetMS;
SetRun(True);
if not TileOnMM(BankTile) then //We arent in the bank
begin
if not TileOnMM(CookTile) then //We arent in the cookery either
begin
WriteLn('You must start either in the bank or in the cookery!');
Exit;
end
end;
for LoadsCompleted := 0 to LoadsToDo do
begin
if TileOnMM(BankTile) then //We are in the bank
begin
WriteLn('In bank starting banking procedures');
if R_OpenBankBooth('feb') then
begin //Opened the bank successfully
WriteLn('Bank booth opened, depositing all items');
R_DepositAll(True);
if Withdraw(1, 1, 28) then
begin //Withdrew successfully
WriteLn('Food in slot 1 withdrawn, walking to cookery');
CloseBank;
WalkPath(WalkToCook);
end else
begin
WriteLn('Failed to withdraw food');
Exit;
end
end else
begin
WriteLn('Failed to open the bank booth');
Exit;
end
end else
begin
if TileOnMM(CookTile) then //We are in the cookery
begin
WriteLn('In cookery, checking if the door is open');
DoorObj := GetObjectByID(DoorIDOpen, OBJECT_TYPE_WALLOBJECT, 15);
TP := TileToMS(DoorObj.Tile, 1);
if TP.x > 0 then
begin //Door is open
WriteLn('Door found at ('+IntToStr(DoorObj.Tile.x)+','+IntToStr(DoorObj.Tile.y)+')');
WriteLn('Door is open walking to bank');
WalkPath(WalkToBank);
if R_OpenBankBooth('feb') then
begin //Opened the bank successfully
WriteLn('Bank booth opened, depositing all items');
R_DepositAll(True);
if Withdraw(1, 1, 28) then
begin //Withdrew successfully
WriteLn('Food in slot 1 withdrawn, walking to cookery');
CloseBank;
WalkPath(WalkToCook);
end else
begin
WriteLn('Failed to withdraw food');
Exit;
end
end else
begin
WriteLn('Failed to open the bank booth');
Exit;
end
end else
begin //Door is closed
WriteLn('Door is closed');
DoorObj := GetObjectByID(DoorIDClosed, OBJECT_TYPE_WALLOBJECT, 15)
TP := TileToMS(DoorObj.Tile, 1);
if TP.x > 0 then
begin //We found the door successfully
WriteLn('Door found at ('+IntToStr(DoorObj.Tile.x)+','+IntToStr(DoorObj.Tile.y)+')');
WriteLn('Attempting to open it');
Mouse(TP.x, TP.y, 2, 2, False);
if not R_ChooseOptionMulti(['Open','open','pen']) then
begin //Failed to open the door
WriteLn('Got stuck in the cookery, couldnt open the door');
Exit;
end else
begin //Opened the door successfully
WriteLn('Door opened, walking to bank');
WalkPath(WalkToBank);
if R_OpenBankBooth('feb') then
begin //Opened the bank successfully
WriteLn('Bank booth opened, depositing all items');
R_DepositAll(True);
if Withdraw(1, 1, 28) then
begin //Withdrew successfully
WriteLn('Food in slot 1 withdrawn, walking to cookery');
CloseBank;
WalkPath(WalkToCook);
end else
begin
WriteLn('Failed to withdraw food');
Exit;
end
end else
begin
WriteLn('Failed to open the bank booth');
Exit;
end
end
end
end
end
end;
//We are now outside the cookery with uncooked food
WriteLn('Outside cookery, checking if the door is open');
DoorObj := GetObjectByID(DoorIDClosed, OBJECT_TYPE_WALLOBJECT, 15)
TP := TileToMS(DoorObj.Tile, 1);
if TP.x > 0 then
begin //We found the door successfully
WriteLn('Door found at ('+IntToStr(DoorObj.Tile.x)+','+IntToStr(DoorObj.Tile.y)+')');
Mouse(TP.x, TP.y, 2, 2, False);
if not R_ChooseOptionMulti(['Open','open','pen']) then
begin //Failed to open the door
WriteLn('Got stuck in the cookery, couldnt open the door');
Exit;
end else
begin //Opened the door successfully
WriteLn('Door opened, walking in');
if not WalkToTile(CookTile, 2, 0) then
begin
WriteLn('WalkToTile failed, trying WalkPath');
TempTA := [CookTile];
WalkPath(TempTA);
end
end
end;
//Door is open so just walk in
WriteLn('Door is open, walking in');
if not WalkToTile(CookTile, 2, 0) then
begin
WriteLn('WalkToTile failed, trying WalkPath');
TempTA := [CookTile];
WalkPath(TempTA);
end;
//Cook food
WriteLn('Trying to find the Range to cook food');
RangeObj := GetObjectByID(RangeID, OBJECT_TYPE_INTERACTABLE, 15)
TP := TileToMS(RangeObj.Tile, 1);
if TP.x > 0 then
begin
WriteLn('Range found at ('+IntToStr(RangeObj.Tile.x)+','+IntToStr(RangeObj.Tile.y)+')');
WriteLn('Range found, attempting to cook food');
R_ClickItem(Random(5), True, '');
Mouse(TP.x, TP.y, 2, 2, True);
Mouse(259, 418, 20, 20, False); //Right click the button for cooking
if R_ChooseOptionMulti(['Cook All', 'Cook all', 'cook all']) then
begin
WriteLn('Food is in process of cooking...');
Wait(25000);
LoadsCompleted := LoadsCompleted + 1;
ProgressReport;
end else
begin
WriteLn('Failed to cook the food');
Exit;
end
end else
begin
WriteLn('Couldnt find the range');
Exit;
end
end
end;
begin
Init;
MainLoop;
end.