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

[Turtle] Bomber

Started by fuj1n, 01 January 1970 - 01:00 AM
fuj1n #1
Posted 01 January 1970 - 01:00 AM
Hello Everyone.
I Created A Turtle Bomber
Features:
Creates A Randomised Linear Crater
Bugs Or Problems:
Only The First Slot Is Used So Max Amount Of TNT Released Is 64(Will Fix Later)
Youtube Video:
Spoiler[media]http://youtu.be/-mrUjxzeGyY[/media]
Code:
Spoiler
d = 64
local tArgs = { ... }
if #tArgs ~= 1 then
print("Usage: tnt <number>")
return
end
term.clear()
x, y = term.getSize()
term.setCursorPos(x/2-19/2, y/2)
print("Waiting To Start...")
rednet.open("left")
rednet.open("right")
--act, msg = os.pullEvent("rednet_message")
--if msg == "tnt" then
for i = 0, 10 do
turtle.up()
sleep(0.5)
end
rs.setOutput("bottom", true)
term.clear()
term.setCursorPos(x/2-6, y/2)
print("Operating...")
for i = 0, tArgs[1] - 1 do
turtle.placeDown()
sleep(0.5)
turtle.forward()
sleep(0.5)
turtle.forward()
d = d + 1
end
for i = 0, 10 do
turtle.forward()
sleep(0.5)
end
while not turtle.detectDown() do
turtle.down()
end
term.clear()
term.setCursorPos(1,1)
Or Download:
SpoilerPlease Click One Of The Links Below:
v1.0 Adfly + Mediafire
v1.0 Mediafire
hamish1001 #2
Posted 01 January 1970 - 01:00 AM
to complicated :(/>/>
easier one :)/>/>
Spoiler


local tArgs = { ... }
if #tArgs ~= 2 then
print( "Usage: bomb <slot number> <frequency>" )
return
end
local slotNum = tonumber(tArgs[1])
local freq = tonumber(tArgs[2])
turtle.select(slotNum)
while turtle.getItemCount(slotNum) ~= 0 do
for n=1,freq
do
turtle.forward()
end
turtle.placeDown()
redstone.setOutput("bottom",true)
sleep(0.5)
redstone.setOutput("bottom",false)
end
fuj1n #3
Posted 01 January 1970 - 01:00 AM
to complicated :(/>/>
easier one :)/>/>
Spoiler


local tArgs = { ... }
if #tArgs ~= 2 then
print( "Usage: bomb <slot number> <frequency>" )
return
end
local slotNum = tonumber(tArgs[1])
local freq = tonumber(tArgs[2])
turtle.select(slotNum)
while turtle.getItemCount(slotNum) ~= 0 do
for n=1,freq
do
turtle.forward()
end
turtle.placeDown()
redstone.setOutput("bottom",true)
sleep(0.5)
redstone.setOutput("bottom",false)
end
true, one thing you could cut down on though is where you toggle the output, you could just turn it on and leave it on until the end of the program.

Edit: Thanks Though, I Am Still A Learner At cc-Lua (Lua With All The CC Apis), That Will Help Me Making My Programs More Compact.
Edit2: Oh And I Forgot To Remove All The Rednet Stuff Where I Was Gonna Make It Wi-fi Activated.
tactical_troll #4
Posted 01 January 1970 - 01:00 AM
HELP
I am a complete noob at LUA coding and is in need of some help, can you please walk me through the coding step by step or make it easy for me to understand becouse when I put that coding in a floppy disk and make this the startup file on a turtle it dosent work. so just help me out? :P/>/>