rubberduck-ai / rubberduck-vscode

Use AI-powered code edits, explanations, code generation, error diagnosis, and chat in Visual Studio Code with the official OpenAI API.
https://marketplace.visualstudio.com/items?itemName=Rubberduck.rubberduck-vscode
MIT License
579 stars 70 forks source link

1 #104

Closed BeardedNRG closed 9 months ago

BeardedNRG commented 11 months ago

Is this request related to a problem? Please describe.

A clear and concise description of what the problem is (e.g. "I'm always frustrated when […]").

Describe the solution you'd like

A clear and concise description of what you want to happen.

Additional context

Add any other information or screenshots about the feature request here (e.g. a gif showing how another tool does it). local Activate_Key = "numlock" -- Turn-On numlock to activate the script local Auto_ADS_Key = "capslock" -- Turn-On capslock to activate Auto-ADS when you are firing local Fire_key = 1 -- Your Mouse Left-Click (Fire) local ADS_key = 3 -- Your Mouse Right-Click (ADS) local Weapon_switch_key = 5 -- Switch between Weapon-Patterns local weapon_table = { primary = { Horizontal= -0.2, Vertical= 2, FireDelay= 6, AdsDelay= 250}, -- Your Primary weapon recoil-pattern secondary = { Horizontal= -0.1, Vertical= 3, FireDelay= 6, AdsDelay= 130} -- Your Secondary weapon recoil-pattern } local current_weapon = "primary" -- The Recoil-pattern you want to be activated on the start local VERSION = "0.0.1" local script_active = true

local function Volatility(range, impact) local interupt = range (1 + impact math.random()) return interupt end

local function Move_x(_horizontal_recoil) MoveMouseRelative(math.floor(Volatility(0.7, 1) * _horizontal_recoil), 0) -- 70 ~ 140 % end

local function Move_y(_vertical_recoil) MoveMouseRelative(0, math.floor(Volatility(0.7, 1) * _vertical_recoil)) -- 70 ~ 140 % end

local function Direct_Fire() local horizontal_recoil = weapon_table[current_weapon].Horizontal local vertical_recoil = weapon_table[current_weapon].Vertical local float_x = math.abs(horizontal_recoil) - math.floor(math.abs(horizontal_recoil)) local float_y = math.abs(vertical_recoil) - math.floor(math.abs(vertical_recoil)) local i = 0 local j = 0

while IsMouseButtonPressed(Fire_key) do if horizontal_recoil ~= 0 then if horizontal_recoil < 0 then Move_x(horizontal_recoil + float_x) else
Move_x(vertical_recoil - float_x) end end

 if vertical_recoil ~= 0  then
     if vertical_recoil < 0 then
         Move_y(vertical_recoil + float_y)
     else
         Move_y(vertical_recoil - float_y)
     end
 end

 if float_x ~= 0 then
     i = i + float_x
     if i >= 1 * Volatility(0.7, 1) then
         if horizontal_recoil > 0 then
             Move_x(1)
         else
             Move_x(-1)
         end
         i = 0
     end
 end

 if float_y ~= 0 then
     j = j + float_y
     if j >= 1 * Volatility(0.7, 1)  then
         if vertical_recoil > 0 then
             Move_y(1)
         else
             Move_y(-1)
         end
         j = 0
     end
 end

 Sleep(math.floor(Volatility(0.8, 0.5) * weapon_table[current_weapon].FireDelay))   -- 80 ~ 120 %

end end

local function ADS_Fire() PressMouseButton(ADS_key) Sleep(weapon_table[current_weapon].AdsDelay) Direct_Fire() ReleaseMouseButton(ADS_key) Sleep(40) end

local function Initialize() ClearLog() OutputLogMessage('\n') OutputLogMessage('Selected weapon: %s\n', current_weapon) OutputLogMessage('Fire button: %s\n', Fire_key) OutputLogMessage('ADS button: %s\n', ADS_key) OutputLogMessage('Weapon switch: %s\n', Weapon_switch_key) OutputLogMessage('Auto ADS: %s\n', Auto_ADS_Key) OutputLogMessage('\n')

if IsKeyLockOn(Activate_Key) then script_active = true OutputLogMessage('Script is On and ready\n') else script_active = false OutputLogMessage('Script is Off...\n') OutputLogMessage('You can activate it by pressing: %s\n', Activate_Key) end end

Initialize()

function OnEvent(event, arg) if event == "PROFILE_ACTIVATED" then EnablePrimaryMouseButtonEvents(true) elseif event == "PROFILE_DEACTIVATED" then ReleaseMouseButton(Fire_key) ReleaseMouseButton(ADS_key) end

if IsKeyLockOn(Activate_Key) then if not script_active then script_active = true OutputLogMessage('Script is on...\n') end

 if event == "MOUSE_BUTTON_PRESSED" and arg == Weapon_switch_key then
     if current_weapon == "primary" then
         current_weapon = "secondary"
         OutputLogMessage('Secondary weapon profile activated...\n')
     else
         current_weapon = "primary"
         OutputLogMessage('Primary weapon profile activated...\n')
     end
 end

 if event == "MOUSE_BUTTON_PRESSED" and arg == Fire_key then
     if IsKeyLockOn(Auto_ADS_Key) then
         ADS_Fire()
     else
         Direct_Fire()
     end
 end

else if script_active then script_active = false OutputLogMessage('Script is off...\n') end end end