SRL Archive - OSR Help

Another error...


bas

2012-04-30 06:27:13

Getting this wierd error…
Anyone know how to fix it?

Error] (433:65): 'THEN' expected at line 432

procedure MainLoop;
begin
repeat
GameTab(Tab_Inv);
if (not FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
CreateGateStone;
DropGateStone;
HomeTeleport;
TradeSmuggler;
BuyMagebanes;
UseTheGatestone;
end else
//THIS FindDTM lights orange.
if FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin

GameTab(Tab_Inv);
ClickMagebane;

nickrules

2012-04-30 06:28:36

if FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then

should be

if FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then

You had two ')'s at then end of the finddtm

bas

2012-04-30 06:29:30

Removed the ).
Now getting:

This is the last thing before i can release my DungFarmer with smuggler support.

[Error] (424:65): Closing parenthesis expected at line 423

Edit:

Removed ). now until(false); light up… wtf..

My full MainLoop:

procedure MainLoop;
begin
repeat
GameTab(Tab_Inv);
if (not FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
CreateGateStone;
DropGateStone;
HomeTeleport;
TradeSmuggler;
BuyMagebanes;
UseTheGatestone;
end else
if FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin

GameTab(Tab_Inv);
ClickMagebane;
UseOnFarming;
wait(randomrange(2000,2100));
AntiBan;
wait(randomrange(1000,1100));
ClearDebug; //ADDED CLEAR DEBUG
wait(randomrange(200,300));
ProgressReport;
wait(randomrange(1000,1100));
HarvestPatch;

CleaningHerbs;

repeat
HighAlchItem;
wait(randomrange(400,500));
AlchingTheHerbs;


until (not FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2));
FreeDTM(HighAlchDTM);
FreeDTM(CleanHerbDTM);
AntiBan;
GameTab(Tab_Inv);
until(false);
end;

J J

2012-04-30 07:02:13

Work on your standards :P
This should work
procedure MainLoop;
var
X, Y, MagebaneDTM, CleanHerbDTM, HighAlchDTM: Integer;

begin
repeat
begin
GameTab(Tab_Inv);
if not(FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
//CreateGateStone;
//DropGateStone;
//HomeTeleport;
//TradeSmuggler;
//BuyMagebanes;
//UseTheGatestone;
end else
if FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
GameTab(Tab_Inv);
//ClickMagebane;
//UseOnFarming;
Wait(RandomRange(2000, 2100));
//AntiBan;
Wait(Randomrange(1000, 1100));
ClearDebug; //ADDED CLEAR DEBUG
Wait(RandomRange(200, 300));
//ProgressReport;
Wait(RandomRange(1000, 1100));
//HarvestPatch;
//CleaningHerbs;
repeat
//HighAlchItem;
Wait(RandomRange(400, 500));
//AlchingTheHerbs;
until not(FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2));
end;
FreeDTM(HighAlchDTM);
FreeDTM(CleanHerbDTM);
//AntiBan;
GameTab(Tab_Inv);
end;
until(False);
end;
Remove the //'s

Oh yeah, it didn't work because you forgot to place and end; somewhere.

bas

2012-04-30 07:05:43

From: J J
Work on your standards :P
This should work
procedure MainLoop;
var
X, Y, MagebaneDTM, CleanHerbDTM, HighAlchDTM: Integer;

begin
repeat
begin
GameTab(Tab_Inv);
if not(FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
//CreateGateStone;
//DropGateStone;
//HomeTeleport;
//TradeSmuggler;
//BuyMagebanes;
//UseTheGatestone;
end else
if FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
GameTab(Tab_Inv);
//ClickMagebane;
//UseOnFarming;
Wait(RandomRange(2000, 2100));
//AntiBan;
Wait(Randomrange(1000, 1100));
ClearDebug; //ADDED CLEAR DEBUG
Wait(RandomRange(200, 300));
//ProgressReport;
Wait(RandomRange(1000, 1100));
//HarvestPatch;
//CleaningHerbs;
repeat
//HighAlchItem;
Wait(RandomRange(400, 500));
//AlchingTheHerbs;
until not(FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2));
end;
FreeDTM(HighAlchDTM);
FreeDTM(CleanHerbDTM);
//AntiBan;
GameTab(Tab_Inv);
end;
until(False);
end;
Remove the //'s

Oh yeah, it didn't work because you forgot to place and end; somewhere.

This fixed it!
Thank you very much :) hope i can it runs great now and i can release to public to help the community! :)