# Soldier76 **Repository Path**: yaoys95/Soldier76 ## Basic Information - **Project Name**: Soldier76 - **Description**: 此仓库为 github 上 kiccer/Soldier76 的镜像,方便国内玩家下载脚本。 - **Primary Language**: Lua - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: https://github.com/kiccer/Soldier76 - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 21 - **Created**: 2023-03-05 - **Last Updated**: 2025-04-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
* Note the comments in the code, which clearly mark the player's customizable area and the script's core area. Do not modify the code in the script's core area.
### Other Settings (Optional) * To enable the rapid fire feature, please set it in the `canUse` section. * To set the individual coefficient, please set it in the `canUse` section. * To set the individual crouch coefficient, please set it in the `canUse` section. * [Extended Development Tutorial: Adding a New Weapon/Modifying the Data of an Existing Weapon](https://github.com/kiccer/Soldier76/issues/24) * [Extended Development Tutorial: Setting Custom Aiming Conditions](https://github.com/kiccer/Soldier76/issues/52) ### What is Configuration Switching? Many people are unclear about what switching means, which is what sets our script apart from others. This script contains a weapon library, which is divided into different series based on bullet type, including the **.45** series, **9mm** series, **5.56** series, and **7.62** series. Each series contains firearms that match the ammunition type, such as the **M416** being the first gun in the 5.56 series. The G6-G9 keys represent the four different series, and clicking on them will switch to the corresponding series of firearms and automatically select the first gun in the list. Pressing G11 multiple times will allow you to select the next firearm in the series, and if you need the last firearm in the series, simply press G10 once. For example, if you pick up an **AKM**, you only need to click the G8 key, as the **AKM** is the first gun in the **7.62** series. If you later pick up a **QBZ**, and you no longer want the **AKM**, you need to click the G6 key to switch to the **5.56** series, which by default will select the first gun in the list. As the **QBZ** is the third gun in the series, you need to press G11 twice to select it. The order of firearms can be found in the `userInfo.canUse` section of the source code, which reflects the order of the firearms. The functions of the G keys can all be customized, and by default they are set to G502, but other Logitech programmable mice are also supported. If you do not know how to set or adjust them, feel free to join the group and ask us.  ### G key functions (default settings) | G key | Function | | ----- | ----- | | `G6` | Switch to **5.56** firearms configuration file table, and use the **first** configuration | | `G7` | Switch to **9mm** firearms configuration file table, and use the **first** configuration | | `G8` | Switch to **7.62** firearms configuration file table, and use the **first** configuration | | `G9` | Switch to **.45** firearms configuration file table, and use the **first** configuration | | `G10` | Switch to **last** configuration (scroll wheel right tilt) | | `G11` | Switch to **next** configuration (scroll wheel left tilt) | > The above settings can all be customized in `G_bind` by changing the keybindings. ### Command List | Command | Function | | ----------------- | ----------------- | | `.45` | Switch to the **.45** series firearm list and use the first firearm in the list | | `9mm` | Switch to the **9mm** series firearm list and use the first firearm in the list | | `5.56` | Switch to the **5.56** series firearm list and use the first firearm in the list | | `7.62` | Switch to the **7.62** series firearm list and use the first firearm in the list | | `first` | Switch to the first firearm in the current list | | `next` | Switch to the next firearm in the current list | | `last` | Switch to the last firearm in the current list | | `first_in_canUse` | Treat all usable firearms under `canUse` as one list and switch to the first firearm in the list | | `next_in_canUse` | Treat all usable firearms under `canUse` as one list and switch to the next firearm in the list | | `last_in_canUse` | Treat all usable firearms under `canUse` as one list and switch to the last firearm in the list | | `off` | When `startControl = "G_bind"`, use this command to turn off the script control. Switching firearms will restart the macro. | | `scopeX1` | Switch to basic sight mode (red dot, holographic, side sight, or no sight) | | `scopeX2` | Switch to 2x scope mode | | `scopeX3` | Switch to 3x scope mode | | `scopeX4` | Switch to 4x scope mode | | `scopeX6` | Switch to 6x scope mode | | `UMP45` | Directly switch to the `UMP45` configuration | | `Tommy Gun` | Directly switch to the `Tommy Gun` configuration | | `Vector` | Directly switch to the `Vector` configuration | | `Micro UZI` | Directly switch to the `Micro UZI` configuration | | `M416` | Directly switch to the `M416` configuration | | `SCAR-L` | Directly switch to the `SCAR-L` configuration | | `QBZ` | Directly switch to the `QBZ` configuration | | `G36C` | Directly switch to the `G36C` configuration | | `M16A4` | Directly switch to the `M16A4` configuration | | `AKM` | Directly switch to the `AKM` configuration | | `Beryl M762` | Directly switch to the `Beryl M762` configuration | | `DP-28` | Directly switch to the `DP-28` configuration | | `fast_pickup` | One-click pickup (use after closing the backpack). **Users have reported that this function has been detected by the game and may lead to a ban, so use with caution!** | | `fast_discard` | One-click discard (use after closing the backpack) | | `fast_lick_box` | One-click lick pack (use after closing the backpack, only pick up items that can be placed in the backpack) | > Can be bound to `G_bind`, trigger the command with the preset key combination. > > Note: The command is bound to the key combination, not the key combination to the command. Please do not modify the content in `[""]` before the equal sign! > > Note: **One-click pick up/One-click discard/One-click lick pack** all have the possibility of three days, use with caution! Some experimental updates have been made to these three functions, and their safety is not guaranteed at the moment! ### `G_bind` command binding demonstration ```lua -- G ["G3"] = "", ["G4"] = "", ["G5"] = "", ["G6"] = "5.56", ["G7"] = "9mm", ["G8"] = "7.62", ["G9"] = ".45", ["G10"] = "last", ["G11"] = "next", -- ✖, incorrect modification method ["G3"] = "", ["G4"] = "", -- The G4 below will overwrite this G4, causing G6 to be lost and an error when G6 is pressed. ["G5"] = "", ["G4"] = "5.56", -- Never directly modify the key combination before the equal sign! ["G7"] = "9mm", ["G8"] = "7.62", ["G9"] = ".45", ["G10"] = "last", ["G11"] = "next", -- ✔, correct modification method ["G3"] = "", ["G4"] = "5.56", -- Bind the command here ["G5"] = "", ["G6"] = "", -- Clear this command ["G7"] = "9mm", ["G8"] = "7.62", ["G9"] = ".45", ["G10"] = "last", ["G11"] = "next", -- Added support for binding a group of commands with | in v4.4 ["rctrl + G5"] = "M416|scopeX1", ["rctrl + G6"] = "AKM|scopeX4", ``` ### Hardware requirements * A programmable Logitech mouse (wireless mice are very unstable when running macros) * The game screen should not stutter or drop frames frequently, and the frame rate can be locked if necessary to ensure stability. ### Disclaimer * **This script program is for learning and communication purposes only. It is strictly forbidden to use it for any commercial purposes. We will not be responsible for any profit disputes arising from such use.** * **Please respect the author's work. If you need to reprint it, please indicate the source. Thank you!** * **It is not allowed to use this script for commercial purposes after secondary creation!** ### Communication Group * Welcome to join our technical discussion QQ group (**below is the designated official group, beware of fake groups!**): * [768483124](https://kiccer.github.io/Soldier76/static/join_group.html) (just cleared out some inactive members, join now!) * _If the group is temporarily full and you cannot join, please go to the [Discussion](https://github.com/kiccer/Soldier76/discussions) section first and join later when the new group is established!_ * We warmly welcome those who are willing to fine-tune the ballistics of this project * We also welcome other project partners to join and exchange technical topics together * Group activities: * Posting promotional articles about [Soldier76](https://github.com/kiccer/Soldier76) macros in any well-known forums can get you a personal exclusive nickname, visit: [【Activity】Personal Exclusive Nickname Collection Area](https://github.com/kiccer/Soldier76/discussions/131) * Reporting second-hand merchants can get you an exclusive nickname "Clip Sister Dou", visit: [【Activity】Exclusive Nickname "Clip Sister Dou" Collection Area](https://github.com/kiccer/Soldier76/discussions/128) * Giving a star to [Soldier76](https://github.com/kiccer/Soldier76) project can get you an exclusive nickname "⭐", visit: [【Activity】Exclusive Nickname "⭐" Collection Area](https://github.com/kiccer/Soldier76/discussions/126) * _You can choose any one of the above if you meet multiple criteria._ ### Frequently Asked Questions * Q: No response? * A1: Please check if your wireless mouse or GHUB is working properly. * A2: Please check if you have enabled macros (it's usually enabled by default when typing in uppercase letters). * Q: It works on desktop but not in game? * A: Close the driver and restart it with administrator privileges. * Q: The comments in the code are all garbled? * A1: Your driver may be GHUB, which is currently not supported. * A2: You may have used the "import" function. The Lua file is copied and pasted directly into the editor and cannot be imported. * Q: After copying the code into the editor, it gives an error when saving? * A1: GHUB is not supported. * A2: Make sure you have obtained the code from the official website. * Q: The gun is pointing directly at the ground and cannot be lifted? * A: Adjust the ADS (if you have this question, you must not have read the tutorial above). * Q: What is the answer to the group joining question? * A: Sorry, there is no answer! This group joining question is to prevent people who haven't read the documentation from joining the group and asking some meaningless questions. As long as you have carefully read the documentation once, you can find the answer to the group joining question! (ps: it's very troublesome to answer repetitive questions every day. If I have time to answer, I might as well write the documentation more detailed.) * Q: How to distinguish between fully equipped and bare equipment? * A1: First of all, I want to say that I do not recommend distinguishing between configurations for fully equipped and bare equipment separately. If you do make a distinction, you will need to manually switch settings, which is more cumbersome. It is recommended to set the fully equipped coefficient. If you can't find the compensator in the game, use crouching posture shooting. The effect of reducing recoil while crouching is equal to that of the compensator. It is recommended to use the triangular grip, because it only controls horizontal recoil and does not affect vertical recoil. If you use other grips, you may experience overshooting. (depending on personal habits) * A2: If you must distinguish between fully equipped and bare equipment, you can randomly choose one of the scopeX2, scopeX3, scopeX4, and scopeX6 in the code as the coefficient for bare equipment. (Usually you don't need so many magnification coefficients, you can sacrifice one magnification coefficient that you don't use as the coefficient for bare equipment.) ### Feedback * If you have any questions or find any deficiencies while using the script, please feel free to leave feedback for me in [`Issues`](https://github.com/kiccer/Soldier76/issues). ### About macros Macros are like a resourceful blind person. They can help you perform more complex and delicate operations, but they cannot adapt to real-time situations, so inexperienced people will still be inexperienced in reality... ### About the fairness of the game I agree with [@liantian-cn](https://github.com/liantian-cn/logitech-pubg/tree/f816d1da3e2d5cf82708bf4225b4cf3f03c06332#q2-%E6%80%8E%E4%B9%88%E7%9C%8B%E5%BE%85%E9%BC%A0%E6%A0%87%E5%AE%8F)'s point of view. Is it unfair to win against an opponent with a $400 display using a $4,000 display? Is it unfair to win against an opponent with a $1,000 graphics card using a $10,000 graphics card? Then why do some people think it's cheating to win against an opponent with a $30 mouse using a mouse macro? The impact of good displays and graphics cards on game skill is much greater than that of a mouse macro, so why do people specifically think that mouse macros are unfair? Some people might argue that you can use a $30 mouse that has macro capabilities, but you have the right not to use them. Likewise, you can argue that a $4,000 display gives you 144Hz and 2K or even 4K resolution, but you also have the right not to use them and revert to 60Hz and 1080p resolution. The same applies to graphics cards. Due to some people's biases, I have to make these things clear. Mouse macros are not guilty, being bad at the game is the original sin. For those who believe that others using mouse macros have ruined their game experience, please try using them first and then answer. It's not as magical as you think. **Mouse macros are just like training wheels when you learn how to ride a bike**, once you learn how to ride, you only want to take them off, it's that simple. > Translated from [chatGPT](https://chat.openai.com/chat)