koenkoe

settings

Mar 21st, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.11 KB | None | 0 0
  1. setcolor = colors.white
  2. timings = 0
  3. black = colors.black
  4. function back()
  5.     term.setBackgroundColor(setcolor)
  6. end
  7. back()
  8. term.clear()
  9. term.setTextColor(black)
  10.  
  11. settings()
  12.  
  13. while true do
  14.     local event, button, X, Y = os.pullEventRaw()
  15.     if event == "mouse_click" then
  16.         if X >=1 and X <=29 and button == 1 and Y== 3 then
  17.             makelogin()
  18.             term.setBackgroundColor(222)
  19.             cp(20,7)
  20.             print("Change username")
  21.             term.setBackgroundColor(555)
  22.             cp(20,9)
  23.             print("New username?")
  24.             cp(20,10)
  25.             newu = read()
  26.             makelogin()
  27.             cp(20,7)
  28.             term.setBackgroundColor(222)
  29.             print("Change password")
  30.             term.setBackgroundColor(555)
  31.             cp(20,9)
  32.             print("New password?")
  33.             cp(20,10)
  34.             newp = read()
  35.             settings()
  36.             fs.delete("OS/account1")
  37.             fs.delete("OS/account1ww")
  38.             nu = fs.open("OS/account1", "w")
  39.             nu.write(newu)
  40.             nu.close()
  41.             np = fs.open("OS/account1ww", "w")
  42.             np.write(newp)
  43.             np.close()
  44.             sleep(2)
  45.             settings()
  46.         elseif X >=1 and X <=18 and button == 1 and Y== 9 then
  47.             fs.delete("Paints/.background")
  48.             shell.run("paint", "Paints/.background")
  49.             if not fs.exists("Paints/.background") then
  50.                 clear()
  51.                 print("You need to save it")
  52.                 sleep(2)
  53.                 shell.run("pastebin", "get", "uGKhyZTw", "Paints/.background")
  54.                 clear()
  55.             end
  56.             if not fs.exists("Paints/.background") then
  57.                 clear()
  58.                 print("You need to save it.")
  59.                 term.setCursorPos(1,2)
  60.                 print("Couldnt connect to the internet!")
  61.                 sleep(4)
  62.                 settings()
  63.             end
  64.             settings()
  65.         elseif X >=1 and X <=18 and button == 1 and Y== 11 then
  66.             shell.run("pastebin", "get", "uGKhyZTw", "internettest")
  67.             settings()
  68.             if not fs.exists("internettest") then
  69.                 clear()
  70.                 print("Couldn't connect to the internet")
  71.                 fs.delete("internettest")
  72.                 sleep(3)
  73.             else
  74.                 fs.delete("Paints/.background")
  75.                 fs.delete("internettest")
  76.                 shell.run("pastebin", "get", "uGKhyZTw", "Paints/.background")
  77.             end
  78.             settings()
  79.         elseif X >=1 and X <=29 and button == 1 and Y== 5 then
  80.             change = fs.open("OS/loginonof", "r")
  81.             onf = change.readLine(1)
  82.             change.close()
  83.             if onf == "off" then
  84.                 fs.delete("OS/loginonof")
  85.                 ch = fs.open("OS/loginonof", "w")
  86.                 ch.write("on")
  87.                 ch.close()
  88.             elseif onf == "on" then
  89.                 fs.delete("OS/loginonof")
  90.                 chf = fs.open("OS/loginonof", "w")
  91.                 chf.write("off")
  92.                 chf.close()
  93.             end
  94.             settings()
  95.         elseif X>=1 and X<=4 and Y== 15 and button ==1 then
  96.             shell.run("System/Desktop")
  97.         elseif X >=1 and X <=17 and button == 1 and Y== 7 then
  98.             shell.run("Programs/remove")
  99.         elseif X >=1 and X <=17 and button == 1 and Y== 13 then
  100.             clear()
  101.             print("Type the number of the background")
  102.             cp(1,3)
  103.             print("[1]Minecraft world")
  104.             cp(1,4)
  105.             print("[2]Default")
  106.             cp(1,2)
  107.             number = read()
  108.             clear()
  109.             if number == "1" then
  110.                 fs.delete("Paints/.background")
  111.                 shell.run("pastebin","get","LzjCwkXJ","Paints/.background")
  112.             end
  113.             if number == "2" then
  114.                 fs.delete("Paints/.background")
  115.                 shell.run("pastebin", "get", "uGKhyZTw", "Paints/.background")
  116.             end
  117.             settings()
  118.         end
  119.     end
  120. end
Advertisement
Add Comment
Please, Sign In to add comment