Results 1 to 10 of 10

Thread: [OGL] claimKey

  1. #1
    Join Date
    Jun 2014
    Posts
    463
    Mentioned
    27 Post(s)
    Quoted
    229 Post(s)

    Default [OGL] claimKey

    This is for those little key tokens that spawn in your inventory, they also prevent you from banking with presets if it's in your inventory as it cannot be banked.

    Simba Code:
    1. function claimKey(): boolean;
    2.   var textures:glTextureArray; waitTime: tCountdown;
    3.   begin
    4.     if (length(textures:=ogl.getTextures(125205))>=1) and waitTime.isFinished() and (result:=true) then
    5.       if bank.hasBank() then
    6.         sendKeys(#27, 30+normalRandom(0,60), 30+normalRandom(0,60))
    7.       else
    8.         inventory.clickItem(125205);
    9.         waitTime.setTime(2500);
    10.   end;
    Last edited by Lucidity; 07-14-2015 at 03:12 AM.
    Tsunami

  2. #2
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Can't you check a box to auto-claim the keys?

  3. #3
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Yeah, you only have to claim the first one afaik.

  4. #4
    Join Date
    Jun 2014
    Posts
    463
    Mentioned
    27 Post(s)
    Quoted
    229 Post(s)

    Default

    Didn't know that, there wasn't an option for me
    Tsunami

  5. #5
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

  6. #6
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Simba Code:
    function claimKey(): boolean;
    begin
      if length(ogl.getTextures(125205)) > 0 then
        if bank.hasBank() then
        begin
          multiType(VK_ESCAPE, randomRange(30, 50), 2);
          result := true;
        end
        else
          result := inventory.clickItem(125205);
    end;
    i mean... i dont know exactly how oglib works, but... i feel like this actually accomplishes what is you actually want.

    but on the topic of auto-redemption, if you have 10+ redeemed keys, i dont think it will let you redeem more. sooo. i mean, its not like this is completely useless. maybe a bit more error checking should be used.

  7. #7
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    Simba Code:
    function claimKey(): boolean;
    begin
      if length(ogl.getTextures(125205)) > 0 then
        if bank.hasBank() then
        begin
          multiType(VK_ESCAPE, randomRange(30, 50), 2);
          result := true;
        end
        else
          result := inventory.clickItem(125205);
    end;
    i mean... i dont know exactly how oglib works, but... i feel like this actually accomplishes what is you actually want.

    but on the topic of auto-redemption, if you have 10+ redeemed keys, i dont think it will let you redeem more. sooo. i mean, its not like this is completely useless. maybe a bit more error checking should be used.
    Ideally you would check for tickets before you even opened the bank, because you know you will have to close the bank and open it again. It's better to just open it once

    Simba Code:
    function claimKey(): boolean;
    begin
      if length(ogl.getTextures(125205)) > 0 then
        result := inventory.clickItem(125205);
    end;

  8. #8
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Ideally you would check for tickets before you even opened the bank, because you know you will have to close the bank and open it again. It's better to just open it once

    Simba Code:
    function claimKey(): boolean;
    begin
      if length(ogl.getTextures(125205)) > 0 then
        result := inventory.clickItem(125205);
    end;
    i was actually rather confused as to what the bank thing had to do with the key, so i just left it in there.

  9. #9
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    i was actually rather confused as to what the bank thing had to do with the key, so i just left it in there.
    This was one of the few snippets of OGL code I actually understood

  10. #10
    Join Date
    Jun 2014
    Posts
    463
    Mentioned
    27 Post(s)
    Quoted
    229 Post(s)

    Default

    The bank was in there because sometimes I'd get one as I went to click the bank after doing an activity, you can't use a preset if it's in your inventory. So I'd have it close out the bank.
    Tsunami

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
  •