This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Timo_Ho's profile picture

Need help with a progress bar

Started by Timo_Ho, 25 August 2014 - 09:48 AM
Timo_Ho #1
Posted 25 August 2014 - 11:48 AM
I don't understand this error…

code:

http://pastebin.com/ea9LncrA

eg. I type cAPI.percent(1,60). then it says:[string "cAPI"]: 93: attempt to compare nil with number

but if I type cAPI.percent(5,11) or cAPI.percent(7,10) , … then it works fine

look at this program: http://pastebin.com/HmZbq89u it uses this function and it works.

:huh:/> :huh:/> :huh:/> :huh:/> :huh:/> :huh:/> :huh:/>
Edited on 25 August 2014 - 09:52 AM
Timo_Ho #2
Posted 25 August 2014 - 11:57 AM
Ok found the mistake… just added if pb == nil then pb = 0 end at line 90 and all works fine now.