DEv0on

Untitled

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