Results 1 to 16 of 16

Thread: Destroy an item while dropping

  1. #1
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Destroy an item while dropping

    Hey,

    I'm making a Mahongany/Teak PowerChopper in Hardwood grove, but the point is, sometimes you will get a special log (Mahogany and Teak) and you have to destroy it, because you can't drop it. Is there any way to destroy that special log and just drop the normal Teak/Mahogany logs? The special logs have stripes on it, so they look different in color, but not in shape. I hope you understand what I mean and know a solution.

    Thanks in advance.

  2. #2
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Use a bitmap.

  3. #3
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And how am I supposed to do that? I'm new at this. I know a few things about DTM and thats all.

    EDIT: I'm watching a tutorial how to do this, thanks S1n.
    Last edited by FiLow; 02-20-2012 at 01:21 PM.

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

    Default

    Depends on how you are doing the dropping procedure. If you are just going through each space and dropping whatever item is there, you can just put an if function for options exist 'stroy' and chose that option if it's available

  5. #5
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Could someone tell me whats wrong with this code?

    Simba Code:
    Var x, y, bitmap : Integer;

    Begin
      bitmap := BitmapFromString(15, 11, 'meJw9kVtLAlEUhX+SKJVN5FMPgh' +
            'KVzuRlxksiIoOE4psoioqSaCRGIlGIMXTB8Cf03lv/qA8WDnwP5+y' +
            '19jr7nGNPvKNECeyJ50zfc7OPY6sC+fsvKDxsTzLuqV27WeyK828q' +
            'vopEERVYCCNVJYGc7N2btqg4/UZUETbLeNKj9fXgJRC1mrs/nOrVP' +
            'KiZ8Uakhq9W/znZXV61H4PxLE4CqdN+eFlEJQQDmL1VovPEqHBWac' +
            'UaY2YgCil07qASgoEcQKKIRDshpPEIEec2WuvrIJAT6PJtHM2E7vp' +
            'H8xMCJJMv2MrG0WRyWaM0YEHx4CIPihJcQTb//TFzQXv/NcoRbPWA' +
            '+gKugLn++cuWU4AQ5SgKD/Aa+o5//FPdkA==');

    If FindBitmap(Bitmap, x, y) Then
    Begin
      Mouse(x, y, 3, 3, false);
      begin
            wait(random(400) + 100);
            chooseoption('Drop');
            wait(1200 + random(1000));

       End;
    End;
    until (not (finddtm(logdtm, x, y, 550, 203, 731, 464)));
    FreeBitmap(Bitmap); // :)
    End.

  6. #6
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ashaman, I got this drop procedure:

    Simba Code:
    procedure SmartDrop;
    var
      logdtm, x, y: integer;
    begin
      if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
        NextPlayer(false);
      Writeln('using Dtm (smart way) slower though but more accurate');
      logdtm := DTMFromString('78DA63CC63626078C880029A536D18FE03694' + '620FE0F048C054035EF18D000231209A463816A9E135093015473' + '87809A3222D45413B60B0046720E26');
      gametab(4);
      repeat
        if finddtm(logdtm, x, y, 550, 203, 731, 464) then
        begin
          Mouse(x, y, 3, 3, false);
          begin
            wait(random(400) + 100);
            chooseoption('Drop');
            wait(1200 + random(1000));
           { case LowerCase(Players[CurrentPlayer].Strings[1]) of
              'tree': ReportVars[4] := ReportVars[4] + 28;
              'oak': ReportVars[5] := ReportVars[5] + 28;
              'willow': ReportVars[6] := ReportVars[6] + 28;
              'all': ReportVars[7] := ReportVars[7] + 28;  }

            //end;
          end;
        end;
      until (not (finddtm(logdtm, x, y, 550, 203, 731, 464)));
      freedtm(logdtm);
    end;

    Yes, I didn't make it by myself. But what should I add then?

  7. #7
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    That procedure will drop Items by DTM (Currently Log)

    ~Home

  8. #8
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, and I have to add something that it will destroy the special logs.

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

    Default

    This is how I would do it

    Simba Code:
    procedure SmartDrop;
    var
      logdtm, x, y: integer;
    begin
      if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
        NextPlayer(false);
      Writeln('using Dtm (smart way) slower though but more accurate');
      logdtm := DTMFromString('78DA63CC63626078C880029A536D18FE03694' + '620FE0F048C054035EF18D000231209A463816A9E135093015473' + '87809A3222D45413B60B0046720E26');
      gametab(4);
      repeat
        if finddtm(logdtm, x, y, 550, 203, 731, 464) then
        begin
          Mouse(x, y, 3, 3, false);
          begin
            wait(random(400) + 100);
            chooseoption('Drop')
          else
            waitoption('Destroy');
            MMouse(x of the destroy thing, y of the destroy thing, randomx, randomy);
            Mouse(0, 0, true);
            wait(1200 + random(1000));
           { case LowerCase(Players[CurrentPlayer].Strings[1]) of
              'tree': ReportVars[4] := ReportVars[4] + 28;
              'oak': ReportVars[5] := ReportVars[5] + 28;
              'willow': ReportVars[6] := ReportVars[6] + 28;
              'all': ReportVars[7] := ReportVars[7] + 28;  }

            //end;
          end;
        end;
      until (not (finddtm(logdtm, x, y, 550, 203, 731, 464)));
      freedtm(logdtm);
    end;

    Be mindful, that I'm typing this straight from my head.

    You can use the DTM of the logs if you want.. But I would make the DTM of the logs, the same as the Specials, like the same colors.. If you want.. You can even use ACA, ot ATPAs(if you know how to)

    Correct me if I am wrong.. WaitOption already does the Right Click..

    Thread to ACA (Which is quite accurate way of finding things)

    http://villavu.com/forum/showthread....t=AutoColorAid
    Last edited by VillaVuFTW; 02-20-2012 at 02:26 PM.
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

  10. #10
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok thanks, i'm gonna see if it works.

  11. #11
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It gives an error at the line ''else'' and I don't know what you mean with a DTM with the same colors. Also when you click destroy, you will get a confirmation screen.

  12. #12
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It keep giving me an error at the line else, this is what I did:

    Simba Code:
    procedure SmartDrop;
    var
      logdtm, x, y: integer;
    begin
      if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
        NextPlayer(false);
      Writeln('using Dtm (smart way) slower though but more accurate');
      logdtm := DTMFromString('78DA63CC63626078C880029A536D18FE03694' + '620FE0F048C054035EF18D000231209A463816A9E135093015473' + '87809A3222D45413B60B0046720E26');
      gametab(4);
      repeat
        if finddtm(logdtm, x, y, 550, 203, 731, 464) then
        begin
          Mouse(x, y, 3, 3, false);
          begin
            wait(random(400) + 100);
            chooseoption('Drop')
          else
            waitoption('Destroy');
            MMouse(374, 400);
            Mouse(0, 0, true);
            wait(1200 + random(1000));

          end;
      until (not (finddtm(logdtm, x, y, 550, 203, 731, 464)));
      freedtm(logdtm);
    end;

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

    Default

    Simba Code:
    procedure SmartDrop;
    var
      logdtm, x, y: integer;
    begin
      if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
        NextPlayer(false);
      Writeln('using Dtm (smart way) slower though but more accurate');
      logdtm := DTMFromString('78DA63CC63626078C880029A536D18FE03694' + '620FE0F048C054035EF18D000231209A463816A9E135093015473' + '87809A3222D45413B60B0046720E26');
      gametab(4);
      repeat
        if finddtm(logdtm, x, y, 550, 203, 731, 464) then
        begin
          Mouse(x, y, 3, 3, false);
          begin
            wait(random(400) + 100);
            chooseoption('Drop')
          else
            waitoption('Destroy');
            MMouse(374, 400);
            Mouse(0, 0, true);
            wait(1200 + random(1000));

          end;
      until (not (finddtm(logdtm, x, y, 550, 203, 731, 464)));
      freedtm(logdtm);
    end;
    I meant you can make a DTM for the regular logs, and it will pick up the Special aswell, if you get the same color like if Log1 (Regular) is 1523083, find to see if that is a color on the Log2(Special) so it will pick up the special..

    But if you want, you can USE ACA for the Log and SpecialLog

    As for the ELSE Error.. I think you have to add a Begin End;

    Like This.. Try this Code
    Simba Code:
    procedure SmartDrop;
    var
      logdtm, x, y: integer;
    begin
      if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
        NextPlayer(false);
      Writeln('using Dtm (smart way) slower though but more accurate');
      logdtm := DTMFromString('78DA63CC63626078C880029A536D18FE03694' + '620FE0F048C054035EF18D000231209A463816A9E135093015473' + '87809A3222D45413B60B0046720E26');
      gametab(4);
      repeat
        if finddtm(logdtm, x, y, 550, 203, 731, 464) then
        begin
          Mouse(x, y, 3, 3, false);
          begin
            wait(random(400) + 100);
            chooseoption('Drop')
          else
           Begin
            waitoption('Destroy');
            MMouse(374, 400);
            Mouse(0, 0, true);
            wait(1200 + random(1000));
           end;
          end;
      until (not (finddtm(logdtm, x, y, 550, 203, 731, 464)));
      freedtm(logdtm);
    end;
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

  14. #14
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I still get the same error.

    And for that ACA, I just don't get it to work.

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

    Default

    PM ME your script please.. I'll check it out
    "What can't hurt you, try it. What can kill you, do it!"

    Scripts Completed: 3
    Amount Released : 2

  16. #16
    Join Date
    Feb 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Will do.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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