SRL Archive - OSR Help

Only do 1 thing from procedure?


bas

2012-04-30 01:27:26

I made a huge procedure.


But it only do the CreateGateStoneDTM

Anyone know how to fix?

Procedure ClickMagebane;
Begin
MagebaneDTM := DTMFromString('mQwAAAHicY2ZgYHBnZmBwBmIXII5gZGCIBOJQIC7LqmLorZvE0FXdz8AKVAfDjEgYCAD+RgaB');
GameTab(Tab_Inv);
if FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
wait(randomrange(500,600));
MMouse(X, Y + 3, 0, 0);
wait(randomrange(350,400));
ClickMouse2(false);
Writeln ('Found seed, Time to farm!')
wait(randomrange(200,300));
ChooseOption('Use');

wait(randomrange(300, 350));

FreeDTM(MagebaneDTM);

end else
begin
writeln ('Not found Magebane seed, buying new seeds!')
wait(randomrange(100,200));
GameTab(Tab_Magic);
wait(randomrange(100,200));

CreateGatestoneDTM := DTMFromString('mbQAAAHicY2VgYAhmYmAIBGJfIPYE4jAgtmZkYDAGYisgtmWE8KX3z2IIeX2HQfb1MQbx2c1gzAzUj44ZsWAwAACvCAqg');
if FindDTM(CreateGatestoneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);
If WaitUptextMulti(['Create','Gatestone'], 500) Then
Begin

ClickMouse2(true);
wait(randomrange(1000,1500));

GameTab(Tab_Inv);

wait(randomrange(500,600));



DropGateStoneDTM := DTMFromString('mggAAAHicY2NgYFjIxMCwEojXA/FmIF4LpU0YGRjUgVgPiM2BWAOIjYBYy9yYwcnXkyFv2RQG+/hQBnFleQafiBAGVqBZ2DAjDgwBALD5Crs=');
if FindDTM(DropGateStoneDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);
wait(randomrange(200,300));
If WaitUptextMulti(['Gatestone'], 500) Then
Begin
ClickMouse2(false);
wait(randomrange(100,150));
ChooseOption('Drop');
wait(randomrange(1000,1500));




HomeTeleportDTM := DTMFromString('mWAAAAHicY2FgYPBmYmDwQ8KcjAwMHEDMDMTcQBwbuJTBQSmZoSxuBphmBupBxoxoGAQALoIFvg==');
if FindDTM(HomeTeleportDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);
If WaitUptextMulti(['Dungeon', 'Home','Teleport'], 500) Then
Begin

ClickMouse2(true);
wait(randomrange(6000,7000));



TradeTheSmuggler := DTMFromString('mbQAAAHicY2VgYNBiZGAwB2IVILaCsicCxacC8QIgXg7EW4G4o8iXoS7LnSHUz4AhLcyKoTw/gIEVKI6OGbFgMAAAiQAJtg==');
if FindDTM(TradeTheSmuggler, x, y, MSX1, MSY1, MSX2, MSY2) then
Begin
MMouse(X, Y + 3, 0, 0);
If WaitUptextMulti(['Talk','Smuggler'], 500) Then
Begin

ClickMouse2(false);
wait(randomrange(300,400));
ChooseOption('Trade');
wait(randomrange(1500,2000));


MMouse(503,312+ 3, 0, 0);
wait(randomrange(100,150));
ClickMouse2(false);
wait(randomrange(100,150));



BuyMagebaneSeeds := DTMFromString('mQwAAAHicY2ZgYHABYlcgdgTiQiAug+Ke2okMHVW9DIsnrWRgBfJhmBEJAwEAGvwHRA==');
if FindDTM(BuyMagebaneSeeds, x, y, MSX1, MSY1, MSX2, MSY2) then
Begin
MMouse(X, Y + 3, 0, 0);

ClickMouse2(false);
wait(randomrange(300,400));
ChooseOption('Buy 250');
wait(randomrange(1500,2000));

MMouse(507,53+ 3, 0, 0);
wait(randomrange(100,200));
ClickMouse2(true);


GameTab(Tab_Magic);


UseGateStoneTeleport := DTMFromString('mWAAAAHicY2FgYEhmYmBIB+J8IM4BYhNGBgZbILYAYkMgLms7y+DmfJAhTH86Q8+0kwzMQD3ImBENgwAAzH0Iug==');
if FindDTM(UseGateStoneTeleport, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
MMouse(X, Y + 3, 0, 0);
If WaitUptextMulti(['Gatestone','Teleport'], 500) Then
Begin

ClickMouse2(true);
wait(randomrange(1500,2000));

GameTab(Tab_Inv);

wait(randomrange(500,600));

FreeDTM(CreateGatestoneDTM);
FreeDTM(DropGateStoneDTM);
FreeDTM(HomeTeleportDTM);
FreeDTM(TradeTheSmuggler);
FreeDTM(BuyMagebaneSeeds);
FreeDTM(UseGateStoneTeleport);

//Restart this procedure from start
wait(randomrange(500,600));

ClickMagebane;

end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;

Brandon

2012-04-30 01:31:05

Turn all of those into functions and call them in the main loop.. Format your code to a better style so that it's readable.. then we can help u.

bas

2012-04-30 01:35:37

Ill try that, didnt think of it :) thanks

Edit:

Added all in procedures.

Getting the following error:
[Error] (455:3): Identifier expected at line 454

Whats wrong??

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
begin
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;

xtrapsp

2012-04-30 02:03:45

program Helpedscript;

{$i SRL\SRL.simba}
{$i sps/sps.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
{$i SRL/SRL/Misc/Debug.simba}

procedure MainLoop;
var
x,y,magebaneDTM,CleanHerbDTM,HighAlchDTM : Integer;
begin
MagebaneDTM := DTMFromString('mQwAAAHicY2ZgYHBnZmBwBmIXII5gZGCIBOJQIC7LqmLorZvE0FXdz8AKVAfDjEgYCAD+RgaB');
CleanHerbDTM := DTMFromString('mQwAAAHicY2ZgYHBnZmBwBmIXII5gZGCIBOJQIC7LqmLorZvE0FXdz8AKVAfDjEgYCAD+RgaB');
HighAlchDTM := DTMFromString('mQwAAAHicY2ZgYHBnZmBwBmIXII5gZGCIBOJQIC7LqmLorZvE0FXdz8AKVAfDjEgYCAD+RgaB');
repeat
GameTab(Tab_Inv);
if (not FindDTM(MagebaneDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
//CreateGateStone;
//DropGateStone;
//HomeTeleport;
//TradeSmuggler;
//BuyMagebanes;
//UseTheGatestone;
end else
begin
//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;
end;
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;


begin
MainLoop;
end.

every procedure i didn't have i //'d out. This compiles for me…

bas

2012-04-30 02:05:13

Can i PM you the whole script so u can see whats wrong???
I dont get it lol

xtrapsp

2012-04-30 02:06:36

From: kipjes bende
Can i PM you the whole script so u can see whats wrong???
I dont get it lol


go ahead but im on phone waiting for bus haha

bas

2012-04-30 02:13:09

Oh lol. PMing you in a sec

nickrules

2012-04-30 06:34:47

Use writeln's and if then statements to isolate the issue, like this:

if not(finddtm(XY,blahblahblah… ) then
writeln('DTM XYZ not found!');

Odds are, you need DTMs with a higher tolerance

Jokester

2012-04-30 08:18:43

You do know that you can just have them setup a farming patch inside the main room right? Just destroy the group gatestone portal and choose build. Then you wouldn't need anything to do with a gatestone.