Results 1 to 7 of 7

Thread: Dropore procedure not working

  1. #1
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default Dropore procedure not working

    This is a bit of code from my Powerminer, it does work but for some reason it moves the mouse two pixels at a time! Does anyone know how to fix this?
    I use MIX1 so it should hop to the inventory i thought.
    Thanks.

    Simba Code:
    program IronMad;
    {.include SRL/SRL.simba}

      var
      x, y,IronOre: Integer;

    procedure DropOre;
    begin
    repeat
        IronOre := DTMFromString('mrAAAAHic42BgYHBiYmAIBGJbIDYGYjMgtgNiNyD2AeInQDV3gfgTEL8A4ntAfBWIrwPxGyA2lhUDkox4MH6ATyeybgDUEQmo');

        If FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
        begin
            MMouse(x, y, 22, 22);
            Mouse(x, y, 0, 0, false);
            WaitOption('Drop', randomrange(200, 300));
            Wait(randomrange(200, 300));
        end;



    until(not(FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2)))
       FreeDTM(IronOre);
    end;

  2. #2
    Join Date
    May 2012
    Location
    Texas
    Posts
    365
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well for one, You do want to repeat the IronOre := DtmFromString
    Also your MMouse has a randomness of 22 pixels in the X and Y direction which will cause a lot of issues.

    Can you post your main loop as well?
    Mostly Inactive, School

  3. #3
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    The mouse will not hop to the inv, it merely searches the DTM within ur inv, and if found, it will move ur mouse to the DTM with extremely high pixel offset, then move again with 0 offset (what are u trying to do?)

    Also u are loading ur DTM like 28 times and freeing it only once! Just load it once before the repeat loop.

  4. #4
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    1,199
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    It's not finding the iron ore because you have your tolerance set to zero. Change your DTM to this
    Simba Code:
    DTMFromString('mrAAAAHic42BgYOAHYkkgFgZibiBmBmIuBgiQg8qLAzETVIwTiGWh6jmA2FhWDEgy4sSiDPgBbp0QDAMAro0BbQ==');

  5. #5
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default

    Was set to 2, 2 pixel offset I must've done it again? heres the new code:
    Simba Code:
    program IronMad;
    {.include SRL/SRL.simba}

      var
      x, y,IronOre: Integer;

    procedure DropOre;
    begin
        IronOre := DTMFromString('mrAAAAHic42BgYHBiYmAIBGJbIDYGYjMgtgNiNyD2AeInQDV3gfgTEL8A4ntAfBWIrwPxGyA2lhUDkox4MH6ATyeybgDUEQmo');
    repeat
        If FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2) then
        begin
            MMouse(x, y, 2, 2);
            Mouse(x, y, 0, 0, false);
            WaitOption('Drop', randomrange(200, 300));
            Wait(randomrange(200, 300));
        end;



    until(not(FindDTM(IronOre, x, y, MIX1, MIY1, MIX2, MIY2)))
       FreeDTM(IronOre);
    end;

    begin
      DropOre
    end.

  6. #6
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I know! I know! Pick me! Pick me!

    This happens when you forget to call SetupSRL;

    Simple make your mainloop

    Simba Code:
    Begin
      SetupSRL;
      DropOre;
    End.

    Problem solved!

  7. #7
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    418
    Mentioned
    2 Post(s)
    Quoted
    86 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    I know! I know! Pick me! Pick me!

    This happens when you forget to call SetupSRL;

    Simple make your mainloop

    Simba Code:
    Begin
      SetupSRL;
      DropOre;
    End.

    Problem solved!
    Made me facepalm, thanks yohojo

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
  •