Syntax
2013-08-08 08:04:28
program Herb_Identifier;
{$i SRL-OSR/SRL.Simba}
{$i SPS/SPS-OSR.simba}
Var
X,Y,DTM_House,DTM_Bank,DTM_Cookingpot, DTM_Herb, DTM_Pot:Integer;
IsInbank:Boolean;
IsInIdentifier:Boolean;
Status:String;
Const
//SRL Stats
SRLStats_Username = '';
SRLStats_Password = '';
Procedure declarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; //username
Pass := ''; //password
Nick := ''; //display name
Pin := ''; //bank pin
LampSkill := Skill_Agility;
WorldInfo := [];
Member := True;
Active := True;
end;
end;
Procedure WriteStatus;
begin
Wait(400);
ClearDebug;
Writeln('Status:' + status);
end;
Procedure FreetheDTMs;
Begin
FreeDTM(DTM_Bank);
FreeDTM(DTM_Cookingpot);
FreeDTM(DTM_Herb);
FreeDTM(DTM_Pot);
end;
Procedure LoadDTM;
Begin
DTM_Bank := DTMFromString('mWAAAAHicY2FgYLjPxMDwGIjvAvFzIL4IFDsNxSD2lSO2DIyMjHCMDhjRMAgAAD4/CK0=');
DTM_Cookingpot := DTMFromString('mWAAAAHicY2FgYOBkZmDgA2JhIBYA4qNAsb1AfJABwq71F2JgZGQE465JExjQASMaBgEAQdwF5w==');
DTM_Herb := DTMFromString('mWAAAAHicY2FgYJjCxMAwC4j7mCBsM6CYERTrA7FhCSMDIyMCowNGNAwCAAx8A9k=');
DTM_Pot := DTMFromString('mbQAAAHicY2VgYIhgguB4II4C4jggdgKKWzNAaE8gdgXiBb6CDIyMjCgYG2DEgsEAAFlRBDM=');
end;
function IsInBank(): boolean;
var
Dist_To_Bank,c,b,t,u,Dist_To_Cookingpot:Integer;
begin
Status := 'Outside of the bank'
Result := false;
FindDTM(DTM_Bank, x, y, 524, 3, 762, 168)
FindDTM(DTM_Cookingpot, t, u, 524, 3, 762, 168)
Dist_To_Bank := Distance(c, b, 643, 83);
Dist_To_Cookingpot := Distance (t, u, 643, 83);
Writeln('Current Distance from Bank symbol:' + ToStr(Dist_To_Bank))
Writeln('Current Distance from Cookingpot symbol:' + ToStr(Dist_To_Cookingpot))
If (Dist_To_Bank <= 20) And
(Dist_To_Cookingpot <= 42) then
Begin
Status := 'Inside of the Bank'
Result := true;
end;
end;
function IsInIdentifer(): boolean;
var
c,b,o,p, Dist_To_Pot,Dist_To_Herb:Integer;
begin
Status := 'Outside of the identifier'
Result := false;
FindDTM(DTM_Herb, o, p, 524, 3, 762, 168)
FindDTM(DTM_Pot, c, b, 524, 3, 762, 168)
Dist_To_Herb := Distance(X, Y, 643, 83);
Dist_To_Pot := Distance (c, b, 643, 83);
Writeln('Current Distance from Pot symbol:' + ToStr(Dist_To_Pot))
Writeln('Current Distance from Herb symbol:' + ToStr(Dist_To_Herb))
If (Dist_To_Herb <= 12) And
(Dist_To_Pot <= 36) then
Begin
Status := 'Inside of the identifier'
Result := true;
end;
end;
Function MyOpenBank:Boolean;
var
TPA : TPointArray;
ATPA : T2DPointArray;
x, y, i, ii:Integer;
begin
Result:= False;
if BankScreen then
begin
Result:= True;
Writeln('Bank Found');
Exit;
end;
MakeCompass('W');
Wait(300); //screen settel
FindColorsTolerance(TPA, 2445165, MSX1, MSY1, MSX2, MSY2, 5);
//DebugTPA(TPA, '');
//Wait(3000);
ATPA := SplitTPAEx(TPA, 10, 10);
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
//DebugATPABounds(ATPA);
ii := High(ATPA); //get higherst entry in array
for i := 0 to ii do //from 0 first entry in array to ii highest entry
begin
MiddleTPAEx(ATPA[i], x, y);//find middle of array entry
MMouse(x, y, 3, 3);
if WaitUpTextMulti(['ooth', 'ank booth'], 300) then
begin
Mouse(x, y, 0, 0, False);
Wait(200); //ERROR HERE
//ChooseOption('uickly'); //Dont work
//WaitOptionMultiEx(['se-quickly', 'uickly'], 'all', ClickLeft, 200);//Dont work
//WaitOption('uickly', 500); //Dont work
ChooseOptionMultiEx(['uickl'], 'all', ClickLeft) //Dont work
Flag;
Wait(2000 + Random(800));
if BankScreen then
begin
Result:= True;
Writeln('Bank Found');
Exit;
end;
end;
end;
end;
procedure WalkToBank;
var
MyPath:TPointArray;
begin
if not IsInBank then
SPS_Setup(runescape_surface, ['13_12']);
myPath := [Point(329, 275), Point(329, 258), Point(346, 259), Point(353, 265),
Point(358, 277), Point(360, 289), Point(358, 304), Point(358, 318),
Point(357, 333), Point(342, 341)];
SPS_WalkPath (myPath);
end;
Procedure get_herbs;
begin
if not IsInBank then
WalkToBank
else
writeln('test');
end;
procedure walk_to_identifier;
begin
if not IsInIdentifier then
WalkToIdentifer
else
end;
procedure identify_herbs;
begin
if not IsInIdentifer then;
WalkToIdentifer;
check for coins
find him and click on him (TPAs)?
identify herbs (click through dialogue)
end;
begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
end. [Error] C:\Simba\Scripts\Herb.simba(156:1): Identifier expected at line 155
Compiling failed.
Ignore the notes I have made in the script, as far as the compiler goes it hasn't got up to there yet.
Also not showing up will all procedures I have made:
http://i.imgur.com/FteA1jy.png
