Advertisement
justync7

checkbalance

Jun 29th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. googol={}
  2. googol.cash={}
  3. function googol.cash.balance(user)
  4. local response = http.post("http://www.googol.comli.com/cash/checkbalance.php",
  5. "user="..textutils.urlEncode(user)
  6. ):readAll()
  7.  
  8. return tonumber(string.match(response, "^%d+")) or "?"
  9. end
  10. p=peripheral.wrap("right")
  11. while true do
  12. ev,name,msg=os.pullEvent("chat")
  13. if msg:sub(1,4)==".bal" then
  14. user=msg:sub(6)
  15. p.say(user.." Has $"..googol.cash.balance(user))
  16. end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement