· 5 years ago · May 05, 2020, 10:58 AM
1var js_items = ["Misc", "JAVASCRIPT", "Script Items"];
2var rbot_weapon_types = ["GENERAL", "PISTOL", "HEAVY PISTOL", "SCOUT", "AWP", "AUTOSNIPER"];
3var reworked_lbot_guns = ["Pistol", "Heavy pistol", "Heavy", "Rifle", "SMG", "Scout", "AWP", "Autosnipers"];
4
5var mathlib = require("mathlib.js") //damn.......
6function setup_menu()
7{
8 UI.AddCheckbox("Enable semirage assist");
9 UI.AddHotkey("Enable ragebot");
10 UI.AddHotkey("Autowall");
11 UI.AddDropdown("Currently configured weapon", reworked_lbot_guns);
12 for(var i = 0; i < 8; i++)
13 {
14 var current_gun = reworked_lbot_guns[i];
15 UI.AddSliderInt(current_gun + " dynamic FOV base", 2500, 6000);
16 UI.AddSliderFloat(current_gun + " dynamic FOV min", 0.1, 180.0);
17 UI.AddSliderFloat(current_gun + " dynamic FOV max", 0.1, 180.0);
18 UI.AddSliderFloat(current_gun + " dynamic FOV modifier", 0.34, 1);
19 if(i == 2 || i == 3 || i == 4)
20 {
21 UI.AddSliderInt(current_gun + " minimum damage", 0, 130);
22 UI.AddSliderInt(current_gun + " hitchance", 0, 100);
23 UI.AddCheckbox(current_gun + " prefer bodyaim");
24 UI.AddCheckbox(current_gun + " prefer safepoint");
25 }
26 UI.AddDropdown(current_gun + " w/o autowall key", ["Autowall on triggers", "No autowall", "Full autowall"]);
27 UI.AddMultiDropdown(current_gun + " autowall triggers", ["Hitbox visible", "Hurt us", "In autowall FOV", "Possible lethal damage", "We are low HP", "Ragebot shot him before"]);
28 UI.AddSliderInt(current_gun + " hitbox amount", 1, 10);
29 UI.AddSliderFloat(current_gun + " time after hurt (s)", 0.01, 10);
30 UI.AddSliderFloat(current_gun + " autowall FOV", 0.5, 10.0);
31 UI.AddSliderInt(current_gun + " health +", 0, 60);
32 UI.AddSliderFloat(current_gun + " shot expire time (s)", 1, 120);
33 }
34 UI.AddCheckbox("Trigger fakelag on visible");
35 UI.AddSliderInt("Minimum damage", 1, 50);
36 UI.AddSliderInt("Choke on visible", 0, 8);
37 UI.AddSliderInt("Normal choke", 0, 8);
38 UI.AddCheckbox("Enable legit AA");
39 UI.AddCheckbox("Safety checks");
40 UI.AddDropdown("LBY Mode", ["Safe", "Extend"]);
41 UI.AddHotkey("Legit AA juke (only in rage)");
42 UI.AddCheckbox("Legit AA edge detection");
43 UI.AddDropdown("Peeking mode", ["Peek with fake", "Peek with real"]);
44 UI.AddCheckbox("Fix slowwalk on legitbot");
45 UI.AddMultiDropdown("Semirage assist indicators", ["Aimbot status", "Autowall", "Legit AA", "Choke", "Inaccuracy", "Aim mode", "Enemy possible real yaw side", "Fake arrows", "Watermark"]);
46
47 UI.AddSliderFloat("Indicator offset", 0.2, 1);
48 UI.AddColorPicker("AA arrow color");
49 UI.AddColorPicker("Side text color");
50
51 UI.AddColorPicker("Watermark accent color");
52
53 UI.AddCheckbox("Rage shot logs");
54
55 UI.AddCheckbox("Trashtalk");
56}
57
58setup_menu();
59
60var local = 0;
61
62var script_config = {
63rbot_active: 0,
64rbot_lbot_switch_active: 0,
65lbot_active: 0,
66script_active: 0,
67rbot_fov_min: -1,
68rbot_fov_max: -1,
69rbot_fov_mod: -1,
70rbot_fov_base_distance: -1,
71rbot_fov_awall: -1,
72rbot_optional_mindmg: -1,
73rbot_optional_hc: -1,
74rbot_optional_baim: 0,
75rbot_optional_safepoint: 0,
76autowall_active: 0,
77autowall_mode: -1,
78legit_autowall_modifiers: -1,
79legit_autowall_hitbox_amt: -1,
80legit_autowall_hurt_time: -1,
81legit_autowall_lethal_override: -1,
82legit_autowall_ragebot_decay_time: -1,
83legitaa_active: 0,
84legitaa_safety_active: 0,
85legitaa_lby_mode: -1,
86legitaa_juke_active: 0,
87legitaa_edge_active: 0,
88legitaa_edge_distance: -1,
89legitaa_peek_behavior: -1,
90slowwalk_fix: 0,
91gay_fakelag_active: 0,
92gay_fakelag_mindmg: -1,
93gay_fakelag_vis_choke: -1,
94gay_fakelag_invis_choke: -1,
95indicator_picks: -1,
96indicator_offset: -1,
97indicator_legitaa_col: [0, 0, 0, 255],
98indicator_enemy_side_col: [0, 0, 0, 255],
99indicator_watermark_accent_col: [0, 0, 0, 255],
100rage_shot_log: 0,
101trashtalk: 0,
102};
103//Trying out a new model for this shit
104
105var cached_wpnname = "";
106var cached_wpntype = -1;
107function get_weapon_for_config()
108{
109 var wpn_name = Entity.GetName(Entity.GetWeapon(local));
110 if(cached_wpnname == wpn_name)
111 {
112 return cached_wpntype;
113 }
114 var ret = 0;
115 switch(wpn_name)
116 {
117 case "usp s":
118 case "p2000":
119 case "glock 18":
120 case "dual berettas":
121 case "p250":
122 case "tec 9":
123 case "five seven":
124 case "cz75 auto":
125 break;
126 case "desert eagle":
127 case "r8 revolver":
128 ret = 1;
129 break;
130 case "nova":
131 case "xm1014":
132 case "mag 7":
133 case "sawed off":
134 case "m249":
135 case "negev":
136 ret = 2;
137 break;
138 case "famas":
139 case "galil ar":
140 case "ak 47":
141 case "m4a4":
142 case "m4a1 s":
143 case "sg 553":
144 case "aug":
145 ret = 3;
146 break;
147 case "mac 10":
148 case "mp9":
149 case "mp7":
150 case "mp5 sd":
151 case "ump 45":
152 case "pp bizon":
153 case "p90":
154 ret = 4;
155 break;
156 case "ssg 08":
157 ret = 5;
158 break;
159 case "awp":
160 ret = 6;
161 break;
162 case "scar 20":
163 case "g3sg1":
164 ret = 7;
165 break;
166 default:
167 ret = -1; //on knives/whatnot
168 break;
169 }
170 cached_wpnname = wpn_name;
171 cached_wpntype = ret;
172 return ret;
173}
174
175function convert_weapon_index_into_rbot_idx(wpn_index) //Converts current weapon type into ragebot index
176{
177 switch(wpn_index)
178 {
179 case 0:
180 return 1;
181 case 1:
182 return 2;
183 case 2:
184 case 3:
185 case 4:
186 return 0;
187 case 5:
188 return 3;
189 case 6:
190 return 4;
191 case 7:
192 return 5;
193 }
194}
195
196var prev_wpntype_settings = -1;
197function update_settings()
198{
199 script_config.rbot_active = UI.IsHotkeyActive("Rage", "General", "Enabled");
200 script_config.lbot_active = UI.IsHotkeyActive("Legit", "GENERAL", "General", "Enabled");
201 script_config.script_active = UI.GetValue(js_items, "Enable semirage assist");
202 script_config.rbot_lbot_switch_active = UI.IsHotkeyActive(js_items, "Enable ragebot");
203 if(prev_wpntype_settings == -1)
204 {
205 script_config.rbot_lbot_switch_active = true; //for legitaa with knife (p100 ghettofix)
206 }
207 script_config.autowall_active = UI.IsHotkeyActive(js_items, "Autowall");
208
209 script_config.legitaa_active = UI.GetValue(js_items, "Enable legit AA");
210 script_config.legitaa_safety_active = UI.GetValue(js_items, "Safety checks");
211 script_config.legitaa_lby_mode = UI.GetValue(js_items, "LBY Mode");
212 script_config.legitaa_juke_active = UI.IsHotkeyActive(js_items, "Legit AA juke");
213 script_config.legitaa_edge_active = UI.GetValue(js_items, "Legit AA edge detection");
214 script_config.legitaa_peek_behavior = UI.GetValue(js_items, "Peeking mode");
215 script_config.slowwalk_fix = UI.GetValue(js_items, "Fix slowwalk on legitbot");
216 script_config.gay_fakelag_active = UI.GetValue(js_items, "Trigger fakelag on visible");
217 script_config.gay_fakelag_mindmg = UI.GetValue(js_items, "Minimum damage");
218 script_config.gay_fakelag_vis_choke = UI.GetValue(js_items, "Choke on visible");
219 script_config.gay_fakelag_invis_choke = UI.GetValue(js_items, "Normal choke");
220 script_config.indicator_picks = UI.GetValue(js_items, "Semirage assist indicators");
221 script_config.indicator_offset = UI.GetValue(js_items, "Indicator offset");
222 script_config.indicator_legitaa_col = UI.GetColor(js_items, "AA arrow color");
223 script_config.indicator_enemy_side_col = UI.GetColor(js_items, "Side text color");
224 script_config.indicator_watermark_accent_col = UI.GetColor(js_items, "Watermark accent color");
225 script_config.rage_shot_log = UI.GetValue(js_items, "Rage shot logs");
226 script_config.trashtalk = UI.GetValue(js_items, "Trashtalk");
227 if(World.GetServerString() == "" || !Entity.IsValid(local) || !Entity.IsAlive(local))
228 {
229 return; //Can't really go further without using localplayer's weapon.
230 }
231
232 var local_weapon_type = get_weapon_for_config();
233 if(local_weapon_type == -1)
234 {
235 return;
236 }
237
238 var weapon_name = reworked_lbot_guns[local_weapon_type];
239
240 script_config.autowall_mode = UI.GetValue(js_items, weapon_name + " w/o autowall key");
241 script_config.legit_autowall_modifiers = UI.GetValue(js_items, weapon_name + " autowall triggers");
242 script_config.legit_autowall_hitbox_amt = UI.GetValue(js_items, weapon_name + " hitbox amount");
243 script_config.legit_autowall_hurt_time = UI.GetValue(js_items, weapon_name + " time after hurt (s)");
244 script_config.legit_autowall_lethal_override = UI.GetValue(js_items, weapon_name + " health +");
245 script_config.legit_autowall_ragebot_decay_time = UI.GetValue(js_items, weapon_name + " shot expire time (s)");
246 script_config.rbot_fov_awall = UI.GetValue(js_items, weapon_name + " autowall FOV");
247 script_config.rbot_fov_min = UI.GetValue(js_items, weapon_name + " dynamic FOV min");
248 script_config.rbot_fov_max = UI.GetValue(js_items, weapon_name + " dynamic FOV max");
249 script_config.rbot_fov_mod = UI.GetValue(js_items, weapon_name + " dynamic FOV modifier");
250 script_config.rbot_fov_base_distance = UI.GetValue(js_items, weapon_name + " dynamic FOV base");
251 if(convert_weapon_index_into_rbot_idx(local_weapon_type) == 0)
252 {
253 script_config.rbot_optional_mindmg = UI.GetValue(js_items, weapon_name + " minimum damage");
254 script_config.rbot_optional_hc = UI.GetValue(js_items, weapon_name + " hitchance");
255 script_config.rbot_optional_baim = UI.GetValue(js_items, weapon_name + " prefer bodyaim");
256 script_config.rbot_optional_safepoint = UI.GetValue(js_items, weapon_name + " prefer safepoint");
257 }
258 prev_wpntype_settings = local_weapon_type;
259}
260
261var last_script_enabled_state = -1; //Force the script to update the visibility on load
262var last_configured_weapon = -1; //Cached to prevent useless visibility updates.
263var last_autowall_mode = -1;
264var last_legitaa_mode = -1;
265var last_fakelag_state = -1;
266var was_legitaa_edge_active = -1;
267var last_awall_state_for_weapons = [-1, -1, -1, -1, -1, -1, -1, -1]; //im a gamer
268var last_awall_triggers_for_weapons = [-1, -1, -1, -1, -1, -1, -1, -1];
269var old_indicator_picks = -1;
270function handle_visibility()
271{
272 if(!UI.IsMenuOpen())
273 {
274 return; //What's the point of handling menu visibility if the damn thing isn't even visible?
275 }
276 var indicator_picks = UI.GetValue(js_items, "Semirage assist indicators");
277 if(script_config.script_active != last_script_enabled_state || last_legitaa_mode != script_config.legitaa_active || was_legitaa_edge_active != script_config.legitaa_edge_active || indicator_picks != old_indicator_picks || last_fakelag_state != script_config.gay_fakelag_active)
278 {
279 UI.SetEnabled(js_items, "Autowall", script_config.script_active);
280 UI.SetEnabled(js_items, "Enable ragebot", script_config.script_active);
281 UI.SetEnabled(js_items, "Currently configured weapon", script_config.script_active);
282
283 UI.SetEnabled(js_items, "Enable legit AA", script_config.script_active);
284 UI.SetEnabled(js_items, "Safety checks", script_config.script_active && script_config.legitaa_active);
285 UI.SetEnabled(js_items, "LBY Mode", script_config.script_active && script_config.legitaa_active);
286 UI.SetEnabled(js_items, "Legit AA juke (only in rage)", script_config.script_active && script_config.legitaa_active);
287
288 UI.SetEnabled(js_items, "Legit AA edge detection", script_config.script_active && script_config.legitaa_active);
289 UI.SetEnabled(js_items, "Peeking mode", script_config.script_active && script_config.legitaa_active && script_config.legitaa_edge_active);
290 UI.SetEnabled(js_items, "Fix slowwalk on legitbot", script_config.script_active);
291 UI.SetEnabled(js_items, "Semirage assist indicators", script_config.script_active);
292
293 UI.SetEnabled(js_items, "Indicator offset", script_config.script_active);
294 UI.SetEnabled(js_items, "Side text color", script_config.script_active && indicator_picks & (1 << 6));
295 UI.SetEnabled(js_items, "AA arrow color", script_config.script_active && indicator_picks & (1 << 7));
296 UI.SetEnabled(js_items, "Watermark accent color", script_config.script_active && indicator_picks & (1 << 8));
297 UI.SetEnabled(js_items, "Rage shot logs", script_config.script_active);
298 UI.SetEnabled(js_items, "Trashtalk", script_config.script_active);
299
300 UI.SetEnabled(js_items, "Trigger fakelag on visible", script_config.script_active);
301 UI.SetEnabled(js_items, "Minimum damage", script_config.script_active && script_config.gay_fakelag_active);
302 UI.SetEnabled(js_items, "Choke on visible", script_config.script_active && script_config.gay_fakelag_active);
303 UI.SetEnabled(js_items, "Normal choke", script_config.script_active && script_config.gay_fakelag_active);
304 }
305 old_indicator_picks = indicator_picks;
306 last_fakelag_state = script_config.gay_fakelag_active;
307 var cur_selected_gun = UI.GetValue(js_items, "Currently configured weapon"); //Shame I have to do it like this.
308 var lbot_weapons_length = 8; //Hardcoded because it won't change lol
309
310 for(var i = 0; i < lbot_weapons_length; i++)
311 {
312 var weapon_name = reworked_lbot_guns[i];
313 if(last_configured_weapon != cur_selected_gun || script_config.script_active != last_script_enabled_state)
314 {
315 UI.SetEnabled(js_items, weapon_name + " dynamic FOV base", script_config.script_active && cur_selected_gun == i);
316 UI.SetEnabled(js_items, weapon_name + " dynamic FOV min", script_config.script_active && cur_selected_gun == i);
317 UI.SetEnabled(js_items, weapon_name + " dynamic FOV max", script_config.script_active && cur_selected_gun == i);
318 UI.SetEnabled(js_items, weapon_name + " dynamic FOV modifier", script_config.script_active && cur_selected_gun == i);
319 UI.SetEnabled(js_items, weapon_name + " hitchance", script_config.script_active && cur_selected_gun == i && (i == 2 || i == 3 || i == 4));
320 UI.SetEnabled(js_items, weapon_name + " minimum damage", script_config.script_active && cur_selected_gun == i && (i == 2 || i == 3 || i == 4));
321 UI.SetEnabled(js_items, weapon_name + " prefer bodyaim", script_config.script_active && cur_selected_gun == i && (i == 2 || i == 3 || i == 4));
322 UI.SetEnabled(js_items, weapon_name + " prefer safepoint", script_config.script_active && cur_selected_gun == i && (i == 2 || i == 3 || i == 4));
323 }
324 var awall_mode = UI.GetValue(weapon_name + " w/o autowall key");
325 if(last_configured_weapon != cur_selected_gun || script_config.script_active != last_script_enabled_state || awall_mode != last_awall_state_for_weapons[i])
326 {
327 UI.SetEnabled(js_items, weapon_name + " w/o autowall key", script_config.script_active && cur_selected_gun == i);
328 UI.SetEnabled(js_items, weapon_name + " autowall triggers", script_config.script_active && cur_selected_gun == i && awall_mode == 0);
329 }
330 var awall_triggers = UI.GetValue(weapon_name + " autowall triggers");
331 if(last_configured_weapon != cur_selected_gun || script_config.script_active != last_script_enabled_state || awall_mode != last_awall_state_for_weapons[i] || awall_triggers != last_awall_triggers_for_weapons[i])
332 {
333 UI.SetEnabled(js_items, weapon_name + " hitbox amount", script_config.script_active && cur_selected_gun == i && awall_mode == 0 && awall_triggers & (1 << 0));
334 UI.SetEnabled(js_items, weapon_name + " time after hurt (s)", script_config.script_active && cur_selected_gun == i && awall_mode == 0 && awall_triggers & (1 << 1));
335 UI.SetEnabled(js_items, weapon_name + " autowall FOV", script_config.script_active && cur_selected_gun == i && awall_mode == 0 && awall_triggers & (1 << 2));
336 UI.SetEnabled(js_items, weapon_name + " health +", script_config.script_active && cur_selected_gun == i && awall_mode == 0 && awall_triggers & (1 << 3));
337 UI.SetEnabled(js_items, weapon_name + " shot expire time (s)", script_config.script_active && cur_selected_gun == i && awall_mode == 0 && awall_triggers & (1 << 5));
338 }
339 last_awall_state_for_weapons[i] = awall_mode;
340 last_awall_triggers_for_weapons[i] = awall_triggers;
341 }
342 last_script_enabled_state = script_config.script_active;
343 last_configured_weapon = cur_selected_gun;
344 was_legitaa_edge_active = script_config.legitaa_edge_active;
345}
346handle_visibility();
347
348function clamp(val, min, max)
349{
350 return Math.max(min,Math.min(max,val));
351}
352
353function random_float(min, max)
354{
355 return Math.random() * (max - min) + min;
356}
357
358function angle_diff(angle1, angle2)
359{
360 var diff = angle1 - angle2;
361 diff %= 360;
362 if(diff > 180)
363 {
364 diff -= 360;
365 }
366 if(diff < -180)
367 {
368 diff += 360;
369 }
370 return diff;
371}
372
373function get_choked_ticks_for_entity(entity)
374{
375 return clamp(Math.floor((Globals.Curtime() - Entity.GetProp(entity, "CBaseEntity", "m_flSimulationTime")) / Globals.TickInterval()), 0, 16);
376}
377
378function get_hitbox_name(hitbox) //Useless, but I love the bloody shot logs
379{
380 var hitbox_name = "";
381 switch (hitbox)
382 {
383 case 0:
384 hitbox_name = "head";
385 break;
386 case 1:
387 hitbox_name = "neck";
388 break;
389 case 2:
390 hitbox_name = "pelvis";
391 break;
392 case 3:
393 hitbox_name = "body";
394 break;
395 case 4:
396 hitbox_name = "thorax";
397 break;
398 case 5:
399 hitbox_name = "chest";
400 break;
401 case 6:
402 hitbox_name = "upper chest";
403 break;
404 case 7:
405 hitbox_name = "left thigh";
406 break;
407 case 8:
408 hitbox_name = "right thigh";
409 break;
410 case 9:
411 hitbox_name = "left calf";
412 break;
413 case 10:
414 hitbox_name = "right calf";
415 break;
416 case 11:
417 hitbox_name = "left foot";
418 break;
419 case 12:
420 hitbox_name = "right foot";
421 break;
422 case 13:
423 hitbox_name = "left hand";
424 break;
425 case 14:
426 hitbox_name = "right hand";
427 break;
428 case 15:
429 hitbox_name = "left upper arm";
430 break;
431 case 16:
432 hitbox_name = "left forearm";
433 break;
434 case 17:
435 hitbox_name = "right upper arm";
436 break;
437 case 18:
438 hitbox_name = "right forearm";
439 break;
440 default:
441 hitbox_name = "generic";
442 }
443
444 return hitbox_name;
445}
446
447
448
449//Since the one in mathlib looks to be kinda dumb and since we're cool people I'll just use my own (well ""my own"")
450/**
451 *
452 * @param {*} {array} from
453 * @param {*} {array} to
454 * @param {*} {array} base_angle
455 * @returns {array} angle delta from base angle to calculated angle
456 */
457function calculate_angle(from, to, base_angle)
458{
459 var delta = mathlib.VectorSub(from, to);
460 var ret_angle = [];
461 ret_angle[0] = mathlib.RadToDeg(Math.atan(delta[2] / Math.hypot(delta[0], delta[1]))) - base_angle[0];
462 ret_angle[1] = mathlib.RadToDeg(Math.atan(delta[1] / delta[0])) - base_angle[1];
463 ret_angle[2] = 0;
464 if(delta[0] >= 0.0)
465 ret_angle[1] += 180.0;
466
467 ret_angle[1] %= 360;
468 if(ret_angle[1] > 180)
469 ret_angle[1] -= 360;
470 if(ret_angle[1] < -180)
471 ret_angle[1] += 360;
472 return ret_angle;
473}
474
475//Sets up the config for generic weapons and sets up the dynamic ragebot FOV.
476function setup_config_and_dyn_fov()
477{
478 var fov_max = script_config.rbot_fov_max;
479 var fov_min = script_config.rbot_fov_min;
480
481 var fov_mod = script_config.rbot_fov_mod;
482 var fov_base = script_config.rbot_fov_base_distance;
483
484 var new_dynamic_fov = 0;
485
486 var weapon_type = get_weapon_for_config();
487 if(weapon_type == -1)
488 {
489 return; //No point configuring it if we're holding a knife or something, right?
490 }
491 var rbot_weapon_type = convert_weapon_index_into_rbot_idx(weapon_type);
492 var rbot_config_string = rbot_weapon_types[rbot_weapon_type];
493 if(rbot_weapon_type == 0)
494 {
495 UI.SetValue("Rage", rbot_config_string, "Accuracy", "Prefer safe point", script_config.rbot_optional_safepoint); //Can't force the hack to PREFER bodyaim or safepoint through the new API functions.
496 UI.SetValue("Rage", rbot_config_string, "Accuracy", "Prefer body aim", script_config.rbot_optional_baim);
497 }
498
499 var old_fov = UI.GetValue("Rage", rbot_config_string, "Targeting", "FOV");
500 var local_render_origin = Entity.GetRenderOrigin(local);
501
502 var enemies = Entity.GetEnemies();
503 var enemy_arr_length = enemies.length;
504
505 var distance = 10000;
506 for(var i = 0; i < enemy_arr_length; i++)
507 {
508 if(Entity.IsValid(enemies[i]) && Entity.IsAlive(enemies[i]) && !Entity.IsDormant(enemies[i]))
509 {
510 if(rbot_weapon_type == 0)
511 {
512 Ragebot.ForceTargetMinimumDamage(enemies[i], script_config.rbot_optional_mindmg);
513 Ragebot.ForceTargetHitchance(enemies[i], script_config.rbot_optional_hc);
514 }
515 var enemy_render_origin = Entity.GetRenderOrigin(enemies[i]);
516 var current_distance = mathlib.VectorLength(mathlib.VectorSub(local_render_origin, enemy_render_origin));
517 if(distance > current_distance)
518 {
519 distance = current_distance;
520 }
521 }
522 }
523 if(distance != 10000)
524 {
525 new_dynamic_fov = clamp((fov_base / distance) * (fov_mod * 3), fov_min, fov_max);
526 }
527 else //We haven't found any enemies.
528 {
529 new_dynamic_fov = old_fov;
530 }
531 UI.SetValue("Rage", rbot_config_string, "Targeting", "FOV", new_dynamic_fov);
532}
533
534var players_who_hurt_us = [];
535var ragebot_targets_this_round = [];
536
537function handle_autowall()
538{
539 var is_legit_autowall_active = script_config.autowall_mode == 0;
540 var visible_hitbox_check = is_legit_autowall_active && script_config.legit_autowall_modifiers & (1 << 0);
541 var visible_hitbox_amt = script_config.legit_autowall_hitbox_amt;
542 var hurt_check = is_legit_autowall_active && script_config.legit_autowall_modifiers & (1 << 1);
543 var hurt_length = script_config.legit_autowall_hurt_time;
544 var fov_check = is_legit_autowall_active && script_config.legit_autowall_modifiers & (1 << 2);
545 var autowall_fov = script_config.rbot_fov_awall;
546 var lethal_check = is_legit_autowall_active && script_config.legit_autowall_modifiers & (1 << 3);
547 var lethal_override_hp_amt = script_config.legit_autowall_lethal_override;
548 var local_lowhp_check = is_legit_autowall_active && script_config.legit_autowall_modifiers & (1 << 4);
549 var rbot_target_check = is_legit_autowall_active && script_config.legit_autowall_modifiers & (1 << 5);
550 var rbot_target_decay_time = script_config.legit_autowall_ragebot_decay_time;
551
552 if(local_lowhp_check)
553 {
554 var local_health = Entity.GetProp(local, "CBasePlayer", "m_iHealth");
555 if(local_health < 25) //fuck them if we're low hp, i should prolly make this user-adjustable
556 {
557 return;
558 }
559 }
560 var local_eyepos = Entity.GetEyePosition(local);
561 var local_viewangles = Local.GetViewAngles();
562 var enemies = Entity.GetEnemies();
563 var enemy_arr_length = enemies.length; //Apparently doing this is slightly faster than getting the array length every iteration
564
565 for(var i = 0; i < enemy_arr_length; i++)
566 {
567 if(Entity.IsValid(enemies[i]) && Entity.IsAlive(enemies[i]) && !Entity.IsDormant(enemies[i]))
568 {
569 if(hurt_check)
570 {
571 if(players_who_hurt_us.some(function(value) { return value.cisgendered_pig == enemies[i] && value.time_he_hurt_us + hurt_length > Globals.Curtime(); }))
572 {
573 continue;
574 }
575 }
576 if(rbot_target_check)
577 {
578 if(ragebot_targets_this_round.some(function(value) { return value.aimbot_target == enemies[i] && value.shot_time + rbot_target_decay_time > Globals.Curtime(); }))
579 {
580 continue;
581 }
582 }
583 var is_inside_autowall_fov = false;
584 var vis_length = 0;
585 var could_be_lethal = false;
586 for(var j = 0; j <= 18; j++)
587 {
588 var hitbox = Entity.GetHitboxPosition(enemies[i], j);
589 if(typeof(hitbox) == "undefined") //sometimes happens l0l
590 {
591 continue;
592 }
593 if(fov_check)
594 {
595 var angle_to_hitbox = calculate_angle(local_eyepos, hitbox, local_viewangles);
596 var fov = Math.hypot(angle_to_hitbox[0], angle_to_hitbox[1]);
597 if(autowall_fov > fov)
598 {
599 is_inside_autowall_fov = true;
600 break;
601 }
602 }
603 var trace = Trace.Bullet(local, enemies[i], local_eyepos, hitbox);
604 if(trace[2])
605 {
606 vis_length++;
607 }
608 if(lethal_check)
609 {
610 var enemy_hp = Entity.GetProp(enemies[i], "CBasePlayer", "m_iHealth");
611 if(trace[1] > enemy_hp + lethal_override_hp_amt)
612 {
613 could_be_lethal = true;
614 break;
615 }
616 }
617 if(visible_hitbox_check && vis_length >= visible_hitbox_amt)
618 {
619 break;
620 }
621 }
622 if(could_be_lethal || is_inside_autowall_fov || (visible_hitbox_check && vis_length >= visible_hitbox_amt))
623 {
624 continue;
625 }
626 if(vis_length < 12)
627 {
628 Ragebot.IgnoreTarget(enemies[i]);
629 }
630 }
631 }
632}
633
634
635function are_we_peeking(local_eye_position, velocity, predicted_ticks, min_damage) //premium, also stolen from my doubletap peek thing
636{
637 var extrapolated_local_eyepos = mathlib.VectorAdd(local_eye_position, mathlib.VectorMulFl(velocity, predicted_ticks * Globals.TickInterval()));
638 var enemies = Entity.GetEnemies();
639 var enemy_arr_length = enemies.length;
640 for(var i = 0; i < enemy_arr_length; i++)
641 {
642 if(Entity.IsValid(enemies[i]) && Entity.IsAlive(enemies[i]) && !Entity.IsDormant(enemies[i]))
643 {
644 var enemy_stomach = Entity.GetHitboxPosition(enemies[i], 2);
645 if(typeof(enemy_stomach) == "undefined")
646 {
647 continue;
648 }
649 var trace = Trace.Bullet(local, enemies[i], extrapolated_local_eyepos, enemy_stomach);
650 if(trace[1] > min_damage) //AMAZING PEEK DETECTION, PATENT PENDING
651 {
652 return true;
653 }
654 }
655 }
656 return false;
657}
658
659var peek_time = 0.0;
660var current_proper_direction = 0;
661var last_peek = 0.0;
662var indicator_dir = 0;
663
664
665//That's a lotta global vars.
666
667function handle_legitaa_safety()
668{
669 if(Entity.IsValid(local) && Entity.IsAlive(local))
670 {
671 if(!script_config.legitaa_safety_active)
672 {
673 return true; //epic gamer move
674 }
675 var current_latency = Local.Latency();
676 var current_framerate = 1 / Globals.Frametime();
677 var current_choke = get_choked_ticks_for_entity(local);
678 return current_latency < 100 && current_framerate >= 100 && current_choke < 4; //Quick bandaid check.
679 }
680 return true;
681}
682function handle_legitaa()
683{
684 var are_we_safe = handle_legitaa_safety();
685 if(script_config.legitaa_active && are_we_safe)
686 {
687 var used_implementation = script_config.rbot_lbot_switch_active ? 1 : 0;
688 var is_autodirection_used = script_config.legitaa_edge_active == 1;
689 var is_peek_invert_active = script_config.legitaa_peek_behavior == 1;
690 var lby_mode = script_config.legitaa_lby_mode;
691
692 var local_velocity = Entity.GetProp(local, "CBasePlayer", "m_vecVelocity[0]");
693 var local_velocity_length = mathlib.VectorLength(local_velocity);
694 var current_inversion = indicator_dir;
695 if(is_autodirection_used)
696 {
697 current_inversion = current_proper_direction;
698 }
699 if(is_autodirection_used && is_peek_invert_active && last_peek + 0.4 < Globals.Curtime())
700 {
701 var localplayer_eyepos = Entity.GetEyePosition(local);
702 var in_peek = are_we_peeking(localplayer_eyepos, local_velocity, 7, 1);
703 if(in_peek)
704 {
705 peek_time += Globals.TickInterval();
706 }
707 if(peek_time > 2.0)
708 {
709 peek_time = 0;
710 in_peek = false;
711 last_peek = Globals.Curtime();
712 }
713 if(local_velocity_length > 33 && in_peek)
714 {
715 current_inversion *= -1; //To fuck up antifreestanding resolvers (and most legit AA resolvers should be doing anti-freestanding at some point in time, otherwise they're horribly lucky.)
716 }
717 }
718 if(used_implementation == 1)
719 {
720 UI.SetValue("Misc", "PERFORMANCE & INFORMATION", "Information", "Restrictions", 0);
721 UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Enabled", 1);
722 UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Yaw offset", 180);
723 UI.SetValue("Anti-Aim", "Extra", "Pitch", 0);
724 UI.SetValue("Anti-Aim", "Fake angles", "Enabled", 1);
725
726 if(!is_autodirection_used)
727 {
728 current_inversion = UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter") == 1 ? -1 : 1;
729 }
730
731 AntiAim.SetOverride(1);
732 var should_use_juke = lby_mode == 1 && script_config.legitaa_juke_active; //If we're using "safe" LBY, we can't exactly trick dumb resolvers into trying to resolve us as if we were using opposite.
733 var real_yaw_offset = 60 * current_inversion * (should_use_juke ? -1 : 1);
734 var lower_body_yaw_offset = lby_mode == 1 ? (100 * -current_inversion) : 0;
735
736 AntiAim.SetRealOffset(real_yaw_offset);
737 AntiAim.SetLBYOffset(lower_body_yaw_offset);
738 indicator_dir = current_inversion;
739 }
740 else
741 {
742 UI.SetValue("Anti-Aim", "Fake angles", "Enabled", 0);
743 UI.SetValue("Anti-Aim", "Legit Anti-Aim", "Enabled", 1);
744 UI.SetValue("Anti-Aim", "Legit Anti-Aim", "Extend angle", lby_mode == 1);
745
746 var current_side = UI.IsHotkeyActive("Anti-Aim", "Legit Anti-Aim", "Direction key") == 1 ? 1 : -1;
747 if(!is_autodirection_used)
748 {
749 indicator_dir = current_side;
750 return;
751 }
752
753 if(current_inversion != current_side)
754 {
755 UI.ToggleHotkey("Anti-Aim", "Legit Anti-Aim", "Direction key");
756 }
757 indicator_dir = current_inversion;
758 }
759 }
760 else
761 {
762 AntiAim.SetOverride(0); //Bad code, but seems to flick less due to reasons I have no clue about.
763 UI.SetValue("Anti-Aim", "Legit Anti-Aim", "Enabled", 0);
764 UI.SetValue("Anti-Aim", "Rage Anti-Aim", "Enabled", 0);
765 }
766}
767
768var were_we_peeking = false;
769function handle_fakelag()
770{
771 if(script_config.gay_fakelag_active)
772 {
773 var local_eyepos = Entity.GetEyePosition(local);
774 var local_velocity = Entity.GetProp(local, "CBasePlayer", "m_vecVelocity[0]");
775 var peek = are_we_peeking(local_eyepos, local_velocity, 5, script_config.gay_fakelag_mindmg);
776 if(peek != were_we_peeking)
777 {
778 were_we_peeking = peek;
779 UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", peek ? script_config.gay_fakelag_vis_choke : script_config.gay_fakelag_invis_choke);
780 }
781 }
782}
783
784//Shamelessly pasted from April's script due to me being too lazy to figure out the easy math myself. Returns 1 on left and -1 on right. Won't work very well against spinners, though.
785//This is also better than the idea I had, so its good lol
786function handle_edge_detection(entity, step) //I recommend the step being divisible by 15.
787{
788 if(Entity.IsValid(entity) && Entity.IsAlive(entity) && !Entity.IsDormant(entity))
789 {
790 var ent_headpos = Entity.GetHitboxPosition(entity, 0);
791 var ent_eyeangles = [0, 0, 0];
792 if(entity == local)
793 {
794 ent_eyeangles = Local.GetViewAngles();
795 }
796 else
797 {
798 ent_eyeangles = Entity.GetProp(entity, "CCSPlayer", "m_angEyeAngles");
799 }
800 var left_fractions = 0;
801 var right_fractions = 0;
802
803 var base_yaw = ent_eyeangles[1] - 90;
804 var end_yaw = ent_eyeangles[1] + 90;
805
806 for(var current_step = base_yaw; current_step <= end_yaw; current_step += step)
807 {
808 if(current_step == ent_eyeangles[1])
809 {
810 continue; //Not exactly a side, I guess.
811 }
812 var point_next_to_ent = mathlib.VectorAdd(ent_headpos, [Math.cos(mathlib.DegToRad(current_step)) * 450, Math.sin(mathlib.DegToRad(current_step)) * 450, 0]);
813 var ray = Trace.Line(entity, ent_headpos, point_next_to_ent);
814 current_step < ent_eyeangles[1] ? left_fractions += ray[1] : right_fractions += ray[1];
815 }
816
817 left_fractions /= (90 / step);
818 right_fractions /= (90 / step);
819
820 return left_fractions > right_fractions ? 1 : -1;
821 }
822 return 0;
823}
824
825
826function handle_indicators()
827{
828 if(script_config.script_active && script_config.indicator_picks)
829 {
830 var screensize = Render.GetScreenSize();
831 var font = Render.AddFont("Tahoma", 12, 700);
832 var watermark_font = Render.AddFont("Verdana", 8, 250);
833 if(Entity.IsValid(local) && Entity.IsAlive(local))
834 {
835 var base_yaw = screensize[1] * script_config.indicator_offset; //not actually yaw l0l
836 if(script_config.indicator_picks & (1 << 0))
837 {
838 var string_size = Render.TextSizeCustom("Aimbot: ", font);
839
840 var is_aimbot_active = script_config.rbot_lbot_switch_active ? script_config.rbot_active : script_config.lbot_active;
841 var text = is_aimbot_active ? "ON" : "OFF";
842 var weapon_type = get_weapon_for_config();
843 if(weapon_type != -1)
844 {
845 var converted_ragebot_type = convert_weapon_index_into_rbot_idx(weapon_type);
846 var weapon_cur_fov = UI.GetValue("Rage", rbot_weapon_types[converted_ragebot_type], "Targeting", "FOV");
847 var string = ", FOV: " + weapon_cur_fov;
848 text += (script_config.rbot_lbot_switch_active ? string : "");
849 }
850 Render.StringCustom(15, base_yaw, 0, "Aimbot: ", [255, 255, 255, 255], font);
851 Render.StringCustom(15 + string_size[0], base_yaw, 0, text, is_aimbot_active ? [0, 255, 0, 255] : [255, 0, 0, 255], font);
852 base_yaw += 20;
853 }
854 if(script_config.indicator_picks & (1 << 1))
855 {
856 var string_size = Render.TextSizeCustom("Autowall: ", font);
857 Render.StringCustom(15, base_yaw, 0, "Autowall: " , [255, 255, 255, 255], font);
858 Render.StringCustom(15 + string_size[0], base_yaw, 0, (script_config.autowall_active ? "ON" : (script_config.autowall_mode == 0 ? "LEGIT" : "OFF")), (script_config.autowall_active ? [0, 255, 0, 255] : (script_config.autowall_mode == 0 ? [232, 216, 35, 255] : [255, 0, 0, 255])), font);
859 base_yaw += 20;
860 }
861 if(script_config.indicator_picks & (1 << 2))
862 {
863 var string_size = Render.TextSizeCustom("Fake: ", font);
864 Render.StringCustom(15, base_yaw, 0, "Fake: ", [255, 255, 255, 255], font);
865 var fake_yaw = Local.GetFakeYaw();
866 var real_yaw = Local.GetRealYaw();
867
868 var difference = angle_diff(fake_yaw, real_yaw);
869 var text = script_config.legitaa_active ? ("ON, fake delta: " + Math.round(difference) + (script_config.legitaa_juke_active ? " (in juke)" : "")) : "OFF";
870 Render.StringCustom(15 + string_size[0], base_yaw, 0, text, (script_config.legitaa_active ? (script_config.legitaa_juke_active ? [150, 35, 232, 255] : [0, 255, 0, 255]) : [255, 0, 0, 255]), font);
871 base_yaw += 20;
872 }
873 if(script_config.indicator_picks & (1 << 3))
874 {
875 var string_size = Render.TextSizeCustom("Choke: ", font);
876 var choked_fl_ticks = get_choked_ticks_for_entity(local);
877 var cool_representation = "";
878 for(var i = 0; i < choked_fl_ticks; i++)
879 {
880 cool_representation += "/";
881 }
882 Render.StringCustom(15, base_yaw, 0, "Choke: " + cool_representation, [255, 255, 255, 255], font);
883 Render.StringCustom(15 + string_size[0], base_yaw, 0, cool_representation, [0, 255, 0, 255], font);
884 base_yaw += 20;
885 }
886 if(script_config.indicator_picks & (1 << 4))
887 {
888 var string_size = Render.TextSizeCustom("Inaccuracy: ", font);
889 var inaccuracy = Local.GetInaccuracy();
890 if(inaccuracy == 0)
891 {
892 inaccuracy = 0.001;
893 }
894 var inaccuracy_text = 1 / inaccuracy < 50 ? "High" : "Low";
895 Render.StringCustom(15, base_yaw, 0, "Inaccuracy: ", [255, 255, 255, 255], font);
896 Render.StringCustom(15 + string_size[0], base_yaw, 0, inaccuracy_text, (inaccuracy_text == "Low" ? [0, 255, 0, 255] : [255, 0, 0, 255]), font);
897 base_yaw += 20;
898 }
899 if(script_config.indicator_picks & (1 << 5))
900 {
901 var string_size = Render.TextSizeCustom("Aim mode: ", font);
902 var text = (script_config.rbot_lbot_switch_active ? "RAGE" : "LEGIT");
903 Render.StringCustom(15, base_yaw, 0, "Aim mode: ", [255, 255, 255, 255], font);
904 Render.StringCustom(15 + string_size[0], base_yaw, 0, text, (text == "RAGE" ? [135, 50, 168, 255] : [39, 214, 202, 255]), font);
905 }
906 if(script_config.indicator_picks & (1 << 6))
907 {
908 var enemies = Entity.GetEnemies();
909 var enemy_arr_length = enemies.length;
910 var col = script_config.indicator_enemy_side_col;
911 for(var i = 0; i < enemy_arr_length; i++)
912 {
913 if(Entity.IsValid(enemies[i]) && Entity.IsAlive(enemies[i]) && !Entity.IsDormant(enemies[i]) && !Entity.IsBot(enemies[i])) //Of course a bot cannot desync lol
914 {
915 //var enemy_choked_ticks = get_choked_ticks_for_entity(enemies[i]);
916 //if(enemy_choked_ticks < 1)
917 //{
918 // continue;
919 //}
920 var enemy_freestanding_result = handle_edge_detection(enemies[i], 30);
921 if(enemy_freestanding_result == 0)
922 {
923 continue;
924 }
925 var render_box = Entity.GetRenderBox(enemies[i]);
926 if(render_box[0] == false)
927 {
928 continue;
929 }
930 var center_of_bbox_x = render_box[3] - render_box[1];
931 center_of_bbox_x /= 2;
932 center_of_bbox_x += render_box[1];
933 var text = "EST. REAL DIR: " + (enemy_freestanding_result == 1 ? "LEFT" : "RIGHT");
934 Render.String(center_of_bbox_x, render_box[2] - 25, 1, text, col, 2);
935 }
936 }
937 }
938 if(script_config.indicator_picks & (1 << 7)) //Shit code incoming lol
939 {
940 var current_fake_side = indicator_dir; //Actually real side but w/e
941 var screen_center_y = screensize[1] * 0.5;
942 var screen_side_top = screensize[1] * 0.495;
943 var screen_side_bottom = screensize[1] * 0.505;
944
945 var col = script_config.indicator_legitaa_col;
946
947 if(current_fake_side == -1) //The lines are for cool gamer style outlines around the polygons
948 {
949 var right_front = screensize[0] * 0.54;
950 var right_end = screensize[0] * 0.535;
951 var right_side = screensize[0] * 0.533;
952
953 Render.Line(right_front, screen_center_y, right_side, screen_side_top, col);
954 Render.Line(right_end, screen_center_y, right_side, screen_side_top, col);
955
956 Render.Line(right_front, screen_center_y, right_side, screen_side_bottom, col);
957 Render.Line(right_end, screen_center_y, right_side, screen_side_bottom, col);
958 Render.Polygon([[right_front, screen_center_y], [right_end, screen_center_y], [right_side, screen_side_top]], [col[0], col[1], col[2], col[3] * 0.45]);
959 Render.Polygon([[right_front, screen_center_y], [right_side, screen_side_bottom], [right_end, screen_center_y]], [col[0], col[1], col[2], col[3] * 0.45]);
960 }
961 else if(current_fake_side == 1)
962 {
963 var left_front = screensize[0] * 0.46;
964 var left_end = screensize[0] * 0.465;
965 var left_side = screensize[0] * 0.467;
966
967 Render.Line(left_front, screen_center_y, left_side, screen_side_top, col);
968 Render.Line(left_end, screen_center_y, left_side, screen_side_top, col);
969
970 Render.Line(left_front, screen_center_y, left_side, screen_side_bottom, col);
971 Render.Line(left_side, screen_side_bottom, left_end, screen_center_y, col);
972
973 Render.Polygon([[left_end, screen_center_y], [left_front, screen_center_y], [left_side, screen_side_top]], [col[0], col[1], col[2], col[3] * 0.45]);
974 Render.Polygon([[left_side, screen_side_bottom], [left_front, screen_center_y], [left_end, screen_center_y]], [col[0], col[1], col[2], col[3] * 0.45]);
975 }
976 }
977 }
978 if(script_config.indicator_picks & (1 << 8)) //gay watermark
979 {
980 var watermark_string = "";
981 var server_ip = World.GetServerString();
982 var are_we_ingame = server_ip != "" && Entity.IsValid(local);
983 if(server_ip == "valve")
984 {
985 server_ip = "valve ds"
986 }
987 if(server_ip == "local server")
988 {
989 server_ip = "127.0.0.1";
990 }
991 var accent_color = script_config.indicator_watermark_accent_col;
992 var watermark_nickname = Cheat.GetUsername();
993 if(are_we_ingame)
994 {
995 var kills = Entity.GetProp(local, "CPlayerResource", "m_iKills");
996 var deaths = Entity.GetProp(local, "CPlayerResource", "m_iDeaths");
997
998 var kd_ratio = deaths == 0 ? kills : (kills / deaths);
999 var kd_string = kd_ratio.toFixed(2);
1000
1001 watermark_string = "onetap.su & semirage assist | user: " + watermark_nickname + " | kills: " + kills + " | deaths: " + deaths + " | k/d: " + kd_string + " | host: " + server_ip;
1002 }
1003 else
1004 {
1005 watermark_string = "onetap.su && semirage assist | user: " + watermark_nickname;
1006 }
1007 var string_size = Render.TextSizeCustom(watermark_string, watermark_font);
1008 Render.FilledRect(screensize[0] * 0.99 - string_size[0], 8, string_size[0] + 10, 20, [0, 0, 0, 150]);
1009 Render.StringCustom(screensize[0] * 0.99 - string_size[0] + 5, 11, 0, watermark_string, accent_color, watermark_font);
1010 Render.Line(screensize[0] * 0.99 - string_size[0], 28, screensize[0] * 0.99 + 9, 28, accent_color);
1011 Render.GradientRect(screensize[0] * 0.99 - string_size[0], 27, string_size[0] + 10, 3, 1, accent_color, [accent_color[0] * 0.75, accent_color[1]*0.75, accent_color[2]*0.75, accent_color[3] * 0.75]);
1012 }
1013 }
1014}
1015
1016function handle_switch()
1017{
1018 UI.SetValue("Rage", "GENERAL", "Enabled", script_config.rbot_lbot_switch_active);
1019 UI.SetValue("Legit", "GENERAL", "General", "Enabled", !script_config.rbot_lbot_switch_active);
1020}
1021
1022function fix_slowwalk()
1023{
1024 UI.SetValue("Misc", "Movement", "Accurate walk", script_config.script_active && !script_config.rbot_lbot_switch_active && UI.IsHotkeyActive("Anti-Aim", "Extra", "Slow walk"));
1025}
1026
1027function on_move()
1028{
1029 local = Entity.GetLocalPlayer();
1030 if(script_config.script_active)
1031 {
1032 setup_config_and_dyn_fov();
1033 handle_legitaa();
1034 if(script_config.rbot_active && !script_config.autowall_active)
1035 {
1036 handle_autowall();
1037 }
1038 handle_fakelag();
1039 }
1040}
1041
1042var last_direction_switch = 0;
1043
1044function on_draw()
1045{
1046 update_settings();
1047 handle_visibility();
1048 handle_switch();
1049 handle_indicators();
1050 if(last_direction_switch + 0.3 < Globals.Curtime())
1051 {
1052 current_proper_direction = handle_edge_detection(local, 15);
1053 last_direction_switch = Globals.Curtime();
1054 }
1055 fix_slowwalk();
1056} //Can't be arsed setting up a FSN callback for all the misc shit and doing it in Draw doesn't seem to be a bad choice, seeing as it's called once-per-frame.
1057
1058//Gay killsay territory
1059var normal_killsays = ["ez", "too fucking easy", "effortless", "easiest kill of my life",
1060 "retard blasted", "cleans?", "nice memesense retard", "hello mind explaining what happened there",
1061 "pounce out of your window disgusting tranny, you shouldnt exist in this world",
1062 "lmao ur so ugly irl like bro doesnt it hurt to live like that, btw you know you can just end it all",
1063 "ROFL NICE *DEAD* HHHHHHHHHHHHHHHHHH", "take the cooldown and let your team surr retard",
1064 "go take some estrogen tranny", "uid police here present your user identification number right now"];
1065
1066 var hs_killsays = ["ez", "effortless", "1", "nice antiaim, you sell?", "you pay for that?",
1067 "refund right now", "consider suicide", "bro are u clean?",
1068 "another retard blasted",
1069 "hhhhhhhhhhhhhhhhhh 1, you pay for that? refund so maybe youll afford some food for your family thirdworld monkey",
1070 "paster abandoned the match and received a 7 day competitive matchmaking cooldown",
1071 "freeqn.net/refund.php", "refund your rainbowhook right now pasteuser dog",
1072 "140er????", "get good get vantap4ik",
1073 "1 but all you need to fix your problems is a rope and a chair you ugly shit",
1074 "who (kto) are you (nn4ik) wattafak mens???????", "must be an uid issue", "holy shit consider refunding your trash paste rofl",
1075 "hello please refund your subpar product"];
1076
1077 var awall_killsays = ["ez", "effortless", "sorry for awall bro",
1078 "get autoballed monkey",
1079 "too ez", "legit wallbang", "my awall > your awall", "1 hhhh",
1080 "sorry i held down my awall key bro", "thats going in my media compilation right there get shamed retard rofl",
1081 "imagine the only thing you eat being bullets man being a thirdworlder must suck rofl", "so fucking ez", "bot_kick", "where the enemies at????"];
1082
1083//I hope you haven't gotten cancer after reading those
1084
1085function on_player_death()
1086{
1087 if(script_config.trashtalk)
1088 {
1089 var victim = Entity.GetEntityFromUserID(Event.GetInt("userid"));
1090 var attacker = Entity.GetEntityFromUserID(Event.GetInt("attacker"));
1091 var headshot = Event.GetInt("headshot") == 1;
1092 var autowalled = Event.GetInt("penetrated");
1093
1094 if(attacker == local && attacker != victim)
1095 {
1096 var normal_say = normal_killsays[Math.floor(Math.random() * normal_killsays.length)];
1097 var hs_say = hs_killsays[Math.floor(Math.random() * hs_killsays.length)];
1098 var awall_say = awall_killsays[Math.floor(Math.random() * awall_killsays.length)];
1099
1100 if(headshot && Math.floor(Math.random() * 3) <= 2) //gamer style randomizer
1101 {
1102 Cheat.ExecuteCommand("say " + hs_say);
1103 return;
1104 }
1105 if(autowalled && Math.floor(Math.random() * 3) <= 2)
1106 {
1107 Cheat.ExecuteCommand("say " + awall_say);
1108 return;
1109 }
1110 Cheat.ExecuteCommand("say " + normal_say);
1111 }
1112 }
1113}
1114
1115//if they shoot us they better be ready for da OTTOBALL
1116function on_player_hurt()
1117{
1118 var attacker = Entity.GetEntityFromUserID(Event.GetInt("attacker"));
1119 var victim = Entity.GetEntityFromUserID(Event.GetInt("userid"));
1120 if(local == victim && Event.GetInt("health") > 0 && Entity.IsEnemy(attacker))
1121 {
1122 players_who_hurt_us.push({cisgendered_pig: attacker, time_he_hurt_us: Globals.Curtime()}); //How dare he hurt our precious trans selves? (youre playing semirage youre probably taking estrogen)
1123 }
1124}
1125
1126function on_round_start() //Clean up our shit.
1127{
1128 players_who_hurt_us.splice(0, players_who_hurt_us.length);
1129 ragebot_targets_this_round.splice(0, ragebot_targets_this_round.length);
1130 last_peek = 0.0;
1131 last_direction_switch = 0.0;
1132}
1133
1134function on_ragebot_fire()
1135{
1136 var target_index = Event.GetInt("target_index");
1137 ragebot_targets_this_round.push({aimbot_target: target_index, shot_time: Globals.Curtime()});
1138 if(script_config.rage_shot_log)
1139 {
1140 var target_name = Entity.GetName(target_index);
1141 var hitbox = Event.GetInt("hitbox");
1142 var hitbox_name = get_hitbox_name(hitbox);
1143 var hitchance = Event.GetInt("hitchance");
1144 var safety = Event.GetInt("safepoint");
1145 var safety_string = safety == 1 ? "ON" : "OFF";
1146 var local_eyepos = Entity.GetEyePosition(local);
1147 var target_hitboxpos = Entity.GetHitboxPosition(target_index, hitbox);
1148 var hitbox_string = "";
1149 if(typeof(target_hitboxpos) != "undefined")
1150 {
1151 var trace = Trace.Bullet(local, target_index, local_eyepos, target_hitboxpos);
1152 var damage = trace[1];
1153 var visibility = trace[2];
1154 hitbox_string = " ( predicted damage: \x0C" + damage + " \x01, center of hitbox visible: \x0C" + visibility + " \x01)";
1155 }
1156 var final_string = " \x03[semirage assist] \x01fired at \x04" + target_name + " \x01into \x04" + hitbox_name + " \x01with hitchance \x0C" + hitchance + " \x01( safety status: \x02" + safety_string + " \x01)" + hitbox_string;
1157 Cheat.PrintChat(final_string);
1158 }
1159}
1160
1161function on_unload()
1162{
1163 AntiAim.SetOverride(0); //i hate having aa override left on
1164}
1165
1166function setup_callbacks()
1167{
1168 //Function callbacks + unload callback
1169 Cheat.RegisterCallback("CreateMove", "on_move");
1170 Cheat.RegisterCallback("Draw", "on_draw");
1171 Cheat.RegisterCallback("Unload", "on_unload");
1172
1173 //Event callbacks
1174 Cheat.RegisterCallback("player_death", "on_player_death");
1175 Cheat.RegisterCallback("player_hurt", "on_player_hurt");
1176 Cheat.RegisterCallback("ragebot_fire", "on_ragebot_fire");
1177 Cheat.RegisterCallback("round_start", "on_round_start");
1178}
1179
1180setup_callbacks();