Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
component:modem [2015/05/03 09:22]
sulljason
component:modem [2023/04/09 02:54] (current)
bioscreeper Added "Also, calls to set the strength that exceed the installed modem's maximum strength will simply set the modem's strength to it's maximum." to modem.setStrength() documenation
Line 33: Line 33:
   //Wireless network cards only.//   //Wireless network cards only.//
 - `setStrength(value:​ number): number`  ​ - `setStrength(value:​ number): number`  ​
-  Sets the signal strength. If this is set to a value larger than zero, sending a message will also generate a wireless message. The higher the signal strength the more energy is required to send messages, though.+  Sets the signal strength. If this is set to a value larger than zero, sending a message will also generate a wireless message. ​Also, calls to set the strength that exceed the installed modem'​s maximum strength will simply set the modem'​s strength to it's maximum.  ​The higher the signal strength the more energy is required to send messages, though.
   //Wireless network cards only.//   //Wireless network cards only.//
 - `getWakeMessage():​string`  ​ - `getWakeMessage():​string`  ​
-  Gets the current wake-up message. +  Gets the current wake-up message. When the network card detects the wake message (a string in the first argument of a network packet), on any port and the machine is off, the machine is started. Works for robots, cases, servers, drones, and tablets. [[component:​tunnel|Linked Cards]] provide this same functionality
-- `setWakeMessage(message:​ string):​string` ​  +- `setWakeMessage(message:​ string, [fuzzy: boolean]):​string` ​  
-  Sets the wake-up message to the specified **string**.+  Sets the wake-up message to the specified **string**. The message matching can be fuzzy (default is false). A fuzzy match ignores additional trailing arguments in the network packet.
  
  
Line 58: Line 58:
 print(m.isOpen(123)) -- true print(m.isOpen(123)) -- true
 -- Send some message. -- Send some message.
-m.broadcast(321, "this is a test")+m.broadcast(123, "this is a test")
 -- Wait for a message from another network card. -- Wait for a message from another network card.
 local _, _, from, port, _, message = event.pull("​modem_message"​) local _, _, from, port, _, message = event.pull("​modem_message"​)