Auto gym switcher(1.2.4) PC/mobile
-
Thread created on 02:52:55 - 13/11/23 (2 years ago)|Last replied 13:48:23 - 20/06/26 (3 months ago)
Download from greasyfork here
Raw script, GreasyFork removes the updateURL.I am not maintaining this fork, contact him for issues related to his fork specifically.
This script will check if the gym you are using is optimal for the stat you are training. If it's not, it will change gyms when you click to train, you can then click again to train. It will keep track of manual gym changes and will let you know when it automatically changes gyms, a message will appear where the train message would be. This script can be automatically updated. It SHOULD check and consider newly unlocked gyms, but I haven't tested it yet. Also, make sure to disable tornpda's own gym ratio feature.
PS: the script was made compliant since beta, it is perfectly legal. One click, one request, one action.PSS: if it broke for you on newer versions of TM, setting 'Modify existing content security policy (CSP) headers' to 'Yes' fixes it.
1.1.0: now energy cost, logo, name and selection buttons are changed visually to match the gym being used.
1.1.1: just made the script a bit more resilient in case element's classes and ids change.
1.1.2: made compatible with TornPDA. It seems to glitch out when used in conjunction with the ratio script. Also, set it to inject at start.
1.2.0: added a gym ratio feature and a checkbox to disable auto swap. It works for me on TornPDA, but I have all other scripts disabled. One person said it's still broken there and another says it's broken for them even with all scripts disabled.
1.2.2: added colors to ratio feature. Fixed interaction with relocked specialist gyms. Fixed detection of newly unlocked gyms. Yes, I accidentally skipped 1.2.1 but I'm not feeling like resetting and force pushing the repository. Also it should fix duplicate elements on tornPDA.1.2.3: fixed the break caused by august, 22, 2024 update.
1.2.4: fixed visual elements not updating because of the anniversary event.
Last edited by Stephen_Lynx on 05:10:19 - 26/05/26 (4 months ago) -
-
Posted on 03:43:27 - 13/11/23 (2 years ago)Post link copied to clipboard Copy post linkFirst of all... link lol
By the way, from what I can tell, you're making a non-API network request to Torn without user interaction (as well as more than one request per interaction) which they don't allow.
-
-
Posted on 03:46:34 - 13/11/23 (2 years ago)Post link copied to clipboard Copy post linkHm, I didn't know the rules were that strict.
-
-
Posted on 05:16:21 - 13/11/23 (2 years ago)Post link copied to clipboard Copy post linkYeah, for non-API requests, you're supposed to have one user interaction (eg a button press) per request... and you're only supposed to make the call on pages where they're normally made (so you can't make a call to use an item from an attack loader for example).

-
-
-
-
Posted on 02:52:41 - 14/11/23 (2 years ago)Post link copied to clipboard Copy post linkSmall changes, but I made a breakthrough that will allow me to achieve what I wanted as a final experience: now instead of making a separate request for initial gym info, I piggy back the request made by the base script. This will allow me to use the same UI of the gym instead of a separate set of buttons and fields, but I'll leave that for tomorrow. Also, I added a updateUrl entry so users can update directly from TM.
-
-
Posted on 19:17:59 - 14/11/23 (2 years ago)Post link copied to clipboard Copy post linkReleased 1.0.
let's goooo
>:3 -
-
Posted on 11:44:25 - 15/11/23 (2 years ago)Post link copied to clipboard Copy post linkI added this to TamperMonkey and nothing appears on the Gym page unless I'm missing something?

-
-
Posted on 12:15:40 - 15/11/23 (2 years ago)Post link copied to clipboard Copy post linkCorrect, just click the stats you want to train.
-
-
Posted on 12:43:02 - 15/11/23 (2 years ago)Post link copied to clipboard Copy post linkYes. The first click will change gyms and not train. Only subsequent clicks will train you.
-
-
Posted on 16:27:36 - 16/11/23 (2 years ago)Post link copied to clipboard Copy post linkWill this work on TornPDA?
Not all changes are for the better. #BeCarefulWhatYouWishFor
-
-
Posted on 16:31:11 - 16/11/23 (2 years ago)Post link copied to clipboard Copy post linkDidn't test it. I haven't used tornPDA for a long time now, but from what I remember the UI is not too different. So I guess it might but I can't give you any guarantees.
edit: installed tornpda with my script, will post results when I land.Last edited by Stephen_Lynx on 16:45:52 - 16/11/23 (2 years ago) -
-
Posted on 16:53:56 - 16/11/23 (2 years ago)Post link copied to clipboard Copy post linkDidn't work.
-
-
Posted on 17:12:06 - 16/11/23 (2 years ago)Post link copied to clipboard Copy post linkJust my 2 cents, it's a bad user experience to have the gym switch override the train button.
I think a better way, is upon the user clicking train, do a check & math on the current gym and what the best gym is. Then, cancel the usual torn request and show a message back to the user.
"You're currently in YouSuck gym, the better gym to pick is: YouRock gym. The training request was cancelled. Switch gyms to continue."
Something like that.
Make the script prevent you from being dumb, and make the user correct the gym themselves with a little output information. IMO.
(Switching the gym for you might still be against the rules, not 100% sure)Last edited by MightyGoober on 17:13:16 - 16/11/23 (2 years ago)
-
-
Posted on 17:23:12 - 16/11/23 (2 years ago)Post link copied to clipboard Copy post linkAnd where exactly do you add the script for it to work? It just loads a page full of code?

-
-
Posted on 17:29:07 - 16/11/23 (2 years ago)Post link copied to clipboard Copy post linkI have changed the link to one from greasyfork with an install button.
-
-
Posted on 17:31:34 - 16/11/23 (2 years ago)Post link copied to clipboard Copy post linkI 100% will NOT make it just block training and display a message. If that would suffice, I wouldn't have made this script. The issue I had was that changing gyms manually was super clunky and slow. The one I wrote not only prevents you from being dumb but also streamlines the experience. Is it against the rules? I don't think so. The rules don't say anything about making a button perform a different action. The general consensus was that as long as one interaction performs one action within one http request, you are safe.
-
-
Posted on 17:43:35 - 16/11/23 (2 years ago)Post link copied to clipboard Copy post linkAs-is it sounds really cool. I'm selfishly hoping you'll get it working on TornPDA :-D since that's all I use for this game (a growing number of people are the same) but, even if not, what it seems to do just now is excellent.
Not all changes are for the better. #BeCarefulWhatYouWishFor
-
-
Posted on 17:45:06 - 16/11/23 (2 years ago)Post link copied to clipboard Copy post linkI'll have a look at it. The issue with tornpda is that it doesn't seem to offer an environment that is friendly to developing scripts. If I can get help on their discord, I'll post a second link for the tornpda version.
-






