Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local channel = 0
- local sSide = "back"
- -- Get Channel Number
- print("What channel?")
- channel = tonumber(read())
- -- Connect
- print("Connecting to "..channel)
- rednet.open(sSide)
- rednet.send(channel, "Init")
- local id, msg = rednet.receive(1)
- if not msg or id ~= channel then
- print("Could not connect")
- return
- end
- -- Print commands
- print("Commands:")
- print("Q - Disconnect/Quit")
- print("WASD - Move/Turn")
- print("Space- Move Up")
- print("Shift- Move Down")
- print("Y - Mine Up")
- print("H - Mine")
- print("N - Mine Down")
- print("U - Place Up")
- print("J - Place")
- print("M - Place Down")
- -- Program Loop
- while true do
- local event, sc = os.pullEvent("key")
- if sc == keys.q then
- rednet.send(channel, sc)
- print("Closing")
- rednet.close(sSide)
- return
- elseif sc == keys.k or
- sc == keys.w or
- sc == keys.a or
- sc == keys.s or
- sc == keys.d or
- sc == keys.space or
- sc == keys.leftCtrl or
- sc == keys.up or
- sc == keys.left or
- sc == keys.down or
- sc == keys.i or
- sc == keys.j then
- rednet.send(channel, sc)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement