MudkipTheEpic

Key API

Jan 8th, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. function queueWord(lol)
  2. local r = 1
  3. if lol == nil then
  4. return false
  5. end
  6. num = tonumber(string.len(lol))
  7. if num == nil then
  8. return false
  9. end
  10. for i=1, num do
  11. local currentletter = string.sub(lol, r, r)
  12. os.queueEvent("char", currentletter)
  13. r = r + 1
  14. end
  15. end
  16. function queueEntry(lol)
  17. local r = 1
  18. if lol == nil then
  19. return false
  20. end
  21. num = tonumber(string.len(lol))
  22. if num == nil then
  23. return false
  24. end
  25. for i=1, num do
  26. local currentletter = string.sub(lol, r, r)
  27. os.queueEvent("char", currentletter)
  28. r = r + 1
  29. end
  30. os.queueEvent("key", 28)
  31. end
  32. function tokey(stringchar)
  33. return keys[stringchar] or false
  34. end
  35. function tochar(numkey)
  36. return keys.getName(numkey) or false
  37. end
Advertisement
Add Comment
Please, Sign In to add comment