PDA

View Full Version : The Miscellaneous Script Thread


Spherical Ice
December 20th, 2008, 10:47 AM
The Miscellaneous Script ThreadScripts are XSE-compatible only!

Welcome to The Miscellaneous (XSE) Script Thread! The purpose of this thread is simple; it is an archive of numerous, pretty random, scripts available for you to use in your hack if you are having difficulties scripting it yourself (or are too lazy. ^.^).

If you wish to see one of your threads up on this post, please use the following form:

Name:
ROM info:
Effect:
Script:
Comments & Bugs:
Credits:

For example, you could post this:
Name: Talking Script
ROM info: Pokémon: FireRed Version (U)
[B]Effect: When you interact with the person event affiliated with this script, a message will appear.
Script:

#dynamic 0x# ‘ Scripter must define offset.

#org @start ‘ Pointer name up to scripter’s preferences.
lock
faceplayer
msgbox @1 0x6
release
end

#org @1
= This is a test message.

Comments & Bugs: Make sure you do not use “boxset 0x6”! That’s an outdated command!
Credits: Person A, Person B and Person C.

Of course, you shouldn’t really bother submitting a simple script as easy as that – if you think people can’t do that, than you must be a pessimist!


The Scripts:
Egg Shop Script:

#dynamic 0x<offset>

#org @start
lock
faceplayer
showmoney 0x0 0x0 0x0
msgbox @msg1 MSG_KEEPOPEN
closeonkeypress
multichoice 0x14 0x1 0x<mcnumber> 0x0
compare 0x800D 0x0
if 0x1 goto @common
compare 0x800D 0x1
if 0x1 goto @uncommon
compare 0x800D 0x2
if 0x1 goto @rare
hidemoney 0x0 0x0
release
end

#org @common
checkmoney 0x1388 0x0
compare 0x800D 0x0
if 0x1 goto @notenough
paymoney 0x1388 0x0
updatemoney 0x0 0x0 0x0
fanfare 0x13E
msgbox @msg3 MSG_KEEPOPEN
closeonkeypress
waitfanfare
hidemoney 0x0 0x0
random 0x5
compare 0x800D 0x0
if 0x1 goto @1
compare 0x800D 0x1
if 0x1 goto @2
compare 0x800D 0x2
if 0x1 goto @3
compare 0x800D 0x3
if 0x1 goto @4
compare 0x800D 0x4
if 0x1 goto @5
release
end

#org @1
giveegg 0x<species>
release
end

#org @2
giveegg 0x<species>
release
end

#org @3
giveegg 0x<species>
release
end

#org @4
giveegg 0x<species>
release
end

#org @5
giveegg 0x<species>
release
end

#org @notenough
hidemoney 0x0 0x0
msgbox @msg2 MSG_KEEPOPEN
closeonkeypress
release
end

#org @uncommon
checkmoney 0x2710 0x0
compare 0x800D 0x0
if 0x1 goto @notenough
paymoney 0x2710 0x0
updatemoney 0x0 0x0 0x0
fanfare 0x13E
msgbox @msg3 MSG_KEEPOPEN
closeonkeypress
waitfanfare
hidemoney 0x0 0x0
random 0x5
compare 0x800D 0x0
if 0x1 goto @k1
compare 0x800D 0x1
if 0x1 goto @k2
compare 0x800D 0x2
if 0x1 goto @k3
compare 0x800D 0x3
if 0x1 goto @k4
compare 0x800D 0x4
if 0x1 goto @k5
release
end

#org @k1
giveegg 0x<species>
release
end

#org @k2
giveegg 0x<species>
release
end

#org @k3
giveegg 0x<species>
release
end

#org @k4
giveegg 0x<species>
release
end

#org @k5
giveegg 0x<species>
release
end

#org @rare
checkmoney 0x61A8
compare 0x800D 0x0
if 0x1 goto @notenough
paymoney 0x61A8 0x0
updatemoney 0x0 0x0 0x0
fanfare 0x13E
msgbox @msg1 MSG_KEEPOPEN
closeonkeypress
waitfanfare
hidemoney 0x0 0x0
random 0x3
compare 0x800D 0x0
if 0x1 goto @rare1
compare 0x800D 0x1
if 0x1 goto @rare2
compare 0x800D 0x2
if 0x1 goto @rare3
release
end

#org @rare1
giveegg 0x<species>
release
end

#org @rare2
giveegg 0x<species>
release
end

#org @rare3
giveegg 0x<species>
release
end

#org @msg1
= Hello, welcome to our Egg Shop!\pWhich kind of Egg would you like?

#org @msg2
= You don't have enough money.

#org @msg3
= [black_fr][player] received a [red_fr]Pokémon Egg[black_fr]!
Comments: Here is an egg shop script. Feel free to change any of the text and any of script. Give credit to Manipulation, okay? The Multichoice box at the top should contain 'Uncommon, Common and Rare'.

Rock Climb (Vine Whip):

From down:
#dynamic 0x800000

#org @1
#raw 0x7C 0x16 0x00
compare 0x800D 0x06
if 0x1 call @end
#raw 0x9D 0x00 0x0D 0x80
message @ha
boxset 5
compare LASTRESULT 0
if 0x1 goto @end
#raw 0x68
#raw 0x9C 0x25 0x00
waitstate
#raw 0x17 0x00 0x80 0x01 0x00
goto @jump
#org @jump
compare 0x8000 0x01
if 0x4 goto @move
release
end
#org @end
release
end
#org @move
applymovement 0xFF @move1
waitmovement 0x0
#raw 0x18 0x00 0x80 0x01 0x00
goto @jump

#org @ha
= It's some climbable rocks!\pWant to use VINE WHIP to\nclimb up them?

#org @move1
#raw 0x1E 0x1E 0x1E 0xFE
From up:
#dynamic 0x800000

#org @1
#raw 0x7C 0x16 0x00
compare 0x800D 0x06
if 0x1 call @end
#raw 0x9D 0x00 0x0D 0x80
message @ha
boxset 5
compare LASTRESULT 0
if 0x1 goto @end
#raw 0x68
#raw 0x9C 0x25 0x00
waitstate
#raw 0x17 0x00 0x80 0x01 0x00
goto @jump
#org @jump
compare 0x8000 0x01
if 0x4 goto @move
release
end
#org @end
release
end
#org @move
applymovement 0xFF @move1
waitmovement 0x0
#raw 0x18 0x00 0x80 0x01 0x00
goto @jump

#org @ha
= It's some climbable rocks!\pWant to use VINE WHIP to\nclimb down them?

#org @move1
#raw 0x1D 0x1D 0x1D 0xFE
Credits: Hiche
Headbutt Trees (Headbutt):
1)#dynamic 0x800000

#org @headbutt
#raw 0x7C 0x1D 0x00
compare 0x800D 0x06
if 0x1 jump @could
#raw 0x9D 0x00 0x0D 0x80
#raw 0x7F 0x00 0x0D 0x80
#raw 0x82 0x01 0x1D 0x00
message @question
boxset 0x5
compare 0x800D 0x00
if 0x1 jump @end
message @used
boxset 0x6
#raw 0x68
#raw 0x9C 0x25 0x00
waitstate
jump 0x1Be06F

#org @could
message @you
boxset 0x6
release
end

#org @end
release
end

#org @question
= This tree could have a Pokemon\nin it. Use HEADBUTT?

#org @used
= \v\h02 used \v\h03!

#org @you
= This tree could be HEADBUTTed!

Credits: Hiche, Dabomstew

2)
#org @headbutt
lock
checkattack 0x1D
compare 0x800D 0x6
if 0x1 goto @release
bufferpokemon2 0x0 0x800D
bufferattack 0x1 0x1D
message @head
boxset 0x5
compare 0x800D 0x0
if 0x1 goto @release
message @used
boxset 0x4
closeonkeypress
goto @treeshake
end

#org @treeshake
random 0xamount
compare 0x800D 0x0
if 0x1 goto @wildbattle offset
compare 0x800D 0x1
if 0x1 goto @wildbattle offset2
[the random amount is how many different ones you can add]


#org @used
= [buffer1] used HEADBUTT.

#org @head
= Pokemon live in this tree. Using\nHEADBUTT may cause them to come out.\pDo you want to use HEADBUTT?
Credits: Dratii

3) //-------------------------------------
//Preperations
//-------------------------------------
#dynamic 0x800000
#define cAttack 0x1D //Change this value to use another attack

