- ComputerCraft | Programmable Computers for Minecraft
- → luingar's Content
luingar's Content
There have been 8 items by luingar (Search limited from 29-March 23)
#22356 Truly random (or sequential) music player
Posted by luingar on 29 July 2012 - 02:59 AM in Turtle Programs
When i did this my turtle just spun around endlessly turning right...
#22087 Quarry Filling Program
Posted by luingar on 28 July 2012 - 05:58 AM in Turtle Programs
Sorry, i don't know what happened. added to original post.
#21959 Quarry Filling Program
Posted by luingar on 27 July 2012 - 06:03 PM in Turtle Programs
This program fills in the hole left by buildcraft quarries with whatever resource you load the turtle's inventory with (I recommend dirt obviously). Supports mid-run reloading, only puts a 1 block cover of dirt.
local x = 1 turtle.forward() -- Move into hole while(true) do while (turtle.detectDown() == false) do if(turtle.getItemCount(x)==0) then x=x+1 if(x==10) then x = 1 end turtle.select(x) end turtle.placeDown() turtle.forward() if(turtle.detect()) and (turtle.detectDown() == false) then turtle.turnLeft() end end while (turtle.detectDown() == true) do turtle.back() turtle.turnLeft() turtle.forward() end -- turtle.back() -- turtle.turnLeft() end
#19946 [lua][question]Recieving input while in a loop.
Posted by luingar on 17 July 2012 - 11:53 PM in Ask a Pro
I did not know you could do that. thanks a lot. Also I edited the code a bit ago and hadn't tested it in game yet, which is why that line was like that lol. Thanks a LOT.
and while they could do that, if they do insert the disk while it's on the computer will erase it which will be very annoying at least.
and while they could do that, if they do insert the disk while it's on the computer will erase it which will be very annoying at least.
#19944 [CC1.5]ComputerCraft Emulator V0.57 (February 19th)
Posted by luingar on 17 July 2012 - 11:49 PM in APIs and Utilities
Suggestion. Context menu. This could let you do many many things, making the emulator a much better testing enviroment without sacrificing asthetics or realistic-ness (I hate when I forget a word)
here's a shitty photoshop of how it could look.
here's a shitty photoshop of how it could look.
#19940 [lua][question]Recieving input while in a loop.
Posted by luingar on 17 July 2012 - 11:05 PM in Ask a Pro
Right now, i'm trying to create a door lock script from scratch. Right now, it works very well, but is still vulnerable to inserting a disk and restarting it. I've got a bit of code that checks for disks and if they exist, erases and ejects them, but unfortunately the program only runs across that snippet of code when it's not nessicary (before the user enters the password)
What I would like to do is have the whole thing in a loop that runs 4 times per second, but .25 seconds it not nearly long enough for a user to enter a password.
How could I impliment a password system that loops while the user is still entering the password? I considered some kinda thing that checks if the user entered an input and if so, saving it into a variable and when the input is enter, combining the variables into one variable and checking it against the password, but is there a better way?
Here's my current code, for reference.
What I would like to do is have the whole thing in a loop that runs 4 times per second, but .25 seconds it not nearly long enough for a user to enter a password.
How could I impliment a password system that loops while the user is still entering the password? I considered some kinda thing that checks if the user entered an input and if so, saving it into a variable and when the input is enter, combining the variables into one variable and checking it against the password, but is there a better way?
Here's my current code, for reference.
Spoiler
oldPullEvent = os.pullEvent os.pullEvent = os.pullEventRaw while true do if fs.exists("disk") then k = fs.open("disk/startup", "No") k.writeLine("write no") k.close() disk.eject("back") disk.eject("bottom") disk.eject("top") disk.eject("front") disk.eject("left") disk.eject("right") else end local side = "back" local password = "limes" local opentime = 5 term.clear() term.setCursorPos(1,1) write("Enter Password Now") local input = read("*") if input == password then term.clear() term.setCursorPos(1,1) rs.setOutput(side,true) sleep(opentime) rs.setOutput(side,false) os.reboot() else term.clear() term.setCursorPos(1,1) print("Password incorrect!") sleep(5) os.reboot() os.reboot() end end os.pullEvent = oldPullEvent
- ComputerCraft | Programmable Computers for Minecraft
- → luingar's Content