Clem105

THE GAME Right Monitor

Sep 28th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.79 KB | None | 0 0
  1. isThereOnlyOne = true
  2. isNewPlayer = false
  3. isOnHunt = false
  4. modem = peripheral.wrap("right")
  5. modem.open(105)
  6. RightMonitor = peripheral.wrap("top")
  7.  
  8. function Title()
  9.     RightMonitor.setBackgroundColor(colors.black)
  10.     RightMonitor.setCursorPos(8,1)
  11.     RightMonitor.setTextColor(colors.white)
  12.     RightMonitor.write("Engage there for the glory")
  13.     RightMonitor.setCursorPos(15,3)
  14.     RightMonitor.write("of ")
  15.     RightMonitor.setTextColor(colors.red)
  16.     RightMonitor.write("Boethiah")
  17. end
  18.  
  19.  
  20.  
  21.  
  22.  
  23. function PanelRight()
  24.     os.loadAPI("touch")
  25.     local button = touch.new("top")
  26.     if not isThereOnlyOne then
  27.         buttonName = {
  28.     "                     ",
  29.     "                     ",
  30.     "                     ",
  31.     "        Leave !      ",
  32.     "                     ",
  33.      "  Boethiah is though ",
  34.     "  against the cowards",
  35.     "                     ",
  36.     "                     ",
  37.     "                     ",
  38.     label = "mButton"}
  39.     elseif isNewPlayer then
  40.         buttonName = {
  41.     "                     ",
  42.     "                     ",
  43.     "                     ",
  44.     "     Subscribe !     ",
  45.     "                     ",
  46.      "   Spread the blood  ",
  47.     " All around the world",
  48.     "                     ",
  49.     "                     ",
  50.     "                     ",
  51.     label = "mButton"}
  52.     elseif isOnHunt then
  53.         buttonName = {
  54.     "                     ",
  55.     "                     ",
  56.     "                     ",
  57.     " Claim your rewards !",
  58.     "                     ",
  59.     "  Boethiah is yours  ",
  60.     "                     ",
  61.     "                     ",
  62.     "                     ",
  63.     label = "mButton"}
  64.     else
  65.         buttonName = {
  66.     "                     ",
  67.     "                     ",
  68.     "                     ",
  69.     "         GO !        ",
  70.     "                     ",
  71.     "   The hunt is on    ",
  72.     "                     ",
  73.     "                     ",
  74.     "                     ",
  75.     label = "mButton"}
  76.     end
  77.     button:add(buttonName,nil,10,10,30,16)
  78.     button:draw()
  79.     Title()
  80.     while true do
  81.         local event,p1,_,p3,p4 = button:handleEvents(os.pullEvent())   
  82.         if event == "button_click" then
  83.             button:flash(p1,0.5)
  84.             Title()
  85.             if isThereOnlyOne then
  86.                 modem.transmit(105,1,"Click")
  87.             end
  88.             sleep(2)
  89.         elseif event == "modem_message" and p3 == 2 then
  90.             t = textutils.unserialize(p4)
  91.             if t[1] == "isThereOnlyOne" then
  92.                 isThereOnlyOne = t[2]
  93.             elseif t[1] == "isNewPlayer" then
  94.                 isNewPlayer = t[2]
  95.             elseif t[1] == "isOnHunt" then
  96.                 isOnHunt = t[2]
  97.             end
  98.             if not isThereOnlyOne then
  99.                     buttonName = {
  100.                 "                     ",
  101.                 "                     ",
  102.                 "                     ",
  103.                 "        Leave !      ",
  104.                 "                     ",
  105.                 "  Boethiah is though ",
  106.                 "  against the cowards",
  107.                 "                     ",
  108.                 "                     ",
  109.                 "                     "}
  110.             elseif isNewPlayer then
  111.                     buttonName = {
  112.                 "                     ",
  113.                 "                     ",
  114.                 "                     ",
  115.                 "     Subscribe !     ",
  116.                 "                     ",
  117.                 "   Spread the blood  ",
  118.                 " All around the world",
  119.                 "                     ",
  120.                 "                     ",
  121.                 "                     "}
  122.             elseif isOnHunt then
  123.                     buttonName = {
  124.                 "                     ",
  125.                 "                     ",
  126.                 "                     ",
  127.                 " Claim your rewards !",
  128.                 "                     ",
  129.                 "  Boethiah is yours  ",
  130.                 "                     ",
  131.                 "                     ",
  132.                 "                     "}
  133.             else
  134.                     buttonName = {
  135.                 "                     ",
  136.                 "                     ",
  137.                 "                     ",
  138.                 "         GO !        ",
  139.                 "                     ",
  140.                 "   The hunt is on    ",
  141.                 "                     ",
  142.                 "                     ",
  143.                 "                     "}
  144.             end
  145.             button.buttonList["mButton"].label = buttonName
  146.             button:draw()
  147.             Title()
  148.         end
  149.     end
  150. end
  151.  
  152. PanelRight()
Advertisement
Add Comment
Please, Sign In to add comment