//-------------------------------------
//Main Script
//-------------------------------------
#org @Main
lockall //Lock everything from moving
checkattack cAttack //Stores the first Pokémon who knows the attack into the variable 0x800D
compare 0x800D 0x06 //Makes sure a Pokémon knows the attack...
if 0x01 goto @NotKnown //If the value is 6 then no Pokémon knows the attack
setanimation 0x00 0x800D //The Pokémon animation is set with the Pokémon who knows the attack
bufferpartypokemon 0x00 0x800D //Puts the Pokémon who knows the attack into [buffer1]
bufferattack 0x01 cAttack //Puts the attack name into [buffer2]
msgbox @Message1 0x05 //A Yes/No box appears with the message
compare 0x800D 0x00 //Checks in "No" was selected
if 0x01 goto @DoNotWant //If it was, quit
msgbox @Message2 0x04 //"[buffer1] used [buffer2]!" >> Keep open
closeonkeypress //Close the msgbox when a key is pressed
doanimation 0x25 //Shows the Pokémon animation
waitstate //Waits for the animation to complete
setvar 0x8004 0x01 //Set up to shake screen
setvar 0x8005 0x01
setvar 0x8006 0x0C
setvar 0x8007 0x02
special 0x136 //Shake screen
pause 0x20 //Wait 1~ second
special 0xAB //Call a random battle from the "Tree" section of wild Pokémon
compare 0x800D 0x00 //Checks if a wild battle happened
if 0x1 goto @DoNotWant //If not, quit
waitstate //Wait for the battle to complete
releaseall //Allow the player to move freely again
end //End the script

//-------------------------------------
//Sub Scripts
//-------------------------------------
#org @NotKnown
msgbox @Message3 0x03
end

#org @DoNotWant
releaseall
end

//-------------------------------------
//Messages
//-------------------------------------
#org @Message1
= This tree may contain a Pokemon.\nUse the move [buffer2]?

#org @Message2
= [buffer1] used [buffer2]!

#org @Message3
= This tree may contain a Pokemon.\nIt may be able to be knocked out.
Credits: Dartharon

Braille Script:
#dynamic 0x[your offset]
#org @start
lock
faceplayer
msgbox @3
boxset MSG_NORMAL 'Must be a msgbox!
braille @4
waitkeypress
release
end

#org @3
= There is something strange on the stone...

#org @4
#braille something 'the braille words
Credits: liuyanghejerry

Move Tutor Script:
#org @Start
lock
faceplayer
checkflag 0x200
compare LASTRESULT 0x1
if 0x1 goto @AlreadyLearnt
msgbox @WantToLearn
boxset 0x5
compare LASTRESULT 0x0
if 0x1 goto @DontWant
setvar 0x8005 0x1 ' 0x[Move number]
special 0x18D
setflag 0x200
release
end
Credits: liuyanghejerry

'Wishing' Well Script
#dynamic 0x800000

#org @start
lock
random 0xA
compare LASTRESULT 0x9
if 0x1 goto @lucky
msgbox @nothing 0x6
release
end

#org @lucky
msgbox @jackpot 0x6
giveitem 0x1A 0x1 0x0
release
end

#org @nothing
= [PLAYER] reeled up the bucket...\p...\pNothing!

#org @jackpot
= [PLAYER] reeled up the bucket...\p...\pJackpot!

Credits: The Master, HackMew (fixing up script)

Bike Stand Script
#dynamic 0x800000

#org @begin
lock
faceplayer
checkitem 0x168 0x1
compare LASTRESULT 0x1
if 0x0 jump @no
message @mount 0x5
compare LASTRESULT 0x0
if 0x1 goto @no
special 0x157
release
end

#org @no
release
end

#org @mount
= Do you want to mount your bike?
Credits: The blob of blobs, HackMew (fixing up script)

Honey Tree Script:
#dynamic 0x0FF5E1

#org @start
lock
checkflag 0x200
compare LASTRESULT 0x1
if 0x1 call @already
msgbox @honeytree MSG_NORMAL
checkitem ITEM_HONEY 0x1
compare LASTRESULT 0x1
if 0x1 call @honey
setflag 0x200
release
end

#org @honey
msgbox @hunny MSG_QUESTION
compare LASTRESULT 0x1
if 0x1 call @ona
return

#org @already
msgbox @pokemon MSG_NORMAL
random 0x0A
compare LASTRESULT 0x0
if 0x1 call @1
compare LASTRESULT 0x1
if 0x1 call @2
compare LASTRESULT 0x2
if 0x1 call @3
compare LASTRESULT 0x3
if 0x1 call @4
compare LASTRESULT 0x4
if 0x1 call @5
compare LASTRESULT 0x5
if 0x1 call @6
compare LASTRESULT 0x6
if 0x1 call @7
compare LASTRESULT 0x7
if 0x1 call @8
compare LASTRESULT 0x8
if 0x1 call @9
compare LASTRESULT 0x9
if 0x1 call @10
clearflag 0x200
release
end

#org @1
wildbattle PKMN_WURMPLE 0x8 0x0
return

#org @2
wildbattle PKMN_COMBEE 0xD 0x0
return

#org @3
wildbattle PKMN_WURMPLE 0x7 0x0
return

#org @4
wildbattle PKMN_WURMPLE 0xA 0x0
return

#org @5
wildbattle PKMN_MUNCHLAX 0xE 0x0
return

#org @6
wildbattle PKMN_HERACROSS 0x8 0x0
return

#org @7
wildbattle PKMN_AIPOM 0x8 0x0
return

#org @8
wildbattle PKMN_COMBEE 0x8 0x0
return

#org @9
wildbattle PKMN_CHERUBI 0x8 0x0
return

#org @10
wildbattle PKMN_CHERUBI 0x8 0x0
return

#org @ona
removeitem ITEM_HONEY 0x1
msgbox @hungry MSG_NORMAL
return

#org @pokemon
= Huh?\pIt looks like there's a POKéMON on\nthe HONEY TREE!

#org @honeytree
= It's a HONEY TREE.

#org @hunny
= Would you like to slather the bark\nwith HONEY?

#org @hungry
= [player] slathered the bark with\nHONEY.

Comments:You need to make a different flag for all the honey trees, unless you want to slather one tree and catch Pokemon on another. If you want, you can replace the Pokémon with ones that you prefer.
Also, you need the item Honey. In the example, Berry Juice has been replaced, but again, it is up to what you prefer.

Credits: Colorful Summer

Random Weather Script:
'---------------
#org 0x(offset)
random 0x0A
compare LASTRESULT 0x0
if 0x1 goto @1
compare LASTRESULT 0x1
if 0x1 goto @2
compare LASTRESULT 0x2
if 0x1 goto @3
compare LASTRESULT 0x3
if 0x1 goto @4
compare LASTRESULT 0x4
if 0x1 goto @5
compare LASTRESULT 0x5
if 0x1 goto @6
compare LASTRESULT 0x6
if 0x1 goto @7
compare LASTRESULT 0x7
if 0x1 goto @8
compare LASTRESULT 0x8
if 0x1 goto @9
compare LASTRESULT 0x9
if 0x1 goto @10

#org @1
setweather 0x1
doweather
end

#org @2
setweather 0x2
doweather
end

#org @3
setweather 0x3
doweather
end

#org @4
setweather 0x4
doweather
end

#org @5
setweather 0x5
doweather
end

#org @6
setweather 0x7
doweather
end

#org @7
setweather 0xb
doweather
end

#org @8
setweather 0xd
doweather
end

#org @9
setweather 0x2
doweather
end

#org @10
setweather 0xb
doweather
end

Credits: Sab

Phonecall Script:
#dynamic 0x800000

#org @start
checkflag 0x1000
if 0x1 goto @nope
random 0x2
compare 0x800D 0x1
if 0x1 goto @nope
compare 0x800D 0x2
if 0x1 goto @yes
release
end

#org @yes
setanimation 0x41 0x27
doanimation 0x41
pause 0x35
msgbox @fonecall 0x6
applymovement 0xFF @?
msgbox @hello? 0x6
setflag 0x1000
release
end

#org @nope
release
end

#org @fonecall
= PHONECALL:Beeep

#org @?
#raw 0x62 0xFE

#org @hello?
= Hello \v\h01 How are you doing.\nPHONE Ending message\pBeep\nBeep\pBeep
Credits:

Rock Jump Script:

#dynamic 0x740000

#org @start
compare 0x800C 0x1
if 0x1 call @T
compare 0x800C 0x2
if 0x1 call @S
compare 0x800C 0x3
if 0x1 call @A
compare 0x800C 0x4
if 0x1 call @D
end

#org @A
release
end

#org @D
release
end

#org @T
checkattack 0x16
Compare LASTRESULT 6
if 0x1 call @no2
#raw 0x9D 0x00 0x0D 0x80
msgbox @rock 0x5
Compare LASTRESULT 1
if 0x0 goto @NOPE
Doanimation 0x25
waitstate
Checkanimation 0x25
compare 0x8000 0x01
applymovement 0xFF @test
waitmovement 0x0
release
end

