term.clear()
term.setCursorPos(1,1)
print("DrumOS 1.1")
sleep(1)
print "Welcome To The Drumstick Test Operating System Version 1.1"
sleep(1)
write "Please Enter Username"
username = read()
if username == "Drumstick" then
print ("Welcome Drumstick")
print ("Your Terminal Is Waiting")
local function openAll()
for _,side in pairs(rs.getSides()) do
if peripheral.getType(side) == "modem" then
rednet.open(side)
return true
end
end
return false
end
openAll()
print ("Rednet Opened")
write "Would You Like To Upload To DrumNet Turtles")
answer=read()
if answer=="Yes" then
print ("Beggining Upload")
rednet.broadcast("Launch")
print ("Launch Command Sent Turtles launched")
end
write "Would You Like To Edit Your Log y/n"
answer=read()
if answer=="y" then
os.run edit log
end
if answer=="n" then
write "Would You Like To Shutdown"
answer=read()if answer=yes then
os.shutdown
end
if answer=no then
print ("Check This Page For The New Version Of DrumOS With A User Friendly Menu")
sleep(5)
tArgs = {...}
print "Now Booting CraftOS
end
end
Please Leave CommentsA Mining Will Be Uploaded Soon To Be Used With The DrumNET Turtles.I Could Use Some Help With Making A Menu Please Leave Your CommentsLink To Lumberjack Program
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
DrumOS V1.2
Started by Camwarp, 10 April 2013 - 01:19 AMPosted 10 April 2013 - 03:19 AM
My Very Simple Operating System That Has Login And Soon In Version 1.2 Networking.
Edited on 12 April 2013 - 07:52 AM
Posted 10 April 2013 - 03:31 AM
Im sorry but this will throw an error on line 10.
Lua is CaSe SeNsItIvE
Lua is CaSe SeNsItIvE
Posted 10 April 2013 - 03:33 AM
Thanks Its Fixed NowIm sorry but this will throw an error on line 10.
Lua is CaSe SeNsItIvE
Posted 10 April 2013 - 03:34 AM
print "Your Terminal Is Waiting"
should be
print ("Your Terminal Is Waiting")
Posted 10 April 2013 - 03:37 AM
Thanks Its Fixedshould beprint "Your Terminal Is Waiting"
print ("Your Terminal Is Waiting")
Posted 10 April 2013 - 03:39 AM
Actually it doesn't need to be… if a function is being passed one argument and it is a string, it is perfectly valid to not have the brackets surrounding the string…should beprint "Your Terminal Is Waiting"
print ("Your Terminal Is Waiting")
Posted 10 April 2013 - 03:41 AM
I Thought So To I've Done A Program Like iT Before
Posted 10 April 2013 - 03:48 AM
Actually it doesn't need to be… if a function is being passed one argument and it is a string, it is perfectly valid to not have the brackets surrounding the string…
Well learned something new today.
However constancy in how you write you code is still a good general practice.
Posted 10 April 2013 - 07:09 AM
Here, I made a function which checks for modems on the sides and opens them.
so to use it just write open() in your code instead of rednet.open("right").
function open()
local side = rs.getSides()
for i=1, #side do
typ = peripheral.getType(side[i])
if typ == "modem" then
modempos = side[i]
end
end
rednet.open(modempos)
end
so to use it just write open() in your code instead of rednet.open("right").
Posted 10 April 2013 - 07:30 AM
Some minor improvements to the codeHere, I made a function which checks for modems on the sides and opens them.function open() local side = rs.getSides() for i=1, #side do typ = peripheral.getType(side[i]) if typ == "modem" then modempos = side[i] end end rednet.open(modempos) end
so to use it just write open() in your code instead of rednet.open("right").
local function openAll()
for _,side in pairs(rs.getSides()) do
if peripheral.getType(side) == "modem" then
rednet.open(side)
return true
end
end
return false
end
this will return true if a modem has been opened and false if it hasn't. this means you can use this return value to tell the user off when there is no modem attached…Posted 10 April 2013 - 07:35 AM
Here, I made a function which checks for modems on the sides and opens them.function open() local side = rs.getSides() for i=1, #side do typ = peripheral.getType(side[i]) if typ == "modem" then modempos = side[i] end end rednet.open(modempos) end
so to use it just write open() in your code instead of rednet.open("right").
Thanks Both Of You Your Good HelpSome minor improvements to the codeHere, I made a function which checks for modems on the sides and opens them.function open() local side = rs.getSides() for i=1, #side do typ = peripheral.getType(side[i]) if typ == "modem" then modempos = side[i] end end rednet.open(modempos) end
so to use it just write open() in your code instead of rednet.open("right").this will return true if a modem has been opened and false if it hasn't. this means you can use this return value to tell the user off when there is no modem attached…local function openAll() for _,side in pairs(rs.getSides()) do if peripheral.getType(side) == "modem" then rednet.open(side) return true end end return false end
Posted 10 April 2013 - 09:53 PM
You haven't ran the openAll function just declared it
Posted 11 April 2013 - 05:10 AM
I don't Know what u meanYou haven't ran the openAll function just declared it
Posted 11 April 2013 - 06:00 AM
You need a
openAll()
in your code, or it won't run the code in the function.Posted 11 April 2013 - 06:39 AM
Ok Thanks I Havent Really Messed With These ThingsYou need ain your code, or it won't run the code in the function.openAll()
Posted 11 April 2013 - 07:10 AM
^^ You have to put the "openAll()" outside of the function.
Posted 11 April 2013 - 12:50 PM
Looks to short, please for your next release of this add a lot more.
Posted 12 April 2013 - 02:34 AM
OkLooks to short, please for your next release of this add a lot more.
Posted 12 April 2013 - 04:06 AM
Haha, do this:
local function openAll()
for _,side in pairs(rs.getSides()) do
if peripheral.getType(side) == "modem" then
rednet.open(side)
return true
end
end
return false
end
openAll()
Posted 12 April 2013 - 09:23 AM
Fixed It ThanksHaha, do this:local function openAll() for _,side in pairs(rs.getSides()) do if peripheral.getType(side) == "modem" then rednet.open(side) return true end end return false end openAll()