Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.84 KB | None | 0 0
  1. specs = {}
  2. file  = File.open("special.txt","r")
  3.  
  4. while(!file.eof())
  5.     line = file.gets().chomp()
  6.     line = line.split("\t",2)
  7.    
  8.     specs[line[0]] = line[1].to_i()
  9. end
  10.  
  11. file.close()
  12.  
  13. type = ""
  14. file = File.open("trainers.txt","r")
  15.  
  16. while(!file.eof())
  17.     line = file.gets.chomp()
  18.     line = line.split(": ",2)
  19.    
  20.     if(line[1].include?("("))
  21.         type = line[1].split(" (",2)[0]
  22.         next
  23.     end
  24.    
  25.     mons  = line[1].split("; ")
  26.     size  = mons.size()
  27.     death = "Y"
  28.    
  29.     size.times() do |i|
  30.         death = "" if(i == size - 1)
  31.         mon   = mons[i]
  32.         mon   = mon[1,mon.size()].split(" ",2)
  33.         spec  = (((8 + specs[mon[1]]) * mon[0].to_i()).to_f() / 50 + 5).to_i()
  34.        
  35.         puts("#{type} 0x#{line[0]} S#{i} D?#{death}") if(spec == ARGV[0].to_i())
  36.     end
  37. end
  38.  
  39. file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement