Log in

View Full Version : Power Miner unfinished help plox



loser69
12-08-2011, 01:41 AM
Hi I tried to do some basic scripting with DTMs cause I have difficulty using the findcolor function anyway heres my script it takes control of the mouse and has to be half screened one window with RS open and this, only tried it at the varrok mines.



program new;

{$i srl/srl.scar}
var
iron, X, Y: Integer;

procedure get
;begin


iron := DTMFromString('mLgAAAHicY2KAAFYgZoGyw03UGYpcjBmMoH xGKGZgAAAqUgHb');

If FindDTM(iron, X, Y, MSX1, MSY1, MSX2, MSY2) then

begin
MMouse(X, Y, 2, 2)
wait(1500)
mouse( x, y, 0, 0, true);
wait(1500)


end;
FreeDTM(iron);
end;
procedure drop;
var
iron, x, y: integer;
begin

iron := DTMFromString('mlwAAAHicY2dgYOABYkYgFoNibgYI4AViLi jNBsSCQCwMxJxQeSslKYa0IEuGnHBbII8JjIOc9Bh0pIQZ8AFG PBgKAGnuBDA=');
If FindDTM(iron, X, Y, MIX1, MIY1, MIX2, MIY2) then
MMouse(X, Y, 3, 3);
mouse(x, y, 0, 0, false);
FindObj( x, y, 'rop', 8691882, 1);
wait(300);
ChooseOption('rop');



FreeDTM(iron);

end;



begin
SetupSRL
repeat
get
drop
until(false)
end.

Blumblebee
12-08-2011, 06:01 AM
FindDTM() will not work for mainscreen object finding. If you can understand the parameters of FindDTM, then FindColorTolerance should be quite easy. It is the exact same idea of finding a DTM, the co-ordinance are just found using a color instead.

Something like this would probably work. Although this would be a simply starting point, keep reading tutorials and you'll be able to make your own, more complex versions.

procedure FindMyRock(color: Integer);
var
x, y : Integer;
begin
FindColorTolerance(x, y, color, MSx1, MSy1, MSx2, MSy2, 10);
MMouse(x, y, 5, 5);
if IsUpText('ock') then
Mouse(x, y, 0, 0, true);
end.

YoHoJo
12-08-2011, 06:04 AM
You don't need to have MMouse before Mouse (unless you need to check uptext) You can just do Mouse (that moves AND clicks)

loser69
12-08-2011, 06:18 AM
Thanks guys that was very helpful I removed the MMouse and it still works also the DTM for me is working on the main screen anyway I will try doing the findcolor for another script.

The DTM for the drop procedure seems not to match when I reload the SMART

marpis
12-08-2011, 09:21 AM
Thanks guys that was very helpful I removed the MMouse and it still works also the DTM for me is working on the main screen anyway I will try doing the findcolor for another script.

The DTM for the drop procedure seems not to match when I reload the SMART

When creating DTMs of items in your inventory, only use the black outline. :)
You can also use the other colors, but remember to add some tolerance (5-15), because most colors change a little every time you load RS.