Jump to content




Controling A Base


  • You cannot reply to this topic
23 replies to this topic

#21 twormtwo

  • Members
  • 14 posts
  • LocationFlorida, USA

Posted 09 March 2014 - 04:40 PM

View PostCometWolf, on 09 March 2014 - 10:52 AM, said:

I've actually never tried to communicate along a wired network, so idk how that works. But generally the easiest way would just be using rednet.open and then rednet.broadcast, or rednet.send if you know the id of the receiver.
I've played around with wired networks, they seem to broadcast the information to all the computers connected along the wire, but because rednet opens a channel with the computer ID, it will only show on the computer with the correct ID when using rednet.send() and all the computers along the line with rednet.broadcast()
I used a computer along the line to send to the computers in the picture via rednet signals. I executed rednet.broadcast("hello") rednet.send(27, "hello") rednet.send(20, "hello") rednet.send(21, "hello") on another in line computer and the events were written to the screens.
Spoiler


#22 OReezy

  • Members
  • 91 posts

Posted 10 March 2014 - 04:43 AM

ModemAPI

You wrap the modem as a peripheral and use open(channel) to listen on a channel, and transmit(channel, replyChannel, message) to send messages on that channel.

local modem = peripheral.wrap("side")
modem.open(12) --opens channel 12
modem.transmit(20, 5, "hello") -- sends on channel 20, with a reply channel 5, and the message 'hello'

To catch messages you use os.pullEvent() which gives you:
  • event type (modem_message)
  • side your modem is on
  • channel
  • reply channel
  • message
  • distance

Edited by OReezy, 10 March 2014 - 04:47 AM.


#23 skwerlman

  • Members
  • 163 posts
  • LocationPennsylvania

Posted 10 March 2014 - 04:02 PM

Wired rednet is the same as wireless rednet.

#24 Dahknee

  • Members
  • 1,808 posts
  • Location/home/da

Posted 14 March 2014 - 12:49 PM

View PostWeaponMaster, on 06 March 2014 - 01:55 PM, said:

View PostDannySMc, on 06 March 2014 - 09:40 AM, said:

View PostWeaponMaster, on 01 March 2014 - 05:01 PM, said:

View PostUNOBTANIUM, on 01 March 2014 - 04:05 PM, said:

Hello :)

To your questions:
1. Yes this is possible. However you would have to make the map on your own and only pixel and text can change their colors. The pixel size is fairly big so your map wont be very detailed at all. It would be better with your gate names and a "Open"/"Closed" Symbol behind that.
The os.pullEvent() returns a numerous amount of input, including the "monitor_touch" event. This can be used to identify the position of the pixel you clicked on.

2. They did in the past and i am to 90% sure they still do.

3. The maximal distance is 384 blocks. I dont think rain or blocks are effecting this anymore.

4. http://computercraft.../wiki/Main_Page

5. http://computercraft...Peripheral_(API)
Interaction with the computer and another block.
ok, Thanks. I was planning to make the map pretty simple anyway. Do you know any tutorials for making a monitor map and menu easily?

View PostCometWolf, on 01 March 2014 - 04:15 PM, said:

Quote

3. The maximal distance is 384 blocks. I dont think rain or blocks are effecting this anymore.
The max distance is at max world height, and at the bottom of the world it's like 64. Thunderstormes do still affect this, and will reduce it to 16 blocks bottom level. To avoid these issues, you could use wired modems.

5. peripheral.wrap() is a function that creates a table(array) of all the functions acessible to a particulair peripheral, and returns this. It is commonly used to name a peripheral for the rest of your code, since you can wrap it to a variable of your choosing, then call it's functions with variable.function()

I plan to build a base underground, and with the monitor at roughly 32 blocks Y. I suppose this won't give me enough range for a base roughly 12x12 chunks, = around 200 blocks. Is it possible to have it send messages to a computer at 250 Y for it to be relayed around? Using wired modems is an option, but can multiple devices and computers be connected to the same cable coming from a main computer over long distance? I plan to control computers on the far ends of my base using that(the far off computers are for doors). Also, is there anyway to 'encrypt' a message so that others cannot send a false message to open my doors for them.

Thanks a lot,
Weapioneer

Yes this is possible would mean you would need to create some kind of protocol on how you will transmit data. Also taking into account that you will need to make sure all the relay computers don't form a square so you do not keep sending it around and around, lagging the computer and the serve(s). This protocol would have to include: ID to receive and the message. Using this you can make a simple protocol which will send the ID it needs to be sent to, and then sends the data after, you can also use the protocol to check it's own ID to the ID the message needs to reach. I have made this before for my own server. If you want I don't mind coding the protocol and the relay programs for you? Just email me or message me on here?
I was planning to use a satellite relay station, but i think just going with networking cable will be better. Could you help me modify the program so that either clicking on the player detector or receiving the message "open" will make it output redstone?

Thanks

Yeah I can do this, tell me when you're free I shall get you on my server, or on yours and you can skype me, and we can talk about what you need, cause I am not completely sure what you are looking for but I kind of understand.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users