SRL Archive - OSR Help

MouseBoxDTM is it possible? Please Red @HighScripters


VillaVuFTW

2013-11-30 09:36:58

Hey Guys,

I'm trying to code a mining script for a RSPS and I would like to know, if I set a DTM that works with all the rocks that I need in an area… Is there a way I can check by using FindDTM and MouseBox to see when the DTM is no longer present in a given area and move to the other "Full Rock"

Example:

If FindDTM(Rock, X, Y, MSX1, MSY1, MSX2, MSY2) then
Begin
MMouse(X, Y, 0, 0);
ClickMouse2(True);
repeat
wait(25);
until(not FindDTM(Rock, X, Y, MSX1, MSY1, MSX2, MSY2)); ///<---- But in a give area that was clicked.
end;

Ashaman88

2013-11-30 09:39:36

If FindDTM(Rock, X, Y, MSX1, MSY1, MSX2, MSY2) then
Begin
MMouse(X, Y, 0, 0);
GetMousePOS(XX,YY);
ClickMouse2(True);
repeat
wait(25);
until(not FindDTM(Rock, X, Y, XX-10, YY-10, XX+10, YY+10))


Add xx and yy as an int variable. increase the 10 to whatever you think it would need

VillaVuFTW

2013-11-30 10:28:02

Can you explain to me what XX and YY Means in the integers?

Is that center point? or what?

Oh I didn't see you use GetMousePOS(XX, YY); Wow you're smart didn't think about that lmao

I could use that for color even.. rather than a DTM

If FindColorTolerance(X, Y, ROCKCOLOR, MSX1, MSY1, MSX2, MSY2) then
Begin
MMouse(X, Y, 0, );
GetMousePOS(XX, YY);
ClickMouse2(True);
Repeat
wait(25)
until(not FindColorTolerance(X, Y, ROCKCOLOR, XX-10, YY-10, XX+10, YY+10));

?

rj

2013-11-30 10:34:03

So are you wanting to make it so that it waits until the rock disappears?

VillaVuFTW

2013-11-30 10:35:54

From: Officer Barbrady
So are you wanting to make it so that it waits until the rock disappears?


yea and moves on to a rock that is visible.. And until that clears redo the mine sequence

Example:

Run Click the ROCK
Wait til CLICKED ROCK IS DEPLETED
Move to another Rock
REPEAT ^

rj

2013-11-30 10:46:43

From: VillaVuFTW
yea and moves on to a rock that is visible.. And until that clears redo the mine sequence

Example:

Run Click the ROCK
Wait til CLICKED ROCK IS DEPLETED
Move to another Rock
REPEAT ^


Well this may not be the best way because it will find other rocks!

A better way to do it, would be wait until the inventory count increases by 1:

Take a look at the inventory part of this tutorial: http://villavu.com/forum/showthread.php?t=105919


Consider this code:

If FindColorTolerance(X, Y, ROCKCOLOR, MSX1, MSY1, MSX2, MSY2) then
Begin
curCount := rsps_invCount;
MMouse(X, Y, 0, 0);
ClickMouse2(True);
markTime(t);
repeat
wait(25);
Until (rsps_invCount > curCount) or (TimeFromMark(t) > 5000);
end;

Line 1: Looks for the rock color
Line 2: start of block if the color is found
Line 3: Gets the current inventory count
Line 4-5: Clicks the color
Line 6: Store the current system time in the variable t
Line 7: Start of repeat
Line 8: waits 25
Line 9: if the current inventory count is greater then the original inventory count stored in curCount, then it stops repeating (hence the inventory count increased by 1, because a ore was mined) OR if the amount of time passed from t is greater then 5000 then it stops repeating
Line 10: end of block

Coh3n

2013-11-30 13:33:01

^ May want to consider the possibility of getting a gem as well. If a gem is mined, the inventory count would change, but you wouldn't want to change rocks. :)

rj

2013-11-30 15:26:19

From: Coh3n
^ May want to consider the possibility of getting a gem as well. If a gem is mined, the inventory count would change, but you wouldn't want to change rocks. :)


Oo in that case he could use my countInventoryDTM function :d

function rsps_CountInventoryDTM(DTMSearch:Integer):Integer;
var
i, x, y:Integer;
begin
for i := 0 to high(Inventory) do
begin
if FindDTM(DTMSearch, x, y, Inventory[i].x1, Inventory[i].y1, Inventory[i].x2, Inventory[i].y2) then
result := result + 1;
end;
end;