#org @S
checkattack 0x16
Compare LASTRESULT 6
if 0x1 call @no3
#raw 0x9D 0x00 0x0D 0x80
msgbox @rock2 0x5
Compare LASTRESULT 1
if 0x0 goto @NOPE
doanimation 0x25
waitstate
Checkanimation 0x25
compare 0x8000 0x01
applymovement 0xFF @test2
waitmovement 0x0
release
end

#org @no3
msgbox @noclimb2 0x6
release
end

#org @test2
#raw 0x15 0xFE

#org @rock2
= These rocks look scaly want to\n use vine whip to throw\p yourself up?

#org @nope
release
end

#org @test
#raw 0x14 0xFE

#org @rock
= These rocks look scaly \n Do you want to use\p vine whip to \nthrow yourself Down?

#org @NO2
msgbox @noclimb 0x6
release
end

#org @noclimb
= These rocks look like a pokemons\nMove could scale them.

#org @no
release
end

#org @noclimb2
= These rocks look like a pokemons\nMove could scale them.
Credits: -

Feel free to submit your miscellaneous, XSE scripts!

Also, to save up a bit of clutter, I've merged all of these repeat threads in one, so some of these replies may not make sense. DON'T MAKE ANY MORE MISC. XSE SCRIPT THREADS. BUMP THIS ONE. Thanks.

liuyanghejerry
December 20th, 2008, 05:41 PM
Well,I've donated my scripts to the ROM Hacking Newsletter,and should I post them here again?
BTW,you lost the ROM version imformation...

Hiche..
December 20th, 2008, 11:31 PM
Well, I have a HEADBUTT script. Do I post all the script if I want?

Also, in the two rock climb scripts, change this part #org @move, to this #org @move1. In both scripts.

Tropical Sunlight
December 21st, 2008, 03:27 AM
Well,I've donated my scripts to the ROM Hacking Newsletter,and should I post them here again?
BTW,you lost the ROM version imformation...
Please post them here, I'm too lazy to looks up the Newspapers (X-Buster made lazyness)

Well, I have a HEADBUTT script. Do I post all the script if I want?

Also, in the two rock climb scripts, change this part #org @move, to this #org @move1. In both scripts.
Done.
Yes, please post them here. Just make sure they're in XSE format.

Hiche..
December 21st, 2008, 03:42 AM
Name: Headbutt script
ROM info: FireRed BPRE
Effect: Like in Pokemon G/S/C versions.
Script:

#dynamic 0x800000

#org @headbutt
#raw 0x7C 0x1D 0x00
compare 0x800D 0x06
if 0x1 jump @could
#raw 0x9D 0x00 0x0D 0x80
#raw 0x7F 0x00 0x0D 0x80
#raw 0x82 0x01 0x1D 0x00
message @question
boxset 0x5
compare 0x800D 0x00
if 0x1 jump @end
message @used
boxset 0x6
#raw 0x68
#raw 0x9C 0x25 0x00
waitstate
jump 0x1Be06F

#org @could
message @you
boxset 0x6
release
end

#org @end
release
end

#org @question
= This tree could have a Pokemon\nin it. Use HEADBUTT?

#org @used
= \v\h02 used \v\h03!

#org @you
= This tree could be HEADBUTTed!

Credits: Dabomstew, Hiche.

Some explanations:

jump 0x1BE06F

It's the command that calls the Pokemon that are encountered, when you HEADBUTT the small tree.

HackMew
December 21st, 2008, 07:58 AM
This is a good idea, but it doesn't really make sense to use #raw for known commands.

machomuu
December 21st, 2008, 08:04 AM
I have a question, say I have a mini-game script, I can post it here for others to use?

Tropical Sunlight
December 21st, 2008, 08:26 AM
I have a question, say I have a mini-game script, I can post it here for others to use?
Sure you can! Not can, must.

HackMew I'm sorry but you should ask Hiche for that...

HackMew
December 21st, 2008, 08:37 AM
Sure you can! Not can, must.

HackMew I'm sorry but you should ask Hiche for that...

Well, you can still open the Command Help to see what commands are those, can't you? ;)

Hiche..
December 21st, 2008, 09:38 AM
Lol. I only put the #raw because to explain some. I will post it with XSE known commands later on.

#dynamic 0x800000

#org @1
checkattack 0x16
compare 0x800D 0x06
if 0x1 call @end
setanimation 0x00 0x800D
message @ha
boxset 5
compare LASTRESULT 0
if 0x1 goto @end
closeonkeypress
doanimation 0x25
waitstate
addvar 0x8000 0x1
goto @jump

#org @jump
compare 0x8000 0x01
if 0x4 goto @move
release
end

#org @end
release
end

#org @move
applymovement 0xFF @move1
waitmovement 0x0
subvar 0x8000 0x1
goto @jump

#org @ha
= It's some climbable rocks!\pWant to use VINE WHIP to\nclimb up them?

#org @move1
#raw 0x1E 0x1E 0x1E 0xFE

Edit the other part of the script. Here is the XSE format of the script. No #raws.

The Headbutt script, I will modify it tomorrow.

Dratii
December 22nd, 2008, 04:17 PM
For those that are confused, here is a more complete script

Name: Headbutt script
ROM info: FR
Effect: makes a wild pokemon appear after using headbutt

#org @headbutt
lock
checkattack 0x1D
compare 0x800D 0x6
if 0x1 goto @release
bufferpokemon2 0x0 0x800D
bufferattack 0x1 0x1D
message @head
boxset 0x5
compare 0x800D 0x0
if 0x1 goto @release
message @used
boxset 0x4
closeonkeypress
goto @treeshake
end

#org @treeshake
random 0xamount
compare 0x800D 0x0
if 0x1 goto @wildbattle offset
compare 0x800D 0x1
if 0x1 goto @wildbattle offset2
[the random amount is how many different ones you can add]


#org @used
= [buffer1] used HEADBUTT.

#org @head
= Pokemon live in this tree. Using\nHEADBUTT may cause them to come out.\pDo you want to use HEADBUTT?Credits Dratii

liuyanghejerry
December 22nd, 2008, 11:17 PM
I think I have to enter more than 24 chracters...



Name: Braille Script
ROM info: Firered English (BPRE)
Effect: Makes the words become braille
Script:



#dynamic 0x[your offset]
#org @start
lock
faceplayer
msgbox @3
boxset MSG_NORMAL 'Must be a msgbox!
braille @4
waitkeypress
release
end

#org @3
= There is something strange on the stone...

#org @4
#braille something 'the braille words


Comments & Bugs: NEVER forget a message box!

Credits Nintendo







Name: Move Tutor Script
ROM info: Firered English (BPRE)
Effect:You can learn a move from this script

Script:



#org @Start
lock
faceplayer
checkflag 0x200
compare LASTRESULT 0x1
if 0x1 goto @AlreadyLearnt
msgbox @WantToLearn
boxset 0x5
compare LASTRESULT 0x0
if 0x1 goto @DontWant
setvar 0x8005 0x1 ' 0x[Move number]
special 0x18D
setflag 0x200
release
end

Comments & Bugs: You can use any number between 0 and F. That gives us 16 possible moves to

use. You can find all possible moves on this page (http://www.serebii.net/red_green/move-tutor.shtml)

And if you want to change the move ,read this post

http://www.pokecommunity.com/showpost.php?p=4141210&postcount=258



Credits: Nintendo

Tropical Sunlight
December 24th, 2008, 03:17 AM
Thank you for the scripts you are donating.
It really helps beginners like me :)

Lady Berlitz
December 26th, 2008, 12:27 PM
I tried both of the Headbutt scripts, and neither of them work for me.

Hiche..
December 26th, 2008, 12:36 PM
I tried both of the Headbutt scripts, and neither of them work for me.

#dynamic 0x800000

#org @headbutt
checkattack 0x1D
compare 0x800D 0x06
if 0x1 jump @could
setanimation 0x00 0x800D
bufferpartypokemon 0x00 0x800D
bufferattack 0x01 0x1D
message @question MSG_YESNO
compare 0x800D 0x00
if 0x1 jump @end
message @used MSG_NORMAL
closeonkeypress
doanimation 0x25
waitstate
call 0x1Be06F

#org @could
message @you MSG_NORMAL
release
end

#org @end
release
end

#org @question
= This tree could have a Pokemon\nin it. Use HEADBUTT?

#org @used
= [buffer1] used [buffer2]!

#org @you
= This tree could be HEADBUTTed!

Try this. It's XSE. In what way it does not work? Like, you click on the headbutt tree, and nothing happens, or something else? Because it worked perfectly in my ROM.

This is for the new version of XSE.

Lady Berlitz
December 26th, 2008, 12:41 PM
No, I get an error in XSE when I try to compile it into the ROM.
Unknown keyword "jump" at line 19.

Hiche..
December 26th, 2008, 12:53 PM
I edited it again.(Before you post now). replace jump with call. See it. Also, you have the new XSE, right? 1.1.1

