superanonymous

djclient (touch) (no more bg!!!)

May 17th, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.53 KB | None | 0 0
  1. ----Custimization variables----
  2.  
  3. computerID=1626  --The ID of the turtle DJ server
  4.  
  5. -------------------------------
  6.  
  7. sendmsg=""
  8.  
  9. --To run on a monitor, paste this into an empty file: 'shell.run("monitor","top","djclient")'
  10. --Run that file and it works!!!
  11.  
  12. --Credit to Freack100 for automatic rednet finder!--
  13. for k,v in pairs(rs.getSides()) do
  14. if peripheral.isPresent(v) then
  15. if peripheral.getType(v) == "modem" then
  16. rednet.open(v)
  17. end
  18. end
  19. end
  20.  
  21. orange=colors.orange
  22. black=colors.black
  23. lime=colors.lime
  24. function centerprint(text)
  25. local x,y = term.getSize()
  26. local x2,y2 = term.getCursorPos()
  27. term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
  28. write(text)
  29. term.setCursorPos(1,y2+1)
  30. end
  31. function line(linenum,color)
  32. local x,y = term.getSize()
  33. paintutils.drawLine(1,linenum,x,linenum,color)
  34. end
  35. function color(color2)
  36. term.setBackgroundColor(color2)
  37. end
  38. function play(disk)
  39. rednet.send(computerID,disk)
  40. end
  41. while not term.isColor() do
  42. term.clear()
  43. term.setCursorPos(1,1)
  44. print("DJMix OS 3.0")
  45. print("Choices: 13, cat, blocks, chirp, far, mall, mellohi, stal, strad, ward, 11, and wait")
  46. print("Type song name here: (spelling counts)")
  47. sendmsg=read()
  48. if sendmsg=="exit" then break end
  49. rednet.send(computerid,sendmsg)
  50. end
  51. if term.isColor() then
  52. line(1,lime)
  53. line(2,lime)
  54. line(3,lime)
  55. line(4,orange)
  56. line(5,black)
  57. line(6,orange)
  58. line(7,black)
  59. line(8,orange)
  60. line(9,black)
  61. line(10,orange)
  62. line(11,black)
  63. line(12,orange)
  64. line(13,black)
  65. line(14,orange)
  66. line(15,black)
  67. line(16,orange)
  68. line(17,lime)
  69. line(18,lime)
  70. line(19,lime)
  71. term.setCursorPos(1,4)
  72. color(orange)
  73. centerprint("13")
  74. color(black)
  75. centerprint("cat")
  76. color(orange)
  77. centerprint("blocks")
  78. color(black)
  79. centerprint("chirp")
  80. color(orange)
  81. centerprint("far")
  82. color(black)
  83. centerprint("mall")
  84. color(orange)
  85. centerprint("mellohi")
  86. color(black)
  87. centerprint("stal")
  88. color(orange)
  89. centerprint("strad")
  90. color(black)
  91. centerprint("ward")
  92. color(orange)
  93. centerprint("11")
  94. color(black)
  95. centerprint("wait")
  96. color(orange)
  97. centerprint("stop")
  98. end
  99. while term.isColor() do
  100. event,button,x,y=os.pullEvent("mouse_click")
  101. if y==4 then play("13") end
  102. if y==5 then play("cat") end
  103. if y==6 then play("blocks") end
  104. if y==7 then play("chirp") end
  105. if y==8 then play("far") end
  106. if y==9 then play("mall") end
  107. if y==10 then play("mellohi") end
  108. if y==11 then play("stal") end
  109. if y==12 then play("strad") end
  110. if y==13 then play("ward") end
  111. if y==14 then play("11") end
  112. if y==15 then play("wait") end
  113. if y==16 then play("stop") end
  114. sleep(0.2)
  115. end
Advertisement
Add Comment
Please, Sign In to add comment