Results 1 to 3 of 3

Thread: Problem dropping items

  1. #1
    Join Date
    Dec 2011
    Location
    New York
    Posts
    119
    Mentioned
    5 Post(s)
    Quoted
    40 Post(s)

    Question Problem dropping items

    Code:
    procedure dropItems();
    var
      dropTimer: TTimeMarker;
      uselessDTMs: TIntegerArray;
      uselessNames: TStringArray;
      x, y, i, invcount: integer;
    begin
      if (not isLoggedIn()) then
        exit;
    
      gameTabs.openTab(TAB_BACKPACK); // Should be open anyway
    
      uselessDTMs := [DTMFromString('m1gAAAHic42JgYFjIxsCwFIhXAPFqIJ4DxMuAeAMQTwLi2UA8H4iFmRgY2IGYA4i5gFgZiKWBWBBKCwAxDxAbx1gATWUiiOWAJDGYkUiMAAAvCAlz'), // Mint cake
                      DTMFromString('mwQAAAHic42RgYKhgY2AoA+IaIK4F4noouwiIC6C0JBMDAxsQ8wCxGBBLA7EyFIsDMR8Qh2fxAU1jwovlgCQjFTAcAADpIAZd')]; // Agility potion
      uselessNames := ['int c', 'gility po'];
    
      for i := 0 to high(uselessDTMs) do
      begin
        if findDTM(uselessDTMs[i], x, y, tabBackpack.getBounds()) then
        begin
          setStatus('Dropping stuff');
          repeat
            dropTimer.reset();
            dropTimer.start();
            smartImage.debugDTM(uselessDTMs[i], tabBackpack.getBounds(), clAqua);
            mouse(x, y, 3, 3, MOUSE_MOVE);
            if isMouseOverText([uselessNames[i]], 150, false) then // Could search for entirety of uselessNames
            begin
              invcount := tabBackpack.count();
              fastClick(mouse_Right);
              chooseOption.select(['rop'], 100);
              repeat // Better than waiting a set amount of time when things can influence when the icon leaves backpack
                wait(randomRange(100, 260));
              until (not (tabBackpack.count() = invcount)) or (dropTimer.getTime() > 10000);
              clearMufasa();
              smartImage.debugDTM(uselessDTMs[i], tabBackpack.getBounds(), clAqua);
            end;
          until (not findDTM(uselessDTMs[i], x, y, tabBackpack.getBounds())) or (dropTimer.getTime() > 20000);
        end;
      end;
      freeDTMs(uselessDTMs);
    end;
    Although this isnt from a script I have written (its from the qhefin scrpit)

    When mint cakes are randomly given, sometimes the script will continuously right click on the cake and not drop it..

    Im not quite sure why it would do so but im assuming it has something to do with this section of the script.. can anyone look over it and see if there is anything that sticks out?

  2. #2
    Join Date
    Jun 2014
    Location
    Lithuania
    Posts
    475
    Mentioned
    27 Post(s)
    Quoted
    200 Post(s)

    Default

    Quote Originally Posted by iAmaGz View Post
    Code:
    procedure dropItems();
    var
      dropTimer: TTimeMarker;
      uselessDTMs: TIntegerArray;
      uselessNames: TStringArray;
      x, y, i, invcount: integer;
    begin
      if (not isLoggedIn()) then
        exit;
    
      gameTabs.openTab(TAB_BACKPACK); // Should be open anyway
    
      uselessDTMs := [DTMFromString('m1gAAAHic42JgYFjIxsCwFIhXAPFqIJ4DxMuAeAMQTwLi2UA8H4iFmRgY2IGYA4i5gFgZiKWBWBBKCwAxDxAbx1gATWUiiOWAJDGYkUiMAAAvCAlz'), // Mint cake
                      DTMFromString('mwQAAAHic42RgYKhgY2AoA+IaIK4F4noouwiIC6C0JBMDAxsQ8wCxGBBLA7EyFIsDMR8Qh2fxAU1jwovlgCQjFTAcAADpIAZd')]; // Agility potion
      uselessNames := ['int c', 'gility po'];
    
      for i := 0 to high(uselessDTMs) do
      begin
        if findDTM(uselessDTMs[i], x, y, tabBackpack.getBounds()) then
        begin
          setStatus('Dropping stuff');
          repeat
            dropTimer.reset();
            dropTimer.start();
            smartImage.debugDTM(uselessDTMs[i], tabBackpack.getBounds(), clAqua);
            mouse(x, y, 3, 3, MOUSE_MOVE);
            if isMouseOverText([uselessNames[i]], 150, false) then // Could search for entirety of uselessNames
            begin
              invcount := tabBackpack.count();
              fastClick(mouse_Right);
              chooseOption.select(['rop'], 100);
              repeat // Better than waiting a set amount of time when things can influence when the icon leaves backpack
                wait(randomRange(100, 260));
              until (not (tabBackpack.count() = invcount)) or (dropTimer.getTime() > 10000);
              clearMufasa();
              smartImage.debugDTM(uselessDTMs[i], tabBackpack.getBounds(), clAqua);
            end;
          until (not findDTM(uselessDTMs[i], x, y, tabBackpack.getBounds())) or (dropTimer.getTime() > 20000);
        end;
      end;
      freeDTMs(uselessDTMs);
    end;
    Although this isnt from a script I have written (its from the qhefin scrpit)

    When mint cakes are randomly given, sometimes the script will continuously right click on the cake and not drop it..

    Im not quite sure why it would do so but im assuming it has something to do with this section of the script.. can anyone look over it and see if there is anything that sticks out?
    Maybe chooseoption isnt open or chooseoption.getoptions doesnt find 'rop'

    Simba Code:
    if isMouseOverText([uselessNames[i]], 150, false) then // Could search for entirety of uselessNames
            begin
              invcount := tabBackpack.count();
              fastClick(mouse_Right);
              chooseoption.isopen(2000); // waits up to 2 seconds till the chooseoption is open
              writeln(chooseoption.getoptions());  // write what it has found
              chooseOption.select(['rop'], 100);
              repeat // Better than waiting a set amount of time when things can influence when the icon leaves backpack
                wait(randomRange(100, 260));
              until (not (tabBackpack.count() = invcount)) or (dropTimer.getTime() > 10000);
              clearMufasa();
              smartImage.debugDTM(uselessDTMs[i], tabBackpack.getBounds(), clAqua);
            end;

    Functions names might be abit off as i have atm no acces to srl include.

  3. #3
    Join Date
    Dec 2011
    Location
    New York
    Posts
    119
    Mentioned
    5 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by cosmasjdz View Post
    Maybe chooseoption isnt open or chooseoption.getoptions doesnt find 'rop'

    Simba Code:
    if isMouseOverText([uselessNames[i]], 150, false) then // Could search for entirety of uselessNames
            begin
              invcount := tabBackpack.count();
              fastClick(mouse_Right);
              chooseoption.isopen(2000); // waits up to 2 seconds till the chooseoption is open
              writeln(chooseoption.getoptions());  // write what it has found
              chooseOption.select(['rop'], 100);
              repeat // Better than waiting a set amount of time when things can influence when the icon leaves backpack
                wait(randomRange(100, 260));
              until (not (tabBackpack.count() = invcount)) or (dropTimer.getTime() > 10000);
              clearMufasa();
              smartImage.debugDTM(uselessDTMs[i], tabBackpack.getBounds(), clAqua);
            end;

    Functions names might be abit off as i have atm no acces to srl include.
    Would you be able to ellaborate on this a little more for me? Im brand new to this and I noticed you added:

    chooseoption.isopen(2000); // waits up to 2 seconds till the chooseoption is open
    writeln(chooseoption.getoptions()); // write what it has found

    Which function names might be off? Any other help? :P

    P.S. If I manually move the mouse off the item it is trying to drop it will be able to drop it and then usually doesn't have any other problems after that.

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
  •