SRL Archive - OSR Help

How can i repeat until not find DTM?


bas

2012-04-29 11:18:15

How can i keep high alching until not found the herb DTM??

 Procedure HighAlchItem;
Begin
HighAlchDTM := DTMFromString('mggAAAHicY2NgYHBmYmDwBGJ/IA4C4lAoO4ERguOAOBGIo6H0xV0SYPzqdghDfzkrQ+Kp7wzrpvAysALNwoYZcWAIAABJeA4k');
GameTab(Tab_Magic);
wait(randomrange(400,500));
repeat
if FindDTM(HighAlchDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
GameTab(Tab_Magic);
wait(randomrange(100,150));

MMouse(X, Y + 3, 0, 0);

If WaitUptextMulti(['High', 'Alchemy'], 500) Then
Begin
Writeln ('Found High Alch spell')
ClickMouse2(true);

wait(300);


//Clicking Herb DTM ( Not added yet )

///////HERE

until not found CleanHerbDTM??

Jokester

2012-04-29 11:26:29

From: kipjes bende
How can i keep high alching until not found the herb DTM??

 Procedure HighAlchItem;
Begin
HighAlchDTM := DTMFromString('mggAAAHicY2NgYHBmYmDwBGJ/IA4C4lAoO4ERguOAOBGIo6H0xV0SYPzqdghDfzkrQ+Kp7wzrpvAysALNwoYZcWAIAABJeA4k');
GameTab(Tab_Magic);
wait(randomrange(400,500));
repeat
if FindDTM(HighAlchDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
GameTab(Tab_Magic);
wait(randomrange(100,150));

MMouse(X, Y + 3, 0, 0);

If WaitUptextMulti(['High', 'Alchemy'], 500) Then
Begin
Writeln ('Found High Alch spell')
ClickMouse2(true);

wait(300);


//Clicking Herb DTM ( Not added yet )

///////HERE

until not found CleanHerbDTM??


You could just have a clean herb in the last inv spot and then just alch that until you have alched it x amount of times. X would be 28-How many items are in your inventory. Keep the same amount of itmes in your inventory at all times except clean herbs obviously.

Edit: Im pretty sure there is an If not find DTM or something along those lines if you look.

Abu

2012-04-29 11:37:02

You do it exactly as how you said:

repeat
yadayada
until (not FindDTM(HerbDTM, x, y, xs ,ys, xe, ye);

masterBB

2012-04-29 11:42:36

Either use:
until (not(FindDTM(HerbDTM, x, y, xs ,ys, xe, ye)));

or, if you find that confusing:

until (FindDTM(HerbDTM, x, y, xs ,ys, xe, ye) = false);

bas

2012-04-29 12:02:52

Thanks guys!
@ Jokester: Its for my DungFarmer. the herbs are not noted/stackable.

bas

2012-04-29 12:05:40

Is it also possible to add in main loop??

Thanks guys!
@ Jokester: Its for my DungFarmer. the herbs are not noted/stackable.

EDIT: Is it also possible to add it in my main loop???


EG:

CleaningHerbs;

repeat
HighAlchItem;
CleanHerbDTM;
until (not FindDTM(CleanHerbDTM, x, y, xs ,ys, xe, ye);

Element17

2012-04-29 12:11:28

Yes it is possible to add in your mainlopp. Just put in it there like that.

bas

2012-04-29 12:18:30

Thanks! :)

EDIT:

Giving a error i cant find whats wrong..

The Procedure AlchingTheHerbs; light up orange…

   Procedure AlchingTheHerbs;
Begin
CleanHerbDTM := DTMFromString('mLgAAAHicY2JgYAhiYmAIBeJERgaGOCDWN9Fg0NCTZ2AGyoEwIxQzMAAASwgCdw==');
wait(randomrange(400,500));

if FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
wait(randomrange(100,150));

MMouse(X, Y + 3, 0, 0);
Writeln ('Found Clean herb, Clicking.')

wait(randomrange(100,150));
ClickMouse2(true);

wait(randomrange(400,500));
FreeDTM(CleanHerbDTM);

end;
end;

The loop:

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

until (not FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2);

Jokester

2012-04-29 12:28:06

From: kipjes bende
Thanks guys!
@ Jokester: Its for my DungFarmer. the herbs are not noted/stackable.


Due to the newest dung update raw resources in the dungeon including grimy herbs are stackable. Clean herbs however are not.

bas

2012-04-29 12:38:49

From: Jokester
Due to the newest dung update raw resources in the dungeon including grimy herbs are stackable. Clean herbs however are not.


Sadly enough not no :( would be easyer. lol

putonajonny

2012-04-29 12:41:41

From: kipjes bende
Thanks! :)

EDIT:

Giving a error i cant find whats wrong..

The Procedure AlchingTheHerbs; light up orange…

   Procedure AlchingTheHerbs;
Begin
CleanHerbDTM := DTMFromString('mLgAAAHicY2JgYAhiYmAIBeJERgaGOCDWN9Fg0NCTZ2AGyoEwIxQzMAAASwgCdw==');
wait(randomrange(400,500));

if FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
wait(randomrange(100,150));

MMouse(X, Y + 3, 0, 0);
Writeln ('Found Clean herb, Clicking.')

wait(randomrange(100,150));
ClickMouse2(true);

wait(randomrange(400,500));
FreeDTM(CleanHerbDTM);

end;
end;

The loop:

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

until (not FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2);


Post the error that you get :)

bas

2012-04-29 12:44:53

From: putonajonny
Post the error that you get :)


[Error] (236:6): Identifier expected at line 235
Compiling failed.

masterBB

2012-04-29 12:46:44

   Procedure AlchingTheHerbs;
Begin
//Removed line
wait(randomrange(400,500));

if FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
wait(randomrange(100,150));

MMouse(X, Y + 3, 0, 0);
Writeln ('Found Clean herb, Clicking.'); //added ;

wait(randomrange(100,150));
ClickMouse2(true);

wait(randomrange(400,500));
//removed line

end;
end;

The loop:

CleanHerbDTM := DTMFromString('mLgAAAHicY2JgYAhiYmAIBeJERgaGOCDWN9Fg0NCTZ2AGyoEwIxQzMAAASwgCdw=='); //added line 
repeat
HighAlchItem;
wait(randomrange(400,500));
AlchingTheHerbs;

until (not FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2)); //added )
FreeDTM(CleanHerbDTM); //added line

