Jump to content




Can someone please assist me


3 replies to this topic

#1 Joker-venom

  • Members
  • 8 posts

Posted 11 April 2013 - 02: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.

#2 etopsirhc

  • Members
  • 122 posts

Posted 12 April 2013 - 09: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

#3 Spongy141

  • Members
  • 526 posts
  • Location'Merica

Posted 12 April 2013 - 11:52 AM

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...

#4 Noiro

  • Members
  • 65 posts

Posted 13 April 2013 - 03: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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users