XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 17

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

  1. #1
    Senior Member xux's Avatar
    Join Date
    Apr 2013
    Posts
    713
    Mentioned
    33 Post(s)
    Tagged
    0 Thread(s)

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

    Hello guys,

    I was busy making my own HUD and i a stumbled on the problem of counting gold.
    At start it all works good but then the gold backpack is full and it will open another and the count gold will drop back to 0.

    So i was thinking is there an option/function that counts all gold coins in your backpack not just a backpack in your backpack.

    Function i use now is
    Self.ItemCount(3031)

    I know i could do some if statement like if gold in backpack is 1900 then store gold but somehow i am not getting that properly to work.
    cause it will not count it or it will store it several times if it's exactly 1900.

    Need a private build script? PM me.

  2. #2
    Lifetime Subscriber Hendy's Avatar
    Join Date
    Jan 2012
    Location
    Northern Ireland
    Posts
    1,593
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    @xux Self.Money() counts all money in open backpacks.

  3. #3
    Moderator Nakuu's Avatar
    Join Date
    Feb 2013
    Location
    EU
    Posts
    5,194
    Mentioned
    642 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Hendy View Post
    @xux Self.Money()
    It will only count visible platinum, crystal and gold coins.

    @xux
    I don't think there is such function.

  4. #4
    Senior Member xux's Avatar
    Join Date
    Apr 2013
    Posts
    713
    Mentioned
    33 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hendy View Post
    @xux Self.Money() counts all money in open backpacks.
    Quote Originally Posted by Nakuu View Post
    It will only count visible platinum, crystal and gold coins.

    @xux
    I don't think there is such function.
    Hmm the Self.Money() i tried but it does get what @Nakuu mentioned.
    To bad there isn't such function.
    Gotta find a solution for this then somehow.

    Thanks for the help tho.

    Need a private build script? PM me.

  5. #5
    Sycho's Avatar
    Join Date
    Jun 2013
    Location
    Australia
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just hotkey gold, platinum or crystal coins.

    Eg Gold Coin hotkeyd for Shift + F12, comes up as "12:00 Using one of **** gold coins..."

    same as any other coin

  6. #6
    Moderator Nakuu's Avatar
    Join Date
    Feb 2013
    Location
    EU
    Posts
    5,194
    Mentioned
    642 Post(s)
    Tagged
    2 Thread(s)
    But we can't read chat messages so no really use of it in HUD script

  7. #7

    Join Date
    Apr 2012
    Location
    RS, Brazil
    Posts
    179
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    lol delete this post
    Last edited by Ropiderz; 06-13-2013 at 06:02 PM.

  8. #8

    Join Date
    Apr 2012
    Location
    RS, Brazil
    Posts
    179
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    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.

  9. #9
    XenoBot Developer DarkstaR's Avatar
    Join Date
    Dec 2010
    Posts
    6,104
    Mentioned
    1326 Post(s)
    Tagged
    16 Thread(s)
    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)
    end


    That way you'll update MONEY value constantly without losing the count.
    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

  10. #10

    Join Date
    Apr 2012
    Location
    RS, Brazil
    Posts
    179
    Mentioned
    6 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
    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.

Posting Permissions

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