View Full Version : [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.
Hendy
06-13-2013, 11:40 AM
xux Self.Money() counts all money in open backpacks.
Nakuu
06-13-2013, 11:42 AM
xux Self.Money()
It will only count visible platinum, crystal and gold coins.
xux
I don't think there is such function.
xux Self.Money() counts all money in open backpacks.
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. :)
Sycho
06-13-2013, 05:43 PM
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
Nakuu
06-13-2013, 05:46 PM
But we can't read chat messages so no really use of it in HUD script :(
Ropiderz
06-13-2013, 05:57 PM
lol delete this post
Ropiderz
06-13-2013, 06:01 PM
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.
DarkstaR
06-13-2013, 06:06 PM
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:
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
Ropiderz
06-13-2013, 06:29 PM
But when a new backpack is opened, that stops working. MY suggestion is this:
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.
dinmamma
06-13-2013, 06:36 PM
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 :)
But when a new backpack is opened, that stops working. MY suggestion is this:
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
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 :D
XtrmJosh
06-13-2013, 07:05 PM
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...
Ardibe
01-26-2015, 03:47 PM
is there any updated version of this that works with todays bot to count gold in nestled backpacks?
DarkstaR
01-27-2015, 10:35 AM
Better just check NPC proxy or result from using a gold coin with hotkeys
Ryuzaki
01-27-2015, 03:19 PM
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)
Ardibe
01-30-2015, 12:58 PM
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! :)
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.