SHARE
TWEET

to nie nowy hawk

a guest Dec 3rd, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // credits to rory!
  2. var master = {
  3.     dir: "back",
  4.     cycle: false,
  5.     iteration: 0,
  6.     showArrows: false,
  7.     showCycle: false,
  8.     showDegree: false,
  9.     showInverted: false,
  10.     getJitter: function() { return UI.GetValue("Anti-Aim", "Rage Anti-Aim", "Jitter offset") },
  11.     setJitter: function(jitter) { return UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Jitter offset", jitter) },
  12.     getJitterValue: function() { return UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "Jitter Value") },
  13.     getJitterRandom: function() { return UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "Jitter Random") },
  14.     leftPressed: function() { return UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script Items", "Left") },
  15.     backPressed: function() { return UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script Items", "Back") },
  16.     rightPressed: function() { return UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Script Items", "Right") },
  17.     getYaw: function() { return UI.GetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset") },
  18.     setYaw: function(yaw) { return UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", yaw) },
  19.     getAAInvert: function() { return UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter") },
  20.     setAAInvert: function() { return UI.ToggleHotkey("Anti-Aim", "Fake angles", "Inverter") },
  21.     getWidth: function() { return UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "[CJitter] Jitter Width") },
  22.     getFreq: function() { return UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "[CJitter] Jitter Frequency") },
  23.     getRandom: function() { return UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "Yaw Randomization") },
  24.     getInvert: function() { return UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "[CJitter] Auto-Inverter") },
  25.     getVisuals: function() { return UI.GetValue("Misc", "JAVASCRIPT", "Script Items", "[CJitter] Visuals") },
  26.     setVisible: function() {
  27.         var selected = master.getVisuals();
  28.         var alias = {
  29.             [1]: "showArrows",
  30.             [2]: "showCycle",
  31.             [4]: "showDegree",
  32.             [8]: "showInverted"
  33.         }, binaries = [8, 4, 2, 1];
  34.  
  35.         for (i in binaries) {
  36.             i = binaries[i];
  37.  
  38.             if (selected - i >= 0) {
  39.                 selected -= i;
  40.                 master[alias[i]] = true;
  41.             } else {
  42.                 master[alias[i]] = false;
  43.             }
  44.         }
  45.     }
  46. }
  47.  
  48. var colors = {
  49.     neg: [255, 255, 255, 255],
  50.     pos: [250, 161, 255, 255]
  51. }
  52.  
  53. function ui() {
  54.     UI.AddSliderInt(" ", 0, 0);
  55.     UI.AddSliderInt("LBY's Jitter Script", 0, 0);
  56.     UI.AddSliderInt("Jitter Value", 0, 180);
  57.     UI.AddSliderInt("Jitter Random", 0, 180);
  58.     UI.AddSliderInt("Yaw Randomization", 0, 180);
  59.     UI.AddHotkey("Left");
  60.     UI.AddHotkey("Right");
  61.     UI.AddHotkey("Back");
  62.     UI.AddSliderInt(" ", 0, 0);
  63.     UI.AddSliderInt("Rory's Original Jitter", 0, 0);
  64.     UI.AddSliderInt("[CJitter] Jitter Width", 0, 1);
  65.     UI.AddSliderInt("[CJitter] Jitter Frequency", 0, 1);
  66.     UI.AddCheckbox("[CJitter] Auto-Inverter");
  67.     UI.AddMultiDropdown("[CJitter] Visuals", ["Arrows", "Cycle", "Degree", "Inverted"]);
  68.     UI.AddSliderInt(" ", 0, 0);
  69. }
  70.  
  71. function hud() {
  72.     if (!Entity.IsAlive(Entity.GetLocalPlayer())) return;
  73.  
  74.     master.setVisible();
  75.  
  76.     var offset = 30;
  77.     var x = Global.GetScreenSize()[0]/2, y = Global.GetScreenSize()[1]/2;
  78.  
  79.     function arrows() {
  80.         Render.String(x-50, y-20, 1, "<", master.dir == "left" ? colors.pos : colors.neg, 4);
  81.         Render.String(x, y+30, 1, "v", master.dir == "back" ? colors.pos : colors.neg, 4);
  82.         Render.String(x+50, y-20, 1, ">", master.dir == "right" ? colors.pos : colors.neg, 4);
  83.     }
  84.  
  85.     function cycle() {
  86.         Render.String(x, y+30+offset, 0, "CYCLE", master.cycle ? colors.pos : colors.neg, 1);
  87.         offset += 12;
  88.     }
  89.  
  90.     function inverted() {
  91.         Render.String(x, y+30+offset, 0, "INVERTED", master.getAAInvert() ? colors.pos : colors.neg, 1);
  92.         offset += 12;
  93.     }
  94.  
  95.     function degree() {
  96.         var yaw = master.getYaw();
  97.         Render.String(x, y+30+offset, 0, "DEG: " + yaw.toString(), colors.pos, 1);
  98.     }
  99.  
  100.     if (master.showArrows) arrows();
  101.     if (master.showCycle) cycle();
  102.     if (master.showInverted) inverted();
  103.     if (master.showDegree) degree();
  104. }
  105.  
  106. function getRandomInt(min, max) {
  107.     min = Math.ceil(min);
  108.     max = Math.floor(max);
  109.     return Math.floor(Math.random() * (max - min)) + min;
  110.   }
  111.  
  112. function jitter() {
  113.     master.iteration++;
  114.  
  115.     if (master.iteration % master.getFreq() != 0) return;
  116.     master.cycle = !master.cycle;
  117.  
  118.     if (master.dir == "left") master.setYaw((master.cycle ? -90 : master.getWidth()-90)+getRandomInt(-master.getRandom(), master.getRandom()));
  119.     else if (master.dir == "back") master.setYaw((master.cycle ? master.getWidth()/2 : -(master.getWidth()/2))+getRandomInt(-master.getRandom(), master.getRandom()));
  120.     else if (master.dir == "right") master.setYaw((master.cycle ? 90 : 90-master.getWidth())+getRandomInt(-master.getRandom(), master.getRandom()));
  121.  
  122.     master.setJitter((master.cycle ? (master.getJitterValue()/2)*2 : -(master.getJitterValue()/2)*2)+getRandomInt(-master.getJitterRandom(), master.getJitterRandom()));
  123. }
  124.  
  125. function invert() {
  126.     if (!master.getInvert() || Entity.GetEntityFromUserID(Event.GetInt("userid")) != Entity.GetLocalPlayer()) return;
  127.  
  128.     master.setAAInvert();
  129. }
  130.  
  131. function keys() {
  132.     if (master.leftPressed()) master.dir = "left";
  133.     if (master.backPressed()) master.dir = "back";
  134.     if (master.rightPressed()) master.dir = "right";
  135. }
  136.  
  137. function main() {
  138.     ui();
  139.     Global.RegisterCallback("Draw", "hud");
  140.     Global.RegisterCallback("CreateMove", "jitter");
  141.     Global.RegisterCallback("player_hurt", "invert");
  142.     Global.RegisterCallback("Draw", "keys");
  143.     Global.Print("LBY's Jitter Script Loaded.");
  144. } main();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top