HackMew
December 26th, 2008, 01:24 PM
I edited it again.(Before you post now). replace jump with call. See it. Also, you have the new XSE, right? 1.1.1

Remember after call you still need end.

hot_kage
January 18th, 2009, 12:33 PM
#dynamic 0x800000

#org @1
#raw 0x7C 0x16 0x00
compare 0x800D 0x06
if 0x1 call @end
#raw 0x9D 0x00 0x0D 0x80
message @ha
boxset 5
compare LASTRESULT 0
if 0x1 goto @end
#raw 0x68
#raw 0x9C 0x25 0x00
waitstate
#raw 0x17 0x00 0x80 0x01 0x00
goto @jump
#org @jump
compare 0x8000 0x01
if 0x4 goto @move
release
end
#org @end
release
end
#org @move
applymovement 0xFF @move1
waitmovement 0x0
#raw 0x18 0x00 0x80 0x01 0x00
goto @jump

#org @ha
= It's some climbable rocks!\pWant to use VINE WHIP to\nclimb up them?

#org @move1
#raw 0x1E 0x1E 0x1E 0xFE

i found the various pointers don't have parameters
@end has none
@jump has none

Sonikku17
March 15th, 2009, 08:04 AM
Hey, thanks for the scripts! I tried the rock climb script, and it pretty much worked. However, for some reason, it repeats the movements 5 times (for instance, if I wanted it to push me one step down, it does five steps and stops). Is there a way to fix this?

Dragonmaster91
March 15th, 2009, 03:31 PM
i found the various pointers don't have parameters
@end has none
@jump has noneLook harder. They are there.

Hey, thanks for the scripts! I tried the rock climb script, and it pretty much worked. However, for some reason, it repeats the movements 5 times (for instance, if I wanted it to push me one step down, it does five steps and stops). Is there a way to fix this?
You change the movements in the script.

Applymovement @pointer

#org @pointer
#raw 0x(whatever)
#raw 0xFE

You change that part.

#dynamic 0x800000

#org @1
#raw 0x7C 0x16 0x00
compare 0x800D 0x06
if 0x1 call @end
#raw 0x9D 0x00 0x0D 0x80
message @ha
boxset 5
compare LASTRESULT 0
if 0x1 goto @end
#raw 0x68
#raw 0x9C 0x25 0x00
waitstate
#raw 0x17 0x00 0x80 0x01 0x00
goto @jump
#org @jump
compare 0x8000 0x01
if 0x4 goto @move
release
end
#org @end
release
end
#org @move
applymovement 0xFF @move1
waitmovement 0x0
#raw 0x18 0x00 0x80 0x01 0x00
goto @jump

#org @ha
= It's some climbable rocks!\pWant to use VINE WHIP to\nclimb down them?

#org @move1
#raw 0x1D 0x1D 0x1D 0xFETo: #org @move1
#raw 0x1D 0xFE

0m3GA ARS3NAL
March 15th, 2009, 09:46 PM
Hmm, this script seems useful indeed. A collaboration of scripts many people may want to use, all located in one place... Nice...

I may contribute in the future, if the thread does not die...
If it lasts a month, I'll post some fantastic scripts.
If not... well, I don't think I gotta explain that...

For this thread, I have a bit of advice... Try to enforce the format given, ESPECIALLY defining the ROM the script can be used in, if people start posting scripts that can only be used in Ruby, and then a FR/LG hacker comes, and uses it, well, things will end up a bit hectic... keep that in mind.

HackMew
June 17th, 2009, 03:09 PM
@ Spherical Ice:
Didn't you know that comparing LASTRESULT multiple times won't work? Each time you use the compare command, the LASTRESULT is updated. The if command checks the LASTRESULT, indeed. Another thing. You messed up the random command. Random work in the range (0, X + 1). So (0,9) would be (0,10). Also, 0x10 is not the same as 10, of course. Please don't mix hex and dec. You should have tested the script before posting it...
Anyway, here's the optimized (and working) version:

#dynamic 0x800000

#org @start
lock
random 0xA
compare LASTRESULT 0x9
if 0x1 goto @lucky
msgbox @nothing 0x6
release
end

#org @lucky
msgbox @jackpot 0x6
giveitem 0x1A 0x1 0x0
release
end

#org @nothing
= [PLAYER] reeled up the bucket...\p...\pNothing!

#org @jackpot
= [PLAYER] reeled up the bucket...\p...\pJackpot!

EDIT: You should update your XSE too, since it's old.

Spherical Ice
June 17th, 2009, 11:11 PM
I did test my script, and it worked fine! I used the LASTRESULT multiple times, as it was like that in diego's tutorial. On XSE, when I asked for a live update, it said that version 1.1.1 is the newest version. Thanks for the help, though, HackMew.

HackMew
June 18th, 2009, 07:37 AM
I did test my script, and it worked fine! I used the LASTRESULT multiple times, as it was like that in diego's tutorial. On XSE, when I asked for a live update, it said that version 1.1.1 is the newest version. Thanks for the help, though, HackMew.

It seemed to work fine, then. You're welcome.

Tropical Sunlight
June 18th, 2009, 09:40 AM
Name: Bike Stand
ROMbase: Currently just FR/LG
Effect: It just activates the bike
Script: #dynamic 0x0FF5E1

#org @start
lock
special 0x157
release
end

Comments & Bugs: Just gets ON the bike, doesn't get OFF yet
Credits: IceCharizard, Tropical Sunlight, or ~Watermelon

HackMew
June 18th, 2009, 10:44 AM
Name: Bike Stand
ROMbase: Currently just FR/LG
Effect: It just activates the bike
Script: #dynamic 0x0FF5E1

#org @start
lock
special 0x157
release
end

Comments & Bugs: Just gets ON the bike, doesn't get OFF yet
Credits: IceCharizard, Tropical Sunlight, or ~Watermelon

Don't get me wrong but... seriously, why should someone credit you for a simple special anyone can put in his/her script? I mean, some special lists are available alredy o.O

-DarK-
June 18th, 2009, 11:39 AM
Don't get me wrong but... seriously, why should someone credit you for a simple special anyone can put in his/her script? I mean, some special lists are available alredy o.O

I agree. Credits are only to be received for bigger and more complex scripts, otherwise you can put in a simple check/setflag script as well...

Tropical Sunlight
June 19th, 2009, 07:13 AM
I'm sorry but I don't think anyone's gonna post a big script here...
This is the point... Maybe I'll try smth with the script ;)

Spherical Ice
June 20th, 2009, 01:09 AM
~Watermelon, I don't think I'll add it up, for the reasons mentioned above.

Tropical Sunlight
June 20th, 2009, 01:38 AM
That's fine with me, I'm still trying smth out ;)

Full Metal
July 6th, 2009, 05:33 PM
Here is a much better bike mounting script.
It
A) checks for the player even having the bike
B) asks the player if he/she wants to mount it!
I've not yet tested it, but it should work.

#dynamic 0x800000

#org @begin
lock
faceplayer
checkitem 0x168 0x1
if 0x1 jump @havebike
release
end

#org @havebike
message @yesno 0x5
if 0x0 goto @pushno
special 0x157
release
end

#org @pushno
release
end

#org @yesno
= Do you want to mount your bike?

And no credits needed o'course

Tropical Sunlight
July 7th, 2009, 04:44 AM
Here is a much better bike mounting script.
It
A) checks for the player even having the bike
B) asks the player if he/she wants to mount it!
I've not yet tested it, but it should work.

#dynamic 0x800000

#org @begin
lock
faceplayer
checkitem 0x168 0x1
if 0x1 jump @havebike
release
end

#org @havebike
message @yesno 0x5
if 0x0 goto @pushno
special 0x157
release
end

#org @pushno
release
end

#org @yesno
= Do you want to mount your bike?

And no credits needed o'course
It is much better, put this one up!
Mine was just a special.

HackMew
July 7th, 2009, 06:31 AM
Here is a much better bike mounting script.
It
A) checks for the player even having the bike
B) asks the player if he/she wants to mount it!
I've not yet tested it, but it should work.

#dynamic 0x800000

#org @begin
lock
faceplayer
checkitem 0x168 0x1
compare LASTRESULT 0x1
if 0x1 jump @havebike
release
end

#org @havebike
message @yesno 0x5
compare LASTRESULT 0x0
if 0x1 goto @pushno
special 0x157
release
end

#org @pushno
release
end

#org @yesno
= Do you want to mount your bike?

And no credits needed o'course

It should, but it won't. Since this is not the Script Help Thread, please post working, tested scripts only thanks. Fixes in bold. And here's the optimized script:

#dynamic 0x800000

#org @begin
lock
faceplayer
checkitem 0x168 0x1
compare LASTRESULT 0x1
if 0x0 jump @no
message @mount 0x5
compare LASTRESULT 0x0
if 0x1 goto @no
special 0x157
release
end

