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

wireless depositing

Started by BulbuloNi, 17 April 2016 - 08:39 AM
BulbuloNi #1
Posted 17 April 2016 - 10:39 AM
Hey, I have 3 questions for you guys
I started learning a few days ago about the turtle programming, I built myself a few programs like branch mines and stuff.
Im not sure if what im asking is even possible though.

I want to make my turtle deposit its inventory into a chest WIRELESSLY, I mean whenever the inventory is full the turtle "sends" the items to a chest i choose before.
I think i saw someone doing it before. How do i do that?

I want to make my turtle use the coal its mining as fuel. how do I do that?

and I want to "attach" a chunk reloader to my trutle so it can go on without me finding the turtle stopped.
Lyqyd #2
Posted 18 April 2016 - 03:30 PM
Moved to Ask a Pro.
KingofGamesYami #3
Posted 18 April 2016 - 04:09 PM
Turtles cannot "transmit" items. The closest thing I've seen to what you're describing is having the turtle carry an ender chest, which has a counterpart placed next to a buildcraft pipe or hooked up to an ME storage system.

Try to refuel from each slot. If the slot contains valid fuel (eg coal) it'll work. Otherwise, nothing will happen.

You will have to install an addon to CC to use a chunkloader on a turtle.
BulbuloNi #4
Posted 18 April 2016 - 10:24 PM
Turtles cannot "transmit" items. The closest thing I've seen to what you're describing is having the turtle carry an ender chest, which has a counterpart placed next to a buildcraft pipe or hooked up to an ME storage system.

Try to refuel from each slot. If the slot contains valid fuel (eg coal) it'll work. Otherwise, nothing will happen.

You will have to install an addon to CC to use a chunkloader on a turtle.

1. How do I add a ender chest to the turtle and make it deposit to this certain chest? (I need the turtle to deposit from where it is and not coming back to the start of the branch mine)

2. How do i refuel from each slot in a program? I tried to put a "refuel all" line in my code and it didnt work (I write: "edit branch" and then edit this function. i tried to put the "Refuel all" line and it didnt work)

3. What addon? If im the owner and i install this on the server do every player on the server needs to install it as well?

sorry for bad english
KingofGamesYami #5
Posted 18 April 2016 - 10:52 PM
1. Place the ender chest in the turtle. When the turtle detects the inventory is full, it should select the slot which the ender-chest is in (I recommend slot 1), place it, and call turtle.drop for every other slot (2-16). Ex:

function clearInventory()
  turtle.select( 1 ) --#select the chest's slot
  turtle.place() --#place the chest
  for i = 2, 16 do --#iterate from 2 to 16 by 1 (1 is default)
    turtle.select( i ) --#select the current slot number
    turtle.drop() --#drop all items in that slot into the chest
  end
  turtle.dig() --#pick up the chest
end

2. Refueling is as simple as calling turtle.refuel() with a selected slot

for i = 1, 16 do --#iterate from 1 to 16
  if turtle.refuel() then --#if the refuel was successful (ei consumed items and increased fuel level)
    print( "I found fuel!" ) --#print "I found fuel!" to the console
    break --#exit the for loop early, since we already found fuel.
  end
end

3. There are multiple, the first one I found is Peripherals++. It is both a server-side and client-side mod, so the players will need to install it (AFAIK).

One thing to consider, depending on where you are mining, is that lava has a fuel value of 1000. In my mining script, I gave the turtle a bucket to pick up lava with. My turtle found lava well within 1000 movements, allowing it to stay out indefinitely (the limit was literally inventory space)
Edited on 18 April 2016 - 08:58 PM