Giter Club home page Giter Club logo

oxide-plugin-autocode's Introduction

AutoCode

Automatically sets the code on code locks when placed. Allow players to automatically try and unlock locked code locks with their code.

BSD 3 Clause license Commitizen friendly semantic-release

Permissions

  • autocode.use - Allows use of this plugin.
  • autocode.try - Allows auto-trying of user auto-code on locked code locks.
  • autocode.admin - Allows use of admin commands.

Chat Commands

Core Commands

You refers to the player running the command.

  • code 1234 - Sets your auto-code to 1234.
  • code random - Sets your auto-code to a random code.
  • code remove - Removes your set auto-code (and guest auto-code).

The core commands are also available in a guest code version. e.g.

  • code guest 5678 - Sets your guest code to 5678.

Other Commands

  • code quiet - Toggle quiet mode. In this mode less messages will be displayed and your auto-code will be hidden.
  • code help - Shows a detailed help message.

Console Commands

Requires autocode.admin to use.

  • autocode.resetlockout * - Removes all lock outs for all players.
  • autocode.resetlockout playerSteamId_or_playerDisplayName - Removes lock out for the specified player.

Configuration

Default configuration:

{
  "Commands": {
    "Use": "code"
  },
  "Options": {
    "Display Permission Errors": true,
    "Spam Prevention": {
      "Attempts": 5,
      "Enable": true,
      "Exponential Lock Out Time": true,
      "Lock Out Reset Factor": 5.0,
      "Lock Out Time": 5.0,
      "Window Time": 30.0
    }
  }
}

Explained

  • Commands - Change the commands this plugin uses.
    • Use - Used to set the player's code.
  • Options
    • Display Permission Errors - If set to false, players won't be notified if they don't have the right permissions to use this plugin.
    • Spam Prevention - Prevent players from changing their code too often to prevent abuse.
      • Enable - Whether spam protection is enabled or not.
      • Attempts - The number of code changes the player can make with in Window Time before being marked as spamming.
      • Window Time - The time frame (in seconds) to count the number of code changes the player has made.
      • Lock Out Time - How long (in seconds) a player will be locked out for. This number should be low if using exponential lock out times.
      • Exponential Lock Out Time - If true, each time the player is locked out, they will be locked out for double the amount of time they were previously locked out for.
      • Lock Out Reset Factor - Determines how long (as a multiples of lock out time) before the player is forgive for all previous lockout offenses (should be greater than 1 - has no effect if not using exponential lock out time).

API

string GetCode(BasePlayer player, bool guest = false);
void SetCode(BasePlayer player, string code, bool guest = false);
void RemoveCode(BasePlayer player, bool guest = false);
bool IsValidCode(string codeString);
string GenerateRandomCode();
void OpenCodeLockUI(BasePlayer player, bool guest = false);
void ResetAllLockOuts();
void ResetLockOut(BasePlayer player);

Development

Bug Report or Feature Request

Open an issue on GitHub.

Want to contribute

Fork and clone the GitHub repository. Send me a PR :)

oxide-plugin-autocode's People

Contributors

dependabot[bot] avatar rebeccastevens avatar renovate[bot] avatar semantic-release-bot avatar umod-org[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

oxide-plugin-autocode's Issues

Auto-Try doesn't work for guest codes.

If a player knows the guest code to a lock, they cannot open that locked entity using the auto try feature.

To figure out:

What code should be tried against code locks' guest code? The main code, the guest code, a new "try guest code" code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.