#org @no
release
end

#org @mount
= Do you want to mount your bike?

ExitWound
July 14th, 2009, 10:30 PM
Name: POKéDEX Given
ROMbase: Sapphire
Effect: Enables the POKéDEX in the start menu
Script: Not needed
Comments & Bugs: My script is complete except for 1 problem: what flag is set or what special is used to activate the POKéDEX in the start menu for Sapphire?

Tropical Sunlight
July 14th, 2009, 11:02 PM
Name: POKéDEX Given
ROMbase: Sapphire
Effect: Enables the POKéDEX in the start menu
Script: Not needed
Comments & Bugs: My script is complete except for 1 problem: what flag is set or what special is used to activate the POKéDEX in the start menu for Sapphire?
Eh... You need to post a script, maybe? O.o

Name: Honey Tree
ROMbase: Whatever, I used FR
Effect: A honey tree script which requires Honey in order to encounter a random Pokemon.
Script:
#dynamic 0x0FF5E1

#org @start
lock
checkflag 0x200
compare LASTRESULT 0x1
if 0x1 call @already
msgbox @honeytree MSG_NORMAL
checkitem ITEM_HONEY 0x1
compare LASTRESULT 0x1
if 0x1 call @honey
setflag 0x200
release
end

#org @honey
msgbox @hunny MSG_YESNO
compare LASTRESULT 0x1
if 0x1 call @ona
return

#org @already
msgbox @pokemon MSG_NORMAL
random 0x0A
compare LASTRESULT 0x0
if 0x1 call @1
compare LASTRESULT 0x1
if 0x1 call @2
compare LASTRESULT 0x2
if 0x1 call @3
compare LASTRESULT 0x3
if 0x1 call @4
compare LASTRESULT 0x4
if 0x1 call @5
compare LASTRESULT 0x5
if 0x1 call @6
compare LASTRESULT 0x6
if 0x1 call @7
compare LASTRESULT 0x7
if 0x1 call @8
compare LASTRESULT 0x8
if 0x1 call @9
compare LASTRESULT 0x9
if 0x1 call @10
clearflag 0x200
release
end

#org @1
wildbattle PKMN_WURMPLE 0x8 0x0
return

#org @2
wildbattle PKMN_COMBEE 0xD 0x0
return

#org @3
wildbattle PKMN_WURMPLE 0x7 0x0
return

#org @4
wildbattle PKMN_WURMPLE 0xA 0x0
return

#org @5
wildbattle PKMN_MUNCHLAX 0xE 0x0
return

#org @6
wildbattle PKMN_HERACROSS 0x8 0x0
return

#org @7
wildbattle PKMN_AIPOM 0x8 0x0
return

#org @8
wildbattle PKMN_COMBEE 0x8 0x0
return

#org @9
wildbattle PKMN_CHERUBI 0x8 0x0
return

#org @10
wildbattle PKMN_CHERUBI 0x8 0x0
return

#org @ona
removeitem ITEM_HONEY 0x1
msgbox @hungry MSG_NORMAL
return

#org @pokemon
= Huh?\pIt looks like there's a POKéMON on\nthe HONEY TREE!

#org @honeytree
= It's a HONEY TREE.

#org @hunny
= Would you like to slather the bark\nwith HONEY?

#org @hungry
= [player] slathered the bark with\nHONEY.
Comments & Bugs: You need to make a different flag for all the honey trees, unless you want to slather one tree and catch Pokemon on another.
I didn't debug the script, replace the Pokemon with the ones you prefer.
Also, you need the item honey.
I replaced it with Berry Juice, but again, whatever you prefer.

ExitWound
July 15th, 2009, 05:55 AM
Eh... You need to post a script, maybe? O.o

Well I didn't think my script was necessary but here it is:

#dynamic 0x80731D

#org @start
checkflag 0x1005
if b_true goto @nevermind
applymovement 0xFF @1move
applymovement 0x21 @2move
waitmovement 0x0
msgbox @1msg 0x6
Something here to activate pokedex in start menu
fanfare 0x13E
msgbox @2msg 0x4
waitfanfare
closeonkeypress
fadescreen 0x1
applymovement 0x21 @3move
waitmovement 0x0
setflag 0x1005
fadescreen 0x0
release
end

#org @1msg
= [player], I almost forgot. You're\ngonna need this if you want to\lhave an easier journey.

#org @2msg
= [red_rs]You received a POKéDEX!

#org @nevermind
release
end

#org @1move
#raw 0x56 0x2 0xFE

#org @2move
#raw 0xB 0xFE

#org @3move
#raw 0x2F 0x2D 0x2D 0x54 0xFE

Spherical Ice
July 17th, 2009, 01:25 AM
Well I didn't think my script was necessary but here it is:

#dynamic 0x80731D

#org @start
checkflag 0x1005
if b_true goto @nevermind
applymovement 0xFF @1move
applymovement 0x21 @2move
waitmovement 0x0
msgbox @1msg 0x6
Something here to activate pokedex in start menu
fanfare 0x13E
msgbox @2msg 0x4
waitfanfare
closeonkeypress
fadescreen 0x1
applymovement 0x21 @3move
waitmovement 0x0
setflag 0x1005
fadescreen 0x0
release
end

#org @1msg
= [player], I almost forgot. You're\ngonna need this if you want to\lhave an easier journey.

#org @2msg
= [red_rs]You received a POKéDEX!

#org @nevermind
release
end

#org @1move
#raw 0x56 0x2 0xFE

#org @2move
#raw 0xB 0xFE

#org @3move
#raw 0x2F 0x2D 0x2D 0x54 0xFE

You seem to have misunderstood the purpose of this thread. It's for posting completed, workig scripts that most hackers will find useful to use in their hacks. For help on the scripts, the Script Help Thread is where you should be. If you do happen to understand this thread, and you're posting that script for other people, I can't really see why other would want to use the movement stuff, etc. The flag for activating the National Dex can be found in scripting tutorials, such as diegoisawesome's.

sab
July 21st, 2009, 08:23 AM
effect: a random weather script
game: all gba games
credit: sab
script:

'---------------
#org 0x(offset)
random 0x0A
compare LASTRESULT 0x0
if 0x1 goto @1
compare LASTRESULT 0x1
if 0x1 goto @2
compare LASTRESULT 0x2
if 0x1 goto @3
compare LASTRESULT 0x3
if 0x1 goto @4
compare LASTRESULT 0x4
if 0x1 goto @5
compare LASTRESULT 0x5
if 0x1 goto @6
compare LASTRESULT 0x6
if 0x1 goto @7
compare LASTRESULT 0x7
if 0x1 goto @8
compare LASTRESULT 0x8
if 0x1 goto @9
compare LASTRESULT 0x9
if 0x1 goto @10

#org @1
setweather 0x1
doweather
end

#org @2
setweather 0x2
doweather
end

#org @3
setweather 0x3
doweather
end

#org @4
setweather 0x4
doweather
end

#org @5
setweather 0x5
doweather
end

#org @6
setweather 0x7
doweather
end

#org @7
setweather 0xb
doweather
end

#org @8
setweather 0xd
doweather
end

#org @9
setweather 0x2
doweather
end

#org @10
setweather 0xb
doweather
end

558122_DG
December 30th, 2009, 04:41 PM
cool...those are pretty custom scripts :) I've seen em at work in your hack and they seem pretty nice to me :) maybe you should post the vid of them at work that will make this post better, and maybe an explanation of how they work :)

sky_queen3
December 30th, 2009, 05:23 PM
Hmm, these look like fun. :D

Haku.
December 30th, 2009, 09:15 PM
Stealing script.
Works for FR/LG only!

#dynamic 0x[offset]
#org @start
msgbox @1 0x5
compare LASTRESULT 0x01
if 0x01 goto @yes
release
end

#org @yes
random 0x02
compare LASTRESULT 0x0
if 0x1 goto @steal
compare LASTRESULT 0x1
if 0x1 goto @caught
end

#org @steal
random 0x02
compare lastresult 0x0
if 0x1 goto @pokeball
compare lastresult 0x01
if 0x1 goto @potions
end

#org @caught
msgbox @2 0x6
warp 0x[map bank] 0x[map no.] 0xFF 0x[x position] 0x[Y position]
end

#org @pokeball
random 0x03
compare lastresult 0x0
if 0x1 goto @1pokeball
compare lastresult 0x01
if 0x2 goto @2pokeball
compare lastresult 0x02
if 0x3 goto @3 pokeball
end

#org @1pokeball
giveitem 0x04 0x1 MSG_OBTAIN
closeonkeypress
release
end

#org @2pokeball
giveitem 0x04 0x02 MSG_OBTAIN
closeonkeypress
release
end

#org @3pokeball
giveitem 0x04 0x03 MSG_OBTAIN
closeonkeypress
release
End

