Jump to content




chunk loader?


  • You cannot reply to this topic
3 replies to this topic

#1 jakemg

  • Members
  • 88 posts

Posted 07 April 2013 - 07:52 PM

Edit: i figured out my chunk loader issue
New problem :P :

I am wondering how to put a torch feature in, i had an idea but i realised that it would put a torch down every block so I cant quite figure out how to get a torch feature in this program

local tArgs = {...}
local times = tArgs[1] and tonumber(tArgs[1]) or 1
turtle.select(1)
function move()
  while not turtle.forward() do  --this loop runs as long as turtle.move() return false
	    turtle.dig() --dig its way through
	    sleep(0.8) --i think this is falling time of gravel
  end
end

for i = 1, times do
	    turtle.dig()
	    move()
	    turtle.digUp()
	    turtle.turnRight()
	    turtle.dig()
	    move()
	    turtle.digUp()
	    turtle.digDown()
   turtle.dig()
	    turtle.turnRight()
	    turtle.turnRight()
	    move()
   move()
   turtle.dig()
	    turtle.digUp()
	    turtle.digDown()
   turtle.turnLeft()
	    turtle.turnLeft()
	    move()
	    turtle.turnLeft()
	    if turtle.getItemCount(16) > 0 then
			    turtle.select(1)
			    turtle.placeUp()
			    turtle.select(3)
			    for i = 3, 16 do
					    turtle.select(i)
					    turtle.dropUp()
			    end
			    turtle.select(1)
			    turtle.digUp()
	    end
end
function home()
	    for i = 1, times do -- notice the loop
			    move()
	    end
end
function torch()
turn

function turn()
	    turtle.turnLeft()
	    turtle.turnLeft()
end

turn()
home()


#2 jakemg

  • Members
  • 88 posts

Posted 07 April 2013 - 08:16 PM

Is there a code for like every 10 blocks do this function because I think thats what I need

#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 07 April 2013 - 08:19 PM

View Postjakemg, on 07 April 2013 - 08:16 PM, said:

Is there a code for like every 10 blocks do this function because I think thats what I need
you will have to keep a record of how far it has been moved, so basically each time you move increment the number, then you can do this
if theDistanceVar % 10 == 0 then
  -- do what you want, it has moved a multiple of 10 blocks
end

EDIT: based off your code, you could use the variable 'i' as your distance variable.

Edited by theoriginalbit, 07 April 2013 - 08:20 PM.


#4 jakemg

  • Members
  • 88 posts

Posted 07 April 2013 - 08:31 PM

i didnt even think about that Thanks =D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users