Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function openRednet()
- local listOfSides = rs.getSides()
- local listofPossibles = {}
- local counter1 = 0
- while true do
- counter1 = counter1 +1
- if peripheral.isPresent(tostring(listOfSides[counter1])) and peripheral.getType(listOfSides[counter1]) == "modem" then
- table.insert(listofPossibles,tostring(listOfSides[counter1]))
- end
- if counter1 == 6 and table.maxn(listofPossibles) == 0 then
- print("no modem present")
- return nil
- end
- if counter1 == 6 and table.maxn(listofPossibles) ~= 0 then
- rednet.open(listofPossibles[1])
- return listofPossibles[1]
- end
- end
- end
- modemOn = openRednet()
- if modemOn == nil then
- print("You are dumb (:")
- print("Will shutdown in 3 seconds")
- sleep(3)
- os.shutdown()
- else
- print("Opened modem on "..modemOn.." side")
- end
- rednet.send(19, "request")
- id, message = rednet.receive()
- print ("Reactor Computer " .. id .. " answered")
- print ("-" .. message .. " ")
- i, m = rednet.receive()
- print ("-" .. m .. " ")
- id2, m2 = rednet.receive()
- print ("-" .. m2 .. " ")
- os.sleep(4)
- term.clear()
- term.setCursorPos(1,1)
- error()
- -- This is some simple code i made to get information about a Big Reactor wireless using a Pocket computer.
- -- Place a computer with a wireless modem on the left side and the Computercraft Big Reactor port right behind it.
- -- UPDATE! you need to input the right computer IDs in both programs respectivly
- -- The Server computer program is at /AGq32UqZ
- -- Made by Dukrobber
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement