8 posts
Posted 11 April 2013 - 03:32 PM
I currently have a understanding of coding but not fully experienced. I Have created my own hotel and have used computer to turn on each floor lighting as I choose etc. also have installed a fire alarm to activate at different areas of hotel. But I need help creating a program for a turtle to take items to their room, I understand this may meen I have to type in the directions and if that is the only way for this to happen us there a way that I can put these directions into a program. Please feel free to ask any questions due to I'm half asleep and not best at describing what I need.
120 posts
Posted 12 April 2013 - 10:21 AM
the easiest way would be to have a setup where it knows 2 places and has a math and logic setup to find the other waypoints
for example:
a single pickup location
the lower end of a turtle only maitenance hatch
moveUp X blocks per floor
move forward into the hall ( i'd use the middle celing of the hallway )
then move forward Y to get to the rooms door
then go into the room and drop off the items
645 posts
Location
'Merica
Posted 12 April 2013 - 12:52 PM
I remember you posting something just like this a couple of days ago. So look, how about you PM the full details of what you want to program to be like, then we can talk further, and I will make the program for you…
65 posts
Posted 13 April 2013 - 04:31 AM
That depends, is each floor symmetrical? You could setup a program to pass in the floor level and room number (each floor has same numbers in program, room 1, floor one may be room 11 for others) and then you only have to have the turtle move to that floor and follow the logic to move to room 1.
That way, you can add as many floors as you want. Just have him come up through the floor or a turtle chute.
args = {...}
floor = tonumber(args[1])
roomNumber = tonumber(args[2])
toFloor(floor)
toRoom(roomNumber)
toFloor
function toFloor(floors)
--Move to chute here--
for i=0,floors*floorheight do
turtle.up()
end
end
Floor height would be how high up each floor would be. You'd have to modify this to account for him coming back down, but I'm sure you get the gist of it.