1ng0

Computer Craft Redstone In Motion Controlls

Nov 15th, 2015
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.clear()
  2.  
  3. local inputTable = {[16] = 0, [17] = 2, [18] = 1, [30] = 4, [31] = 3, [32] = 5}
  4.  
  5. function movement()
  6.  term.setCursorPos(1,1)
  7.  print("WASD to control, Q = down, E = up")
  8.  while true do
  9.   local sEvent, par = os.pullEvent("key")
  10.    for k, v in pairs(inputTable) do
  11.    if(sEvent == "key") then
  12.     drive.move(inputTable[par], true, false)
  13.    end
  14.   end
  15.  end
  16. end
  17.  
  18. movement()
Add Comment
Please, Sign In to add comment