Skip to content

Instantly share code, notes, and snippets.

@sbaildon
Last active January 10, 2024 22:27
Show Gist options
  • Save sbaildon/30368a6d6c629a2f351b679a74a8c838 to your computer and use it in GitHub Desktop.
Save sbaildon/30368a6d6c629a2f351b679a74a8c838 to your computer and use it in GitHub Desktop.
Yakuza 0 Legend Dragon of Dojima/Mad Dog of Shimano styles AutoHotKey Script

Preface

I wrote this script when Yakuza 0 was a PS4 exclusive, but I've heard whispers that it works just fine for the PC version. No need for PS4 Remote Play

Info

Using the PS4 Remote Play and AutoHotKey for Windows you can automate leveling up the Legend styles for Kiryu (Dragon of Dojima), and Majima (Mad Dog of Shimano).

The PS4 Remote Play app allows keyboard emulation for the Dpad, and "x" button only—but that's all that's necessary for leveling up!

1 full talent tree takes about 5 minutes to automate.

Usage

Prerequisites

Running

  • Download legend.ahk
  • Use remote play to open the Legend style in game.
  • Move the cursor to the first red skill point.
  • Run the script, right click -> "Run Script"
  • Click in the Remote Play app and wait
  • Press escape to cancel

Notes

You've got 2 seconds from "Run Script" to click into the Remote Play app. Increase the number on line 120 to give yourself more time.

Change the number on line 122 to the number of iterations you want before you need to rerun the script

Increase the Sleep on line 6 if you need more a buffer when closing the skill up display. (See this DaMoggen's fork for examples https://gist.github.com/DaMoggen/9557e31891e1958966c9a67b9b2fb889)

You can't use your PC whilst the script is running, because the key presses are sent to the foreground window. I tried using ControlSend to specify which window to send key events to, but I couldn't get it to work for Remote Play.

If you've partially filled out a talent tree already, upgrade it to the next level.

If the script is interrupted for any reason, there's a good chance the Remote Play app will stop responding to the Dpad or the x button. Test them out in game before restarting the script. If they don't work, restarting the Remote Play app will fix it.

It's recommended the machine you're remote playing from, and the PS4 are connected to the same network with a cable. Random spikes in latency can mess up the automation. If your network connection is particularly bad, consider increasing some of the Loop and Sleep values, although this will slow down automation.

AcquireNode() {
Loop 185 {
Send {Return down}
}
Send {Return up}
Sleep 1100
Loop 20 {
Send {Return down}
}
Send {Return up}
}
PressDPad(DPadKey) {
Loop 10 {
Send {%DPadKey% down}
}
Send {%DPadKey% up}
Sleep 60
}
AcquireNodeAndMove(Direction) {
AcquireNode()
PressDPad(Direction)
}
AcquireFullTree() {
; Start from bottom red
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Left")
; Red left side
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Right")
PressDPad("Right")
; Red right side
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Right")
; Blue outside
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Down")
; Move to yellow center
PressDPad("Down")
PressDPad("Up")
PressDPad("Up")
PressDPad("Up")
PressDPad("Up")
PressDPad("Up")
; Yellow Tree middle from center
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
; Move to Right yellow
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Right")
; Move to blue and back to yellow
PressDPad("Left")
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Right")
; Move to left yellow side
PressDPad("Down")
PressDPad("Left")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Left")
; Get center bottom blue orbs
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Left")
; Get in position for blue
PressDPad("Left")
PressDPad("Up")
PressDPad("Up")
PressDPad("Up")
PressDPad("Up")
PressDPad("Up")
; Blue center lines
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
; Blue right lines
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Left")
; Blue left lines
PressDPad("Left")
AcquireNodeAndMove("Left")
AcquireNodeAndMove("Left")
AcquireNodeAndMove("Left")
AcquireNodeAndMove("Up")
; Blue outside
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Right")
;
; Should be finished now
; Reset cursor to start again
PressDPad("Right")
PressDPad("Down")
PressDPad("Down")
PressDPad("Down")
PressDPad("Down")
}
Sleep 2000
Loop 5 {
AcquireFullTree()
}
TrayTip, Yakuza, Finished
Esc::ExitApp
@btjman
Copy link

btjman commented Nov 19, 2021

im trying it out with a steam controller emulating Xbox on PC right now.

@iodrjhodrhjhdj-code
Copy link

doesn't work for me unfortunately

@sbaildon
Copy link
Author

doesn't work for me unfortunately

If you can explain what's happening, there may be a way to help you

@btjman
Copy link

btjman commented Jun 22, 2022 via email

@RyuHousen
Copy link

RyuHousen commented Jul 14, 2022

I figured out a more efficient path to the full tree (because as it turns out, the menu is extremely weird)

AcquireFullTree() {
; Start from bottom red
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Right")
; Red right side
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Right")
; Blue outside
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Left")
; Move to yellow center
PressDPad("Left")
PressDPad("Up")
PressDPad("Up")
; Yellow Tree middle from center
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
; Move to Right yellow
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Right")
; Move to blue and back to yellow
PressDPad("Left")
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Right")
AcquireNodeAndMove("Right")
; Move to left yellow side
PressDPad("Down")
PressDPad("Left")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Left")
; Get center bottom blue orbs
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Up")
; Get in position for blue
PressDPad("Up")
; Blue center lines
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
; Blue right lines
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Left")
; Blue left lines
PressDPad("Left")
AcquireNodeAndMove("Left")
AcquireNodeAndMove("Left")
AcquireNodeAndMove("Left")
AcquireNodeAndMove("Up")
; Blue outside
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
AcquireNodeAndMove("Up")
; Red left side
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
AcquireNodeAndMove("Down")
;
; Should be finished now
}

Also if you're using speedhacks on PC, you can just about reduce the timer on lines 2, 6, and 18 by a factor of 5.

@LioTheBadAss
Copy link

how do i download?

@DJCrazee
Copy link

Doesn't work anymore since Sony broke the keyboard function in Remote Play. Tried multiple times and literally nothing happens in game.

@ANt111hom
Copy link

Doesnt work remote play doesnt allow keyboards for some odd reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment