From c7d375b65f96b7e43759f4951cce7a6b468fd141 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 28 Dec 2016 19:31:28 +0100 Subject: Add support for unlimited uses --- init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 99cbd32..c695604 100644 --- a/init.lua +++ b/init.lua @@ -215,7 +215,11 @@ local factoid_toolcaps = function(tool_capabilities, check_uses) if check_uses and base_uses > 0 then for level=0, maxlevel do local real_uses = base_uses * math.pow(3, maxlevel - level) - miningusesstr = miningusesstr .. S("• @1, level @2: @3 uses", doc.sub.items.get_group_name(k), level, real_uses) + if real_uses < 65535 then + miningusesstr = miningusesstr .. S("• @1, level @2: @3 uses", doc.sub.items.get_group_name(k), level, real_uses) + else + miningusesstr = miningusesstr .. S("• @1, level @2: Unlimited", doc.sub.items.get_group_name(k), level) + end miningusesstr = miningusesstr .. "\n" useslines = useslines + 1 end -- cgit v1.2.3