Advertisement
Muzze77

Webserver Test

Oct 8th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.78 KB | None | 0 0
  1. -- (c) Muzze77  Webserver--
  2. shell.run("clear")
  3. wire = rednet.open("back")
  4. black = colors.black
  5. white = colors.white
  6. green = colors.green
  7. red = colors.red
  8. blue = colors.blue
  9. gray = colors.gray
  10. lgray = colors.lightGray
  11. nr = 1
  12.  
  13.  
  14.  
  15.  
  16. function cleL(line)
  17. term.clearLine(line)
  18. end
  19.  
  20. function cSite(http)
  21. window(4,4,4,4,white, blue)
  22. cbut(4,2,"                                      ", white, gray)
  23. cbut(4,2,http, white, black)
  24. cbut(42, 2," ENTER ", green, black)
  25. end
  26.  
  27.  
  28. function muzze77acc_login()
  29. cbut(16,5,"                          " ,black, lgray)
  30. cbut(16,6,"         Username         " ,black, lgray)
  31. cbut(16,7,"                          " ,black, lgray)
  32.  
  33. cbut(16,11,"                          " ,black, lgray)
  34. cbut(16,12,"        Password          " ,black, lgray)
  35. cbut(16,13,"                          " ,black, lgray)
  36.  
  37.  
  38. evt, button,x, y = os.pullEvent("mouse_click")
  39.     if button == 1 then
  40.         for m2 = 16, 41, 1 do
  41.         for n1 = 5, 7, 1 do
  42.         if x == m2 and y == n1 then
  43.         term.setCursorPos(5, 19)
  44.         term.clearLine(19)
  45.         print("click"  .. nr )
  46.        
  47.         nr = nr + 1
  48.         next1()
  49.         end
  50.         end
  51.         end
  52.         end
  53. end
  54.  
  55. function next1()
  56. evt, button,x, y = os.pullEvent("mouse_click")
  57.     if button == 1 then
  58.         for m2 = 17, 23, 1 do
  59.         for n1 = 11, 13, 1 do
  60.         if x == m2 and y == n1 then
  61.         term.clear()
  62.        
  63.         cSite(" http:\\Muzze77Acc.de/login ")
  64.         muzze77acc_login()
  65.        
  66.  
  67.         end
  68.         end
  69.         end
  70.  
  71.     end
  72. end
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98. function tooL()
  99.     cbut(6,7,"Adressenname zu lang ",white, black)
  100.     evt, button,x, y = os.pullEvent("mouse_click")
  101.     if evt == "mouse_click" then
  102.     window(4,4,4,4,white, blue)
  103.     cbut(4,2,"           Adresse waehlen            ", white, gray)  
  104.    
  105.     end
  106. end
  107.  
  108.  
  109. function wrongAdd()
  110.    
  111.     cbut(6,7,"Addresse " .. msg,white, black)
  112.     cbut(8,8,"wurde nicht gefunden!",white, black)
  113.     evt, button,x, y = os.pullEvent("mouse_click")
  114.     if evt == "mouse_click" then
  115.     window(4,4,4,4,white, blue)
  116.     cbut(4,2,"           Adresse waehlen            ", white, gray)  
  117.    
  118.     end
  119. end
  120.  
  121.  
  122. function muzze77acc()
  123. cbut(42, 2," ENTER ", green, black)
  124.        
  125.         tap = 0.3
  126.         cbut(4,2," http:\\Muzze77Acc.de - LOADING |0  %|", white, black)
  127.         cbut(42, 2," ENTER ", green, black)
  128.         cleL(2)
  129.         sleep(tap)
  130.         cbut(4,2," http:\\Muzze77Acc.de - LOADING |25 %|", white, black)
  131.         cbut(42, 2," ENTER ", green, black)
  132.         cleL(2)
  133.         sleep(tap)
  134.         cbut(4,2," http:\\Muzze77Acc.de - LOADING |50 %|", white, black)
  135.         cbut(42, 2," ENTER ", green, black)
  136.         cleL(2)
  137.         sleep(tap)
  138.         cbut(4,2," http:\\Muzze77Acc.de - LOADING |75 %|", white, black)
  139.         cbut(42, 2," ENTER ", green, black)
  140.         cleL(2)
  141.         sleep(tap)
  142.        
  143.         cbut(4,2," http:\\Muzze77Acc.de - LOADING |100%|", white, black)
  144.         cbut(42, 2," ENTER ", green, black)
  145.         sleep(1)
  146.         term.clear()
  147.         cSite(" http:\\Muzze77Acc.de ")
  148.        
  149.         cbut(13,7,"                              ", black, blue)
  150.         cbut(13,8," Willkommen auf Muzze77Acc.de ", black, blue)
  151.         cbut(13,9,"                              ", black, blue)
  152.        
  153.         cbut(17,11,"       ", green, blue)
  154.         cbut(17,12," Login ", green, blue)
  155.         cbut(17,13,"       ", green, blue)
  156.        
  157.         cbut(32,11,"         ", red, blue)
  158.         cbut(32,12," Register", red, blue)
  159.         cbut(32,13,"         ", red, blue)
  160.         next1()
  161.        
  162. end
  163.  
  164. function window(sx, sy,linex, liney, bcol, tcol)
  165.         stx = sx + 45
  166.         sty = sx + 14
  167.        
  168.         while sy ~= sty do
  169.        
  170.         term.setBackgroundColor(bcol)
  171.         term.setTextColor(tcol)
  172.         term.setCursorPos(sx,sy)
  173.         print(" ")
  174.         sx = sx + 1
  175.  
  176.         if sx == stx then
  177.             sy = sy + 1
  178.             sx = linex
  179.         end
  180.  
  181.         end
  182.        
  183. end
  184.  
  185.  
  186.  
  187.  
  188. function reset()
  189.  
  190. term.setBackgroundColor(black)
  191. term.setTextColor(white)
  192.  
  193. end
  194.  
  195. function cbut(cx,cy,ctext,bcol,tcol)
  196. ncx = cx
  197. term.setCursorPos(cx, cy)
  198. term.setBackgroundColor(bcol)
  199. term.setTextColor(tcol)
  200. print(ctext)
  201. reset()
  202. end
  203.  
  204. cbut(42, 2," ENTER ", green, black)
  205. window(4,4,4,4,white, blue)                    
  206. cbut(4,2,"           Adresse waehlen            ", white, gray)                      
  207.  
  208. while true do
  209.  
  210. evt, button,x, y = os.pullEvent("mouse_click")
  211.  
  212.     if button == 2 then
  213.     term.setCursorPos(1,1)
  214.     term.clearLine(1)
  215.     print(button .. " : " .. x .. " : " .. y)
  216.     end
  217.    
  218.    
  219.  
  220.     if button == 1 then
  221.     for m = 4, 41, 1 do
  222.     if x == m and y == 2 then
  223.    
  224.     cbut(4,2,"                                      ", white, gray)
  225.     term.setCursorPos(5,2)
  226.     term.setBackgroundColor(white)
  227.     term.setTextColor(lgray)
  228.  
  229.     term.setCursorPos(6,2)
  230.     msg = io.read()
  231.     sins = string.len(msg)
  232.     if sins >= 30 then
  233.     tooL()
  234.    
  235.     else
  236.     if msg == "Muzze77Acc.de" or msg == "http:\\Muzze77Acc.de" or msg == "muzze77acc.de" or msg == "muzze77acc.de"  then
  237.         cbut(4,2,"                                      ", white, gray)
  238.         cbut(6,2,msg, white, gray)
  239.         muzze77acc()
  240.    
  241.    
  242.     else
  243.     wrongAdd()
  244.    
  245.     end
  246.     end
  247.     end
  248.     end
  249. end
  250.     end
  251.    
  252.    
  253.    
  254. -- DO NOT  PUBLIC THIS SCRIPT  WITHOUT PERMISSION --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement