Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def pbSendStatus(type)
- begin
- id = $Trainer.id
- name = Marshal.load(Marshal.dump($Trainer.name))
- data = {"player_id"=>id, "player_name"=>name, "type"=>type, "info"=>pbBuildInfo(), "equipo"=>pbGetTeam()}
- response = pbPostData("http://midominio.com/registro.php", data, filename=nil, depth=0)
- rescue => exception
- Kernel.pbMessage("Vaya, ha habido un error.")
- end
- end
- def pbGetTeam()
- aux = ""
- $Trainer.party().each{|pokemon|
- aux += PBSpecies.getName(pokemon.species) + " Lvl. " + pokemon.level.to_s + "<br>"
- }
- return aux
- end
- def pbBuildInfo()
- aux = ""
- n_captured = $Trainer.pokedexOwned
- 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"
- aux += " Pokemon capturados: #{n_captured}"
- aux += " Medallas: #{n_badges}"
- return aux
- end
Advertisement
Add Comment
Please, Sign In to add comment