Skip to content

Instantly share code, notes, and snippets.

@edenbynever
Created May 21, 2024 12:58
Show Gist options
  • Save edenbynever/51e7599dcf7363147d4438c1cbcae97d to your computer and use it in GitHub Desktop.
Save edenbynever/51e7599dcf7363147d4438c1cbcae97d to your computer and use it in GitHub Desktop.
require 'csv'
item_ids = {}
CSV.open('items.csv', headers: true).each do |row|
id, name = row.fields.first 2
item_ids[name] = id
end
move_ids = {}
CSV.open('moves.csv', headers: true).each do |row|
id, name = row.fields.first 2
move_ids[name] = id
end
DATA.each do |line|
line =~ /TM(\d+), which now teaches (.+) instead/
item = item_ids["tm#{$1}"]
move = move_ids[$2.downcase.tr ' ', '-']
puts [$1, 23, item, move] * ','
end
DPHM = %w[- cut fly surf strength defog rock-smash waterfall rock-climb]
1.upto 8 do |n|
item = item_ids['hm%02d' % n]
move = move_ids[DPHM[n]]
puts [92 + n, 23, item, move] * ','
end
__END__
TM10, which now teaches Work Up instead of Hidden Power.
TM21, which now teaches Dazzling Gleam instead of Frustration.
TM27, which now teaches Low Sweep instead of Return.
TM43, which now teaches Volt Switch instead of Secret Power.
TM49, which now teaches Scald instead of Snatch.
TM62, which now teaches Bug Buzz instead of Silver Wind.
TM63, which now teaches Nasty Plot instead of Embargo.
TM78, which now teaches Snarl instead of Captivate.
TM83, which now teaches Bulldoze instead of Natural Gift.
10,23,314,526
21,23,325,605
27,23,331,490
43,23,347,521
49,23,353,503
62,23,366,405
63,23,367,417
78,23,382,555
83,23,387,523
93,23,397,15
94,23,398,19
95,23,399,57
96,23,400,70
97,23,401,432
98,23,402,249
99,23,403,127
100,23,404,431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment