Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ startup
- id="ZpfzEeat"
- loadstring(http.get("http://pastebin.com/raw.php?i=" .. id).readAll())()
- ]]--
- modem = false
- myChannel = 6635
- targetChannel = 6636
- for a,b in pairs(rs.getSides()) do
- if peripheral.getType(b) == 'modem' then
- print("Found modem on " .. b .. ", attaching to " .. myChannel)
- modem = peripheral.wrap(b)
- modem.open(myChannel)
- break
- end
- end
- print("Press W to move north, Z to move south, A to west, S to move east, E to move up and D to move down.")
- while true do
- local event, key = os.pullEvent("key") -- limit os.pullEvent to the 'key' event
- local tosend = false
- if key == keys.w then
- tosend = "move.north"
- elseif key == keys.z then
- tosend = "move.south"
- elseif key == keys.a then
- tosend = "move.west"
- elseif key == keys.s then
- tosend = "move.east"
- elseif key == keys.e then
- tosend = "move.up"
- elseif key == keys.d then
- tosend = "move.down"
- end
- if tosend then
- modem.transmit(targetChannel, myChannel, tosend)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement