Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def pbSendStatus(type)
- begin
- Thread.new {
- begin
- id = $Trainer.id
- name = pbGetUserName()
- data = {"trainer_id"=>id, "player_name"=>name, "type"=>type, "info"=>pbBuildInfo(), "team"=>pbGetTeam(),
- "play_time"=>(Graphics.frame_count / Graphics.frame_rate / 60)}
- pbPostData("http://urldelsitio.com/api/registerData", data, filename=nil, depth=0)
- rescue => exception
- #p exception
- #Kernel.pbMessage("Vaya, ha habido un error.")
- end
- }
- end
- end
- def pbBuildInfo()
- aux = ""
- played_time_h = (Graphics.frame_count / Graphics.frame_rate / 60)/60
- played_time_m = (Graphics.frame_count / Graphics.frame_rate / 60)%60
- n_badges = $Trainer.numbadges
- aux += "Tiempo jugado: #{played_time_h}h #{played_time_m}m<br>"
- aux += "Medallas: #{n_badges}<br>"
- return aux
- end
- def pbGetTeam()
- aux = []
- $Trainer.party().each{|pokemon|
- aux.push(PBSpecies.getName(pokemon.species) + " Lvl. " + pokemon.level.to_s)
- }
- return aux.join("<br>")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement