Results 1 to 4 of 4

Thread: [OGL] action key dropping

  1. #1
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Question [OGL] action key dropping

    So I'm still ridiculously new at scripting with ogLib and have run into an issue with making a power fisher.

    Simba Code:
    procedure dropFish();
    var
      t: TTimeMarker;
      i: Integer;
      trout, salmon: glTextureArray
    begin
      if conversationBox.continue(true, true) then
        wait(randomRange(500, 750));

      salmon := ogl.getTextures(58905, 2628890);  //FULLCOLOURID = 2037269
      trout :=  ogl.getTextures(58905, 2696999);  //FULLCOLOURID = 2104862

      if not salmon.isEmpty then
      begin
        t.start;
        keyDown(VK_1);
        wait(randomRange(500, 800));
        repeat
          wait(100);
          salmon := ogl.getTextures(58905, 2628890);
          //writeLn(toStr(length(salmon)));
          if salmon.isEmpty then
            break;
        until(t.time > randomRange(3000, 5000));
        keyUp(VK_1);
      end;

        wait(randomRange(800, 2000));

      if not trout.isEmpty then
      begin
        t.start;
        keyDown(VK_2);
        wait(randomRange(500, 800));
        repeat
          wait(100);
          trout :=  ogl.getTextures(58905, 2696999);
          //writeLn(toStr(length(trout)));
          if trout.isEmpty then
            break;
        until(t.time > randomRange(3000, 5000));
        keyUp(VK_2);
      end;
    end;

    This is my current code for dropping the fish using textures found on the action bar. My issue at present is that even when the action bar slot is 'greyed out' because there are no more of that fish in the inventory the colour ID and texture appear to remain the same as when the key was active. Is there a solution for this using OGL or do I need to resort to a colour count/DTM check?

  2. #2
    Join Date
    Jan 2012
    Location
    East Coast
    Posts
    733
    Mentioned
    81 Post(s)
    Quoted
    364 Post(s)

    Default

    Have it monitor the amount of fish in your inventory and key up when it's empty.

  3. #3
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    On phone, sorry:

    timeout.setTime(30000);
    pressKeyDown;
    While (not inventory.getItems(fishID).isEmpty()) and (not timeout.isFinished()) do
    Continue;
    pressKeyUp;

    Provided you can hold the key to drop all.
    Last edited by Obscurity; 11-24-2015 at 05:38 PM.




    Skype: obscuritySRL@outlook.com

  4. #4
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Holding the key will drop all of the particular fish but salmon and trout have the same texture ID as you can see so it needs to recognise when one of them is finished and start dropping the other. I think the inventory check should work nicely if I utilise the colourID as well. Thanks

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
  •