Advertisement
MagmaLP

Item-Wert_PC_Language_Selection

Apr 23rd, 2022 (edited)
1,260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. function calc_color(color)
  2.     return math.pow(2, color - 1)
  3. end
  4.  
  5. function msg(gap, line, color, groundb, text)
  6.     term.setBackgroundColor(calc_color(groundb))
  7.     term.setCursorPos(gap,line)
  8.     term.setTextColor(calc_color(color))
  9.     text = term.write(text)
  10. end
  11.  
  12. msg(01,04,09,16,"This computer calculates a guide value for")
  13. msg(01,05,09,16,"items that you can trade.")
  14.  
  15. msg(01,07,08,16,"---------------------------------------------------")
  16. msg(13,08,01,15,"           ") msg(29,08,01,15,"           ")
  17. msg(13,09,01,15,"           ") msg(29,09,01,15,"           ")
  18. msg(13,10,01,15,"  English  ") msg(29,10,01,15,"  Deutsch  ")
  19. msg(13,11,01,15,"           ") msg(29,11,01,15,"           ")
  20. msg(13,12,01,15,"           ") msg(29,12,01,15,"           ")
  21. msg(01,13,08,16,"---------------------------------------------------")
  22.  
  23. msg(01,15,09,16,"Dieser Computer rechnet dir Richtwerte aus")
  24. msg(01,16,09,16,"für Items, die du tauschen kannst.")
  25.  
  26. local event, button, X, Y = os.pullEvent("mouse_click")
  27. if X >= 13 and X <= 23 and Y >= 8 and Y <= 12 then
  28.     shell.run("english")
  29. elseif X >= 29 and X <= 39 and Y >= 8 and Y <= 12 then
  30.     shell.run("deutsch")
  31. else
  32.     os.reboot()
  33. end
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement