So I am wondering if it is possible to create a timer using the computer. Something like send signal for 10 minutes and then turn off for a hour. I am trying to automate a nuke reactor in IC and was hoping this would help
hey, im pretty new at lua and i am trying to make a minesweeper program for the turtle...
i was wondering if it was possible to make the turtle, using turtle.detectDown() able to detect only TNT and dig down when it finds it?
If you can answer this i will give you some credit and x20
Cowmonkeys CaveFinder, its not much, but its does what it has to do!
You need to put torches in it.
local blockSinceTorch = 0;
while turtle.detect() do
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
blockSinceTorch = blockSinceTorch + 1
if blockSinceTorch == 10 then
turtle.placeDown()
blockSinceTorch = blockSinceTorch - blockSinceTorch
end
end
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
hey for all of you here's a scrip im currently working on if you would like to help then by all means send me your comments.
rs.setOutput("back", true)
print "Welcome miner to minecraft mine-gate 1.0.0 v1 lite"
write "Do you wish to open the gate? "
input = read()
if input == "Yes" then
print "Alright i'm on it!"
rs.setOutput("bottom", false)
sleep(3)
os.reboot()
elseif input == "no" then
print "Ok! Rebooting..."
sleep(2)
os.reboot()
else
print "I'm sorry I don't understand."
sleep(1)
os.reboot()
end
this code is meant to be changed for multiple anwers which cause different actions and/or reactions to an answer to a question
the way i have it set up is it asks "do you wish to open the gate?"
and you can answer "yes" or "no"
also with the rs.setOutput at the top this is for the computer to start with that side already on.
mind you that this script is meant to be edited as startup.
Can Someone make a code where you type in something to hack the computer and an array of numbers and letters appear for about 10 seconds until it says something and then it activates redstone
here you go this script should be what your looking for
pass="password here"
write "password: "
input = read()
if pass == input then
print "Access Granted!"
rs.setOutput("back", true)
sleep(3)
os.reboot()
elseif input == "God" then
print "00010000 10010000 11100000 11110000 00100000!"
sleep(10)
print "Hi God! Please by all means enter your shrine. :)"
rs.setOutput("back", true)
sleep(3)
os.reboot()
else
print "Access Denied!"
rs.setOutput("bottom", true) --forget this line if you dont have a trap setup
sleep(2)
os.reboot()
end
please put it to good use and tell everyone kiliin made it
hello there i am a new user here and i used this program on one of the turtles i labeled and messed up when i put the password in is there any backdoor to this?
hello again i was wondering if there was a simple way to make a turtle execute a a list of programs for ex:
excavate return to start move x blocks forward excavate return to start move x blocks so on and so forth
sorry if this is simple or i missed a code for this i am very new to lua and coding in general have not actual written anything of my own just used the installed commands on turtles to make them build
Hello. I was wondering if I could get some help with a program for my nuclear reactor cooling system. I need a program that emits a steady redstone signal if the computer receives a set amount of pulses per second over a period of time. I've been trying to teach myself how to program it myself, but it's a little difficult to teach myself something like programming.
Hello. I was wondering if I could get some help with a program for my nuclear reactor cooling system. I need a program that emits a steady redstone signal if the computer receives a set amount of pulses per second over a period of time. I've been trying to teach myself how to program it myself, but it's a little difficult to teach myself something like programming.
Try Programming in lua, it's available from the author online here: http://lua.org/pil
Oh, yeah it's an old version, but there's a list of differences.
hello there i am a new user here and i used this program on one of the turtles i labeled and messed up when i put the password in is there any backdoor to this?
i remembered i can use ctr T lol
Well, you could use ctrl-t, or go into .minecraft/saves/*yoursavehere*/computer/turtle/*turtle id*
How to use:
1.Choose how many counts you want which will be 'x'
2.Write which side you want the pulse to be made after x counts has been made
3.Choose how much time the pulse will last
Example
lets say i will do it like that
1. 100 counts
2.front
3. 5
After the counter counts 100 pulses from its back it will send a pulse to its front for 5 seconds and it will start to count again as soon as 100 pulses has been counted (It is used with the Item Detector of RP2)
you can use it for other things aswell so its up to you
function Check(way)
if way~="left" then
if way~="right" then
if way~="top" then
if way~="button" then
if way~="front" then
if way~="back" then
return true
end
end
end
end
end
end
return false
end
function check(nus)
if nus==nill then
return true
end
return false
end
term.clear()
term.setCursorPos(1,1)
write("Enter How Many Times To Count")
print(newline)
num=read()
while check(tonumber(num)) do
write("Write a number")
print(newline)
num=read()
end
write("Enter The Side The Pulse Will Be Sended After "..num.." Counts Has been Made")
print(newline)
Side=read()
while Check(Side) do
write("Side Doesn't Exitst , Write Again")
print(newline)
Side = read()
end
write("Enter How Long The Pulse Will Be In Seconds")
print(newline)
delay=tonumber(read())
while check(delay) do
write("Write a number")
print(newline)
delay=read()
delay = tonumber(delay)
end
write ("Automate Counting Started- Now Executing ")
print(newline)
num=tonumber(num)
Counter=0
while true do
while Counter<num do
sleep(0.01)
if redstone.getInput("back") then
j = 0
while j==0 do
sleep(0.05)
if redstone.getInput("back")==false then
Counter = Counter + 1
a = tostring(Counter)
print("Pulse " .. a .. " ")
j=1
end
end
end
end
Counter=0
redstone.setOutput(Side, true)
sleep(delay)
redstone.setOutput(Side, false)
end
If you just want to count pulses without reseting the counter just choose a really high number for the counts like 9999999999 and it will count the pulses
This works running on a monitor too? and shows it on the monitor?
Kann mir jemand helfen. Ich arbeite das erste mal mit LUA. Möchte ein Programm machen für ein kleines Labor. Allerdings bekomme ich Probleme wenn ich die Funktionen aufrufen will. Es kommt immer: attempt to call nil! Hier das Programm. Das 2. funktionerte. Wollte es dann aber erweitern.
while true do
term.clear()
term.setCursorPos(1, 1)
print("Laboratory Lock-Version 1.0")
print""
sleep(0.5)
print("Welcome to the Security Login!")
print""
print""
sleep(0.5)
login()
end
function elevator()
if not hermeticStat then
rs.setBundledOutput("back", colors.black)
sleep(8)
sleep(2)
rs.setBundledOutput("back", colors.white)
sleep(8)
return
end
end
function button()
local callStat = redstone.testBundledInput ("back", colors.blue, true)
if callStat and loginStat then
shell.run("clear")
print("Elevator called")
sleep(2)
end
end
function hermetic()
local hermeticStat = redstone.testBundledInput("back", colors.red, true)
if hermeticStat then
shell.run("clear")
print("Hermetically sealed")
print""
print("Access System Locked")
end
end
while true do
term.clear()
term.setCursorPos(1, 1)
So i use redpower2 and buildcraft, and i love letting my quarry work while i let redpower sort it all out, but it is a pain to have to walk all the way to my quarry to check if everything is going ok, so I made a quarry status program that keeps me updated on a giant screen I can see from a mile away.
I thought i would share my code, maybe it would help someone. It implements saving and loading from a file(in case of restart or crash, the information shown is still accurate), multitasking with multiple loops keeping track of things, event handling, and bundled cabling through the rs api.
I use rp2 item detectors getting items from 2 sorting machines to send the pulses for the counting of items recieved from the quarry.
--Quarry Monitoring
monitor = peripheral.wrap( "right" )
monitor.setTextScale( 2.5 )
function updatescreen()
monitor.clear()
monitor.setCursorPos(1,1)
monitor.write(" __-== Quarry Stats ==-__")
monitor.setCursorPos(1,3)
monitor.write( tostring(white) .. " Tin")
monitor.setCursorPos(1,4)
monitor.write( tostring(orange) .. " Copper")
monitor.setCursorPos(1,5)
monitor.write( tostring(magenta) .. " Marble/Basalt")
monitor.setCursorPos(1,6)
monitor.write( tostring(lightblue) .. " Nikolite")
monitor.setCursorPos(1,7)
monitor.write( tostring(yellow) .. " Gold")
monitor.setCursorPos(1,8)
monitor.write( tostring(lime) .. " Gems")
monitor.setCursorPos(1,9)
--I never found anything else to sort, so pink is unused.
monitor.write( tostring(pink) .. " unlisted")
monitor.setCursorPos(1,10)
monitor.write( tostring(gray) .. " Iron")
monitor.setCursorPos(1,11)
monitor.write( tostring(lightgray) .. " Silver")
monitor.setCursorPos(1,12)
monitor.write( tostring(cyan) .. " Diamonds")
monitor.setCursorPos(1,13)
monitor.write( tostring(blue) .. " Lapis")
monitor.setCursorPos(1,14)
monitor.write( tostring(green) .. " Sand")
monitor.setCursorPos(1,15)
monitor.write( tostring(red) .. " Redstone dust")
monitor.setCursorPos(1,16)
monitor.write( tostring(black) .. " Coal")
monitor.setCursorPos(1,17)
monitor.write( tostring(purple) .. " Obsidian")
monitor.setCursorPos(1,18)
monitor.write( tostring(brown) .. " Garbage")
monitor.setCursorPos(22,3)
--Monitor only updates when a block is detected, therefore, we can reset from here.
lastseconds = 0
monitor.write("0 seconds since")
monitor.setCursorPos(22,4)
monitor.write(" last block.")
--Monitor updated, so values have changed. Time to save the changes.
saveinfo()
end
function updateitems (colorset)
while tonumber(colorset) > 0 do
if colors.test(tonumber(colorset), colors.white) then
white = white + 1
colorset = tonumber(colorset) - tonumber(colors.white)
changed = true
elseif colors.test(tonumber(colorset), colors.orange) then
orange = orange + 1
colorset = tonumber(colorset) - tonumber(colors.orange)
changed = true
elseif colors.test(tonumber(colorset), colors.magenta) then
magenta = magenta + 1
colorset = tonumber(colorset) - tonumber(colors.magenta)
changed = true
elseif colors.test(tonumber(colorset), colors.lightBlue) then
lightblue = lightblue + 1
colorset = tonumber(colorset) - tonumber(colors.lightBlue)
changed = true
elseif colors.test(tonumber(colorset), colors.yellow ) then
yellow = yellow + 1
colorset = tonumber(colorset) - tonumber(colors.yellow)
changed = true
elseif colors.test(tonumber(colorset), colors.lime ) then
lime = lime + 1
colorset = tonumber(colorset) - tonumber(colors.lime)
changed = true
elseif colors.test(tonumber(colorset), colors.pink) then
pink = pink + 1
colorset = tonumber(colorset) - tonumber(colors.pink)
changed = true
elseif colors.test(tonumber(colorset), colors.gray) then
gray = gray + 1
colorset = tonumber(colorset) - tonumber(colors.gray)
changed = true
elseif colors.test(tonumber(colorset), colors.lightGray) then
lightgray = lightgray + 1
colorset = tonumber(colorset) - tonumber(colors.lightGray)
changed = true
elseif colors.test(tonumber(colorset), colors.cyan) then
cyan = cyan + 1
colorset = tonumber(colorset) - tonumber(colors.cyan)
changed = true
elseif colors.test(tonumber(colorset), colors.purple) then
purple = purple + 1
colorset = tonumber(colorset) - tonumber(colors.purple)
changed = true
elseif colors.test(tonumber(colorset), colors.blue) then
blue = blue + 1
colorset = tonumber(colorset) - tonumber(colors.blue)
changed = true
elseif colors.test(tonumber(colorset), colors.brown) then
brown = brown + 1
colorset = tonumber(colorset) - tonumber(colors.brown)
changed = true
elseif colors.test(tonumber(colorset), colors.green) then
green = green + 1
colorset = tonumber(colorset) - tonumber(colors.green)
changed = true
elseif colors.test(tonumber(colorset), colors.red) then
red = red + 1
colorset = tonumber(colorset) - tonumber(colors.red)
changed = true
elseif colors.test(tonumber(colorset), colors.black) then
black = black + 1
colorset = tonumber(colorset) - tonumber(colors.black)
changed = true
end
end
if changed then
--Screen only updates when a value is changed. This is for optimization.
changed = false
updatescreen()
end
end
function loadsave()
if pcall(function ()
--Yeah I'm lazy. This code could error if file doesn't exist, so pcall used to intercept the error.
hLoad = fs.open("disk/save", "r")
white = tonumber(hLoad.readLine())
orange = tonumber(hLoad.readLine())
magenta = tonumber(hLoad.readLine())
lightblue = tonumber(hLoad.readLine())
yellow = tonumber(hLoad.readLine())
lime = tonumber(hLoad.readLine())
pink = tonumber(hLoad.readLine())
gray = tonumber(hLoad.readLine())
lightgray = tonumber(hLoad.readLine())
cyan = tonumber(hLoad.readLine())
purple = tonumber(hLoad.readLine())
blue = tonumber(hLoad.readLine())
brown = tonumber(hLoad.readLine())
green = tonumber(hLoad.readLine())
red = tonumber(hLoad.readLine())
black = tonumber(hLoad.readLine())
hLoad.close()
end) then
else
--pcall threw an error, so the file is ill formatted or doesn't exist.
white = 0
orange = 0
magenta = 0
lightblue = 0
yellow = 0
lime = 0
pink = 0
gray = 0
lightgray = 0
cyan = 0
purple = 0
blue = 0
brown = 0
green = 0
red = 0
black = 0
end
end
function saveinfo()
hSave = fs.open("disk/save", "w")
hSave.writeLine(tostring(white))
hSave.writeLine(tostring(orange))
hSave.writeLine(tostring(magenta))
hSave.writeLine(tostring(lightblue))
hSave.writeLine(tostring(yellow))
hSave.writeLine(tostring(lime))
hSave.writeLine(tostring(pink))
hSave.writeLine(tostring(gray))
hSave.writeLine(tostring(lightgray))
hSave.writeLine(tostring(cyan))
hSave.writeLine(tostring(purple))
hSave.writeLine(tostring(blue))
hSave.writeLine(tostring(brown))
hSave.writeLine(tostring(green))
hSave.writeLine(tostring(red))
hSave.writeLine(tostring(black))
--ALWAYS CLOSE!
hSave.close()
end
timertick = function()
lastseconds = 0
while true do
--converts time to minutes when necessary.
if lastseconds > 59 then
monitor.setCursorPos(22,3)
monitor.write(tostring(math.floor(lastseconds / 60)) .. " minutes since ")
monitor.setCursorPos(22,4)
monitor.write(" last block.")
else
monitor.setCursorPos(22,3)
monitor.write(tostring(lastseconds) .. " seconds since")
monitor.setCursorPos(22,4)
monitor.write(" last block.")
end
lastseconds = lastseconds + 1
sleep(1)
end
end
main = function()
while true do
r = os.pullEvent()
if r == "redstone" then
updateitems(rs.getBundledInput("left"))
sleep(0)
saveinfo()
end
end
end
loadsave()
updatescreen()
--Multitasking for the block counting and for the idle time.
parallel.waitForAll( main, timertick)
HATEWANT TO BURN UP THE SERVER to that website.Hello World!
i was wondering if it was possible to make the turtle, using turtle.detectDown() able to detect only TNT and dig down when it finds it?
If you can answer this i will give you some credit and x20
You need to put torches in it.
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
this code is meant to be changed for multiple anwers which cause different actions and/or reactions to an answer to a question
the way i have it set up is it asks "do you wish to open the gate?"
and you can answer "yes" or "no"
also with the rs.setOutput at the top this is for the computer to start with that side already on.
mind you that this script is meant to be edited as startup.
here you go this script should be what your looking for
please put it to good use and tell everyone kiliin made it
http://adf.ly/1205186/7seg-display
It uses bundled cables and wireless redstone.
Download and open this file in you internet browser.
i remembered i can use ctr T lol
excavate return to start move x blocks forward excavate return to start move x blocks so on and so forth
sorry if this is simple or i missed a code for this i am very new to lua and coding in general have not actual written anything of my own just used the installed commands on turtles to make them build
Try Programming in lua, it's available from the author online here: http://lua.org/pil
Oh, yeah it's an old version, but there's a list of differences.
Well, you could use ctrl-t, or go into .minecraft/saves/*yoursavehere*/computer/turtle/*turtle id*
http://i.imgur.com/s5Xsq5k.png (MCF hates big images and text )
Do you mean this:
if(x); then
elseif(!=x); then
?
This works running on a monitor too? and shows it on the monitor?
while true do
term.clear()
term.setCursorPos(1, 1)
print("Laboratory Lock-Version 1.0")
print""
sleep(0.5)
print("Welcome to the Security Login!")
print""
print""
sleep(0.5)
login()
end
function login()
local loginStat = false
usertable = {Admin="1942", Dexter="1942", BlackFox="0000",Sapphire="0000", Rotfuchs="0000", Raze="0000", Franky="0000", BlackDragon="0000"}
key = 1234
textutils.slowPrint ("...............", 9)
print("Username: ") term.setCursorPos(11, 6) username = read()
print("Access Code: ") term.setCursorPos(14, 7) code = read("*")
print("Security Key: ") term.setCursorPos(15, 8) key = read("*")
if usertable[username] == code and key then
loginStat = true
print""
print("Access Granted!")
sleep(1)
print""
print("Welcome "..username)
sleep(1)
print""
print("Enter Laboratory in..")
sleep(1)
print("----- 5 -----")
sleep(1)
print("----- 4 -----")
sleep(1)
print("----- 3 -----")
sleep(1)
print("----- 2 -----")
sleep(1)
print("----- 1 -----")
sleep(1)
shell.run("clear")
elevator()
else
print("Access Denied!")
rs.setBundledOutput("back", colors.orange) --Noteblock
sleep(1)
rs.setBundledOutput("back", colors.orange) --Noteblock
sleep(2)
return login()
end
end
function elevator()
if not hermeticStat then
rs.setBundledOutput("back", colors.black)
sleep(8)
sleep(2)
rs.setBundledOutput("back", colors.white)
sleep(8)
return
end
end
function button()
local callStat = redstone.testBundledInput ("back", colors.blue, true)
if callStat and loginStat then
shell.run("clear")
print("Elevator called")
sleep(2)
end
end
function hermetic()
local hermeticStat = redstone.testBundledInput("back", colors.red, true)
if hermeticStat then
shell.run("clear")
print("Hermetically sealed")
print""
print("Access System Locked")
end
end
while true do
term.clear()
term.setCursorPos(1, 1)
print("Laboratory Lock-Version 1.0")
print""
sleep(0.5)
print("Welcome to the Security Login!")
print""
print""
sleep(0.5)
usertable = {Dexter="1942", BlackFox="0815",Sapphire="nix", Rotfuchs="0000", Raze="0000", Franky="0000", BlackDragon="0000"}
securitykey = 2012
print("Username: ") term.setCursorPos(11, 6)
username = read()
print("Access Code: ") term.setCursorPos(14, 7)
code = read("*")
print("Security Key: ") term.setCursorPos(15, 8)
key = read("*")
if usertable[username] == code and key then
print""
print("Access Granted!")
sleep(1)
print""
print("Welcome "..username)
sleep(1)
print""
print("Enter Laboratory in..")
sleep(1)
print("5")
sleep(1)
print("4")
sleep(1)
print("3")
sleep(1)
print("2")
sleep(1)
print("1")
sleep(1)
rs.setBundledOutput("back", colors.black)
sleep(8)
rs.setBundledOutput("back", colors.black)
sleep(3)
rs.setBundledOutput("back", colors.white)
sleep(8)
rs.setBundledOutput("back", colors.white)
os.shutdown()
else
print("Access Denied!")
rs.setBundledOutput("back", colors.orange)
sleep(1)
rs.setBundledOutput("back", colors.orange)
sleep(2)
os.reboot()
end
end
I thought i would share my code, maybe it would help someone. It implements saving and loading from a file(in case of restart or crash, the information shown is still accurate), multitasking with multiple loops keeping track of things, event handling, and bundled cabling through the rs api.
I use rp2 item detectors getting items from 2 sorting machines to send the pulses for the counting of items recieved from the quarry.