I will get it later today.
There was a storm last night, and my power was out from 7:30 PM until some time in the middle of the night, so I didn't get to do it.
EDIT:
Give this a try, it should change conditional branches as well.
# Define the input and output strings.
INPUT = "$monster_dist_thresh"
OUTPUT = "$game_system.monster_dist_thresh"
#===============================================================================
count = 0
Dir.entries('Data').each {|filename|
if filename =~ /Map[\d]+\.rxdata/
changed = false
map = load_data("Data/#{filename}")
map.events.each_key {|key|
event = map.events[key]
event.pages.each_index {|i|
page = event.pages[i]
page.list.each_index {|j|
cmd = page.list[j]
if cmd.code == 111 && cmd.parameters[0] == 12 &&
cmd.parameters[1].include?(INPUT)
count += 1
event.pages[i].list[j].parameters[1].gsub!(INPUT) { OUTPUT }
map.events[key] = event
changed = true
next
end
next unless [355, 655].include?(cmd.code)
if event.pages[i].list[j].parameters[0].include?(INPUT)
count += 1
event.pages[i].list[j].parameters[0].gsub!(INPUT) { OUTPUT }
map.events[key] = event
changed = true
end
}
}
if changed
File.open("Data/#{filename}", 'wb') {|file| Marshal.dump(map, file) }
end
}
end
}
if count == 0
print "No event script calls found with matching string."
else
print "Found and replaced #{count} occurences of input string.\n" +
"Make sure to close and reload your project in order for the effects " +
"take place. DO NOT SAVE THE GAME when closing or nothing will change."
end
exit