Advertisement
Guest User

xApix

a guest
Nov 12th, 2017
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.64 KB | None | 0 0
  1. os.loadAPI("xdd")
  2. local horline = [[+-------------------------------------+]]
  3.  
  4. local vertline = [[|                                     |]]
  5.  
  6. GC = "indbuildcraft:ibcItemCoinGold"
  7.  
  8. --GC = "minecraft:iron_ingot"
  9.  
  10. cipa = 1
  11. --while true do
  12.     --shell.run("rename startup pizda")
  13.     --sleep(1)
  14. --end
  15. --print(GC)
  16.  
  17. function isGC(slot)
  18.     local item = turtle.getItemDetail(slot)
  19.     if item == nil then
  20.         return false
  21.     end
  22.     return item.name == GC
  23. end
  24.  
  25. function getCount(slot)
  26.     local item = turtle.getItemDetail(slot)
  27.     if not item then
  28.         return false
  29.     end
  30.     return item.count
  31. end
  32.  
  33. function clear()
  34.     shell.run("clear")
  35. end
  36.  
  37. clear()
  38.  
  39. function drawMenu()
  40.     clear()
  41.     print(horline)
  42.     for i = 0, 9 do
  43.         print(vertline)
  44.     end
  45.     print(horline)
  46. end
  47.  
  48. function centerPrint(y, tekst)
  49.     term.setCursorPos((39 / 2) - (string.len(tekst) / 2), y)
  50.     term.write(tekst)
  51. end
  52.  
  53. function printOption(y, tekst, numer)
  54.     term.setCursorPos((39 / 2) - 14, y)
  55.     term.write(numer .. "> ")
  56.     centerPrint(y, tekst)
  57. end
  58.  
  59. function getInput(tekst)
  60.     term.setCursorPos(1, 13)
  61.     term.write(tekst)
  62.     term.setCursorPos(string.len(tekst) + 1, 13)
  63.     local textinput = read()
  64.     return textinput
  65. end
  66.  
  67.  
  68.  
  69. function rejestracja()
  70.     drawMenu()
  71.     centerPrint(5,"REJESTRACJA")
  72.    username = getInput("Podaj nick: ")
  73. --    username = read()
  74.     clear()
  75.     drawMenu()
  76.     centerPrint(5,"REJESTRACJA")
  77.    password =  getInput("Podaj haslo: ")
  78.     if http.get("http://nightgang.pw/register.php?username="..username.."&password="..xdd.sha256(password)).readAll() == "true" then
  79.         centerPrint(5,"Rejestracja powiodla sie!")
  80.         sleep(3)
  81.         main()
  82.     else
  83. --       centerPrint(5,"Rejestracja nie powiodla sie!")
  84.         centerPrint(5,"Blad polaczenia z serwerem lub")
  85.         centerPrint(6,"      konto juz istnieje      ")
  86.         sleep(3)
  87.         main()
  88.     end
  89. end
  90.  
  91. function urlencode(str)
  92.     if (str) then
  93.         str = string.gsub(str, "\n", "\r\n")
  94.         str =
  95.             string.gsub(
  96.             str,
  97.             "([^%w ])",
  98.             function(c)
  99.                 return string.format("%%%02X", string.byte(c))
  100.             end
  101.         )
  102.         str = string.gsub(str, " ", "%%20")
  103.     end
  104.     return str
  105. end
  106.  
  107. function forward(ilosc)
  108. end
  109.  
  110. --clear()
  111. --drawMenu()
  112. --centerPrint(5, "nudzi ci sie nereq?")
  113. --sleep(233)
  114.  
  115. --clear()
  116. --if not http.get("http://nightgang.pw:3000/ping") then
  117. --    drawMenu()
  118. --    centerPrint(5, "Nie udalo sie polaczyc z serwerem")
  119. --    sleep(5)
  120. --    os.reboot()
  121. --end
  122. --centerPrint(5, )
  123. --sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement