Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --v0.1 rby ita gift shiny
- if memory.readbyte(0x013c) == 0x59 then
- yellow = 1
- else
- yellow = 0
- end
- local partyno = (memory.readbyte(0xd168-yellow))-1
- local addr = (0xd18b-yellow)+partyno*0x2C
- local atkdef
- local spespc
- function shiny(atkdef,spespc)
- if spespc == 0xAA then
- if atkdef == 0xA2 or atkdef == 0xA3 or atkdef == 0xA6 or atkdef == 0xA7 or atkdef == 0xAA or atkdef == 0xAB or atkdef == 0xAE or atkdef == 0xAF then
- return true
- else
- return false
- end
- else
- return false
- end
- end
- state = savestate.create()
- savestate.save(state)
- while true do
- emu.frameadvance()
- atkdef = 0
- spespc = 0
- savestate.save(state)
- while atkdef == 0 and spespc == 0 do
- joypad.set(1, {A=true})
- vba.frameadvance()
- atkdef = memory.readbyte(addr)
- spespc = memory.readbyte(addr+1)
- end
- print(atkdef)
- print(spespc)
- if shiny(atkdef,spespc) then
- print("Shiny!!! Script stopped.")
- print(string.format("atk: %d", math.floor(atkdef/16)))
- print(string.format("def: %d", atkdef%16))
- print(string.format("spe: %d", math.floor(spespc/16)))
- print(string.format("spe: %d", spespc%16))
- savestate.save(state)
- break
- else
- savestate.load(state)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement