Results 1 to 8 of 8

Thread: MouseBoxDTM is it possible? Please Red @HighScripters

  1. #1
    Join Date
    Dec 2011
    Posts
    273
    Mentioned
    0 Post(s)
    Quoted
    39 Post(s)

    Default MouseBoxDTM is it possible? Please Red @HighScripters

    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:
    Simba Code:
    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;
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

  2. #2
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    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

  3. #3
    Join Date
    Dec 2011
    Posts
    273
    Mentioned
    0 Post(s)
    Quoted
    39 Post(s)

    Default

    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));

    ?
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

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

  5. #5
    Join Date
    Dec 2011
    Posts
    273
    Mentioned
    0 Post(s)
    Quoted
    39 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    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 ^
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

  6. #6
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by VillaVuFTW View Post
    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:

    Simba 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

  7. #7
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    ^ 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.

  8. #8
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    ^ 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

    Simba Code:
    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;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •