MagmaLP

Trading City Willkommen

Jun 19th, 2021 (edited)
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.52 KB | None | 0 0
  1. side = "right"
  2. mon = peripheral.wrap(side)
  3. mon.setBackgroundColor(32768)
  4. mon.setTextScale(1)
  5. mon.clear()
  6.  
  7.  
  8. function calc_color(color)
  9.     return math.pow(2, color - 1)
  10. end
  11.  
  12. function msg(gap, line, color, groundb, text)
  13.     mon.setBackgroundColor(calc_color(groundb))
  14.     mon.setCursorPos(gap,line)
  15.     mon.setTextColor(calc_color(color))
  16.     text = mon.write(text)
  17. end  
  18.  
  19. function start()
  20.     msg(09,03,06,16,"Important informations, plese read")
  21.     msg(09,04,09,16,"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
  22.     msg(08,07,05,01,"             ")            msg(31,07,05,01,"             ")
  23.     msg(08,08,05,01,"             ")            msg(31,08,05,01,"             ")
  24.     msg(08,09,16,01,"   deutsch   ")            msg(31,09,16,01,"   english   ")
  25.     msg(08,10,05,01,"             ")            msg(31,10,05,01,"             ")
  26.     msg(08,11,05,01,"             ")            msg(31,11,05,01,"             ")
  27.     msg(08,12,05,16," ")
  28.  
  29.     event, side, x, y = os.pullEvent("monitor_touch")
  30.     if x >= 8 and x <= 20 and y >= 7 and y <= 11 then
  31.         mon.clear()
  32.         deutsch()
  33.     elseif x >= 31 and x <= 43 and y >= 7 and y <= 11 then
  34.         mon.clear()
  35.         english()
  36.     else
  37.         start()
  38.     end
  39. end
  40.  
  41. function deutsch()
  42.     msg(02,02,05,16,"Willkommen in Trading-City")
  43.     msg(02,03,05,16,"~~~~~~~~~~~~~~~~~~~~~~~~~~")
  44.     msg(02,05,15,16,"Rechter Seite:")
  45.     msg(02,06,04,16,"Diese Seite können nur Spieler nutzen welche")
  46.     msg(02,07,04,16,"der Stadt beigetreten sind. ")
  47.     msg(02,08,10,16,"/t join Trading")
  48.     msg(02,10,15,16,"Linke Seite:")
  49.     msg(02,11,04,16,"Diese Seite können alle Spieler nutzen, auch")
  50.     msg(02,12,04,16,"wenn diese nicht der Stadt beigetreten ist.")
  51.     msg(39,17,16,01,"            ")
  52.     msg(39,18,16,01,"   zurück   ")
  53.     msg(39,19,16,01,"            ")
  54.  
  55.     event, side, x, y = os.pullEvent("monitor_touch")
  56.     if x >= 39 and x <= 50 and y >= 17 and y <= 19 then
  57.         os.reboot()
  58.     else
  59.         deutsch()
  60.     end
  61. end
  62.  
  63. function english()
  64.     msg(2,2,05,16,"   Welcome to Trading-City  ")
  65.     msg(2,3,05,16,"   ~~~~~~~~~~~~~~~~~~~~~~~  ")
  66.     msg(02,05,15,16,"Right Side:")
  67.     msg(02,06,04,16,"This side can only be used by Players")
  68.     msg(02,07,04,16,"who joined the City. ")
  69.     msg(02,08,10,16,"/t join Trading")
  70.     msg(02,10,15,16,"Left Side:")
  71.     msg(02,11,04,16,"This side can be used by all players, also")
  72.     msg(02,12,04,16,"if they not joined the city")
  73.     msg(39,17,16,01,"            ")
  74.     msg(39,18,16,01,"    back    ")
  75.     msg(39,19,16,01,"            ")
  76.  
  77.     event, side, x, y = os.pullEvent("monitor_touch")
  78.     if x >= 39 and x <= 50 and y >= 17 and y <= 19 then
  79.         os.reboot()
  80.     else
  81.         english()
  82.     end
  83. end
  84.  
  85. start()
Advertisement
Add Comment
Please, Sign In to add comment