function main() {
UI.AddLabel("----->-> Auto Stop <-<-----");
UI.AddCheckbox("Master Toggle");
UI.AddDropdown("Trigger Key", [
"Middle Mouse",
"Mouse 4",
"Mouse 5",
"Caps Lock",
"B",
"C",
"E",
"F",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"T",
"V",
"X",
"Z" ]);
UI.AddLabel("----- <-<->->-- v1.1 --<-<->-> -----");
Cheat.RegisterCallback("Draw", "logic");
Cheat.RegisterCallback("CreateMove", "stop");
}
main();
peeking = false;
function logic() {
if (getVal("Master Toggle")) {
peeking = false;
headVis = false;
isTrigger = false;
enemies = Entity.GetEnemies();
tKey = getVal("Trigger Key");
switch(tKey) {
case 0:
hotkey = 0x04;
break;
case 1:
hotkey = 0x05;
break;
case 2:
hotkey = 0x06;
break;
case 3:
hotkey = 0x14;
break;
case 4:
hotkey = 0x42;
break;
case 5:
hotkey = 0x43;
break;
case 6:
hotkey = 0x45;
break;
case 7:
hotkey = 0x46;
break;
case 8:
hotkey = 0x48;
break;
case 9:
hotkey = 0x49;
break;
case 10:
hotkey = 0x4A;
break;
case 11:
hotkey = 0x4B;
break;
case 12:
hotkey = 0x4C;
break;
case 13:
hotkey = 0x4D;
break;
case 14:
hotkey = 0x4E;
break;
case 15:
hotkey = 0x4F;
break;
case 16:
hotkey = 0x50;
break;
case 17:
hotkey = 0x54;
break;
case 18:
hotkey = 0x56;
break;
case 19:
hotkey = 0x58;
break;
case 20:
hotkey = 0x5A;
break;
default:
Cheat.PrintChat("Shit's broke bro");
}
for ( i = 0; i < enemies.length; i++)
{
localEnt = Entity.GetLocalPlayer();
localHeadPos = Entity.GetHitboxPosition(localEnt, 0);
headHitbox = Entity.GetHitboxPosition(enemies[i], 0);
headToHeadBT = Trace.Bullet(enemies[i], localEnt, headHitbox, localHeadPos);
headVis = 1;
if (headToHeadBT != null) { headVis = headToHeadBT[1]; }
if (Entity.IsValid(enemies[i]) && !Entity.IsDormant(enemies[i]) && Entity.IsAlive(enemies[i]) && headVis >= 1) { peeking = true; }
if (Global.IsKeyPressed(hotkey)) {
isTrigger = true;
} else { return; }
}
} else { return; }
}
function stop() {
inaccuracy = Local.GetInaccuracy();
if (getVal("Master Toggle") && peeking && isTrigger) {
if (inaccuracy >= 0.0120) {
if (Global.IsKeyPressed(0x57)) { UserCMD.SetMovement([-200, 0, 0]); }
if(Global.IsKeyPressed(0x41)) { UserCMD.SetMovement([0, 200, 0]); }
if(Global.IsKeyPressed(0x53)) { UserCMD.SetMovement([200, 0, 0]); }
if(Global.IsKeyPressed(0x44)) { UserCMD.SetMovement([0, -200, 0]); }
}else if (inaccuracy >= 0.0080 && inaccuracy <= 0.0119) {
if (Global.IsKeyPressed(0x57)) { UserCMD.SetMovement([-120, 0, 0]); }
if(Global.IsKeyPressed(0x41)) { UserCMD.SetMovement([0, 120, 0]); }
if(Global.IsKeyPressed(0x53)) { UserCMD.SetMovement([120, 0, 0]); }
if(Global.IsKeyPressed(0x44)) { UserCMD.SetMovement([0, -120, 0]); }
}
}
}
function getVal(valueName) {
return UI.GetValue("Misc", "JAVASCRIPT", "Script items", valueName);
}