5 posts
Posted 03 September 2012 - 02:33 AM
Hey if you could help that would be amazing!
i want to have a computer that is conected to others so that i can run there startup projects by choosing them in a menu…
like:
Witch comuter would you like to run: (computer ip )
Thankyou
318 posts
Location
Somewhere on the planet called earth
Posted 03 September 2012 - 06:39 AM
Set the other computer in rednet.recive modus, then do rednet send and a command, store that in a var in the other computers. and do an if statement with it.
computerid: 2 ways: Store in a var: s
id = os.computerID()
print it: print(os.computerID))
5 posts
Posted 03 September 2012 - 08:02 AM
Thankyou for your help
But sadly l don't exactly get what you mean, I'm new so all the terms don't mean much, i get the concept but not how to do it…
thx tho
sorry for being a noob =)
10 posts
Posted 03 September 2012 - 03:35 PM
Do you need the modem on both devices to connect the computers? Or you must use some kind of cable?
318 posts
Location
Somewhere on the planet called earth
Posted 03 September 2012 - 04:27 PM
You need modems on both computers, making an example code now.
I have yet to make the reciving computers program., but here is the senders one:
Spoiler
programs = {}
programs[1] = worms(1)
programs[2] = help(2)
programs[3] = shutdown(3)
mSides = {}
mSides[1] = left
mSides[2] = right
mSides[3] = top
mSides[4] = down
mSides[5] = front
mSides[6] = back
while true do
for open = 1, #mSides do
rednet.open(mSides[open9])
end
print(os.computerID)
print("That is my id")
write("Enter reciving computers id here: ")
to = tonumber(read())
term.clear()
term.setCursorPos(1, 1)
print("The number in the ()'s are what you type to do it")
for i = 1, #programs do
print(programs[i])
end
write("What command do you want other computer to run: ")
do = read()
if do == "1" then
rednet.send(to, "1")
elseif do == "2" then
rednet.send(to, "2")
elseif do == "3" then
rednet.send(to, "3")
end
end
Reciving computer:
Spoiler
while true do
sender, cmd, junk = rednet.recive()
if cmd == "1" then
shell.run("worms") --Do as stated below
elseif cmd == "2" then
shell.run("help") --Do as stated below
elseif cmd == "3" then
shell.run("shutdown") --REplace shutdown with program name
end
end
5 posts
Posted 03 September 2012 - 06:35 PM
Thankyou so much this was very helpful!