- 16
- Posts
- 6
- Years
- United Kingdom
- Seen Feb 2, 2021
Hi,
I'm using Ruby for this script.
So I'm trying to write a script alongside the Shinyzer tool that has a high shiny chance until a shiny appears on a map. (i.e. you're pretty much guaranteed to find a shiny once per route)
I thought I could achieve this with the setflag and check flag and it does work but I can't reuse this for routes 101 & 102 for example (As the script in route 101 then sets the flag so using the same script in route 103 yields no shiny in 103) as the flag has already been set in a previous route).
My question is this: Is there anyway for the script to detect what map it is being run from so I can just have one script for every route?
I thought about getplayerpos but this only seems to be for the map the player is currently in, not the map itself.
If not I'll have to rinse and repeat the script changing the initial offset and the flags for each route. Please have a look over my script to see if more experienced eyes can pick up on things mine cannot.
Thanks,
Script:
'---------------
#org 0x800900
random 0x3
compare LASTRESULT 0x0
if 0x1 goto 0x8800929
compare LASTRESULT 0x1
if 0x1 goto 0x8800929
compare LASTRESULT 0x2
if 0x1 goto 0x880092C
end
'---------------
#org 0x800929
end
'---------------
#org 0x80092C
checkflag 0x1203
if 0x1 goto 0x8800929
callasm 0x8800481
setvar 0x8003 0x1
setflag 0x1203
end
I'm using Ruby for this script.
So I'm trying to write a script alongside the Shinyzer tool that has a high shiny chance until a shiny appears on a map. (i.e. you're pretty much guaranteed to find a shiny once per route)
I thought I could achieve this with the setflag and check flag and it does work but I can't reuse this for routes 101 & 102 for example (As the script in route 101 then sets the flag so using the same script in route 103 yields no shiny in 103) as the flag has already been set in a previous route).
My question is this: Is there anyway for the script to detect what map it is being run from so I can just have one script for every route?
I thought about getplayerpos but this only seems to be for the map the player is currently in, not the map itself.
If not I'll have to rinse and repeat the script changing the initial offset and the flags for each route. Please have a look over my script to see if more experienced eyes can pick up on things mine cannot.
Thanks,
Script:
'---------------
#org 0x800900
random 0x3
compare LASTRESULT 0x0
if 0x1 goto 0x8800929
compare LASTRESULT 0x1
if 0x1 goto 0x8800929
compare LASTRESULT 0x2
if 0x1 goto 0x880092C
end
'---------------
#org 0x800929
end
'---------------
#org 0x80092C
checkflag 0x1203
if 0x1 goto 0x8800929
callasm 0x8800481
setvar 0x8003 0x1
setflag 0x1203
end