#org @potions
random 0x3
compare lastresult 0x0
if 0x1 goto @1potion
compare lastresult 0x01
if 0x2 goto @2potion
compare lastresult 0x02
if 0x3 goto @3potion
end

#org @1potion
giveitem 0xD 0x1 MSG_OBTAIN
closeonkeypress
release
end

#org @2potion
giveitem 0xD 0x2 MSG_OBTAIN
closeonkeypress
release
end

#org @3potion
giveitem 0xD 0x3 MSG_OBTAIN
closeonkeypress
release
end

#org @1
= Do you want to steal some items?

#org @2
= Hey you!What are you doing!Get out from here!

altariaking
December 30th, 2009, 09:18 PM
these scripts are really good

Spherical Ice
December 31st, 2009, 03:37 AM
Why not just bump the old one - you can do it in Docs and Tuts. -.-''

lilfabbro
January 3rd, 2010, 01:25 AM
where would i put these scripts do i set them on tiles or what? and the steal script is that to steal other trainers pokemon?

Spherical Ice
January 4th, 2010, 04:02 AM
The thief one is a script that allows you to steal items from a PokéMart if the author of the hack positions the script on a script tile which is wherever the stock that is being stolen is, and yes, a majority, if not all, of these scripts are to be put on Script tiles, i.e the green tiles with a yellow S.

I still think all three of the Misc XSE Script threads should just be merged. Harry, could you do the honours? (That is if the OP agrees.)

lilfabbro
January 4th, 2010, 05:00 AM
thanks master, and im not that noob lol, i just didnt know wether they were tile scripts or somthing else but thanks for the help

thedgr05
January 4th, 2010, 08:36 PM
Here's one FR/LG Only:
Weird Tree:
'---------------
#org 0x(offset)
special 0x187
compare LASTRESULT 0x2
if 0x1 call 0x81A7AE0
special 0x188
compare 0x4025 0x1F4
if 0x0 call 0x87800B0
msgbox 0x8780100 MSG_FACE '"It's a weird tree.\pWhat's that[.]..."
giveitem 0x8B 0x1 MSG_OBTAIN
releaseall
special 0x197
end
'---------------
#org 0x1A7AE0
release
end
'---------------
#org 0x7800B0
msgbox 0x87800C0 MSG_FACE '"It's a weird tree.\pWait a sec[.]\..."
end

'---------
' Strings
'---------
#org 0x780100
= It's a weird tree.\pWhat's that[.]\pIt's a BERRY!!!
#org 0x7800C0
= It's a weird tree.\pWait a sec[.]\pNah, nothing here.

EDIT: This goes in the singpost type (the red squares with an S in Adv map)

altariaking
January 5th, 2010, 09:02 AM
for some reason xse keeps saying, when I try to compile the thief script, that "compare LASTRESULT" is an unknown word, how come?

Spherical Ice
January 5th, 2010, 09:06 AM
If LASTRESULT isn't working, I believe you should use 0x800D, but don't quote me on that. The Script Help Thread is really where you should go, altariaking. :/

Omega Zero
January 5th, 2010, 05:41 PM
Yes finally :) all of these are merged but.. some of the Xse have raws in it which shouldn't be in there

Darthatron
January 5th, 2010, 06:53 PM
Half decent 'Headbutt Script':
//-------------------------------------
//Preperations
//-------------------------------------
#dynamic 0x800000
#define cAttack 0x1D //Change this value to use another attack

//-------------------------------------
//Main Script
//-------------------------------------
#org @Main
lockall //Lock everything from moving
checkattack cAttack //Stores the first Pokémon who knows the attack into the variable 0x800D
compare 0x800D 0x06 //Makes sure a Pokémon knows the attack...
if 0x01 goto @NotKnown //If the value is 6 then no Pokémon knows the attack
setanimation 0x00 0x800D //The Pokémon animation is set with the Pokémon who knows the attack
bufferpartypokemon 0x00 0x800D //Puts the Pokémon who knows the attack into [buffer1]
bufferattack 0x01 cAttack //Puts the attack name into [buffer2]
msgbox @Message1 0x05 //A Yes/No box appears with the message
compare 0x800D 0x00 //Checks in "No" was selected
if 0x01 goto @DoNotWant //If it was, quit
msgbox @Message2 0x04 //"[buffer1] used [buffer2]!" >> Keep open
closeonkeypress //Close the msgbox when a key is pressed
doanimation 0x25 //Shows the Pokémon animation
waitstate //Waits for the animation to complete
setvar 0x8004 0x01 //Set up to shake screen
setvar 0x8005 0x01
setvar 0x8006 0x0C
setvar 0x8007 0x02
special 0x136 //Shake screen
pause 0x20 //Wait 1~ second
special 0xAB //Call a random battle from the "Tree" section of wild Pokémon
compare 0x800D 0x00 //Checks if a wild battle happened
if 0x1 goto @DoNotWant //If not, quit
waitstate //Wait for the battle to complete
releaseall //Allow the player to move freely again
end //End the script

//-------------------------------------
//Sub Scripts
//-------------------------------------
#org @NotKnown
msgbox @Message3 0x03
end

#org @DoNotWant
releaseall
end

//-------------------------------------
//Messages
//-------------------------------------
#org @Message1
= This tree may contain a Pokemon.\nUse the move [buffer2]?

#org @Message2
= [buffer1] used [buffer2]!

#org @Message3
= This tree may contain a Pokemon.\nIt may be able to be knocked out.

Yes finally :) all of these are merged but.. some of the Xse have raws in it which shouldn't be in there
It won't make a difference, except for some people not being able to understand it as easily.

sky_queen3
January 5th, 2010, 11:20 PM
Uh, how do I use the last one, my character just frezes on the spot when I walk on the green S tile. :|

Omega Zero
January 5th, 2010, 11:23 PM
Uh, how do I use the last one, my character just frezes on the spot when I walk on the green S tile. :|

in advanced map put
Unknown 0300
var number 4050
hope it helps :)

sky_queen3
January 5th, 2010, 11:49 PM
Well, it at least works now. :D

Spherical Ice
January 7th, 2010, 12:00 AM
Er, no.

#dynamic 0xoffset

#org @start
lock
faceplayer
trainerbattle 0x9 0xid 0x3 @intro @defeat
msgbox @text 0x6
release
end

#org @intro
= Text.

#org @defeat
= Text.

#org @text
= Text.

You don't seem to get the hang of the thread. It's for scripts that are original and aren't explained in tutorials because the commands aren't used specifically for said scripts. You just explained how to make a different type of trainerbattle. -.-

Also, I've merged all four of these threads to prevent clutter. Please don't make any more copies of this thread, and remember that you can bump threads in Doc and Tuts!

trebornosliw
January 30th, 2010, 06:18 AM
Okay, so I have a quick question about the Move Tutor script, right here:

#org @Start
lock
faceplayer
checkflag 0x200
compare LASTRESULT 0x1
if 0x1 goto @AlreadyLearnt
msgbox @WantToLearn
boxset 0x5
compare LASTRESULT 0x0
if 0x1 goto @DontWant
setvar 0x8005 0x1 ' 0x[Move number]
special 0x18D
setflag 0x200
release
end
Now, after I've changed setvar 0x8005 0x1 to setvar 0x8005 0xwhatever, will the script find out on its own what Pokemon can or cannot learn the attack? Where does the program get that info?
I've got a script that I'm working on that I'll post later, though it's nothing compared to some of the awesome stuff I'm seeing here.

Spherical Ice
January 30th, 2010, 08:45 AM
@ Trebonsliw: I'm pretty sure that it searches through the whole of the player's party to see if any of them can learn it. I'm not sure where it gets the info from, though. Trial and error would be the only way to find out.

HackMew
January 30th, 2010, 08:54 AM
@ Trebonsliw: I'm pretty sure that it searches through the whole of the player's party to see if any of them can learn it. I'm not sure where it gets the info from, though. Trial and error would be the only way to find out.

Yeah, the special should handle that.

trebornosliw
January 30th, 2010, 01:47 PM
Okay, thanks! It's an awesome script, I'm definitely going to be using it.

hashtag
February 18th, 2010, 02:10 AM
#dynamic 0x<offset>

#org @start
lock
faceplayer
showmoney 0x0 0x0 0x0
msgbox @msg1 MSG_KEEPOPEN
closeonkeypress
multichoice 0x14 0x1 0x<mcnumber> 0x0
compare 0x800D 0x0
if 0x1 goto @common
compare 0x800D 0x1
if 0x1 goto @uncommon
compare 0x800D 0x2
if 0x1 goto @rare
hidemoney 0x0 0x0
release
end

