Advertisement
NanoBob

Rules

Jul 18th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. if fs.exists("events")==false then
  2.     shell.run("pastebin get bmKBU4Rv events")
  3. end
  4. os.loadAPI("events")
  5.  
  6. if fs.exists("button")==false then
  7.     shell.run("pastebin get hbeLn1ni button")
  8. end
  9. os.loadAPI("button")
  10.  
  11. button.setMonitorSide("top")
  12. button.setBackgroundColor(256)
  13. local monitor=peripheral.wrap("top")
  14.  
  15. function switchTab(bool,buttonID,buttonText)
  16.     for bID,text in pairs(ruleTabs) do
  17.         if bID~=buttonID then
  18.             button.setButtonInfo(bID,"active",false)
  19.         end
  20.     end
  21.     button.drawAllButtons()
  22.     local strings=ruleTabs[buttonID]
  23.     monitor.setBackgroundColor(256)
  24.     for id,text in ipairs(strings) do
  25.         monitor.setCursorPos(3,4+id)
  26.         monitor.write(text)
  27.     end
  28. end
  29.  
  30. ruleTabs={
  31.     [button.addButton(1,1,15,3,"Griefing",switchTab,true,false,128,256)]={"Any way of griefing is strictly forbidden.","This includes using machines to destroy blocks.","Griefing will be punished severly.","You have been warned."},
  32.     [button.addButton(16,1,15,3,"Chunk Loading",switchTab,true,false,128,256)]={"Chunk loading can lag the server quite a bit.","To avoid server lag you are only","Allowed to use personal anchors to load your chunks"},
  33.     [button.addButton(31,1,15,3,"PvP",switchTab,true,false,128,256)]={"You are allowed to kill other players in the game.","However refrain from continuously","(spawn) killing the same person."},
  34.     [button.addButton(46,1,16,3,"Machines",switchTab,true,false,128,256)]={"You have to try and prevent your machines","From creating a lot of server lag","If an admin tells you your machine is too laggy","You have to improve it, or an admin can remove it"},
  35. }
  36.  
  37. while true do
  38.     events.handleCCEvents()
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement