PtokaX forum

Archive => Grimoire => AllInOne Scripts => Archived 5.0 boards => Grimoire - Bugs => Topic started by: Syphrone-NL on 10 May, 2006, 19:03:12

Title: Ascii Bug
Post by: Syphrone-NL on 10 May, 2006, 19:03:12
Found again a error in the new 1.0.1 octavo

Quote
Rincewind's Octavo/Functions.lua:813: attempt to call global 'CalculateShareSize' (a nil value)

Get this error when i typ +ascii hub
or any other ascii file
i got as min share 0gb

and i think there needs to be a little change in the help file
you see:
Quote
+loadgun? ? -? ? ? ?start roulette
..........
..........
..........
..........

+startmonty? ? -? ?start roulette
maybe the last Start Roulette changin in Start 3 Card Monty? so all users now what is what.
Title: Re: Ascii Bug
Post by: Rincewind on 10 May, 2006, 22:25:59
Yeah the three card monty help is wrong. I can correct that easily.

I have the CalculateShareSize function in SecurityFunctions which is not part of Octavo. If yo add the following code into the bottom of Functions.lua it will resolve the problem;

----------------------------------------------------------------------------
-- Function Calculate Share Size
----------------------------------------------------------------------------
function CalculateShareSize(iData)

local iShare = ""
local sShare = ""
if string.len(iData) < 7 then
iShare = iData / kb
iShare = string.format("%.2f", iShare)
sShare = iShare.." KiBs"
elseif string.len(iData) < 10 then
iShare = iData / mb
iShare = string.format("%.2f", iShare)
sShare = iShare.." MiBs"
elseif string.len(iData) < 13 then
iShare = iData / gb
iShare = string.format("%.2f", iShare)
sShare = iShare.." GiBs"
else
iShare = iData / tb
iShare = string.format("%.2f", iShare)
sShare = iShare.." TiBs"
end

return sShare

end


I will resolve this properly in the next version.