Support TOS Forum by making a donation or subscribing as a VIP member today!

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tool to check battle drops in advance
#1
After almost being unable to pass the recent Yog-Sothoth NM, I figured it would be helpful if you could determine ahead of time whether a PR mat would drop on the SM or not, so you can decide whether to use a diamond to revive or whether to quit and try again to save time, etc.

I have therefore written a Java program that can determine battle drops for you in advance. This program can be used for the previously mentioned purpose, but it can also be used to determine whether a raid will appear and drop in a biweekly/guild event, and whether a biweekly card will drop. For now, it can only detect card drops, but in the future I will also be adding support for detecting craft core, treasure chest, or soul drops.

This program can only run on your computer and will require you to transfer your XML file from your phone to your computer (instructions are included in the link), which can be a bit annoying. I am planning on eventually making an Android app that can do everything this program does directly on your phone, which can save you some time and effort transferring the XML file.

This program requires you to be playing TOS on a rooted Android device.

Please read the instructions and download the first release version of my program here: Github repository

I hope this can help some of my fellow summoners better optimize their time and diamonds when farming various stages in the game! Big Grin

Large variety of allies, ID 79172307 (Current main ally PR Yog-Sothoth)

Been playing since March 2015. Level 300+
Reply
#2
Please continue developing this, but there is a program that runs on Android phones that will tell you drops. Look up CodeDiablos. I forget the name of the app, but it's by them.

Just looked it up, it's called Card Explorer

Reply
#3
(04-18-2018, 06:01 AM)evilvoice Wrote: Please continue developing this, but there is a program that runs on Android phones that will tell you drops. Look up CodeDiablos. I forget the name of the app, but it's by them.

Just looked it up, it's called Card Explorer

Looks like that was last updated in 2014, so I don't know if it still works or not. Good to know that something like this exists though, so thank you Smile

I have unfortunately not developed any Android apps in like two years, so it will take me some time to relearn how to use Android Studio. My next target is to make a working Android app for this though, so I will let everyone know when I am ready to release a working Android release.

In the meantime, I do encourage everyone to try what I have right now so we can catch any bugs in the code to fix them immediately, so then I can just copy and paste this code into my Android app later knowing that there are no bugs in the code.

Large variety of allies, ID 79172307 (Current main ally PR Yog-Sothoth)

Been playing since March 2015. Level 300+
Reply
#4
No IOS Sad

Lol time to buy a shitty android
Reply
#5
Actually, everything about your account is in 1 file named com.madhead.tos.en_preferences.xml (about 5-6Mb in size). Before the battle (and before each round) you Android phone downloads this file from MH server.

I studied the file and found out that some information is not encrypted, so basically you can read all information & decode into visual data, like CardExplorer does now. Because CardExplorer has not been updated, some cards are not displayed fully, but we can still see the results.

Hope it helps.
[Image: 841a66da.jpg]
Reply
#6
(04-18-2018, 12:25 PM)kukingkong Wrote: Actually, everything about your account is in 1 file named com.madhead.tos.en_preferences.xml (about 5-6Mb in size). Before the battle (and before each round) you Android phone downloads this file from MH server.

I studied the file and found out that some information is not encrypted, so basically you can read all information & decode into visual data, like CardExplorer does now. Because CardExplorer has not been updated, some cards are not displayed fully, but we can still see the results.

Hope it helps.

The file is actually called com.madhead.tos.en.v2.playerprefs.xml, and it is usually only 2-3 MB in size. It used to be com.madhead.tos.en.xml, but then they changed it to the new v2 file some time ago (I think it was version 10 or somewhere around that time, but not sure). It is stored in /data/data/com.madhead.tos.en/shared_prefs/

Your phone only downloads the data before the battle and sends data back after the battle. It doesn't make any connection to the TOS server during the battle or between rounds.

The battle information in the file is stored in a JSON string that is URL encoded. By URL encoded, I mean percent codes (for example, %20 corresponds to a space, you can google "URL encoding" or "percent encoding" for more information). What my program does is it simply takes the battle data from com.madhead.tos.en.v2.playerprefs.xml, decodes the URL encoded JSON string, then parses the JSON and searches each battle wave for a loot drop.

If you are interested, you can try this yourself:

Start a battle, then force close TOS and open your own account XML file (I suggest moving the file to your computer to do this), and look for this tag:
<string name="MH_CACHE_RUNTIME_DATA_CURRENT_FLOOR_WAVES">

