Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.11 KB | None | 0 0
  1. --local variables for API. Automatically generated by https://github.com/simpleavaster/gslua/blob/master/authors/sapphyrus/generate_api.lua
  2. local client_latency, client_log, client_draw_rectangle, client_draw_circle_outline, client_userid_to_entindex, client_draw_gradient, client_set_event_callback, client_screen_size, client_draw_text, client_visible = client.latency, client.log, client.draw_rectangle, client.draw_circle_outline, client.userid_to_entindex, client.draw_gradient, client.set_event_callback, client.screen_size, client.draw_text, client.visible
  3. local client_visible, client_exec, client_draw_circle, client_delay_call, client_world_to_screen, client_draw_hitboxes, client_get_cvar, client_draw_line, client_camera_angles, client_draw_debug_text, client_random_int, client_random_float = client.visible, client.exec, client.draw_circle, client.delay_call, client.world_to_screen, client.draw_hitboxes, client.get_cvar, client.draw_line, client.camera_angles, client.draw_debug_text, client.random_int, client.random_float
  4. local entity_get_local_player, entity_is_enemy, entity_get_player_name, entity_get_all, entity_set_prop, entity_get_player_weapon, entity_hitbox_position, entity_get_prop, entity_get_players, entity_get_classname = entity.get_local_player, entity.is_enemy, entity.get_player_name, entity.get_all, entity.set_prop, entity.get_player_weapon, entity.hitbox_position, entity.get_prop, entity.get_players, entity.get_classname
  5. local globals_mapname, globals_tickcount, globals_realtime, globals_absoluteframetime, globals_tickinterval, globals_curtime, globals_frametime, globals_maxplayers = globals.mapname, globals.tickcount, globals.realtime, globals.absoluteframetime, globals.tickinterval, globals.curtime, globals.frametime, globals.maxplayers
  6. local ui_new_slider, ui_new_combobox, ui_reference, ui_set_visible, ui_new_color_picker, ui_set_callback, ui_set, ui_new_checkbox, ui_new_hotkey, ui_new_button, ui_new_multiselect, ui_get = ui.new_slider, ui.new_combobox, ui.reference, ui.set_visible, ui.new_color_picker, ui.set_callback, ui.set, ui.new_checkbox, ui.new_hotkey, ui.new_button, ui.new_multiselect, ui.get
  7. local math_ceil, math_tan, math_correctRadians, math_fact, math_log10, math_randomseed, math_cos, math_sinh, math_random, math_huge, math_pi, math_max, math_atan2, math_ldexp, math_floor, math_sqrt = math.ceil, math.tan, math.correctRadians, math.fact, math.log10, math.randomseed, math.cos, math.sinh, math.random, math.huge, math.pi, math.max, math.atan2, math.ldexp, math.floor, math.sqrt
  8. local math_sqrt, math_deg, math_atan, math_fmod, math_acos, math_pow, math_abs, math_min, math_sin, math_frexp, math_log, math_tanh, math_exp, math_modf, math_cosh, math_asin, math_rad = math.sqrt, math.deg, math.atan, math.fmod, math.acos, math.pow, math.abs, math.min, math.sin, math.frexp, math.log, math.tanh, math.exp, math.modf, math.cosh, math.asin, math.rad
  9. local table_maxn, table_foreach, table_sort, table_remove, table_foreachi, table_move, table_getn, table_concat, table_insert = table.maxn, table.foreach, table.sort, table.remove, table.foreachi, table.move, table.getn, table.concat, table.insert
  10. --end of local variables
  11.  
  12. local show_angles_reference = ui.new_multiselect("VISUALS", "Other ESP", "Show Anti-aimbot angles", "Real", "Fake", "LBY", "Camera")
  13.  
  14. local real_length_reference = ui.new_slider("VISUALS", "Other ESP", "Real Distance / Color", 10, 80, 30, true, "u")
  15. local real_color_reference = ui.new_color_picker("VISUALS", "Other ESP", "Real Color", 28, 132, 255, 220)
  16.  
  17. local fake_length_reference = ui.new_slider("VISUALS", "Other ESP", "Fake Distance / Color", 10, 80, 30, true, "u")
  18. local fake_color_reference = ui.new_color_picker("VISUALS", "Other ESP", "Fake Color", 0, 164, 52, 220)
  19.  
  20. local lby_length_reference = ui.new_slider("VISUALS", "Other ESP", "LBY Distance / Color", 10, 80, 30, true, "u")
  21. local lby_color_reference = ui.new_color_picker("VISUALS", "Other ESP", "LBY Color", 255, 0, 0, 220)
  22.  
  23. local camera_length_reference = ui.new_slider("VISUALS", "Other ESP", "Camera Distance / Color", 10, 80, 30, true, "u")
  24. local camera_color_reference = ui.new_color_picker("VISUALS", "Other ESP", "Camera Color", 255, 255, 255, 220)
  25.  
  26. local boxSize = 30
  27. local length = 40
  28.  
  29. local debug = false
  30. local function debug_log(message)
  31. if debug then
  32. client.log(message)
  33. end
  34. end
  35.  
  36. local function contains(table, val)
  37. for i=1,#table do
  38. if table[i] == val then
  39. return true
  40. end
  41. end
  42. return false
  43. end
  44.  
  45. local function on_show_angles_change()
  46. local value = ui_get(show_angles_reference)
  47. ui_set_visible(real_length_reference, contains(value, "Real"))
  48. ui_set_visible(real_color_reference, contains(value, "Real"))
  49.  
  50. ui_set_visible(fake_length_reference, contains(value, "Fake"))
  51. ui_set_visible(fake_color_reference, contains(value, "Fake"))
  52.  
  53. ui_set_visible(lby_length_reference, contains(value, "LBY"))
  54. ui_set_visible(lby_color_reference, contains(value, "LBY"))
  55.  
  56. ui_set_visible(camera_length_reference, contains(value, "Camera"))
  57. ui_set_visible(camera_color_reference, contains(value, "Camera"))
  58. end
  59.  
  60. ui_set_callback(show_angles_reference, on_show_angles_change)
  61.  
  62. local function on_paint(ctx)
  63. local local_player = entity_get_local_player()
  64.  
  65. if local_player == nil then
  66. return
  67. end
  68.  
  69. if entity_get_prop(local_player, "m_lifeState") ~= 0 then
  70. return
  71. end
  72.  
  73. local value = ui_get(show_angles_reference)
  74.  
  75. if value == {} then
  76. return
  77. end
  78.  
  79. local locationX, locationY, locationZ = entity_get_prop(local_player, "m_vecOrigin")
  80.  
  81. if locationX then
  82.  
  83. debug_log("ingame + drawing")
  84.  
  85. local worldX, worldY = client_world_to_screen(ctx, locationX, locationY, locationZ)
  86.  
  87. if worldX == nil or worldY == nil then return end
  88.  
  89. local lbyYaw = entity_get_prop(entity_get_local_player(), "m_flLowerBodyYawTarget")
  90.  
  91. if contains(value, "Real") then
  92. local real_r, real_g, real_b, real_a = ui_get(real_color_reference)
  93. local real_distance = ui_get(real_length_reference)
  94.  
  95. local headX, headY, headZ = entity_hitbox_position(local_player, 0)
  96. local deltaX, deltaY = headX-locationX, headY-locationY
  97. local realYaw = math_deg(math_atan2(deltaY, deltaX))
  98. local additional = lbyYaw > realYaw and -10 or 20
  99. if math_abs(lbyYaw-realYaw) > 15 then
  100. realYaw = realYaw + additional
  101. end
  102.  
  103. locationXReal = locationX + math_cos(math_rad(realYaw)) * real_distance
  104. locationYReal = locationY + math_sin(math_rad(realYaw)) * real_distance
  105.  
  106. local worldXReal, worldYReal = client_world_to_screen(ctx, locationXReal, locationYReal, locationZ)
  107.  
  108. if worldXReal ~= nil then
  109. debug_log("drawing real with colors " .. real_r .. ", " .. real_g .. ", " .. real_b .. ", " .. real_a)
  110. client_draw_line(ctx, worldX, worldY, worldXReal, worldYReal, real_r, real_g, real_b, real_a)
  111. client_draw_text(ctx, worldXReal, worldYReal, real_r, real_g, real_b, real_a, "c-", 0, "REAL")
  112. end
  113. end
  114.  
  115. if contains(value, "Fake") then
  116. local fake_r, fake_g, fake_b, fake_a = ui_get(fake_color_reference)
  117. local fake_distance = ui_get(fake_length_reference)
  118. local _, fakeYaw, _ = entity_get_prop(entity_get_local_player(), "m_angEyeAngles")
  119. locationXFake = locationX + math_cos(math_rad(fakeYaw)) * fake_distance
  120. locationYFake = locationY + math_sin(math_rad(fakeYaw)) * fake_distance
  121.  
  122. local worldXFake, worldYFake = client_world_to_screen(ctx, locationXFake, locationYFake, locationZ)
  123.  
  124. if worldXFake ~= nil then
  125. client_draw_line(ctx, worldX, worldY, worldXFake, worldYFake, fake_r, fake_g, fake_b, fake_a)
  126. client_draw_text(ctx, worldXFake, worldYFake, fake_r, fake_g, fake_b, fake_a, "c-", 0, "FAKE")
  127. end
  128. end
  129.  
  130. if contains(value, "LBY") then
  131. local lby_r, lby_g, lby_b, lby_a = ui_get(lby_color_reference)
  132. local lby_distance = ui_get(lby_length_reference)
  133. locationXLBY = locationX + math_cos(math_rad(lbyYaw)) * lby_distance
  134. locationYLBY = locationY + math_sin(math_rad(lbyYaw)) * lby_distance
  135.  
  136. local worldXLBY, worldYLBY = client_world_to_screen(ctx, locationXLBY, locationYLBY, locationZ)
  137.  
  138. if worldXLBY ~= nil then
  139. client_draw_line(ctx, worldX, worldY, worldXLBY, worldYLBY, lby_r, lby_g, lby_b, lby_a)
  140. client_draw_text(ctx, worldXLBY, worldYLBY, lby_r, lby_g, lby_b, lby_a, "c-", 0, "LBY")
  141. end
  142. end
  143.  
  144. if contains(value, "Camera") then
  145. local camera_r, camera_g, camera_b, camera_a = ui_get(camera_color_reference)
  146. local camera_distance = ui_get(camera_length_reference)
  147. local _, cameraYaw = client_camera_angles()
  148. locationXCamera = locationX + math_cos(math_rad(cameraYaw)) * camera_distance
  149. locationYCamera = locationY + math_sin(math_rad(cameraYaw)) * camera_distance
  150.  
  151. local worldXCamera, worldYCamera = client_world_to_screen(ctx, locationXCamera, locationYCamera, locationZ)
  152.  
  153. if worldXCamera ~= nil then
  154. client_draw_line(ctx, worldX, worldY, worldXCamera, worldYCamera, camera_r, camera_g, camera_b, camera_a)
  155. client_draw_text(ctx, worldXCamera, worldYCamera, camera_r, camera_g, camera_b, camera_a, "c-", 0, "CAM")
  156. end
  157. end
  158.  
  159. if #value > 0 then
  160. client_draw_circle(ctx, worldX, worldY, 17, 17, 17, 255, 2, 0, 1)
  161. end
  162. end
  163. end
  164.  
  165. client.set_event_callback("paint", on_paint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement