- ComputerCraft | Programmable Computers for Minecraft
- → Willibilly19's Content
Willibilly19's Content
There have been 48 items by Willibilly19 (Search limited from 10-February 22)
#95332 [halp?] missing programs
Posted by
Willibilly19
on 10 March 2013 - 03:43 AM
in
Ask a Pro
#84618 [Error] attempt to compare __le on nil and number
Posted by
Willibilly19
on 07 February 2013 - 12:35 AM
in
Ask a Pro
while true do
event, button, x, y = os.pullEvent(monitor_touch)
if x <= 12 and x >= 2 and y <= 4 and y >= 2 then
rs.setOutput("back", true)
sleep(1)
rs.setOutput("back", false)
end
sleep(0.5) --This sleep here
end
Just add that one in:P I'm sure someone would be able to explain the issue or something... But it's working xD
#80898 Auto Start computers and turtles
Posted by
Willibilly19
on 27 January 2013 - 11:06 AM
in
Ask a Pro
#79868 [Lua][Question] Countdown Timer on Loop?
Posted by
Willibilly19
on 24 January 2013 - 12:38 PM
in
Ask a Pro
And You are quite welcome. Glad I could help out.
#79849 [Lua][Question] Countdown Timer on Loop?
Posted by
Willibilly19
on 24 January 2013 - 11:40 AM
in
Ask a Pro
function info()
term.clear()
term.setCursorPos(3,2)
print("Estimated Travel Times: ETT")
term.setCursorPos(3,4)
print("Dorfanos <-> SquareSky City")
term.setCursorPos(3,5)
print("Fourty-Two Seconds")
term.setCursorPos(3,7)
print("Train arriving in..")
term.setCursorPos(5,8)
end
seconds = 42
wait = 63
i = seconds
while true do
while i <= seconds and i > 0 do
i = i - 1
info()
print(i)
sleep (1)
end
if i == 0 then
i = seconds
info()
print("Arrived")
end
sleep(wait)
end
#79644 computer controled prision
Posted by
Willibilly19
on 23 January 2013 - 10:04 PM
in
Ask a Pro
Having it so you can open each door individually from the cell, you could either have a computer at each cell...or you could carry a remote around with you to turn that frequency on. If you need help with it, I'd be glad to help you.
#79324 Is it possible to refuel this way?
Posted by
Willibilly19
on 23 January 2013 - 09:24 AM
in
Ask a Pro
An alternative is doing something like this.
function refuel()
if turtle.getFuelLevel() < x then
turtle.select(1)
turtle.refuel(1)
end
end
just change the "x" to the fuel level you want it to refuel at and tell it which slot to select/how many time to refuel. Put that function into your movement loop and it won't use more fuel than it needs.
#79310 Help please. Simple tunnel script not working properly
Posted by
Willibilly19
on 23 January 2013 - 09:05 AM
in
Ask a Pro
#79309 Help please. Simple tunnel script not working properly
Posted by
Willibilly19
on 23 January 2013 - 09:04 AM
in
Ask a Pro
tArgs = {...}
length = tArgs[1]
if #tArgs ~= 1 then
print("Usage: branch <length>")
end
local function forward()
while not turtle.forward() do
turtle.dig()
turtle.digUp()
turtle.attack()
end
end
local function tunnel()
forward()
if not turtle.detectDown() then
turtle.select(1)
turtle.placeDown()
end
end
for i = 1,length do
tunnel()
end
turtle.digUp()
for i = 1,length do
turtle.back()
end
I'd probably add some more to it, but that would be the basic code.
#79295 Help please. Simple tunnel script not working properly
Posted by
Willibilly19
on 23 January 2013 - 08:46 AM
in
Ask a Pro
#79277 Help please. Simple tunnel script not working properly
Posted by
Willibilly19
on 23 January 2013 - 08:24 AM
in
Ask a Pro
le nub, on 23 January 2013 - 08:17 AM, said:
Next time i ask for help ill try to find my own spelling errors...
No problem. I just threw the code onto my turtle and checked it for you. Glad I could be of help. btw, it's a decent script for just starting:P
#79267 too long w/o yeilding fix?
Posted by
Willibilly19
on 23 January 2013 - 08:11 AM
in
Ask a Pro
#79260 Help please. Simple tunnel script not working properly
Posted by
Willibilly19
on 23 January 2013 - 08:05 AM
in
Ask a Pro
--[[ Go ]]--
function checkBlocks()
if turtle.detectUp() then
turtle.digUp()
end
if turtle.detectDown() then
return true
elseif not turtle.detectDown() then
turtle.select(1)
sleep(0.375)
turtle.placeDown()
end
end
function moveForward()
checkBlocks()
sleep(0.375)
if not turtle.forward() then
turtle.dig()
turtle.forward()
end
end
function tunnel()
input = read()
print("tunneling "..input.." blocks deep...")
for moved = 1, tonumber(input) do
moveForward()
end
moved = 0
print("Finished!!")
sleep(3)
end
print("How many spaces? ")
tunnel()
-- i know i suck at this...
#79242 'Then' Expected
Posted by
Willibilly19
on 23 January 2013 - 07:46 AM
in
Ask a Pro
Edit* Nevermind, changing the code as remiX said fixed that
#79239 Turtle has to move input steps
Posted by
Willibilly19
on 23 January 2013 - 07:40 AM
in
Ask a Pro
tArgs = {...}
length = tArgs[1]
for i = 1, length do
turtle.forward()
end
Here's the code you asked for though. If you name the file "forward" or whatever....type "forward 5"...it'll go 5.
#78895 [lua] Dispenser Program Only Dispenses One?
Posted by
Willibilly19
on 22 January 2013 - 02:02 PM
in
Ask a Pro
inside = "back"
outside = "bottom"
p = 0
pstat = 0
b = 0
bstat = 0
c = 0
cstat = 0
term.clear()
term.setCursorPos(1,1)
print("Order Calculations")
print("Porkchops: "..p)
print("Beef: "..B)/>
print("Chicken: "..c)
while true do
os.pullEvent("redstone")
if rs.testBundledInput(inside, colours.white) then
p = p + 1
pstat = pstat + 1
elseif rs.testBundledInput(inside, colours.orange) then
b = b + 1
bstat = bstat + 1
elseif rs.testBundledInput(inside, colours.magenta) then
c = c + 1
cstat = cstat + 1
elseif rs.testBundledInput(inside, colours.yellow) then
p = 0
b = 0
c = 0
elseif rs.testBundledInput(inside, colours.lightBlue) then
repeat
if pstat > 0 then
p = 0
for i=1, pstat do
rs.setBundledOutput(outside, 1)
sleep(1)
rs.setBundledOutput(outside, 0)
end
pstat = 0
elseif bstat > 0 then
b = 0
for i=1, bstat do
rs.setBundledOutput(outside, 2)
sleep(1)
rs.setBundledOutput(outside, 0)
end
bstat = 0
elseif cstat > 0 then
c = 0
for i=1, cstat do
rs.setBundledOutput(outside, 4)
sleep(1)
rs.setBundledOutput(outside, 0)
end
cstat = 0
elseif cstat == 0 and bstat == 0 and pstat == 0 then
print("Finished Order. New Order may be made.")
sleep(1)
end
until pstat == 0 and bstat == 0 and cstat == 0
else
term.clear()
term.setCursorPos(1,1)
print("Order Calculations")
print("Porkchops: "..p)
print("Beef: "..B)/>
print("Chicken: "..c)
end
end
Also, wasn't sure about this bit. it obviously prints, but the variable should be lowercase (to match your variable above.) What is the /> at the end for?
print("Beef: "..B)/>
Edit* (nevermind...seems the /> is something the forum is adding...don't know why though)
#78863 rednet help
Posted by
Willibilly19
on 22 January 2013 - 11:55 AM
in
Ask a Pro
rednet.open("back")
other than that, I'm not sure. I haven't used it much.
#78689 [lua] blocking programs until....
Posted by
Willibilly19
on 22 January 2013 - 06:52 AM
in
Ask a Pro
while true do
os.pullEvent("redstone")
if rs.getInput("left") then -- check the LEFT input
-- do something
sleep(5) --adjust to how long your elevator takes...+ a few seconds if you want
end
if rs.getInput("right") then -- check the RIGHT input
-- do something
sleep(5) -- same thing here
end
end
#78631 [Lua] Need help making a program work
Posted by
Willibilly19
on 22 January 2013 - 04:59 AM
in
Ask a Pro
print("Continue?")
read()
To continue with that, you just hit enter.
You don't have to print if you don't want to.
#78622 Working with Railcraft
Posted by
Willibilly19
on 22 January 2013 - 04:41 AM
in
Ask a Pro
#78615 [Lua] Need help making a program work
Posted by
Willibilly19
on 22 January 2013 - 04:26 AM
in
Ask a Pro
#78538 [Lua] [Question] Need help with my quarry program.
Posted by
Willibilly19
on 21 January 2013 - 11:38 PM
in
Ask a Pro
I really like how your code looks, and judging just by that, I have a lot to learn(I knew this already...and even though I understand what your code does, I'm not sure I could implement it all.)
#78537 Print screen
Posted by
Willibilly19
on 21 January 2013 - 11:34 PM
in
Ask a Pro
#78528 Print screen
Posted by
Willibilly19
on 21 January 2013 - 10:52 PM
in
Ask a Pro
#78524 Lua question
Posted by
Willibilly19
on 21 January 2013 - 10:46 PM
in
Ask a Pro
- ComputerCraft | Programmable Computers for Minecraft
- → Willibilly19's Content


