GithubHelp home page GithubHelp logo

Comments (2)

ffaen avatar ffaen commented on July 16, 2024 2

The last option can be used but with no keys, so in practice it becomes an array of objects:

announcements:
  - trigger: streak
    interval: 5
    message: '%player% is on a hunt!'
  - trigger: streak
    amount: 100
    message: '%player% killed 100 players in a row!'

Parses as:

{
  "announcements": [
    {
      "message": "%player% is on a hunt!", 
      "trigger": "streak", 
      "interval": 5
    }, 
    {
      "amount": 100, 
      "trigger": "streak", 
      "message": "%player% killed 100 players in a row!"
    }
  ]
}

Since we're now managing intervals, we'll probably have to loop over all options at runtime anyway to figure out which ones should trigger...

from pvpstats.

slipcor avatar slipcor commented on July 16, 2024

Updated requirements based on new features. After reflecting after forgetting we had this issue and this discussion... I am not sure I like the way of setting up these nodes to split up announcements and commands so early. I think there might be a reason to keep them closer together, maybe:

actions:
  - trigger: streak
    amount: 10
    command:
      # can be server or player ; maybe server: true / false
      scope: server
      lines:
      - give %player% diamond 1
      - permission give %player% hat.dominator
    message:
      # can be global or player; maybe global: true / false
      scope: global
      lines:
      - %players% is on a rampage!
      - There is a new dominator! Welcome %player%

Writing this up I came up with something a bit more flexible but of course more complicated 🥇

actions:
  - trigger: streak
    amount: 10
    commands: 
      server:
      - give %player% diamond 1
      - permission give %player% hat.dominator
      # run a command as the player
      player:
      - pvpstats show
    messages:
      global:
      - %players% is on a rampage!
      - There is a new dominator! Welcome %player%
      player:
      - You are now a wearing a bounty hat!

All above things apply like further configurable options like "interval or absolute" and "minimal or maximal" and I need to think about whether we always have all values in there as examples or if we can omit values to have less spam

Edit:
By grouping it like this we can allow setting of these map values and have only one value for each integer, right?

Command ideas:

/pvpstats action 10 add command player "me is the best"
/pvpstats action 10 set type interval
/pvpstats action 10 set minimum 50

from pvpstats.

Related Issues (20)

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.