Giter Club home page Giter Club logo

xpowerpredict's Introduction

xrankpowerpredict

i was inspired by snowpoke's prediction system and wanted to do some predicting myself.

⚠️ WARNING: i haven't used this software since i wrote it in may of 2020. might not work anymore. ⚠️

when this script works:

in x rank solo queue, except during the 10 placement matches and the first regular match (at least it didn't work during testing).

also: beware, it's ugly python code.

setup

thanks to good ol' ninty, this is hella complicated.

we need the iksm_session token that the nintendo switch online app uses for auth, etc.

how do i get that token?

here's a guide. beware that if you try this on android, you'll need an android version below 7.0 (nougat), because later versions have a different policy for user-imported certificates.

if you're lucky (like me), you have an old phone with android 6.0 (marshmallow) lying around, otherwise you'd need to screw around with android virtual machines (probably not that fun tbh).

apparently, iksm_session can be invalidated, so you'll have to keep yours up-to-date

how do i run this?

first, adjust the config options in the script.

then do python3 [path to script]

this also somewhat works on mobile, using this android app.

instructions:

  1. in that app: side panel > pip: install python-dateutil and requests
  2. top bar > folder icon > open: select xpowerpredict.py
  3. click the play button

depending on the aspect ratio of your phone, you might want to adjust lframe_width and rframe_width.

currently, the script needs to be restarted each rotation, see #3

happy VEEEEMO

when to press the buttons

start: after the lobby screen says 'BATTLE TIME!'.

end: when the results are shown (level/rank/kills/etc screen).

doing this anytime else might skew the values and cause errors.

the ui

screenshot

  • 1: an estimate of the points you'd gain (windelta, can be inflated)
  • 2: your current xpower
  • 3: how your initial xpower has changed (while the script was running), i.e. the difference between initial and current xpower
  • 4: how much you'd lose (losedelta)
  • 5: chance of winning (based on windelta & losedelta)
  • 6: start button
  • 7: end button
  • 8: exit the program
  • 9: chance of losing (based on windelta & losedelta)

on mobile (with lframe_widthand rframe_width adjusted):

screenshot (mobile)

how does this work

magic, obviously.

... jk. as soon as a match starts your xpower (in the app) is updated to the value that it'd be if you lost the match. using math we can estimate the points you'd gain. the formulas are not optimal, edge cases (where you lose lots of points or lose less than 5, i.e. unbalanced matches) aren't handled that well and the calculated values tend to be too big/small in those cases. dunno how to fix that atm.

etc

license: gpl3

xpowerpredict's People

Contributors

nunq avatar

Watchers

 avatar

xpowerpredict's Issues

implement rotationdelta

the current way we refresh/update the data doesn't work for this feature. currently, we basically do all the calculating, etc. after a match starts, but then we can't get the current x power anymore.
i.e. we need to poll more than once.

so either we do manual polling (x2) or interval polling (auto refreshing™), but since i'm not sure if there's info on if the player is currently in battle (etc.), i'm opting for option 1.

improving the formulas/estimates

while testing i noticed that the formulas don't account for -30 (etc) changes, because of the cutoff (which is currently at 25). also if the range between windeltaand losedeltais bigger than the cutoff, the percent chances are not guaranteed to be <= 100.

the formulas are currently in the beforebattle() function

implementation error in update()

i forgot that if we poll the current x power after the match starts (what we're currently doing), the x power is already reduced by losedelta.
thus we need to implement the procedure described in #1 anyways.

depends #1

replace manual (user requested) polling by auto-polling

would be possible if the api gives us info about if the player is currently in a match or something like battle timestamps that we can convert.
but i don't know if the api provides that kind of info, so this might not work.

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.