Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1) Aimbot
- This is the one script I don't want to give away, because it'd make the game unfair. That said, here's the function i use to predict movement, for informational purposes:
- function intercept(src, dst, v) {
- var tx = dst.x - src.x,
- ty = dst.y - src.y,
- tvx = dst.vx,
- tvy = dst.vy;
- // Get quadratic equation components
- var a = tvx * tvx + tvy * tvy - v * v;
- var b = 2 * (tvx * tx + tvy * ty);
- var c = tx * tx + ty * ty;
- // Solve quadratic
- var ts = quad(a, b, c); // See quad(), below
- // Find smallest positive solution
- var sol = null;
- if (ts) {
- var t0 = ts[0],
- t1 = ts[1];
- var t = Math.min(t0, t1);
- if (t < 0) t = Math.max(t0, t1);
- if (t > 0) {
- sol = {
- x: dst.x + dst.vx * t,
- y: dst.y + dst.vy * t
- };
- }
- }
- return sol;
- }
- function quad(a, b, c) {
- var sol = null;
- if (Math.abs(a) < 1e-6) {
- if (Math.abs(b) < 1e-6) {
- sol = Math.abs(c) < 1e-6 ? [0, 0] : null;
- } else {
- sol = [-c / b, -c / b];
- }
- } else {
- var disc = b * b - 4 * a * c;
- if (disc >= 0) {
- disc = Math.sqrt(disc);
- a = 2 * a;
- sol = [(-b - disc) / a, (-b + disc) / a];
- }
- }
- return sol;
- }
- Use the above like:
- let t = intercept({
- x: mainCircle.x,
- y: mainCircle.y
- }, {
- x: target.x,
- y: target.y,
- vx: avgXV - myXV,
- vy: avgYV - myYV
- }, bulletSpeed);
- t will have the x and y you should aim at (use Math.atan2)
- ---------------------------------------------------------------------------
- 2) Visual mods
- These are the elegant one-liners! There's two categories, globalCompositeOperation and filter.
- To run code, all you have to do is press f12 or ctrl + shift + i on diep.io to open a developer console. Then, in the space, type the code, hit enter, and you should see the screen change.
- a) GCO
- canvas.getContext('2d').globalCompositeOperation = <filter>
- where <filter> is one of the following: 'lighter', 'xor', 'multiply', 'overlay', 'darken', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', or 'luminosity' (with the single quotes but not the commas)
- b) filter
- Just type one of the following:
- canvas.style.filter = 'sepia(100%)';
- canvas.style.filter = 'hue-rotate(100deg)';
- or my personal favorite, rainbow:
- setInterval(() => {
- canvas.style.filter = ''
- }, 1000 / 60)
- 3) 3D mods
- True 3D script (broken): https://greasyfork.org/en/scripts/432833-diep-io-3d/code
- Fake 3D script shown in the video:
- var shaderButton = document.createElement('button');
- document.getElementsByTagName('body')[0].appendChild(shaderButton);
- shaderButton.style = "position:absolute; top:10px; left:10px; z-index:10000;";
- shaderButton.innerHTML = "Turn on the shader or something lol";
- shaderButton.onclick = function() {
- input.set_convar('ren_background', false);
- document.getElementById('backdrop-asset').style.opacity = 0;
- shaderButton.style.display = 'none';
- }
- var c2 = document.createElement('canvas');
- c2.style = "position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:-1;";
- document.getElementsByTagName('body')[0].appendChild(c2);
- var ctx2 = c2.getContext('2d');
- var c = document.getElementById('canvas');
- var ctx = c.getContext('2d');
- c.style.opacity = 0;
- var i = 0;
- var depth = 6;
- c2.width = c.width;
- c2.height = c.height;
- window.addEventListener('resize', function() {
- c2.width = c.width;
- c2.height = c.height;
- }, false);
- function loop() {
- ctx2.clearRect(0, 0, c2.width, c2.height);
- ctx2.drawImage(c, Math.pow(2, depth - 2), Math.pow(2, depth - 2), c2.width - Math.pow(2, depth - 1), c2.height - Math.pow(2, depth - 1));
- for (i = 0; depth > i; i++) {
- ctx2.drawImage(c2, -Math.pow(2, i), -Math.pow(2, i), c2.width + Math.pow(2, i + 1), c2.height + Math.pow(2, i + 1));
- }
- requestAnimationFrame(loop);
- }
- loop();
- ---------------------------------------------------------------------------
- 4) My own version of diep!
- https://tmzg.onrender.com (hosted on render.com, a free hosting platform)
Advertisement