#org @common
checkmoney 0x1388 0x0
compare 0x800D 0x0
if 0x1 goto @notenough
paymoney 0x1388 0x0
updatemoney 0x0 0x0 0x0
fanfare 0x13E
msgbox @msg3 MSG_KEEPOPEN
closeonkeypress
waitfanfare
hidemoney 0x0 0x0
random 0x5
compare 0x800D 0x0
if 0x1 goto @1
compare 0x800D 0x1
if 0x1 goto @2
compare 0x800D 0x2
if 0x1 goto @3
compare 0x800D 0x3
if 0x1 goto @4
compare 0x800D 0x4
if 0x1 goto @5
release
end

#org @1
giveegg 0x<species>
release
end

#org @2
giveegg 0x<species>
release
end

#org @3
giveegg 0x<species>
release
end

#org @4
giveegg 0x<species>
release
end

#org @5
giveegg 0x<species>
release
end

#org @notenough
hidemoney 0x0 0x0
msgbox @msg2 MSG_KEEPOPEN
closeonkeypress
release
end

#org @uncommon
checkmoney 0x2710 0x0
compare 0x800D 0x0
if 0x1 goto @notenough
paymoney 0x2710 0x0
updatemoney 0x0 0x0 0x0
fanfare 0x13E
msgbox @msg3 MSG_KEEPOPEN
closeonkeypress
waitfanfare
hidemoney 0x0 0x0
random 0x5
compare 0x800D 0x0
if 0x1 goto @k1
compare 0x800D 0x1
if 0x1 goto @k2
compare 0x800D 0x2
if 0x1 goto @k3
compare 0x800D 0x3
if 0x1 goto @k4
compare 0x800D 0x4
if 0x1 goto @k5
release
end

#org @k1
giveegg 0x<species>
release
end

#org @k2
giveegg 0x<species>
release
end

#org @k3
giveegg 0x<species>
release
end

#org @k4
giveegg 0x<species>
release
end

#org @k5
giveegg 0x<species>
release
end

#org @rare
checkmoney 0x61A8
compare 0x800D 0x0
if 0x1 goto @notenough
paymoney 0x61A8 0x0
updatemoney 0x0 0x0 0x0
fanfare 0x13E
msgbox @msg1 MSG_KEEPOPEN
closeonkeypress
waitfanfare
hidemoney 0x0 0x0
random 0x3
compare 0x800D 0x0
if 0x1 goto @rare1
compare 0x800D 0x1
if 0x1 goto @rare2
compare 0x800D 0x2
if 0x1 goto @rare3
release
end

#org @rare1
giveegg 0x<species>
release
end

#org @rare2
giveegg 0x<species>
release
end

#org @rare3
giveegg 0x<species>
release
end

#org @msg1
= Hello, welcome to our Egg Shop!\pWhich kind of Egg would you like?

#org @msg2
= You don't have enough money.

#org @msg3
= [black_fr][player] received a [red_fr]Pokémon Egg[black_fr]!Here is a public egg shop script. Feel free to change any of the text and any of script. Just give credit to Manipulation; okay? The Multichoice box at the top should contain 'Uncommon, Common and Rare' learn how to change them okay. I'm too lazy to explain it.

Common - $5000
Uncommon - $10000
Rare - $25000

Team Rocket's Raichu
February 28th, 2010, 11:27 AM
Wow!...

I don't know what to say about this, except wow!

This will make hacks cooler. If I use these I will credit the makers.

EDIT: We should sticky this thread, if you ask me.

hashtag
February 28th, 2010, 11:42 AM
Just to inform everyone I've edited the script, if you're using it or plan to please update it with the newest version. The post was edited today.

NarutoActor
March 2nd, 2010, 01:38 PM
Okay well I liked harry's Idea for an egg shop, but I thought of a way where rare just gives you a higher percentage, while common just gives you a low percentage at a rare pokemon. This method means that even if you pick common you can get a rare egg(with luck), and if you pick rare you can get an un common pokemon(bad luck)

If you pick Rare
Chance of Rare Egg: 80%
Chance of Uncommon Egg: 20%
Chance of Common Egg:0%

If you pick uncommon:
Chance of Rare Egg:40%
Chance of Uncommon Egg:50%
Chance of Common Egg:10%

If you pick common:
Chance of Rare Egg:~13.33%
Chance of uncommon Egg:~16.66
Chance of Common Egg:70%

The way I would implement this is adding a message that states that you can buy a ticket, and green ticket has the best chance of a rare pokemon egg.Also that blue was the worse chance, but it is the cheapest.

Credits:
Manipulation (for original Egg Shop Script)
NarutoActor (For new method. )

Code:

#dynamic 0x<offset>

#org @start
lock
faceplayer
showmoney 0x0 0x0 0x0
msgbox @msg1 MSG_KEEPOPEN
closeonkeypress
multichoice 0x14 0x1 0x<mcnumber> 0x0
compare 0x800D 0x0
if 0x1 goto @common
compare 0x800D 0x1
if 0x1 goto @uncommon
compare 0x800D 0x2
if 0x1 goto @rare
hidemoney 0x0 0x0
release
end

#org @common
checkmoney 0x1388 0x0
compare 0x800D 0x0
if 0x1 goto @notenough
paymoney 0x1388 0x0
updatemoney 0x0 0x0 0x0
fanfare 0x13E
msgbox @msg3 MSG_KEEPOPEN
closeonkeypress
waitfanfare
hidemoney 0x0 0x0
random 0x1E
goto @com

#org @com
compare 0x800D 0x0
if 0x1 goto @1 'Uses only 2 rare pokemon, which was ment only for an example; you can add more.
compare 0x800D 0x1
if 0x1 goto @1
compare 0x800D 0x2
if 0x1 goto @2
compare 0x800D 0x3
if 0x1 goto @2
compare 0x800D 0x4
if 0x1 goto @3
compare 0x800D 0x5
if 0x1 goto @6
compare 0x800D 0x6
if 0x1 goto @3
compare 0x800D 0x7
if 0x1 goto @3
compare 0x800D 0x8
if 0x1 goto @4
compare 0x800D 0x9
if 0x1 goto @4
compare 0x800D 0xA
if 0x1 goto @5
goto @7 'stop comparing, since all other posiablitys would take you to a common pkmn.

#org @1
giveegg 0x<rare_species>
release
end

#org @2
giveegg 0x<rare_species>
release
end

#org @3
giveegg 0x<uncommon_species>
release
end

#org @4
giveegg 0x<uncommon_species>
release
end

#org @5
giveegg 0x<common_species>
release
end

#org @6
giveegg 0x<common_species>
release
end

#org @7
random 0x1
compare LASTRESULT 0x0
if true goto @5
goto @6

#org @notenough
hidemoney 0x0 0x0
msgbox @msg2 MSG_KEEPOPEN
closeonkeypress
release
end

#org @uncommon
checkmoney 0x2710 0x0
compare 0x800D 0x0
if 0x1 goto @notenough
paymoney 0x2710 0x0
updatemoney 0x0 0x0 0x0
fanfare 0x13E
msgbox @msg3 MSG_KEEPOPEN
closeonkeypress
waitfanfare
hidemoney 0x0 0x0
random 0xA
goto @com

#org @rare
checkmoney 0x61A8
compare 0x800D 0x0
if 0x1 goto @notenough
paymoney 0x61A8 0x0
updatemoney 0x0 0x0 0x0
fanfare 0x13E
msgbox @msg1 MSG_KEEPOPEN
closeonkeypress
waitfanfare
hidemoney 0x0 0x0
random 0x5
goto @com

#org @msg1
= Hello, welcome to our Egg Shop!\pWhich kind of Egg would you like?

#org @msg2
= You don't have enough money.

#org @msg3
= [black_fr][player] received a [red_fr]Pokémon Egg[black_fr]!


Side Notes: Feel Free to add more than 7 to change the percentages around, also re-arranging the Random <number> will change the percentages.

PeregrineFig
March 13th, 2010, 01:52 PM
Name: Random Clefairy Battle script
ROM: FireRed (US Version)
Description: This is a simple little script, but it might come in handy for a newbie hacker. When you talk to the Clefairy a random value between 0 and F is drawn, and if it's 0, you battle the Clefairy for a chance to catch it, otherwise, it bounces away into the mountains and disappears until you re-enter the map.
Script:

#dynamic 0x740000
#org @start
lock
faceplayer
cry 0x23 0x0
msgbox @text 0x6
random 0xF
compare 0x800D 0x0
if 0x1 goto @clefairybattle
applymovement 0x1 @move
waitmovement 0x0
hidesprite LASTTALKED
release
end

#org @clefairybattle
wildbattle 0x23 0x5 0x0
fadescreen 0x1
hidesprite LASTTALKED
fadescreen 0x0
setflag 0x202
release
end

#org @text
= CLEFAIRY: Clef! Cleffa!

#org @move
#raw 0x15
#raw 0x15
#raw 0x15
#raw 0xFE

