VarScript 1.3

Scripting on Groovy

  1. DPOH-VAR
    [VarScript]
    grv.png
    Scripting in minecraft on Groovy.

    Features
    • execute scripts on Groovy by command
    • create script files
    • autorun files
    • tab-completion for groovy syntax (not full-featured)
    • script can register events and timers.
    • full access to Bukkit API (or Spigot API) and other plugins
    • load maven dependencies in runtime
    • download and update git projects
    Why Groovy?
    • It is very easy to learn. If you know Java, you are already able to use Groovy.
    • Fast compilation. Groovy can be used as scripting language in runtime.
    • Compiles to JVM-bytecode. This ensures a high performance.
    • Fully compatible with Bukkit API and Java libraries.
    • Extensible language: add a new methods to existing java classes, operator overloading, closures
    • Very short code (compared to java). You can quickly type code in the console or chat.
    • Import external libraries from maven in runtime with Grape.
    Get Started
    • Download VarScript.jar to plugins/ directory
    • start server
    • wait until VarScript download dependencies
      At first start it can take a long time! ~about 10 minutes,
      depending on your connection to the Internet.
    • use command
      /> println "Hello $world.name"
    Code examples using syntax extensions
    Code (Groovy):
    // teleport Player1 to Player2
    Player1 >> Player2
    Code (Groovy):
    // set your HP to 100
    me.maxhp = 100
    me.hp = 100
    Code (Groovy):
    // spawn little zombie near your location
    zombie = me.spawn(Zombie)
    zombie.baby = true
    Code (Groovy):
    // give one diamond for each online player
    players.each {
        it.give(Material.DIAMOND)
    }
    You can try these examples in chat/console with /> command, or create file .groovy in folder plugins/VarScript/scripts/ and call it by name.
    Command /> allows multiline text input.

    Script example


    Commands

    run groovy code:
    /> (groovy code)
    example: /> me.explode( 10 )

    run script file:
    /> (name) [arg1 [, arg2 [ ... , argN] ] ]
    example: /> noDamage Player1
    show your current workspace:
    /ws

    show all workspaces:
    /ws list

    change your workspace:
    /ws set (name)

    create new workspace:
    /ws create [name]

    remove workspace:
    /ws remove [name]

    stop workspace:
    /ws stop [name]

    reload workspace:
    /ws reload [name]

    delete workspace files:
    /ws delete-files [name]
    clone git project:
    /ws git clone (url) [workspace]

    next commands works in selected workspace. (/ws set name)

    show branches:
    /ws git branch [remote|all]

    show log:
    /ws git log [ref]

    ckeckout:
    /ws git checkout (ref) [force]

    pull:
    /ws git pull [remote] [branch]

    fetch:
    /ws git fetch [remote]

    delete git folder:
    /ws git delete [workspace]

    Variables

    • me - you, as Player
    • server - your bukkit server
    • %PlayerName% - get player by name
    • %PluginName% - get plugin by name
    • %WorldName% - get world by name
    • workspace - current workspace
    • global - global storage of variables and workspaces

    GitHub: https://github.com/DPOH-VAR/VarScript
    Wiki: https://github.com/DPOH-VAR/VarScript/wiki
    nikeTion and Psicosis611 like this.

Recent Reviews

  1. Polzavatel
    Polzavatel
    5/5,
    Version: 1.3
    This plugin is amazing and can be really helpfull for me it s but really hard to understand. Can you make a great tutorial?
  2. NoDeschPro
    NoDeschPro
    3/5,
    Version: 1.2
  3. PCinTheBox
    PCinTheBox
    5/5,
    Version: 1.2
    Awesome my friend!
  4. hsndmrts_
    hsndmrts_
    5/5,
    Version: 1.1.2
    good idea! like Skipt?
    1. DPOH-VAR
      Author's Response
      A bit like skript.
      But I think that Groovy has more features than skript