Posted 25 June 2013 - 02:59 PM
This is my first ever program, so no hate please.
This is a fairly simple program, that waits until a disk is inserted into a drive. When it is, it checks the label. If the label is "pass", a redstone signal is output, which can be set to do anything. If not, it is ejected and nothing else happens.
You can download it directly to your in-game computer, by typing:
pastebin get WMSqjGEA <filename>
Hope this can help some of you. Its a simple program, but I'm proud, as its my first working one!
Nick! :)/>
This is a fairly simple program, that waits until a disk is inserted into a drive. When it is, it checks the label. If the label is "pass", a redstone signal is output, which can be set to do anything. If not, it is ejected and nothing else happens.
local side = "right" --change "right" to the side you want
local pass = "pass" -- change "pass" to the label of your disk
local output = "back" --change what side redstone output goes
local time = 5 -- change how long redstone output lasts
--Don't edit past here --
local label = disk.getLabel
local redstone = redstone.setOutput
print("Waiting for a disk...")
while true do
local _, side = os.pullEvent("disk")
if label(side) == pass then
print("Valid")
disk.eject(side)
redstone(output, false)
redstone(output, true)
sleep(time)
redstone(output, false)
os.reboot()
else
print("Invalid")
disk.eject(side)
os.reboot()
end
end
You can download it directly to your in-game computer, by typing:
pastebin get WMSqjGEA <filename>
Hope this can help some of you. Its a simple program, but I'm proud, as its my first working one!
Nick! :)/>