Advertisement
Guest User

i need to find something better to do with my time, honestly

a guest
Jun 19th, 2019
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. // ==UserScript==
  2. // @name mario
  3. // @version 0.1
  4. // @description no obfuscator in hte world is going to stop me
  5. // @author Zoe
  6. // @match http://www.infernoplus.com/royale/
  7. // @grant none
  8. // ==/UserScript==
  9. const display_debug = false
  10. var _player = window[Object.keys(window).filter(k => window[k]&&window[k].NAME&&window[k].NAME=='PLAYER' && k.indexOf("_") === 0)[0]]
  11. var _mouse = window[Object.keys(window).filter(k => window[k]&&window[k].prototype&&window[k].prototype.mouse && k.indexOf("_") === 0)[0]]
  12. var _player_step = _player.prototype.step;
  13. $(document.body).append('<div class="link-w" '+(display_debug?'':'style="display:none" ')+ 'id="debuginfo"><span id="marioPos"></span> | <span id="mousePos"></span></div>')
  14. document.querySelector('#debuginfo').style.color="white"
  15. document.querySelector('#debuginfo').style.fontFamily="monospace"
  16.  
  17. var yCorrect = (x)=>(16.1 - (0.0226389*x))
  18. var debuginfo = {
  19. marioPos: document.querySelector('#marioPos'),
  20. mousePos: document.querySelector('#mousePos')
  21. }
  22. var prev = {x:0,y:0,reset:true}
  23. var blinkTo = {x:0,y:0,tp:false}
  24. _player['prototype']['damage']=function(a){}
  25. _player.prototype.step = function () {
  26. window._game = this['game']
  27. if (this['game']['getPlayer']() === this) {
  28. debuginfo.mousePos.textContent=`MOUSE [x:${(_mouse.prototype.mouse.pos.x/2)-400}, y:${yCorrect(_mouse.prototype.mouse.pos.y)}]`
  29. debuginfo.marioPos.textContent=`MARIO [x:${this.pos.x}, y:${this.pos.y}]`
  30. if(_mouse.prototype.mouse.lmb) {
  31. this['pos']['x'] = (_mouse.prototype.mouse.pos.x/2)-400
  32. this['pos']['y'] = yCorrect(_mouse.prototype.mouse.pos.y)
  33. }
  34. if(blinkTo.tp==true){
  35. if(prev.reset){prev.x=this['pos'].x;prev.y=this['pos'].y;prev.reset = false}
  36. this['pos']['x'] = blinkTo.x
  37. this['pos']['y'] = blinkTo.y
  38. blinkTo.tp = false
  39. } else if(!prev.reset) {
  40. this.pos.x = prev.x
  41. this.pos.y = prev.y
  42. prev.reset = true
  43. }
  44. }
  45. return _player_step.bind(this)();
  46. }
  47. var _star = window[Object.keys(window).filter(k => window[k]&&window[k].NAME&&window[k].NAME=='STAR' && k.indexOf("_") === 0)[0]]
  48. var _star_physics = _star['prototype']['physics']
  49. _star.prototype.physics = function(){
  50. blinkTo.x = this.pos.x
  51. blinkTo.y = this.pos.y
  52. blinkTo.tp = true
  53. return _star_physics.bind(this)();
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement