Advertisement
Guest User

adaptive fps @henny thanks :)(i did not make this)

a guest
Mar 21st, 2019
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. -- By Spec122
  2. local realtime, delay, FPS_Buffer = 0
  3. local FPS = 0
  4. local curtime = 0
  5. local realtime = 0
  6. local delaybuf = 0
  7. local fpsbuf = 0
  8.  
  9. local misc_m = gui.Reference("MISC", "GENERAL", "BYPASS")
  10. local Gbox_ext = gui.Groupbox(misc_m, "Extended Functions", 0, 150, 200, 450)
  11.  
  12. local AdaptiveFps_c = gui.Checkbox(Gbox_ext, "msc_hitlog", "AdaptiveFps", 1)
  13. local delay = gui.Slider(Gbox_ext,delay,"Adaptive Switch Delay", 3, 0.3,10)
  14.  
  15. local RenderFont = draw.CreateFont("Tahoma", 25, 1300)
  16.  
  17.  
  18. local function GameFPS()
  19. FPS = 0.9 * FPS + (1.0 - 0.9) * globals.AbsoluteFrameTime();
  20. return math.floor((1.0 / FPS) + 0.5);
  21. end
  22.  
  23. function isFPSLow()
  24. if AdaptiveFps_c:GetValue() then
  25. fps = GameFPS()
  26. local w,h = draw.GetScreenSize()
  27. draw.SetFont(RenderFont)
  28. realtime = globals.CurTime()
  29. delaybuf = delay:GetValue()
  30. if entities.GetLocalPlayer() ~= nil then
  31. draw.CreateFont(RenderFont)
  32. if fps <= 60 then
  33. if ((realtime - curtime) > delaybuf) or GameFPS() < fpsbuf then
  34.  
  35. gui.SetValue("rbot_positionadjustment", "5")
  36. gui.SetValue("rbot_autosniper_hitbox_adaptive", 1)
  37. gui.SetValue("rbot_pistol_hitbox_adaptive", 1)
  38. gui.SetValue("rbot_revolver_hitbox_adaptive", 1)
  39. gui.SetValue("rbot_sniper_hitbox_adaptive", 1)
  40. gui.SetValue("rbot_scout_hitbox_adaptive", 1)
  41. curtime = globals.CurTime()
  42. fpsbuf = GameFPS()
  43. end
  44.  
  45. elseif fps <= 120 then
  46. if (realtime - curtime) > delaybuf or GameFPS() < fpsbuf then
  47. gui.SetValue("rbot_positionadjustment", "2")
  48. gui.SetValue("rbot_autosniper_hitbox_adaptive", 0)
  49. gui.SetValue("rbot_pistol_hitbox_adaptive", 0)
  50. gui.SetValue("rbot_revolver_hitbox_adaptive", 0)
  51. gui.SetValue("rbot_sniper_hitbox_adaptive", 0)
  52. gui.SetValue("rbot_scout_hitbox_adaptive", 0)
  53. curtime = globals.CurTime()
  54. fpsbuf = GameFPS()
  55. end
  56. else
  57. if (realtime - curtime) > delaybuf or GameFPS() < fpsbuf then
  58. gui.SetValue("rbot_positionadjustment", "3")
  59. gui.SetValue("rbot_autosniper_hitbox_adaptive", 0)
  60. gui.SetValue("rbot_autosniper_hitbox_adaptive", 0)
  61. gui.SetValue("rbot_pistol_hitbox_adaptive", 0)
  62. gui.SetValue("rbot_revolver_hitbox_adaptive", 0)
  63. gui.SetValue("rbot_sniper_hitbox_adaptive", 0)
  64. gui.SetValue("rbot_scout_hitbox_adaptive", 0)
  65. curtime = globals.CurTime()
  66. fpsbuf = GameFPS()
  67.  
  68. draw.CreateFont(DefalutFont)
  69. end
  70. end
  71. end
  72. end
  73. end
  74.  
  75.  
  76.  
  77. callbacks.Register( "Draw", "isFPSLow", isFPSLow)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement