-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement of auto quest #134
base: master
Are you sure you want to change the base?
Conversation
Hello, You use const to subregions in Alola. Look here: |
This is the first attempt I made, but I didn't make it. So I got the information from here: I tried something like this, but it's shit const alolaRoutesSubRegion0 = Routes.getRoutesByRegion(GameConstants.Region.alola).filter(x => x.subRegion === 0);
const alolaRoutesSubRegion1 = Routes.getRoutesByRegion(GameConstants.Region.alola).filter(x => x.subRegion === 1);
const alolaRoutesSubRegion2 = Routes.getRoutesByRegion(GameConstants.Region.alola).filter(x => x.subRegion === 2);
let alolaTownsSubRegion0 = []
let alolaTownsSubRegion1 = []
let alolaTownsSubRegion2 = []
// recupère les villes qui ont besoins d'avoir une route débloqués
for (const town in TownList) {
if (TownList[town].region === 6) {
let routeRequired = TownList[town].requirements[0].route;
let badgeRequired = TownList[town].requirements[0].badge;
let difficultyRoute = null;
if (TownList[town].dungeon) {
difficultyRoute = TownList[town].dungeon.difficultyRoute;
}
let dungeonRequired = TownList[town].requirements[0].dungeonIndex
if (routeRequired) {
if (alolaRoutesSubRegion0.filter(x => x.number === routeRequired).length > 0) {
alolaTownsSubRegion0.push(town)
} else if (alolaRoutesSubRegion1.filter(x => x.number === routeRequired).length > 0) {
alolaTownsSubRegion1.push(town)
} else if (alolaRoutesSubRegion2.filter(x => x.number === routeRequired).length > 0) {
alolaTownsSubRegion2.push(town)
}
}
else if (badgeRequired) {
for (const gym in GymList) {
const gymTown = GymList[gym].town
if (GymList[gym].badgeReward === badgeRequired) {
if (alolaTownsSubRegion0.filter(x => x === gymTown).length > 0) {
alolaTownsSubRegion0.push(town)
} else if (alolaTownsSubRegion1.filter(x => x === gymTown).length > 0) {
alolaTownsSubRegion1.push(town)
} else if (alolaTownsSubRegion2.filter(x => x === gymTown).length > 0) {
alolaTownsSubRegion2.push(town)
}
}
}
}
else if (difficultyRoute) {
if (alolaRoutesSubRegion0.filter(x => x.number === difficultyRoute).length > 0) {
alolaTownsSubRegion0.push(town)
} else if (alolaRoutesSubRegion1.filter(x => x.number === difficultyRoute).length > 0) {
alolaTownsSubRegion1.push(town)
} else if (alolaRoutesSubRegion2.filter(x => x.number === difficultyRoute).length > 0) {
alolaTownsSubRegion2.push(town)
}
}
else if (dungeonRequired) {
if (alolaTownsSubRegion0.filter(x => GameConstants.getDungeonIndex(x) === TownList[town].requirements[0].dungeonIndex)) {
alolaTownsSubRegion0.push(town)
} else if (alolaTownsSubRegion1.filter(x => GameConstants.getDungeonIndex(x) === TownList[town].requirements[0].dungeonIndex)) {
alolaTownsSubRegion1.push(town)
} else if (alolaTownsSubRegion2.filter(x => GameConstants.getDungeonIndex(x) === TownList[town].requirements[0].dungeonIndex)) {
alolaTownsSubRegion2.push(town)
}
} else {
console.log(TownList[town])
}
}
} Do you have any ideas to get subRegion of towns ? |
I've added several features, I'll keep adding them. Still related to quest resolution. If you have a solution to get the location of the sub-regions of alola do not hesitate. For the version number, I don't know if it's better to increment by 1 each time, or to go to 2.0 once it's finished (knowing that I didn't necessarily think to increment the version). |
I have done most of the quests, I still have the OakItem quests with the Magicball and the dungeon token quests. I have to admit that I usually turn off the farm type quests because they take too long. Has anyone been able to try these improvements? |
I refactored the code to use only one loop. Edit: Need more test |
I need feedback on enhancement ✌️ 📝 |
Hello, i don't know if it's the place but, how can i add auto location for gem quest ? Thx |
You need to manually install to Tampermonkey. |
i did but it's still don't work, the script doesn't know where to go to do the quest gems |
Yes that's what i'm talking to. Devs already did what you search : https://pokeclicker.miraheze.org/wiki/Gems I have access to all locations, i wanted to custom your script for personnal use. |
To do this you would need all this information in JSON format for example. Click to expand[
{
"Gem Type": "Normal",
"Amount": "10",
"Droprate": "1",
"Town": "Violet City",
"Elite": "null"
},
{
"Gem Type": "Normal",
"Amount": "20",
"Droprate": "1",
"Town": "Petalburg City",
"Elite": "null"
},
{
"Gem Type": "Normal",
"Amount": "15",
"Droprate": "1",
"Town": "Aspertia City",
"Elite": "null"
},
{
"Gem Type": "Fire",
"Amount": "15",
"Droprate": "1",
"Town": "Cinnabar Island",
"Elite": "null"
},
{
"Gem Type": "Fire",
"Amount": "20",
"Droprate": "1",
"Town": "Lavaridge Town",
"Elite": "null"
},
{
"Gem Type": "Fire",
"Amount": "25",
"Droprate": "1",
"Town": "Pokémon League Sinnoh",
"Elite": "Elite Flint "
},
{
"Gem Type": "Fire",
"Amount": "20",
"Droprate": "1",
"Town": "Pokémon League Kalos",
"Elite": "Elite Malva"
},
{
"Gem Type": "Water",
"Amount": "10",
"Droprate": "1",
"Town": "Cerulean City",
"Elite": "null"
},
{
"Gem Type": "Water",
"Amount": "20",
"Droprate": "0,8",
"Town": "Johto Indigo Plateau",
"Elite": "Elite Lorelei"
},
{
"Gem Type": "Water",
"Amount": "10",
"Droprate": "0,66",
"Town": "Mahogany Town",
"Elite": "null"
},
{
"Gem Type": "Water",
"Amount": "25",
"Droprate": "1",
"Town": "Sootopolis City",
"Elite": "null"
},
{
"Gem Type": "Water",
"Amount": "15",
"Droprate": "0,6",
"Town": "Pokémon League Hoenn",
"Elite": "Elite Glacia"
},
{
"Gem Type": "Water",
"Amount": "30",
"Droprate": "1",
"Town": "Pokémon League Hoenn",
"Elite": "null"
},
{
"Gem Type": "Water",
"Amount": "15",
"Droprate": "1",
"Town": "Pastoria City",
"Elite": "null"
},
{
"Gem Type": "Water",
"Amount": "20",
"Droprate": "1",
"Town": "Humilau City",
"Elite": "null"
},
{
"Gem Type": "Water",
"Amount": "20",
"Droprate": "1",
"Town": "Pokémon League Kalos",
"Elite": "Elite Siebold"
},
{
"Gem Type": "Electric",
"Amount": "10",
"Droprate": "0,66",
"Town": "Olivine City",
"Elite": "null"
},
{
"Gem Type": "Electric",
"Amount": "20",
"Droprate": "1",
"Town": "Mauville City",
"Elite": "null"
},
...
{
"Gem Type": "Electric",
"Amount": "20",
"Droprate": "1",
"Town": "Sunyshore City",
"Elite": "null"
} We could also have the list of routes in case the player has not unlocked the gyms. Click to expand[
{
"Gem Type": "Normal",
"Route": "Kanto 1",
"Chance": "1"
},
{
"Gem Type": "Normal",
"Route": "Kanto 16",
"Chance": "1"
},
{
"Gem Type": "Normal",
"Route": "Kalos 1",
"Chance": "1"
},
{
"Gem Type": "Fire",
"Route": "Hoenn 112",
"Chance": "0,5"
},
{
"Gem Type": "Water",
"Route": "Kanto 19",
"Chance": "1"
},
{
"Gem Type": "Water",
"Route": "Kanto 20",
"Chance": "1"
},
{
"Gem Type": "Water",
"Route": "Johto 40",
"Chance": "1"
},
{
"Gem Type": "Water",
"Route": "Johto 41",
"Chance": "1"
},
{
"Gem Type": "Water",
"Route": "Hoenn 105",
"Chance": "1"
},
{
"Gem Type": "Water",
"Route": "Hoenn 106",
"Chance": "1"
},
{
"Gem Type": "Water",
"Route": "Hoenn 107",
"Chance": "1"
},
{
"Gem Type": "Water",
"Route": "Hoenn 108",
"Chance": "1"
},
{
"Gem Type": "Water",
"Route": "Hoenn 109",
"Chance": "1"
},
...
{
"Gem Type": "Water",
"Route": "Hoenn 122",
"Chance": "1"
}
] But it would be better to be able to generate this list programmatically and the JSON format could be optimized in this example. |
Ok thank you for your answer. I will see latter then. By the way, you wanted feedback, your script is totaly working. Sometimes, for no reasons, it stop and tp to a dungeon (nothing to do with quests). Change location and toggle the button "autoquest" make it working again. |
This commit adds the completion of quests with a location.
It saves the last state of the player to reset it to its initial position with the initial state of the autoclicker if it is installed.
In the future I also plan to add the sorting change of the breeding if the autohatchery is enabled.
I'm also looking into the possibility of completing pokéball quests so as not to ruin all the dungeon tokens when you active DefeatDungeonQuest in autoquest.
This PR resolve partially issue #121