Advertisement
Guest User

life.exe

a guest
Aug 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.89 KB | None | 0 0
  1. calculator = function()
  2.  term.setBackgroundColor(colors.red)
  3.  term.clear()
  4.  term.setCursorPos(1,1)
  5.  print(name..",")
  6.  sleep(1.5)
  7.  term.setCursorPos(12,7)
  8.  print("Your percentage of life is:")
  9.  sleep(2)
  10.  percentage = math.random(1,100)
  11.  term.setCursorPos(24,8)
  12.  if percentage >= 10 then
  13.   print(percentage.."%")
  14.  else
  15.   print("0"..percentage.."%")
  16.  end
  17.  sleep(1)
  18.  term.setCursorPos(13,9)
  19.  if percentage == 0 then
  20.   print("How are you even playing?")
  21.  end
  22.  if percentage >= 1 then
  23.   if percentage <= 20 then
  24.    print("You need to get a life...")
  25.   end
  26.  end
  27.  if percentage >= 21 then
  28.   if percentage <= 50 then
  29.    print("Not good but also not bad")
  30.   end
  31.  end
  32.  if percentage >= 51 then
  33.   if percentage <= 80 then
  34.    print("Wow that's pretty good!!!")
  35.   end
  36.  end
  37.  if percentage >= 81 then
  38.   if percentage <= 99 then
  39.     print("      I envy you...      ")
  40.    end
  41.   end
  42.  if percentage == 100 then
  43.   print("Why are you even playing?")
  44.  end
  45.  sleep(5)
  46. end
  47.  
  48. typename = function()
  49.  term.clear()
  50.  term.setCursorPos(18,7)
  51.  print("Insert your name")
  52.  term.setCursorPos(13,10)
  53.  term.setBackgroundColor(colors.black)
  54.  print("                          ")
  55.  term.setCursorPos(13,10)
  56.  while true do
  57.   name = read()
  58.   if name == "aleroqu" then
  59.    term.setBackgroundColor(colors.black)
  60.    term.clear()
  61.    term.setCursorPos(1,1)
  62.    print("holy shit nibba you're me gtfo")
  63.    sleep(1)
  64.    os.shutdown()
  65.   else
  66.    return
  67.   end
  68.  end
  69. end
  70.  
  71. term.setBackgroundColor(colors.red)
  72. term.clear()
  73. term.setCursorPos(19,8)
  74. print("Life Calculator")
  75. term.setCursorPos(13.5,9)
  76. print("Click anywhere to continue")
  77. x,y = term.getSize()
  78. term.setCursorPos(1,y)
  79. print("Made by aleroqu")
  80. while true do
  81.  if os.pullEvent("mouse_click") then
  82.   typename()
  83.   calculator()
  84.   term.setBackgroundColor(colors.black)
  85.   term.clear()
  86.   term.setCursorPos(1,1)
  87.   return
  88.  else
  89.   sleep(.01)
  90.  end
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement