SRL Archive - OSR Help

using a dtm


mafia miles

2013-04-03 14:32:12

I want to select make all on the uptext for smithing. heres the code I have :

procedure Smelt;
var
pX,pY:integer;
begin
InvMouse(2, 1);
wait(1000);
MMouse(x,y,5,5);
wait(1000);
ClickMouse2(mouse_left);
Wait(1200+Random(100));
if FindObjCustom(x,y, ['urnace','melt'],[1715865], 35) then
begin
MMouse(x, y, 3, 3);
wait(567);
MMouse(1040, 469, 2, 35);
wait(200 + random(50));
begin
clickMouse2(mouse_right);
if ChooseOptionMulti(['1']) then
writeln('WithDrawing');
wait(800 + random(800));
wait(800 + random(800));
end;


end;
end;

Kevin

2013-04-03 14:42:28

So long as you made the DTM yourself for the object you're looking for, and it's made correctly, you will want to change your code to move the mouse to the bar as well like this:
FindDTM(DTMBar,x,y,MSX1,MSY1,MSX2,MSY2)
MMouse(x,y,5,5);
ClickMouse2(mouse_right);
ChooseOption('se');

mafia miles

2013-04-03 14:57:36

heres my updated procedure:

Procedure craft;
var
x,y,attempts: Integer;
begin
wait(100)
FindDTM(DTMBar,x,y,MSX1,MSY1,MSX2,MSY2)
MMouse(x,y,5,5);
ClickMouse2(mouse_right);
ChooseOption('se');
Wait(RandomRange(1000,1700));
Wait(RandomRange(1000,1201));

end;

Now it takes hold of my actual mouse >.< and doesn't click on the bar. Any Ideas? I tried freeing the dtms in a proper way as seen on http://villavu.com/forum/showthread.php?t=78418
Now remaking the DTM to see if it fixes my issues

Sjoe

2013-04-03 14:58:19

Seems like the DTM is way too short.

Use Findobject for the furnace. use color, why DTM

mafia miles

2013-04-03 15:16:27

How long should it be? here it is now :

SteelBar := DTMFromString('mWAAAAHicY2FgYGBhgAAeIGYDYnYgFgFiPqh4WV4ukGREwqiAEYssAFZOAZw=');

Can I select a certain invy spot and click on a color(furnace)?

Ian

2013-04-04 11:33:03

From: mafia miles
How long should it be? here it is now :

SteelBar := DTMFromString('mWAAAAHicY2FgYGBhgAAeIGYDYnYgFgFiPqh4WV4ukGREwqiAEYssAFZOAZw=');

Can I select a certain invy spot and click on a color(furnace)?


http://docs.villavu.com/srl-5/inventory.html#invmouse will click on an invslot, for example
 InvMouse(1, LeftClick); 

will left click on the first inventory slot.

A DTM's length just depends on the number of sub-points it has, for example here is the DTM for an ingot in my Artisans Workshop script:
 IngotDTM := DTMFromString('mAAEAAHiclc2xCkBQHIXx87+jrlKSkoVnMDAoUUqK3eJdvDhfWYzuV7862/GSJict2LBjxYwBHRq0GNEjNSlCbO/OUaJGhQIZPBJc58GL++1WWBbo2wPm/Qap');

mafia miles

2013-04-04 14:04:01

@BMWxi thanks! I tried to pm you but your inv box is full. Im having trouble finishing the procedure, care to look at it? its up top.

x[Warrior]x3500

2013-04-04 14:05:54

^ also if you still need help with DTMs, feel free to check out my tut (in my sig). it might be able to help

GetHyper

2013-04-04 16:29:13

Thanks Nivec, I was also trying to find this.

Ian

2013-04-04 17:23:58

From: mafia miles
@BMWxi thanks! I tried to pm you but your inv box is full. Im having trouble finishing the procedure, care to look at it? its up top.


Sorry about that :p

What happens when you use your current procedure?

mafia miles

2013-04-04 17:29:52

@BMWxi It now hovers over the bar and clicks it. Then clicks the furnace. Now it has the uptext of make all and I cant get it to right click make all. Ive updated the code in my first post of this thread if you care to look. Any ideas why it might not click make all?

mafia miles

2013-04-04 21:17:47

@Sjoekeloe Can you take a look at the updated procedure?

mafia miles

2013-04-06 02:37:57

Anyone have a idea on how to click all? It should do to the MMouse(1030, 469), 2, 35).

Ian

2013-04-06 03:03:08

From: mafia miles
Anyone have a idea on how to click all? It should do to the MMouse(1030, 469), 2, 35).


Try
WaitOption('all', 300);

dzpliu

2013-04-06 03:25:08

From: mafia miles
Anyone have a idea on how to click all? It should do to the MMouse(1030, 469), 2, 35).


your mouse coordinates are wrong. select SMART screen as client first before choosing any coordinates

mafia miles

2013-04-06 09:26:58

Thanks. Now it clicks it once and loops. Ill experiment around some more :)