Advertisement
DEv0on

Untitled

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