Comments: Obviously you can change the flag, pokemon and level, movements, etc to whatever you want. Just make sure to set the person ID to the same as the flag used, or the Clefairy won't vanish after battling it. Of course, you might also want it to stay there even after battling it once, in that case just get rid of the setflag command and leave the ID as 0000.
Credits: I wrote this myself, however, diegoisawesome's tutorial taught me quite a few things about XSE scripting.

SwirlyBirds
May 21st, 2010, 10:29 PM
effect: a random weather script
game: all gba games
credit: sab
script:

'---------------
#org 0x(offset)
random 0x0A
compare LASTRESULT 0x0
if 0x1 goto @1
compare LASTRESULT 0x1
if 0x1 goto @2
compare LASTRESULT 0x2
if 0x1 goto @3
compare LASTRESULT 0x3
if 0x1 goto @4
compare LASTRESULT 0x4
if 0x1 goto @5
compare LASTRESULT 0x5
if 0x1 goto @6
compare LASTRESULT 0x6
if 0x1 goto @7
compare LASTRESULT 0x7
if 0x1 goto @8
compare LASTRESULT 0x8
if 0x1 goto @9
compare LASTRESULT 0x9
if 0x1 goto @10

#org @1
setweather 0x1
doweather
end

#org @2
setweather 0x2
doweather
end

#org @3
setweather 0x3
doweather
end

#org @4
setweather 0x4
doweather
end

#org @5
setweather 0x5
doweather
end

#org @6
setweather 0x7
doweather
end

#org @7
setweather 0xb
doweather
end

#org @8
setweather 0xd
doweather
end

#org @9
setweather 0x2
doweather
end

#org @10
setweather 0xb
doweather
end



I tried the random weather script and it just said
"No dynamic start offset specified."
Does anyone know how to fix it?

Spherical Ice
May 21st, 2010, 10:42 PM
Add "#dynamic 0xOFFSET" at the beginning, with 0xOFFSET being your offset.

Dark Sneasel
July 25th, 2014, 07:47 AM
Reviving this hella old thread for a script I just made and tested in Emerald. It's quite simple, but still pretty cool. The purpose of it is this:


q1Tx0U4W570


Anyways, it's for Emerald and here's how it works. Italics means you can change anything there, and I just have it there to show the script.

#dynamic 0xE40000
#org @start
lock
faceplayer
msgbox @1 0x6 //just had that there, obviously not mandatory
goto @choose
end

#org @choose
special 0x28 //stores party in RAM
fadescreen 0x1
special 0x2A //Pokemon choosing screen
waitstate
compare LASTRESULT 0x0
if 0x5 goto @it //if all went well, like no cancelling, go to @it
special 0x29 //restores party (In my case it won't be mandatory since I'm forcing the player to choose in @no, obviously you can change that like in the steven battle where he tells you to get ready or something
goto @no //if something bad did happen, goto @no

#org @it
special 0xFB //it updates your party I guess? Without it I still had 6 pokemon
msgbox @3 0x6
trainerbattle 0x3 0x10 0x0 @win
msgbox @4 0x6
special 0x29 //restore your party
release
end

#org @win
= Oh no.

#org @4
= I will now return your party.

#org @3
= Battle begin.

#org @no
msgbox @2 0x6
goto @choose //here for all of @no you can make it do something else, and it will be fine because your party has already been restored back with special 0x29

#org @2
= I said choose.

#org @1
= Choose.

and without my comments, and erased all of my stuff

#dynamic 0xE40000
#org @start
lock
faceplayer
goto @choose
end

#org @choose
special 0x28
fadescreen 0x1
special 0x2A
waitstate
compare LASTRESULT 0x0
if 0x5 goto @it
special 0x29
goto @no

#org @it
special 0xFB
INSERT YOUR STUFF HERE
special 0x29
release
end

#org @no


NOTE:As of now, losing the battle will leave you only with the pokemon you choose. I guess a solution for that would be putting special 0x29 in a level script, perhaps you can put a sethealingplace command IN the script somewhere, so when they lose they will go to that one and have a special 0x29 there. Sorry about that

Dark Sneasel
July 30th, 2014, 11:48 PM
Hate to double post but it doesn't seem like anyone is gonna post here soon.
Okay, so my other script I'd like to share.
What it does: Okay, so you know when you use cut or an HM, your pokemon appears with the cool little background? Well, I found out how to make that happen with pokemon that aren't in your party. This could be good for scenes that a villain uses a pokemon to do something. I would post a video, but seeing as how I put a video in my other post, I don't wanna advertise or anything.
special 0x28 //stores party in RAM
callasm 0x8E40AA1 //Hackmew's routine, erases pokemon from party
callasm 0x8E40AA1
callasm 0x8E40AA1
callasm 0x8E40AA1
callasm 0x8E40AA1
callasm 0x8E40AF1 // Hackmew's routine, erases last pokemon from party
givepokemon 0x15F 0xA 0x0 0x0 0x0 0x0 //the pokemon you want to appear
checkattack 0x96 //like you would in an HM script, but put an attack you're 100% sure it has. Make the pokemon a level 1 if you want.
bufferpokemon 0x0 LASTRESULT
setanimation 0x0 LASTRESULT
doanimation 0x25
waitstate
special 0x29 //restores your party
Bugs I know: The player does an animation as well (raises pokeball). To fix that, move the camera 7 tiles or more to where you can't see the player like I did and then the script. Oh, it's for emerald, and for FR I haven't tried it, but if you wanna do it, replace special 0x28 to 0x27 and 0x29 to 0x28. Again, I haven't tried it, but it SHOULD work.

hashtag
July 31st, 2014, 01:07 AM
stuffLike the concept of that script and what it could do quite a lot, well done. :)

Dark Sneasel
August 6th, 2014, 08:58 PM
Reviving this hella old thread for a script I just made and tested in Emerald. It's quite simple, but still pretty cool. The purpose of it is this:


q1Tx0U4W570


Anyways, it's for Emerald and here's how it works. Italics means you can change anything there, and I just have it there to show the script.

#dynamic 0xE40000
#org @start
lock
faceplayer
msgbox @1 0x6 //just had that there, obviously not mandatory
goto @choose
end

#org @choose
special 0x28 //stores party in RAM
fadescreen 0x1
special 0x2A //Pokemon choosing screen
waitstate
compare LASTRESULT 0x0
if 0x5 goto @it //if all went well, like no cancelling, go to @it
special 0x29 //restores party (In my case it won't be mandatory since I'm forcing the player to choose in @no, obviously you can change that like in the steven battle where he tells you to get ready or something
goto @no //if something bad did happen, goto @no

#org @it
special 0xFB //it updates your party I guess? Without it I still had 6 pokemon
msgbox @3 0x6
trainerbattle 0x3 0x10 0x0 @win
msgbox @4 0x6
special 0x29 //restore your party
release
end

#org @win
= Oh no.

#org @4
= I will now return your party.

#org @3
= Battle begin.

#org @no
msgbox @2 0x6
goto @choose //here for all of @no you can make it do something else, and it will be fine because your party has already been restored back with special 0x29

#org @2
= I said choose.

#org @1
= Choose.

and without my comments, and erased all of my stuff

#dynamic 0xE40000
#org @start
lock
faceplayer
goto @choose
end

#org @choose
special 0x28
fadescreen 0x1
special 0x2A
waitstate
compare LASTRESULT 0x0
if 0x5 goto @it
special 0x29
goto @no

#org @it
special 0xFB
INSERT YOUR STUFF HERE
special 0x29
release
end

#org @no


NOTE:As of now, losing the battle will leave you only with the pokemon you choose. I guess a solution for that would be putting special 0x29 in a level script, perhaps you can put a sethealingplace command IN the script somewhere, so when they lose they will go to that one and have a special 0x29 there. Sorry about that

So diegoisawesome showed me that your stats don't update after. To fix that, first insert this routine:

.text
.align 2
.thumb
.thumb_func
.global ParkHack

start: ldr r0, addr1
ldr r1, val1
ldr r0, [r0]
add r0, r0, r1
ldr r1, addr2
ldrh r1, [r1]
strb r1, [r0]
mov r1, #0x0
strb r1, [r0, #0x2]
strb r1, [r0, #0x4]
strb r1, [r0, #0x6]
strb r1, [r0, #0x8]
strb r1, [r0, #0xA]
bx lr

.align 2
addr1: .word 0x03005D90
addr2: .word 0x020375F0
val1: .word 0x00000CAA


(credit diegoisawesome for it)

And then this

#org @it
callasm 0x(offset + 1) //sets proper slot for 0xEA
special 0xFB //removes all other Pokémon
msgbox @3 0x6
trainerbattle 0x3 0x10 0x0 @win
msgbox @4 0x6
setvar 0x8004 0x6
special 0xEA //store new stats into temporary space
special 0x29 //restore your party from temporary space
release
end