Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local commands = {42, 57, 200, 203, 205, 208}
- local nums = {0, 1, 3, 5, 4, 2}
- local p = peripheral.wrap("bottom")
- local function contains(keycode)
- keycode = tonumber(keycode)
- for i=1,#commands do
- if (keycode==commands[i]) then
- return i
- end
- end
- return -1
- end
- while true do
- local event, keycode, _ = os.pullEvent("key")
- local index = contains(keycode)
- if (index~=-1) then
- p.move(nums[index], false, false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement