TNT_Nolan

TNTAPI 0.2Alpha

Apr 12th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. --TNT_Nolan's API
  2.  
  3. function easyClear(coloru, x, y)
  4. term.setTextColor(coloru)
  5. term.setCursorPos(x,y)
  6. end
  7.  
  8. function easyTextwColor(coloru, text, mode)
  9. term.setTextColor(coloru)
  10. if mode == 1 then
  11. term.write(text)
  12. elseif mode == 2 then
  13. print(text)
  14. end
  15. end
  16.  
  17. function easyText(text, mode, x, y)
  18. term.setCursorPos(x,y)
  19. if mode == 1 then
  20. term.write(text)
  21. elseif mode == 2 then
  22. print(text)
  23. else
  24. term.setTextColor(colors.red)
  25. print("Mode 1 = term.write, Mode 2 = print")
  26. end
  27. end
  28.  
  29. function setScreen(x,y,backgroundcolor,textcolor)
  30. term.setBackgroundColor(backgroundcolor)
  31. term.clear()
  32. term.setCursorPos(x,y)
  33. term.setTextColor(textcolor)
  34. end
  35.  
  36. function waitForKey(key, keystring)
  37. print("Press the "..keystring.." to continue...")
  38. local event, key = os.pullEvent( "key" )
  39. if key == key then
  40. return
  41. end
  42. end
  43.  
  44. function waitKey()
  45. print("Press any key continue...")
  46. os.pullEvent("key")
  47. end
Advertisement
Add Comment
Please, Sign In to add comment