Copy everything between the starting <string> tag and the ending </string> tag. Then go to a website like this, and copy paste it in and click decode. Then delete the first 32 characters (it's a hash that we aren't interested in in this case). You can then copy and paste the resulting JSON (it will start with a square bracket [ character) into a JSON formatter like this one which will make it more readable.

This is also how the TOS Wikia is able to get exact HP values for enemies, by checking the internal battle information.
Large variety of allies, ID 79172307 (Current main ally PR Yog-Sothoth)

Been playing since March 2015. Level 300+
Reply
#7
Ah yes, my mistake on the file name, but the size is true. Previously it is about 2-3Mb, but MH somehow increase it rapidly. I just checked, it is 6.67Mb in my phone. Sometimes when I PR/VR a card, it even jumps to 7Mb.

Again, you are right. We can turn off wifi during battle. What I mean was that ToS itself changes some contents of that file after each round to reflect your progress in battle.

I am not a programmer, so just view the file in Firefox, then search by Ctrl-F and find exactly mobs' HP, attack (if not in %). I also believe that some other numbers will show mobs' IDs. But I didn't go deeper.

So welcome with a new & better tool. I just have an idea that it will be better if it doesn't need PC connection & processing. Card Explorer makes it only on our phones. What you should do is better, faster & simpler than Card Explorer.
[Image: 841a66da.jpg]
Reply
#8
The file does update locally during a battle. It may not talk to Madhead servers until after a battle is completed, but it does update locally.

Try this:
Start a battle
Go to the XML location (don't close ToS)
Copy the XML to a separate location (maybe the previous directory)
Go back to ToS and play a couple of rounds (don't finish the battle)
Close ToS
Copy the backup you created back to the original XML location overwriting the current one
Make sure attributes and ownership are correct (matches other files in the directory)
Restart ToS
Continue battle
You'll be back on the round you were when you made the backup instead of the round when you closed ToS

You may be able to use that to whatever advantage you want. Could save diamonds if you miss spin later in the battle. Possibly.
Reply
#9
(04-18-2018, 12:34 PM)TheCatGod Wrote:
(04-18-2018, 12:25 PM)kukingkong Wrote: Actually, everything about your account is in 1 file named com.madhead.tos.en_preferences.xml (about 5-6Mb in size). Before the battle (and before each round) you Android phone downloads this file from MH server.

I studied the file and found out that some information is not encrypted, so basically you can read all information & decode into visual data, like CardExplorer does now. Because CardExplorer has not been updated, some cards are not displayed fully, but we can still see the results.

Hope it helps.

The file is actually called com.madhead.tos.en.v2.playerprefs.xml, and it is usually only 2-3 MB in size. It used to be com.madhead.tos.en.xml, but then they changed it to the new v2 file some time ago (I think it was version 10 or somewhere around that time, but not sure). It is stored in /data/data/com.madhead.tos.en/shared_prefs/

Your phone only downloads the data before the battle and sends data back after the battle. It doesn't make any connection to the TOS server during the battle or between rounds.

The battle information in the file is stored in a JSON string that is URL encoded. By URL encoded, I mean percent codes (for example, %20 corresponds to a space, you can google "URL encoding" or "percent encoding" for more information). What my program does is it simply takes the battle data from com.madhead.tos.en.v2.playerprefs.xml, decodes the URL encoded JSON string, then parses the JSON and searches each battle wave for a loot drop.

If you are interested, you can try this yourself:

Start a battle, then force close TOS and open your own account XML file (I suggest moving the file to your computer to do this), and look for this tag:
<string name="MH_CACHE_RUNTIME_DATA_CURRENT_FLOOR_WAVES">

Copy everything between the starting <string> tag and the ending </string> tag. Then go to a website like this, and copy paste it in and click decode. Then delete the first 32 characters (it's a hash that we aren't interested in in this case). You can then copy and paste the resulting JSON (it will start with a square bracket [ character) into a JSON formatter like this one which will make it more readable.

This is also how the TOS Wikia is able to get exact HP values for enemies, by checking the internal battle information.

Thank you for sharing this, very interesting.
Reply
#10
(04-18-2018, 04:23 PM)evilvoice Wrote: The file does update locally during a battle. It may not talk to Madhead servers until after a battle is completed, but it does update locally.

Try this:
Start a battle
Go to the XML location (don't close ToS)
Copy the XML to a separate location (maybe the previous directory)
Go back to ToS and play a couple of rounds (don't finish the battle)
Close ToS
Copy the backup you created back to the original XML location overwriting the current one
Make sure attributes and ownership are correct (matches other files in the directory)
Restart ToS
Continue battle
You'll be back on the round you were when you made the backup instead of the round when you closed ToS

You may be able to use that to whatever advantage you want. Could save diamonds if you miss spin later in the battle. Possibly.

Yep, this is a very classic way to cheat by infinitely trying the same stage again and again until you succeed. I have also done it a few times when I got really mad at some bull**** shield that keeps trolling me. But it kind of takes the fun out of the game. Only disadvantage is that you will not be placed on the leaderboard, since TOS will only place you on the leaderboard if you completed the battle in one shot without closing the app.
Large variety of allies, ID 79172307 (Current main ally PR Yog-Sothoth)

Been playing since March 2015. Level 300+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)