Advertisement
DEv0on

Untitled

Nov 12th, 2017
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 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. function getInputPass(tekst)
  67. term.setCursorPos(1, 13)
  68. term.write(tekst)
  69. term.setCursorPos(string.len(tekst) + 1, 13)
  70. local textinput = read("*")
  71. return textinput
  72. end
  73.  
  74.  
  75.  
  76. function rejestracja()
  77. drawMenu()
  78. centerPrint(5,"REJESTRACJA")
  79. username = getInput("Podaj nick: ")
  80. username = string.gsub(username," ", "")
  81. -- username = read()
  82. clear()
  83. drawMenu()
  84. centerPrint(5,"REJESTRACJA")
  85. password = getInputPass("Podaj haslo: ")
  86. password = string.gsub(password," ", "")
  87. if http.get("http://nightgang.pw/register.php?username="..username.."&password="..xdd.sha256(password)).readAll() == "true" then
  88. centerPrint(5,"Rejestracja powiodla sie!")
  89. sleep(3)
  90. main()
  91. else
  92. -- centerPrint(5,"Rejestracja nie powiodla sie!")
  93. centerPrint(5,"Blad polaczenia z serwerem lub")
  94. centerPrint(6," konto juz istnieje ")
  95. sleep(3)
  96. main()
  97. end
  98. end
  99. function logowanie()
  100. drawMenu()
  101. centerPrint(5,"LOGOWANIE")
  102. username = getInput("Podaj nick: ")
  103. username = string.gsub(username," ", "")
  104. -- username = read()
  105. clear()
  106. drawMenu()
  107. centerPrint(5,"LOGOWANIE")
  108. password = getInputPass("Podaj haslo: ")
  109. password = string.gsub(password," ", "")
  110. if http.get("http://nightgang.pw/loginx.php?username="..username.."&password="..xdd.sha256(password)).readAll() == "true" then
  111. centerPrint(5,"Logowanie powiodlo sie!")
  112. sleep(3)
  113. main()
  114. else
  115. -- centerPrint(5,"Rejestracja nie powiodla sie!")
  116. centerPrint(5,"Blad polaczenia z serwerem lub")
  117. centerPrint(6," podano bledne dane ")
  118. sleep(3)
  119. main()
  120. end
  121. end
  122.  
  123. function urlencode(str)
  124. if (str) then
  125. str = string.gsub(str, "\n", "\r\n")
  126. str =
  127. string.gsub(
  128. str,
  129. "([^%w ])",
  130. function(c)
  131. return string.format("%%%02X", string.byte(c))
  132. end
  133. )
  134. str = string.gsub(str, " ", "%%20")
  135. end
  136. return str
  137. end
  138.  
  139. function forward(ilosc)
  140. end
  141.  
  142. --clear()
  143. --drawMenu()
  144. --centerPrint(5, "nudzi ci sie nereq?")
  145. --sleep(233)
  146.  
  147. --clear()
  148. --if not http.get("http://nightgang.pw:3000/ping") then
  149. -- drawMenu()
  150. -- centerPrint(5, "Nie udalo sie polaczyc z serwerem")
  151. -- sleep(5)
  152. -- os.reboot()
  153. --end
  154. --centerPrint(5, )
  155. --sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement