This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Dustmuz's profile picture

help with an idea.. Prison

Started by Dustmuz, 24 September 2014 - 04:59 PM
Dustmuz #1
Posted 24 September 2014 - 06:59 PM
hey there again fellow Crafters

now, i have moved on to some more "practical" uses for my programming, as my girlfriend came with the idea of making a prison, with cells and all that stuff..

now, to save myself from having to run 10000 network cables, i was thinking the following.


at each door, have an advanced computer, with a wireless modem.
have a control room, with 1 computer aswell, also with a wireless modem..

now.. heres where i need the help..

1:how do i get the wireless modems to talk to eachother, ALL of them.. on the same channel..

2:would it be possible to make a program on the "control" computer, that can send a signal, to a certain computer, to open/close the door
example would be, that you on the control comp wrote "open cell 2" then cells 2 computer would open, and not any other.. ***

*** for this, would it require different programs on ALL the door computers, or could i make 1, and copy it, and just change the "name" of the computer???
KingofGamesYami #2
Posted 24 September 2014 - 07:19 PM
Now, why would you want them to all be on the same channel? What's wrong with multiple channels? I would recommend looking at the modem api.

Also, as to naming them, you can get the computer label from within a program.

I would think the cells would be something like this:

os.pullEvent = os.pullEventRaw() --#so nobody can terminate it
local label = os.getComputerLabel()
while true do
  local event = { os.pullEvent() }
  if event[ 1 ] == "modem_message" and event[ 5 ] == label then
    rs.setOutput( "side", true ) --#change side to whatever side the door is on
    sleep( 1 )
    rs.setOutput( "side", false )  --#also change side
  end
end
Dustmuz #3
Posted 24 September 2014 - 07:34 PM
have tried the modem thingy, but that didnt work out so well for me on the wireless modems :D/> hehe..
worked fine for the wired one though :)/>
might just be me, that does something wrong. but do they work "exactly" the same, except one is with cable other is not?

now that code would have taken me 4 days, 6 hours, and maybe 4 times help from this community.
so thaaanks :D/>
KingofGamesYami #4
Posted 24 September 2014 - 08:15 PM
have tried the modem thingy, but that didnt work out so well for me on the wireless modems :D/> hehe..
worked fine for the wired one though :)/>
might just be me, that does something wrong. but do they work "exactly" the same, except one is with cable other is not?

now that code would have taken me 4 days, 6 hours, and maybe 4 times help from this community.
so thaaanks :D/>

The only difference between wired and wireless is wireless cannot connect to peripherals and does not need cable.

Edit: Also, as Bomb Bloke pointed out, wireless modems do have a range limit.

It starts at 64 meters (64 blocks) and extends the farther up you place the modem. 384 meters is the max distance, at block 256.
Edited on 24 September 2014 - 10:03 PM
Bomb Bloke #5
Posted 24 September 2014 - 11:50 PM
There's also the question of range.
applesauce10189 #6
Posted 25 September 2014 - 11:58 AM
There's also the question of range.
Well, quick solution to that if range happens to be a problem, have a little underground network of computers, the main one will still be the one in control, but underground computers can serve as messengers to the computers out of range