Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name mario
- // @version 0.1
- // @description no obfuscator in hte world is going to stop me
- // @author Zoe
- // @match http://www.infernoplus.com/royale/
- // @grant none
- // ==/UserScript==
- const display_debug = false
- var _player = window[Object.keys(window).filter(k => window[k]&&window[k].NAME&&window[k].NAME=='PLAYER' && k.indexOf("_") === 0)[0]]
- var _mouse = window[Object.keys(window).filter(k => window[k]&&window[k].prototype&&window[k].prototype.mouse && k.indexOf("_") === 0)[0]]
- var _player_step = _player.prototype.step;
- $(document.body).append('<div class="link-w" '+(display_debug?'':'style="display:none" ')+ 'id="debuginfo"><span id="marioPos"></span> | <span id="mousePos"></span></div>')
- document.querySelector('#debuginfo').style.color="white"
- document.querySelector('#debuginfo').style.fontFamily="monospace"
- var yCorrect = (x)=>(16.1 - (0.0226389*x))
- var debuginfo = {
- marioPos: document.querySelector('#marioPos'),
- mousePos: document.querySelector('#mousePos')
- }
- var prev = {x:0,y:0,reset:true}
- var blinkTo = {x:0,y:0,tp:false}
- _player['prototype']['damage']=function(a){}
- _player.prototype.step = function () {
- window._game = this['game']
- if (this['game']['getPlayer']() === this) {
- debuginfo.mousePos.textContent=`MOUSE [x:${(_mouse.prototype.mouse.pos.x/2)-400}, y:${yCorrect(_mouse.prototype.mouse.pos.y)}]`
- debuginfo.marioPos.textContent=`MARIO [x:${this.pos.x}, y:${this.pos.y}]`
- if(_mouse.prototype.mouse.lmb) {
- this['pos']['x'] = (_mouse.prototype.mouse.pos.x/2)-400
- this['pos']['y'] = yCorrect(_mouse.prototype.mouse.pos.y)
- }
- if(blinkTo.tp==true){
- if(prev.reset){prev.x=this['pos'].x;prev.y=this['pos'].y;prev.reset = false}
- this['pos']['x'] = blinkTo.x
- this['pos']['y'] = blinkTo.y
- blinkTo.tp = false
- } else if(!prev.reset) {
- this.pos.x = prev.x
- this.pos.y = prev.y
- prev.reset = true
- }
- }
- return _player_step.bind(this)();
- }
- var _star = window[Object.keys(window).filter(k => window[k]&&window[k].NAME&&window[k].NAME=='STAR' && k.indexOf("_") === 0)[0]]
- var _star_physics = _star['prototype']['physics']
- _star.prototype.physics = function(){
- blinkTo.x = this.pos.x
- blinkTo.y = this.pos.y
- blinkTo.tp = true
- return _star_physics.bind(this)();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement