ComputerCraftの非公式Wikiです。

turtle.getFuelLevel

turtle.getFuelLevel 関数
タートルの残りの燃料を返します。
引数nil 無し
戻り値number 燃料値
APITurtle

コード
x = turtle.getFuelLevel() 
if x ~= "unlimited" and x < 1 then
	turtle.refuel()
end
print(x)
燃料がなければ補給します。
そして残り燃料を表示します。

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

メンバーのみ編集できます