Hallo my english is not very good but I found a bug ,
I have worked on an older Program and make it better but in the older CC version 1.45 it doesn't work (I haven't do anny code in who don' work ind older Versions)
The Error message says that ther is the Error:
if FuelLevel < 10 then
end
P
but when I make it so
if FuelLevel <= 10 then
end
The same Error but only in CC1.45.
Pleas help me I want to use my.Program in my Modded World (MC 1.3.2 with mods how not exist for MC 1.4.2)
8 replies to this topic
#1
Posted 27 October 2012 - 11:09 PM
#2
Posted 27 October 2012 - 11:15 PM
Oh in the Error message stod something with "Expectet Number"
#3
Posted 27 October 2012 - 11:15 PM
How are you getting the FuelLevel? Are you using something like this? We probably need to see more of you're code and the exact error you are getting. If you're doing FuelLevel like I have done below both of the if statements should work.
FuelLevel = turtle.getFuelLevel()
#4
Posted 27 October 2012 - 11:20 PM
Yes I do.
I use the code what you printed
I use the code what you printed
#5
Posted 27 October 2012 - 11:34 PM
Okay so I've tried but I'm unable to duplicate this. It's probably something else wrong in you're code and not a bug. You should probably post the code and error message in ask-a-pro.
To validate that it works simply do this.
I've tested in 1.4 and 1.46
To validate that it works simply do this.
FuelLevel = turtle.getFuelLevel()
print(FuelLevel)
if FuelLevel < 10 then
print("it works")
end
I've tested in 1.4 and 1.46
#6
Posted 28 October 2012 - 06:23 AM
Just print your FuelLevel.
Chances it will be "unlimited".
/>
Chances it will be "unlimited".
#7
Posted 28 October 2012 - 07:04 AM
The Error cames from the line with
if FuelLevel <= 10 then
And only in Cc 1.45. My Question is Why in CC 1.45 and only.ther in CC 1.46 work the Program and it gives no Error message back.
I dont now WHY It dont work in CC1.45 !!
if FuelLevel <= 10 then
And only in Cc 1.45. My Question is Why in CC 1.45 and only.ther in CC 1.46 work the Program and it gives no Error message back.
I dont now WHY It dont work in CC1.45 !!
#8
Posted 28 October 2012 - 08:19 AM
turtle.getFuelLevel() returns one of two things dependent on the setting in the config. if fule is on it returns a number if it is off it returns a string. you cant use <= on a string. run this code and post the results
local fuelL = turtle.getFuelLevel()
if type(fuelL) == "number" then
print("fuel is required status")
print(fuelL)
else
print("fuel not required")
print(fuelL)
end
#9
Posted 28 October 2012 - 08:30 AM
Oh I so Stupid I forget that I denyed that turtles net fuel
3 user(s) are reading this topic
0 members, 3 guests, 0 anonymous users











