Advertisement
cenestral

spawn-comp

Feb 26th, 2015
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1.  
  2. rednet.open()
  3. --mon=peripheral.wrap("")
  4. rSideVill="bottom"
  5. rSideLamp="top"
  6. modem=peripheral.wrap("")
  7. selected=1
  8. turtleID=1
  9. rToggle=false
  10.  
  11. function posW(x,y,z,c)
  12. mon.setCursorPos(x,y)
  13. mon.setTextColor(c)
  14. mon.write(z)
  15. end
  16.  
  17. tbl={"Enderman","Creeper","Witch","Villager","Blaze","Cow","!Let them spawn!","!Lamp!"}
  18. --tbl2=textutils.unserialize(rednet.receive())
  19.  
  20. while true do
  21. for i=1,#tbl-2 do
  22. if selected~=i then
  23. posW(0,i,tbl[i],0xffffff)
  24. redstone.setOutput(rSideVill,false)
  25. elseif selected==i then
  26. posW(1,i,tbl[i],0xff0000)
  27. if selected==4 then
  28. redstone.setOutput(rSideVill,true)
  29. end
  30. end
  31. end
  32.  
  33.  
  34. posW(0,#tbl-1,tbl[#tbl-1],0x00ff00)
  35. posW(0,#tbl,tbl[#tbl],0xffff00)
  36.  
  37.  
  38. event, side, xPos, yPos = os.pullEvent("monitor_touch")
  39.  
  40. if yPos<=6 then
  41. selected=yPos
  42. elseif yPos==#tbl-1 then
  43. rednet.send(turtleID,yPos)
  44. elseif yPos==#tbl then
  45. redstone.setOutput(rSideLamp,(rToggle=not rToggle))
  46. posW(7,#tbl,rToggle,0xffff00)
  47. end
  48.  
  49.  
  50. sleep(.25)
  51. mon.clear()
  52.  
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement