· 6 years ago · Jan 03, 2020, 04:38 PM
1 -- local variables for API functions. any changes to the line below will be lost on re-generation
2local client_draw_text, client_random_int, client_screen_size, client_set_event_callback, entity_get_local_player, entity_get_prop, globals_tickcount, math_sqrt, renderer_indicator, ui_get, ui_new_checkbox, ui_new_color_picker, ui_new_combobox, ui_new_hotkey, ui_new_multiselect, ui_reference, ui_set, ui_set_visible = client.draw_text, client.random_int, client.screen_size, client.set_event_callback, entity.get_local_player, entity.get_prop, globals.tickcount, math.sqrt, renderer.indicator, ui.get, ui.new_checkbox, ui.new_color_picker, ui.new_combobox, ui.new_hotkey, ui.new_multiselect, ui.reference, ui.set, ui.set_visible
3
4--desync variables
5local ui_checkbox = ui_new_checkbox("Lua", "A", "Desync")
6local ui_keybind = ui_new_hotkey("Lua", "A", "Desync key", false)
7local ui_combobox_type = ui_new_combobox("Lua", "A", "Desync type", { "Static", "Jitter" })
8local ui_static_type = ui_new_combobox("Lua", "A", "Static type", { "Default", "Backwards", "Half-Backwards" })
9local ui_combobox = ui_new_combobox("Lua", "A", "Jitter type", { "Default", "Advanced" })
10local ui_lby_target_type = ui_new_combobox("Lua", "A", "LBY Target", {"Off", "Flip", "Random"})
11
12--default variables
13local ui_rage_enable = ui_reference("Rage", "Aimbot", "Enabled")
14local ui_jitter, ui_slider = ui_reference("AA", "Anti-aimbot angles", "Yaw jitter")
15local ui_pitch = ui_reference("AA", "Anti-aimbot angles", "Pitch")
16local ui_yaw, ui_yaw_slider = ui_reference("AA", "Anti-aimbot angles", "Yaw")
17local ui_lby, ui_lby_slider = ui_reference("AA", "Anti-aimbot angles", "Body yaw")
18local ui_lby_target = ui_reference("AA", "Anti-aimbot angles", "Lower body yaw target")
19local ui_fd = ui_reference("Rage", "Other", "Duck peek assist")
20
21--indicator variables
22local ui_indicator = ui_new_checkbox("Lua", "A", "Indicator")
23local ui_indicator_type = ui_new_multiselect("Lua", "A", "Indicator type", { "Text", "Arrows" })
24local ui_indicator_text_type = ui_new_combobox("Lua", "A", "Arrow type", { "Default", "Classic", "Zeus", "Round", "Dick", "Square", "Stars" })
25local ui_indicator_color = ui_new_color_picker("Lua", "A", "Indicator color", 60, 240, 228, 255)
26local ui_arrow_indicator = ui_new_checkbox("Lua", "A", "Show second arrow")
27local ui_arrow_color = ui_new_color_picker("Lua", "A", "Second arrow color", 255, 255, 255, 100)
28
29--other variables
30local flip
31local desync_type
32
33--desync switch variables (request from Mishkat)
34local ui_switch_enable = ui_new_checkbox("Lua", "A", "Switch type on key")
35local ui_switch_key = ui_new_hotkey("Lua", "A", "Switch type on key", true)
36
37--------------------------variables end--------------------------
38
39local function contains(table, val) --pasted cuz i didnt know that multiselect cant work properly without custom checks
40 for i=1, #table do
41 if table[i] == val then
42 return true
43 end
44 end
45
46 return false
47end
48
49local function switch_desync()
50
51 if entity_get_local_player() == nil or entity_get_prop(entity_get_local_player(), "m_iHealth") <= 0 then
52 return
53 end
54
55 local vel_x, vel_y = entity_get_prop(entity_get_local_player(), "m_vecVelocity")
56 local vel = math_sqrt(vel_x^2 + vel_y^2)
57
58 if ui_get(ui_switch_enable) then
59 desync_type = ui_get(ui_switch_key) and 1 or 0
60 ui_set(ui_combobox_type, desync_type == 1 and "Jitter" or "Static")
61 flip = ui_get(ui_keybind) and true or false
62 else
63 desync_type = ui_get(ui_combobox_type) == "Jitter" and 1 or 0
64 flip = ui_get(ui_keybind) and true or false
65 end
66
67 local sFlip = globals_tickcount() % 100 > 1 and globals_tickcount() % 100 < 50 and true or false
68
69 if desync_type == 0 then
70 if ui_get(ui_lby_target_type) == "Flip" then
71 ui_set(ui_lby_target, sFlip and "Sway" or "Opposite")
72 end
73 if ui_get(ui_lby_target_type) == "Random" then
74 local random = client_random_int(1, 5)
75 if random == 1 then
76 ui_set(ui_lby_target, "Off")
77 end
78 if random == 2 then
79 ui_set(ui_lby_target, "Sway")
80 end
81 if random == 3 then
82 ui_set(ui_lby_target, "Opposite")
83 end
84 if random == 4 then
85 ui_set(ui_lby_target, sFlip and "Sway" or "Opposite")
86 end
87 end
88 else
89 ui_set(ui_lby_target, "Off")
90 end
91
92 if desync_type == 0 then
93 local values = vel > 10 and 0 or 25
94
95 ui_set(ui_jitter, "Off")
96 ui_set(ui_lby, "Static")
97
98 if ui_get(ui_static_type) == "Default" then
99 if ui_get(ui_keybind) then
100 if ui_get(ui_fd) then
101 ui_set(ui_yaw_slider, 0)
102 else
103 ui_set(ui_yaw_slider, values)
104 end
105 ui_set(ui_lby_slider, 180)
106 else
107 ui_set(ui_yaw_slider, -values)
108 ui_set(ui_lby_slider, -180)
109 end
110 end
111 if ui_get(ui_static_type) == "Backwards" then
112 ui_set(ui_yaw_slider, 0)
113 if ui_get(ui_keybind) then
114 ui_set(ui_lby_slider, 180)
115 else
116 ui_set(ui_lby_slider, -180)
117 end
118 end
119 if ui_get(ui_static_type) == "Half-Backwards" then
120 ui_set(ui_yaw_slider, 0)
121 if ui_get(ui_keybind) then
122 ui_set(ui_lby_slider, 35)
123 else
124 ui_set(ui_lby_slider, -10)
125 end
126 end
127 end
128 if desync_type == 1 then
129 ui_set(ui_lby, "Opposite")
130 if ui_get(ui_combobox) == "Default" then
131 ui_set(ui_jitter, "Center")
132 if ui_get(ui_keybind) then
133 ui_set(ui_slider, 122)
134 ui_set(ui_yaw_slider, 90)
135 else
136 ui_set(ui_slider, -122)
137 ui_set(ui_yaw_slider, -90)
138 end
139 end
140 if ui_get(ui_combobox) == "Advanced" then
141 ui_set(ui_jitter, "Offset")
142 if ui_get(ui_keybind) then
143 ui_set(ui_slider, 140)
144 ui_set(ui_yaw_slider, 0)
145 else
146 ui_set(ui_slider, -140)
147 ui_set(ui_yaw_slider, 0)
148 end
149 end
150 end
151end
152
153local function switch_yaw()
154
155
156
157
158
159end
160
161
162local function draw_indicators()
163 if entity_get_local_player() == nil or entity_get_prop(entity_get_local_player(), "m_iHealth") <= 0 then
164 return
165 end
166
167 local r, g, b, a = ui_get(ui_indicator_color)
168 local r1, g1, b1, a1 = ui_get(ui_arrow_color)
169 local scrsize_x, scrsize_y = client_screen_size()
170 local center_x, center_y = scrsize_x / 2, scrsize_y / 2
171
172 if ui_get(ui_indicator) then
173 if contains(ui_get(ui_indicator_type), "Text") then
174 if not flip then
175 renderer_indicator(r, g, b, a, "LEFT")
176 else
177 renderer_indicator(r, g, b, a, "RIGHT")
178 end
179 end
180
181 local arrow_left, arrow_right
182 if ui_get(ui_indicator_text_type) == "Default" then
183 arrow_left = "⮜"
184 arrow_right = "⮞"
185 end
186 if ui_get(ui_indicator_text_type) == "Classic" then
187 arrow_left = "<"
188 arrow_right = ">"
189 end
190 if ui_get(ui_indicator_text_type) == "Zeus" then
191 arrow_left = "\u{25C0}"
192 arrow_right = "\u{25B6}"
193
194 arrow_left2 = "\u{25E3}"
195 arrow_right2 = "\u{25E2}"
196
197 arrow_down = "\u{25BE}"
198
199 end
200
201
202 if contains(ui_get(ui_indicator_type), "Arrows") then --pasted cuz lazy to calc pos
203 if not flip then
204 client_draw_text(c, center_x - 45, center_y, r1, g1, b1, a1, "c+", 0, arrow_left)
205 client_draw_text(c, center_x - 30, center_y +25, r, g, b, a, "c+", 0, arrow_left2)
206
207 client_draw_text(c, center_x , center_y +40, r1, g1, b1, a1, "c+", 0, arrow_down)
208
209 if ui_get(ui_arrow_indicator) then
210 client_draw_text(c, center_x + 45, center_y, r1, g1, b1, a1, "c+", 0, arrow_right)
211 client_draw_text(c, center_x + 30, center_y +25, r1, g1, b1, a1, "c+", 0, arrow_right2)
212
213
214
215
216 end
217 else
218 client_draw_text(c, center_x + 45, center_y, r1, g1, b1, a1, "c+", 0, arrow_right)
219 client_draw_text(c, center_x + 30, center_y +25, r, g, b, a, "c+", 0, arrow_right2)
220
221 client_draw_text(c, center_x , center_y +40, r1, g1, b1, a1, "c+", 0, arrow_down)
222
223 if ui_get(ui_arrow_indicator) then
224 client_draw_text(c, center_x - 45, center_y, r1, g1, b1, a1, "c+", 0, arrow_left)
225 client_draw_text(c, center_x - 30, center_y +25, r1, g1, b1, a1, "c+", 0, arrow_left2)
226
227
228
229
230 end
231 end
232 end
233 end
234end
235
236local function desync()
237 if entity_get_local_player() == nil or entity_get_prop(entity_get_local_player(), "m_iHealth") <= 0 then
238 return
239 end
240
241 local show = contains(ui_get(ui_indicator_type), "Arrows") and true or false
242 local show_desync = desync_type == 0
243
244 if ui_get(ui_rage_enable) then
245 ui_set(ui_pitch, "Down")
246 ui_set(ui_keybind, "Toggle")
247
248 ui_set_visible(ui_static_type, ui_get(ui_checkbox) and show_desync)
249 ui_set_visible(ui_combobox, ui_get(ui_checkbox) and not show_desync)
250
251 ui_set_visible(ui_indicator, ui_get(ui_checkbox))
252 ui_set_visible(ui_indicator_type, ui_get(ui_indicator))
253 ui_set_visible(ui_indicator_color, ui_get(ui_indicator))
254 ui_set_visible(ui_indicator_text_type, ui_get(ui_indicator) and show)
255 ui_set_visible(ui_arrow_indicator, show)
256 ui_set_visible(ui_arrow_color, ui_get(ui_arrow_indicator) and show)
257
258 if ui_get(ui_checkbox) then
259 switch_desync()
260 draw_indicators()
261 end
262 else
263 ui_set(ui_pitch, "Off")
264 ui_set(ui_yaw, "Off")
265 ui_set(ui_lby, "Off")
266 ui_set(ui_lby_target, "Off")
267 end
268end
269
270client_set_event_callback("paint", desync)