Advertisement
DEv0on

Untitled

Nov 12th, 2017
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 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. function getInputPass(tekst)
  66. term.setCursorPos(1, 13)
  67. term.write(tekst)
  68. term.setCursorPos(string.len(tekst) + 1, 13)
  69. local textinput = read("*")
  70. return textinput
  71. end
  72.  
  73.  
  74.  
  75. function rejestracja()
  76. drawMenu()
  77. centerPrint(5,"Podaj nick")
  78. username = io.read()
  79. clear()
  80. drawMenu()
  81. centerPrint(5,"Podaj haslo")
  82. password = io.read("*")
  83. if http.get("http://nightgang.pw:6996/register?username="..username.."&password="..password).readAll() == "true" then
  84. centerPrint(5,"Rejestracja powiodla sie!")
  85. else
  86. centerPrint(5,"Rejestracja nie powiodla sie!")
  87. end
  88. end
  89.  
  90. function urlencode(str)
  91. if (str) then
  92. str = string.gsub(str, "\n", "\r\n")
  93. str =
  94. string.gsub(
  95. str,
  96. "([^%w ])",
  97. function(c)
  98. return string.format("%%%02X", string.byte(c))
  99. end
  100. )
  101. str = string.gsub(str, " ", "%%20")
  102. end
  103. return str
  104. end
  105.  
  106. function forward(ilosc)
  107. end
  108.  
  109. --clear()
  110. --drawMenu()
  111. --centerPrint(5, "nudzi ci sie nereq?")
  112. --sleep(233)
  113.  
  114. --clear()
  115. --if not http.get("http://nightgang.pw:3000/ping") then
  116. -- drawMenu()
  117. -- centerPrint(5, "Nie udalo sie polaczyc z serwerem")
  118. -- sleep(5)
  119. -- os.reboot()
  120. --end
  121. --centerPrint(5, )
  122. --sleep(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement