Computer Craft Help

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Silas

New Member
Jul 29, 2019
56
0
0
I am using two melee turtles side by side with mobs being pushed by a water trap.

I would like to be able to have said turtles to respond to a lever (on off) and to also drop all items into a chest below them.

What would this code look like?

I so far have the basic kill program of

while true do
turtle.attack()
end

I am guessing that I would change the while true do part to respond to redsone. and somewhere in there add the turtle.drop command or something like that?

Anyone who can help would be awesome!
 

Alex K.

New Member
Jul 29, 2019
51
0
0
Well, there is a much easier way to do this. First of all, change the program to this:

while true do
turtle.attack()
sleep(.5)
end

Under the turtles, Place transposers to suck out all the items from the turtles. If you are using a soul cage, Just send the cage a redstone signal. If you aren't, Use redstone lamps to control the lighting. Hope this helps!
 

Silas

New Member
Jul 29, 2019
56
0
0
Will end up using the lamps thanks! Got the turtle.dropDown now I just need to figure out how to empty the whole inventory. Not just one slot.
 

nickRepublic

New Member
Jul 29, 2019
21
0
0
To empty the whole turtle use a loop. Looks something like this:

Code:
while true do
turtle.attack()
sleep(.5)
if turtle.getItemCount(16) >0 then
  for x=1, 16 do
   turtle.select(x)
   turtle.dropDown()
  end
end
end

It checks if the slot 16 has items. If theres something in 16 (the last one) it empties all the slots.
 

Alex K.

New Member
Jul 29, 2019
51
0
0
Will end up using the lamps thanks! Got the turtle.dropDown now I just need to figure out how to empty the whole inventory. Not just one slot.
Wait If you are using a soul cage, They can not be turned off with light, It has to be redstone. If you are using a regular spawner, You're good to go :p
 

AliveGhost

New Member
Jul 29, 2019
167
0
0
Wait If you are using a soul cage, They can not be turned off with light, It has to be redstone. If you are using a regular spawner, You're good to go :p

Nonononono, it can be turned off with lights if it is tier 4 or below. Tier 5 has to be turned off with redstone

Sent from my HTC Desire X using Tapatalk 2
 
  • Like
Reactions: Alcarkse

voidreality

New Member
Jul 29, 2019
117
0
0
I am using two melee turtles side by side with mobs being pushed by a water trap.

I would like to be able to have said turtles to respond to a lever (on off) and to also drop all items into a chest below them.

What would this code look like?

Like this:
Code:
side = "back"
while true do
 if redstone.getInput(side) then
  turtle.attack()
  if turtle.getItemCount(16) > 0 then
   for i=1, 16 do
    turtle.select(i)
    turtle.dropDown()
   end
  end
 end
 sleep(1)
end