XenoBot Forums - Powered by vBulletin

User Tag List

Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: [scripting] Is there a function that counts gold coins, ALL of them

  1. #11
    Senior Member
    Join Date
    Sep 2012
    Posts
    1,070
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ropiderz View Post
    I was editing my post to correct this and then I did a double one, I guess now it'll work fine. And btw line 1 and 2 have errors.
    Couple typos

  2. #12
    Senior Member xux's Avatar
    Join Date
    Apr 2013
    Posts
    713
    Mentioned
    33 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DarkstaR View Post
    But when a new backpack is opened, that stops working. MY suggestion is this:


    lua code:
    local money = 0local backpacks = 0


    while (true)
    local value = (Self.ItemCount(3031) + (backpacks * 1900) - money
    if (value > 0) then
    money = money + value
    elseif (value < 0) then
    backpacks = backpacks+1
    end
    end


    As long as the following statements are true, this will work:
    • Gold only exists in one backpack
    • Gold is not removed from this backpack
    • Gold is the only thing in this backpack with the exception of one nested backpack
    Quote Originally Posted by Ropiderz View Post
    lua code:

    MONEY = MONEY or 0

    if Self.ItemCount(3031) - MONEY > 0 then
    MONEY = MONEY + (Self.ItemCount(3031) - MONEY)
    elseif Self.ItemCount(3031) + MONEY > MONEY then
    MONEY = MONEY + Self.ItemCount(3031)
    end


    That way you'll update MONEY value constantly without losing the count.
    Interesting i will try both, tho i`m not sure if its gonna count every penny.
    I think i`m just a bit hard headed in this matter.

    Anyways thanks for thinking with me

    Need a private build script? PM me.

  3. #13
    Senior Member XtrmJosh's Avatar
    Join Date
    Apr 2012
    Location
    Cambridge, England
    Posts
    1,324
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)
    Out of interest @DarkstaR - would it be possible to use the HasParent variable for each container to count how many loot or gold backpacks you've used so far? That would mean we could reset containers and use that function to cycle only the required number of backpacks on depositing, could also be useful if we can get more container parent info to allow us to monitor which container we're currently using... I'm not sure what HasParent returns but if it's an item ID we could simply use multicoloured backpacks through the levels...
    You cannot fail, so I'm lowering the standard.

  4. #14

    Join Date
    Feb 2014
    Posts
    27
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    is there any updated version of this that works with todays bot to count gold in nestled backpacks?

  5. #15
    XenoBot Developer DarkstaR's Avatar
    Join Date
    Dec 2010
    Posts
    6,104
    Mentioned
    1326 Post(s)
    Tagged
    16 Thread(s)
    Better just check NPC proxy or result from using a gold coin with hotkeys

  6. #16

    Join Date
    Apr 2013
    Location
    Sweden
    Posts
    73
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ardibe View Post
    is there any updated version of this that works with todays bot to count gold in nestled backpacks?
    Like DarkstaR pointed out using hotkeys you can easily bind a gold coin to a hotkey just like you do with potions and when you press the hotkey it will say "Using one of xxx gold coins" (y)

  7. #17

    Join Date
    Feb 2014
    Posts
    27
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    so after some looking around I got to this

    local goldReturn = 1000


    function checkGold(proxy, message)
    local gold = tonumber(string.match(message, "Using one of (.+) gold coins..."))
    if (gold > goldReturn) then
    gotoLabel("labelToLeave")
    end

    and then inside the label i put

    LootMessageProxy.OnReceive("Gold Checker", checkGold)

    is that correct?
    I then went into the documentation to find out how to use a hotkey with script, but couldn't find this anywhere, so even if I got that far I don't know what to write in the label to actually press the hotkey... help please!

Posting Permissions

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