barwa100

Untitled

Aug 16th, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. local modem = peripheral.wrap("back")
  2. modem.open( 1 )
  3.  
  4. os.pullEvent = os.pullEventRaw
  5.  
  6. local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  7.  
  8.  
  9. function string:split( inSplitPattern, outResults )
  10. if not outResults then
  11. outResults = { }
  12. end
  13. local theStart = 1
  14. local theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
  15. while theSplitStart do
  16. table.insert( outResults, string.sub( self, theStart, theSplitStart-1 ) )
  17. theStart = theSplitEnd + 1
  18. theSplitStart, theSplitEnd = string.find( self, inSplitPattern, theStart )
  19. end
  20. table.insert( outResults, string.sub( self, theStart ) )
  21. return outResults
  22. end
  23.  
  24. local vartable = message:split(", ")
  25.  
  26. if vartable[0] == "login" then
  27. local login = http.get("https://mistaken.pl/barwa/cc/login.php?login="..vartable[1].."&passwd="..vartable[2])
  28. if not login then
  29. print("Error")
  30. else
  31. local content = login.readAll()
  32. modem.transmit(replyChannel, 1, content)
  33. end
  34. end
  35.  
  36. elseif vartable[0] == "auth" then
  37. local login = http.get("https://mistaken.pl/barwa/cc/auth.php?hash="..vartable[1])
  38. if not login then
  39. print("Error")
  40. else
  41. local content = login.readAll()
  42. modem.transmit(replyChannel, 1, content)
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment