SHARE
TWEET

Untitled

a guest Sep 1st, 2014 28 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top