38 posts
Location
Massachusetts USA
Posted 09 April 2016 - 07:14 PM
is there anyway i could compact this down?
just this the other 2 launched by multi-shell are irrelevant
multishell.launch({}, "Debug", 100)
multishell.launch({}, "Input", 1)
multishell.setTitle(multishell.getCurrent(), "Keep On")
while true do
c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11 = peripheral.find("computer")
c1.turnOn()
c2.turnOn()
c3.turnOn()
c4.turnOn()
c5.turnOn()
c6.turnOn()
c7.turnOn()
c8.turnOn()
c9.turnOn()
c10.turnOn()
c11.turnOn()
sleep(1)
end
8543 posts
Posted 09 April 2016 - 07:18 PM
local function on(_, comp)
comp.turnOn()
end
while true do
peripheral.find("computer", on)
sleep(1)
end
38 posts
Location
Massachusetts USA
Posted 10 April 2016 - 11:17 AM
local function on(_, comp)
comp.turnOn()
end
while true do
peripheral.find("computer", on)
sleep(1)
end
the computers are not turning on…
2427 posts
Location
UK
Posted 10 April 2016 - 02:44 PM
is the red light on for each modem?
38 posts
Location
Massachusetts USA
Posted 10 April 2016 - 03:38 PM
yes
is the red light on for each modem?
18 posts
Posted 10 April 2016 - 03:44 PM
Something like this might do to shorten the while loop.
It puts all the computers it can find into a table, then runs though the table and turns all the computers on. This gets rid of all the variables you used and does not limit to 11 computers, too.
while true do
local t = {peripheral.find("computer")}
for i = 1,#t do
t[i].turnOn()
end
sleep(1)
end
Edit: Some typing errors, coded in editor
Edited on 10 April 2016 - 01:46 PM
3057 posts
Location
United States of America
Posted 10 April 2016 - 04:07 PM
Does the original code work when Lyqyd's does not?
7083 posts
Location
Tasmania (AU)
Posted 10 April 2016 - 11:26 PM
It does the same thing, so all other things being equal, it won't.