Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name exp
- // @namespace http://asylum.margonem.pl/
- // @version 0.1
- // @author You
- // @match http://asylum.margonem.pl
- // @grant none
- // ==/UserScript==
- (function() {
- ((_) => {
- _.required = _.calc(Engine.hero.d.lvl);
- _.proccessUpdate = function(e) {
- var diffExp = e.d.exp - _.lastExp, diffLvl = e.d.lvl - _.lastLvl;
- if (diffExp > 0) {
- let percentExp = e.d.ttl < 0 ? 0 : Math.round(diffExp * 10000 / _.required) / 100;
- message('+' + diffExp + ' (' + percentExp + '%)');
- _.lastExp = e.d.exp;
- }
- if (diffLvl > 0) {
- _.lastLvl = e.d.lvl;
- _.required = _.calc(e.d.lvl);
- }
- };
- API.addCallbackToEvent('heroUpdate', _.proccessUpdate);
- })({
- lastExp: Engine.hero.d.exp,
- lastLvl: Engine.hero.d.lvl,
- required: null,
- calc: (a) => Math.pow(a, 4) - Math.pow(a - 1, 4)
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement