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

then expected

Started by TechedZombie, 28 April 2015 - 07:57 PM
TechedZombie #1
Posted 28 April 2015 - 09:57 PM

function fuel()
  for i = 3, 16 do
	turtle.select(1)
	icnt = turtle.getItemCount(1)
	turtle.refuel(icnt - 1)
	print(i)
  end
end

function sapSlot()
  turtle.select(2)
  local data = turtle.getItemDetail(2)
  if data.name == "minecraft:sapling" and data.damage == 2 then
  
	icnt = turtle.getItemCount(2)
if icnt ~> 1 then

   return true
  
else

   print("Please Supply More Saplings")
   while turtle.getItemCount(2) ~> 1 do
  
	 sleep(2)
  
   end
  
end
  
  else
	error("No Saplings")
  end
end
sapSlot()
fuel()

I get then expected on line 18
CrazedProgrammer #2
Posted 28 April 2015 - 09:59 PM
~> isn't a valid operator, you should use => instead.
Edit: I meant >=
Edited on 28 April 2015 - 09:37 PM
TechedZombie #3
Posted 28 April 2015 - 10:06 PM
would != work?
Kaikaku #4
Posted 28 April 2015 - 10:11 PM
would != work?
A not in Lua is ~=
Dragon53535 #5
Posted 28 April 2015 - 10:40 PM
~> isn't a valid operator, you should use => instead.
To correct you so that he doesn't try your suggestion and error. You need the > BEFORE the =
>= <= == ~= all have the = in the last spot.

Edit: I think I just :ph34r:/>'d Lyqyd…
Edited on 28 April 2015 - 08:44 PM
Lyqyd #6
Posted 28 April 2015 - 10:41 PM
~> isn't a valid operator, you should use => instead.

That's still not valid, >= and <= are though. As are ==, ~=, <, and >.