The slave program is meant to be run on a normal computer with a wireless modem attached. It can be called with the api, and will also generate a spoof event. This means the program will generate events that happened to the slave on the master program. WARNING: This has not been tested with other programs that overwrite os.pullEventRaw! It takes 3 command line arguments:
wpslave <channela> <channelb> <modem_side>
The api is meant to be run on a (wireless) pocket computer, but it will also run just fine on a computer (if they wireless modem is placed on the back). It contains just two functions:
<variable> = wp.wrap(<side> <channela> <channelb>) wp.setModem(<side>) --#note that by default, the modem is set on the back. I have included this override if you wish to place the modem on a different side.
Note that if you want, you can wrap a peripheral on multiple slaves. For instance, you could have a computer for your door and a computer for your monitor, and be handling both with a third computer, or a (wireless) pocket computer.
pastebin get TgHFHwkH slave
pastebin get eQkJhzG2 wp
Note: if you attempt to catch a peripheral event such as monitor_touch, the program will never return a value. If anyone knows how I could fix this, I would appreciate the help. Instead, use something similar to this code:
local event
while true do
event = {os.pullEvent()}
if event[1] == "monitor_touch" then
break
end
end
Edited by KingofGamesYami, 09 May 2014 - 12:41 PM.












