For Pokemon Yellow, this script will tell you what trainer ID you get. It's the same thing as the Red script, but the memory address is different.
file = io.open("test.txt", "w")
io.output(file)
-- prints the frame count while running
while true do
io.write(emu.framecount())
io.write(", ")
tid = memory.read_u16_be(0XD358)
io.write((tid), "\n")
emu.frameadvance()
end
io.close(file)