I'm sure it was needed. The DTM wasn't loaded when you called it in the until loop cause you freed them earlier. An identifier expected error mostly occurs when you forgot a ; the previous line.

Edit:
Try it again.

bas

2012-04-29 12:48:58

From: masterBB
   Procedure AlchingTheHerbs;
Begin
//Removed line
wait(randomrange(400,500));

if FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Begin
wait(randomrange(100,150));

MMouse(X, Y + 3, 0, 0);
Writeln ('Found Clean herb, Clicking.')

wait(randomrange(100,150));
ClickMouse2(true);

wait(randomrange(400,500));
//removed line

end;
end;

The loop:

CleanHerbDTM := DTMFromString('mLgAAAHicY2JgYAhiYmAIBeJERgaGOCDWN9Fg0NCTZ2AGyoEwIxQzMAAASwgCdw=='); //added line 
repeat
HighAlchItem;
wait(randomrange(400,500));
AlchingTheHerbs;

until (not FindDTM(CleanHerbDTM, x, y, MIX1, MIY1, MIX2, MIY2)); //added )
FreeDTM(CleanHerbDTM); //added line


I dont think it has something to do with the DTM there.
All my DTM's are like that, never had any errors.
But i tried what you said, and still get the errorr.

Edit: Forget a end; at other procedure….. lol.