Giter Club home page Giter Club logo

Comments (11)

smlbiobot avatar smlbiobot commented on July 17, 2024

@Gr8z Yes, it is planned and will be added.

For now if you want to quickly get to it, you can use this map: https://github.com/smlbiobot/SML-Cogs/blob/master/cr_api/data/chests.json which is the full cycle data.

Then you can determine the index in cycle with

index = position % chests.length

and of course the index of special chests by

index = superMagicalPos - position

But in later iterations we will do the calculations and return you as a list of keys.

from cr-api.

smlbiobot avatar smlbiobot commented on July 17, 2024

UPDATE: you can now use http://api.cr-api.com/constants/chestCycle

LEGACY (pls ignore)
And if you need the source, it is parsed from the csv logic file in the apk:

https://github.com/smlbiobot/cr/blob/master/apk/1.9.0/com.supercell.clashroyale-1.9.0-decoded/assets/csv_logic/chest_order.decoded.csv

from cr-api.

Gr8z avatar Gr8z commented on July 17, 2024

Thank you @selfish

Would you happen to have a map for giant and magical chests as well?

from cr-api.

smlbiobot avatar smlbiobot commented on July 17, 2024

@Gr8z Why did you thank Selfish? 😫

Anyway, Giant + Magical are in the index. They are part of the normal chest cycle.

from cr-api.

Gr8z avatar Gr8z commented on July 17, 2024

hahaha my bad @smlbiobot

Thanks, I also missed those chests in the index.

double blunder

from cr-api.

selfish avatar selfish commented on July 17, 2024

I do agree that it would be nice for the API to return these. I'll add this in one of the next iterations.

from cr-api.

Dino1694 avatar Dino1694 commented on July 17, 2024

@smlbiobot you did include the source but i believe you deleted/privated your cr-sanic repo so i coulsnt find it there.

from cr-api.

smlbiobot avatar smlbiobot commented on July 17, 2024

@Dino0631 cr-sanic repo has been made private so I can store my configs. You can get the full chest order here: https://github.com/smlbiobot/cr/blob/master/apk/1.9.0/com.supercell.clashroyale-1.9.0-decoded/assets/csv_logic/chest_order.decoded.csv

from cr-api.

smlbiobot avatar smlbiobot commented on July 17, 2024

If you want a JSON, you can get it from here right now:

https://github.com/cr-api/cr-api-data/blob/master/dst/chest_order.json

Field is “MainCycle” as chest_order now includes quest chests also.

from cr-api.

smlbiobot avatar smlbiobot commented on July 17, 2024

To help people understand how chests work:

  • Chest cycle is pre-determined and is defined in the chest order json above.
  • The app loops through full cycles and back again.
  • To determine which chests you will be getting next, you need to know the current position, which is also the number of chests you have opened so far.
  • Since the current position is going to be longer than the length of the cycle, you will determine the current index as current_index = position % chests.length
  • Special chests: e.g. Epic, Legendary, Super Magical replaces the current cycle.
  • To see if cycle is replaced by any of those chests, calculate if special chest position coincides with those and replace.

from cr-api.

selfish avatar selfish commented on July 17, 2024

Since all required data exists in constants, I'm closing.

from cr-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.