Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automation with JoyToKey: A Basic Guide
#1
Lightbulb 
I mentioned to some people the other day that I took some of the tedium of breeding and EV training by automating the process (at least to an extent), and they asked if I could show them how to do it themselves. So, here it is. TwistedLogic's brief guide to relieving headaches and boredom.

Part I: Requirements


In order to do either of these, you will need the following:
  • A copy of Pokemon Uranium
  • A gamepad (any will do)
  • JoyToKey, which you can download [here]
  • A willingness to give up use of your computer for set periods of time
These are also recommended:
  • A timer
  • A four function calculator
  • Something to do while you wait
  • Having the Ninja Reunion sidequest completed


Part II: Build a Bot Workshop

Once you have J2K installed, open it up and you will see this window:

[Image: lK8t3d4.png]

Now we want to set up new profile, a set of gamepad to keyboard maps, specifically for our purpose, so let's hit File > New. You should get a pop-up window that looks like this:

[Image: F9bpAof.png]

Congratulations! Now you have a shiny new profile! Let's now choose the input we want to be our "auto-EV train" button. If you want to know which name in the table corresponds to which button on your gamepad, press the button and the corresponding name in the table will be highlighted yellow. For the purposes of this example, I will be using "Button 1", but it can be any input that your gamepad is capable of producing.

[Image: 510undj.png]

Once you've chosen your button, double click the name, and the button assignment window will pop up. Select the first field under "Keyboard emulation: Basic" and press your activate button (default C). Now when you press your chosen button on the gamepad, your computer will read it as you pressing the C key on your keyboard, but now we need to automate it.

If you look at the bottom of the window, you'll see a section labelled "Auto Repeat and Toggle". Click the "Auto Repeat" and "Toggle between ON and OFF" check boxes. Then place a number in the field labelled "times per second", I find that 5 works well for me and will be basing coming calculations on that rate.

[Image: UaTkAJW.png]

Click OK, and your EV training bot is complete, woooooo!

[Image: EbOKDKR.png]

So now that you have it, how do you use it? Well, you'll be glad to know that it's super easy! Go to Tsukinami Village and stand in front of the Ninja Master that corresponds to the stat you want to EV train and be sure to have the Pokemon you want to train at the front of your party. When you're ready, activate your bot by pressing the the assigned button, sit back, and let the game do the rest.

"But Twisty," you ask, "now that I've unleashed my artificial monstrosity upon the Tandor Region all it does is mindlessly pound at punching bags for all eternity. How do I stop this madness?"

Well, you're certainly the panicky one, aren't you? Regardless, turning killing the beast is as easy as awakening it in the first place. Simply press the button again!

Part III: Doing the Math

Okay, now that you have your bot ready to use, you may wonder, "How long should I run it if I want x EV's in a given stat?"

Great question, Billy! And I just happen to know the answer*.
*Provided you used the settings I provided and your machine runs the game at about the same framerate as mine.

If everything is running as it does on my computer (be sure to test to be sure), your Pokemon will go from 0 to 252 EV's in about 7 minutes, or roughly 3 EV's every 5 seconds, or an average of 8 EV's every punching session. Thus, if you want x EV's in a stat, you simply multiply that number by 5/3 and you have the number of seconds your Pokemon should train. If you want it in minutes and seconds, divide the result by 60, subtract the number before the decimal point (that will be your minutes), then multiply by 60 again to get the number of seconds.

As a quick example, let's say you have a Gargryph and want to train its HP EV's to 140:

140 EV's * 5 s / 3 EV's = 233.33333 s

Truncating that down to something usable, we have 233 s. If you have the right timer, you could stop there, but let's go a step further:

233 s * 1 min / 60 s = 3.88 min

So we'll keep note of the 3 min, and see how many seconds to add to that:

0.88 min * 60 s / 1 min = 52.8 s

Not that it matters much, but we can go ahead and round that up to partially make up for the fractions of a second we truncated earlier. Thus, if you want to give your Gargryph 140 EV's in HP, stand in front of Ninja Master Tarou, set your timer to 3:53, activate your bot and timer, and enjoy the fireworks!


I hope this guide has been helpful to you guys, at some point in the near future I'll also post a slightly moreĀ  advanced guide to automating a walk cycle for hatching eggs. See you then!
Reply
#2
is there a way to do it without a gamepad?
Reply
#3
In theory yes, though I haven't personally tested it with other programs. In principle, all you need is a configurable program that emulates a keypress. One example would be this, though I won't be able to guide you in setting it up. I also don't know of any program that does what you need to be able to do for the walk cycle besides JoyToKey, but I'll explain that when I get around to making that guide.
Reply
#4
Alrgiht. Thanks for all that. it's very helpful.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)