SRL Archive - OSR Help

Dropore procedure not working


Syntax

2012-07-06 21:25:05

This is a bit of code from my Powerminer, it does work but for some reason it moves the mouse two pixels at a time! Does anyone know how to fix this?
I use MIX1 so it should hop to the inventory i thought.
Thanks.

program IronMad;
{.include SRL/SRL.simba}

var
x, y,IronOre: Integer;

procedure DropOre;
begin
repeat
IronOre := DTMFromString('mrAAAAHic42BgYHBiYmAIBGJbIDYGYjMgtgNiNyD2AeInQDV3gfgTEL8A4ntAfBWIrwPxGyA2lhUDkox4MH6ATyeybgDUEQmo');

If FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 22, 22);
Mouse(x, y, 0, 0, false);
WaitOption('Drop', randomrange(200, 300));
Wait(randomrange(200, 300));
end;



until(not(FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2)))
FreeDTM(IronOre);
end;

Based Lord

2012-07-06 21:33:34

Well for one, You do want to repeat the IronOre := DtmFromString
Also your MMouse has a randomness of 22 pixels in the X and Y direction which will cause a lot of issues.

Can you post your main loop as well?

riwu

2012-07-06 21:35:24

The mouse will not hop to the inv, it merely searches the DTM within ur inv, and if found, it will move ur mouse to the DTM with extremely high pixel offset, then move again with 0 offset (what are u trying to do?)

Also u are loading ur DTM like 28 times and freeing it only once! Just load it once before the repeat loop.

Hazzah

2012-07-06 21:40:31

It's not finding the iron ore because you have your tolerance set to zero. Change your DTM to this
DTMFromString('mrAAAAHic42BgYOAHYkkgFgZibiBmBmIuBgiQg8qLAzETVIwTiGWh6jmA2FhWDEgy4sSiDPgBbp0QDAMAro0BbQ==');


Syntax

2012-07-06 21:48:06

Was set to 2, 2 pixel offset I must've done it again? heres the new code:
program IronMad;
{.include SRL/SRL.simba}

var
x, y,IronOre: Integer;

procedure DropOre;
begin
IronOre := DTMFromString('mrAAAAHic42BgYHBiYmAIBGJbIDYGYjMgtgNiNyD2AeInQDV3gfgTEL8A4ntAfBWIrwPxGyA2lhUDkox4MH6ATyeybgDUEQmo');
repeat
If FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MMouse(x, y, 2, 2);
Mouse(x, y, 0, 0, false);
WaitOption('Drop', randomrange(200, 300));
Wait(randomrange(200, 300));
end;



until(not(FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2)))
FreeDTM(IronOre);
end;

begin
DropOre
end.

YoHoJo

2012-07-06 21:55:12

I know! I know! Pick me! Pick me!

This happens when you forget to call SetupSRL;

Simple make your mainloop

Begin
SetupSRL;
DropOre;
End.

Problem solved!

Syntax

2012-07-06 22:04:03

From: YoHoJo
I know! I know! Pick me! Pick me!

This happens when you forget to call SetupSRL;

Simple make your mainloop

Begin
SetupSRL;
DropOre;
End.

Problem solved!


Made me facepalm, thanks yohojo :)