Posted 23 September 2012 - 10:05 PM
Hi guys, I play computercraft since two days, so I'm not a really good programer, but I know you guys out there are awesome and I hope you will help my. (the name of my program is: calculate2)
After it printed "How much HVSolars do you have already?", I tiped in 5 and pressed enter, the computer gives my an error message:
calculate2:2: attempt to call nil
please help me:
After it printed "How much HVSolars do you have already?", I tiped in 5 and pressed enter, the computer gives my an error message:
calculate2:2: attempt to call nil
please help me:
print("How much HVSolars do you have already?")
a = tonuumber(read())
x = 1
hv = 12500
stop = 0
power = 1000000
delay = 90
t = 0
tt1 = 0
tt2 = 0
tt3 = 1
tt4 = 0
while stop == 0 do
if tt3 > 0 then
while x < a do
tt1 = power / 512 / 20 / x * hv
tt2 = tt1 - delay
tt3 = tt2 / tt1
x = x + 1
t = t + tt1 + tt4
end
else
print("Ab "..x.." ist tt3 =< als 0")
stop = 1
end
end
print(t.." sec")
tinm = t / 60
print(tinmin.." min")
tinh = tinm / 60
print(tinh.." h")
tind = tinh / 24
print(tind.." d")