Advertisement
SirBaconBitz

startup

Jan 25th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. function one()
  2. sleep(0.1)
  3. data = sens.getPlayerData(name)
  4. loadstring(runit)
  5. print("loaded")
  6. print(value)
  7. valuetext.setText(value)
  8. print("set")
  9. end
  10. function two()
  11. os.pullEvent("chat_command")
  12. bacon = false
  13. print("event pulled")
  14. end
  15. sens = peripheral.wrap("left")
  16. terminal = peripheral.wrap("right")
  17. terminal.clear()
  18. namebox = terminal.addBox(10, 10, 75, 25, 0x00FFFF, 0.5)
  19. nametext = terminal.addText(12, 17, "placeholder", 0xFFFFFF)
  20. typebox = terminal.addBox(10, 40, 50, 15, 0x00FFFF, 0.5)
  21. valuebox = terminal.addBox(10, 60, 50, 15, 0x00FFFF, 0.5)
  22. typetext = terminal.addText(12, 45, "I'm not going to make the type work.", 0xFFFFFF)
  23. valuetext = terminal.addText(12, 65, "1", 0xFFFFFF)
  24. while true do
  25. local _, msg = os.pullEvent("chat_command")
  26. data = sens.getPlayerData(name)
  27. print(data.health)
  28. if string.find(msg, "name") then
  29. for word in msg:gmatch('%S+') do
  30. if word == "name" then
  31. print("nope")
  32. else
  33. name = word
  34. end
  35. end
  36. nametext.setText(name)
  37. print(name.."t")
  38. else
  39. end
  40. if string.find(msg, "typeset") then
  41. local pos = string.find(msg, " ")
  42. local type = string.sub(msg, 1, pos, -1)
  43. typetext.setText(type)
  44. end
  45. if string.find(msg, "value") then
  46. runit = msg
  47. end
  48. if msg == "loop" then
  49. bacon = true
  50. while bacon == true do
  51. parallel.waitForAny(function() one() end, function() return two() end)
  52. end
  53. end
  54.  
  55.  
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement