[MECH] ScriptedEvents v1.7.3 - Make your own plugin-like functionality [1185]

Discussion in 'Inactive/Unsupported Plugins' started by Nopants, Jun 13, 2011.

  1. Offline

    Nopants

    ScriptedEvents - make your own plugin-like functionality:
    Version: v.1.7.3

    With this Plugin you are able to script your own events. This is the backbone of programming. The basic idea behind this plugin is to make server-admins or even players able to create their own little programms that will enhance gameplay, without any knowledge of java.
    How many different things those programms could do depends on this plugin and other plugins a server is running that provide commands.

    Features:
    • Simple copy/paste-able packages to share selfmade functionality
    • Create/delete/edit Cuboids, Triggers, Scripts and Conditions ingame or via a text-editor
    • Create/delete/edit Variables (Integer, String or Set) ingame
    • Use Triggers to execute Scripts on events
    • Use server-commands, plugin-commands, custom actions, custom functions, userdefined and predefined variables
    • Use Conditions that have to be fulfilled if a Trigger should executed a script
    • Scripts and Conditions send errors if syntax or semantics are incorrect
    • Permissions-Support
    By adding more and more events, actions, functions, conditions and more complex variable-management, the possibilities will go through the roof. Many plugin-requests can be done using this plugin and it adds another tool to creativity in playing minecraft.




    Usage:
    Run the Plugin and it will create all necessary files. Read "How things work in ScriptedEvents", "Usable Stuff", "Commands" and some Examples to understand how to use the plugin.

    How things work in ScriptedEvents (open)
    Triggers:
    If a trigger is released, it will check if it's conditions are fulfilled. If they are it executes all lines in a script-file. Triggers are stored in 'trigger.yml' in the plugin-folder.
    A trigger contains an event, an entity (depending on the event), a conditions-file and a script-file.

    Scripts:
    Script-files contain a list of commands that can be executed by a trigger. Every server-command can be used. You must start commands with the typical '/'. There are some further "actions" and "functions" that can be used, like messageTo(). They are listed below. Script-files are stored in the sub-dir 'scripts' of the plugin-dir. If you want to create them with a text-editor and you want them to contain special characters, like 'ä', you have to save them in UTF-8, not the default ANSI.

    Conditions:
    Condition-files contain a list of conditions that have to be fulfilled before a script will be executed. An example contition-file can be downloaded. Condition-files are stored in the sub-dir 'conditions' of the plugin-dir. If you want to create them with a text-editor and you want them to contain special characters, like 'ä', you have to save them in UTF-8, not the default ANSI.

    Cuboids:
    The fist two implemented events were cuboid-related, onEnter and onLeave. Cuboids are created via the common selection of two vertexes. You select the first and the secon vertex via right- and left-clicking a block with the seletion-item, which is defined in the 'config.yml'. The default item is a feather. After selection you can save a cuboid to the 'cuboids.yml'.

    Packages:
    What is the use of Packages:
    Packages will be usefull if you want to add functionality that has been created in ScriptedEvents by other people, or you want to share the functionality you've made with ScriptedEvents with others. Packages combine Cuboids, Triggers, Conditions and Scripts. Packages can be copied and pasted as a whole without any further changes to your plugin folder. This increases portability of user-created content.​
    What are Packages:
    Packages are subdirectories of the "packages" directory, which gets created in the plugin directory. Each Package derives its name from its folders name. They can simply be paste into / created in the "packages" directory and will get loaded on enable or refresh of the plugin. Each Package directory (e.g 'ScriptedEvents/packages/myPack') will have the same file- and folder-structure as the plugin directory (trigger.dat, cuboid.dat, scripts folder, etc.). Entities in Packages can have the same names as entities used in other packages or the main directory.​
    Combining Packages with your own content:
    Inside a Package (e.g. in a script contained in a Package) you can only use other entities contained in the same Package. At the same time entities contained in a Package cannot be used from the main directorie or other Packages. For now all variables have to be set up in the main directorys and they cannot get stored in Packages.​

    Usable Stuff (open)

    Events:
    • onEnter(<cuboid-name>)
    • onLeave(<cuboid-name>)
    • onCommand(<command>)
    • onInteract #works with buttons, levers, everything!
    • onDeath
    • onRespawn
    • onBlockPlace
    • onBlockBreak
    • onJoin
    • onQuit
    • onKick
    World-related Actions:
    • removeItemInHand(<player-name>)
    • removeItem(<player>,<itemID>[,<amount>]) #amount is optional. '1' is default
    • removeItemAt(<player>,<slot>[,<amount>]) #amount is optional. '1' is default
    • giveItem(<player>,<itemID>[,<amount>]) #amount is optional. '1' is default
    • giveItemAt(<player>,<slot>,<itemID>[,<amount>]) #amount is optional. '1' is default
    • setHealth(<player-name>,<new value>)
    • messageTo(<player-name>,<message>) #sends a message to a player without the additional output of the /say command
    • broadcast(<message>) #sends a message to all online players on the server
    • changeBlockType(<world-name>,<block-location>,<new Type-ID>) #changes the type of a block
    • changeBlockData(<world>,<location>,<new Data>)
    • playerCommand(<player-name>,<command>) #let a player execute a server command
    • playEffect(<player>,<effect>) #check the bottom of this spoiler for a list of effects
    • cancelEvent #can be used to cancel an interact()-Event
    • teleport(<player>,<world>,<location>)
    • toggleLever(<world>,<location>)
    • toggleDoor(<world>,<location>) #works with wooden doors, iron doors and trapdoors
    • setTime(<world>,<time>) #time reaches from '0' to '24000'
    Script-related Actions:
    • if(<condition>) #"if" can only be used if it's followed by "then" in the next action. it will execute the action included in the "then"-statement, if the condition is fulfilled
    • then(<action>) #"then" can only be used if it's preceded by an "if"-statement
    • else(<action>) #"else" can only be used if it's preceded by a "then"-statement. it will execute the action if the condition included in the "if"-statement is not fulfilled
    • delay(<milliseconds>) #pauses the script
    • trigger(<trigger-name>) #releases a trigger
    • doForCuboidBlocks(<cuboid-name>,<action>)
    • doForSetItems(<set-name>,<action>)
    • script(<script-name>)
    • do #will execute all following actions that begin with "|" as if they were one single action. use to execute mutiple lines in then() and else()
    • loop(<cycles>) #NEEDS TO BE ADDED AS THE LAST LINE
    • while(<condition>) #NEEDS TO BE ADDED AS THE LAST LINE
    Functions:
    • health(player-name) #will be dissolved to the amount health of the Player
    • itemInHand(player-name) #will be dissolved to <ItemInHandID>
    • itemAtSlot(<player>,<slot>) #will be dissolved to the itemID of the item at <slot>
    • searchItem(<player>,<itemID>[,<amount>]) #will be dissolved to a slot holding the searched item. amount is optional. '1' is default
    • slotInHand(<player>) #will be dissolved to the slot wich is in hand
    • time(<world>)
    • size(<set-name>) #will be dissolved to the number of items in the given set
    • isInBed(<player>)
    • isSneaking(<player>)
    • playerLocation(<player>)
    • playerLocationX(<player>)
    • playerLocationY(<player>)
    • playerLocationZ(<player>)
    • playerWorld(<player>)
    • blockID(<world>,<location>)
    • blockData(<world>,<location>)
    • calc(<mathematic expression>) #will be dissolved to a simple integer
    • random(<min>,<max> | <range>)
    • arg(<argument-position>) #/mycommand nopants test => arg(0) = mycommand; arg(1) = nopants; arg(2) = test
    Conditions:
    • equals(<StringX>,<StringY>) #will check if <StringX> equals <StringY>. works for integer-variables too
    • bigger(<biggerInteger>,<smallerInteger>) #will check if <biggerInteger> is bigger then <smallerInteger>
    • and(<firstCondition>,<secondCondition>) #will check if first AND second condition are met
    • or(<firstCondition>,<secondCondition>) #will check if first OR second condition is met
    • check(<condition-name>) #will check if all conditions in the condition-file are met
    • hasItem(<player>,<itemID>,<requiredAmount>) #requiredAmount is optional. '1' is default
    • isSwitchedOn(<world>,<location>) #works with levers
    • isOpen(<world>,<location>) #works with wooden doors, iron doors and trapdoors
    • isEmpty(<set>)
    • isInside(<player>,<cuboid>)
    • inGroup(<world>,<player>,<group>) #works with the Permissions plugin
    • hasPermission(<world>,<player>,<permission>) #works with the Permissions plugin
    • online(<player>)
    Premade event-related variables:
    • <triggeringPlayer> #will be dissolved to the name of the player, who releases the trigger the script is executed by
    • <triggeringCuboid> #will be dissolved to the name of the cuboid the trigger is released by
    • <cuboidBlockLocation> #will be dissolved to <x>;<y>;<z> of a block. can only be used in doForCuboidBlocks()
    • <cuboidBlockLocationX>
    • <cuboidBlockLocationY>
    • <cuboidBlockLocationZ>
    • <clickedLocation> #will be dissolved to <x>;<y>;<z> of the clicked location. if no location got clicked (air), it will get dissolved to "none"
    • <clickedLocationX>
    • <clickedLocationY>
    • <clickedLocationZ>
    • <clickedLocationID> #will be dissolved to the ID of the Block at the clicked location. If no location got clicked (air), it will get dissolved to "none"
    • <rightClick> #will be dissolved to true if the interaction-event was triggered by a right-click
    • <setItem> #will be dissolved to an item of a set. can only be used in doForSetItems()
    • <deathCause> #will be dissolved to the deathcause in onDeath events. check the bottom of this spoiler for a list of causes
    • <placedBlockLocation> #<x>,<y>,<z>
    • <placedBlockLocationX>
    • <placedBlockLocationY>
    • <placedBlockLocationZ>
    • <placedBlockID>
    • <placedBlockData>
    • <brokenBlockLocation> #<x>,<y>,<z>
    • <brokenBlockLocationX>
    • <brokenBlockLocationY>
    • <brokenBlockLocationZ>
    • <brokenBlockID>
    • <brokenBlockData>
    Permission-Nodes (case-sensitive):
    • se.debug
    • se.help
    • se.refresh
    • se.edit
      • se.edit.add
      • se.edit.delete
      • se.edit.name
      • se.edit.event
      • se.edit.entity
      • se.edit.script
      • se.edit.condition
      • se.edit.close
      • se.edit.save
    • se.cuboid
      • se.cuboid.create
      • se.cuboid.delete
      • se.cuboid.edit
    • se.trigger
      • se.trigger.create
      • se.trigger.delete
      • se.trigger.edit
    • se.script
      • se.script.create
      • se.script.delete
      • se.script.edit
    • se.condition
      • se.condition.create
      • se.condition.delete
      • se.condition.edit
    • se.variable
      • se.variable.create
      • se.variable.delete
      • se.variable.edit
    • se.customCMD
      • se.customCMD.<yourCommand>
    Effects:
    • BOW_FIRE
    • CLICK1
    • CLICK2
    • DOOR_TOGGLE
    • EXTINGUISH
    • RECORD_PLAY
    • SMOKE
    • STEP_SOUND
    Death Causes:
    • BLOCK_EXPLOSION
    • CONTACT
    • CUSTOM
    • DROWNING
    • FALL
    • FIRE
    • FIRE_TICK
    • LAVA
    • LIGHTNING
    • SUFFOCATION
    • VOID
    • SKELETON
    • GHAST
    • PVP
    • SLIME
    • WOLF
    • PIGZOMBIE
    • ZOMBIE
    • CREEPER
    • SPIDER


    Commands (open)

    If feel like creating stuff ingame needs way to many commands. I will try to provide the possibility to use less commands.
    Code:
    /SE.help [page]                                  or /se.h
    /SE.debug                                        or /se.d
    /SE.refresh                                      or /se.r
    
    /SE.cuboid.create <cuboid-name>                  or /se.c.s
    /SE.cuboid.delete <cuboid-name>                  or /se.c.d
    /SE.cuboid.edit <cuboid-name>                    or /se.c.e
    
    /SE.trigger.create <trigger-name>                or /se.t.c
    /SE.trigger.delete <trigger-name>                or /se.t.d
    /SE.trigger.edit <trigger-name>                  or /se.t.e
    
    /SE.script.create <script-name>                  or /se.s.c
    /SE.script.delete <script-name>                  or /se.s.d
    /SE.script.edit <script-name>                    or /se.s.e
    
    /SE.variable.create int|string <name> <value>    or /se.v.c
    /SE.variable.create set <name>                   or /se.v.c
    /SE.variable.delete <name>                       or /se.v.d
    /SE.variable.edit int|string <name> <value>      or /se.v.e
    /SE.variable.edit set <name> add|remove <value>  or /se.v.e
    
    /SE.edit.name <new trigger-name/new cuboid-name> or /se.e.n
    /SE.edit.script <script-name>                    or /se.e.scr
    /SE.edit.condition <condition-name>              or /se.e.co
    /SE.edit.event <trigger-event>                   or /se.e.e
    /SE.edit.entity <cuboid-name/command>            or /se.e.ent
    /SE.edit.add <action>                            or /se.e.e
    /SE.edit.save                                    or /se.e.s
    /SE.edit.close                                   or /se.e.cl
    

    Examples (open)

    Make a command-alias:
    1. Make a script that contains the command you want to have an alias of.
    /se.s.c myAliasScript #create a blank script​
    /se.s.e <script-name> #get into Edit-More​
    /se.e.a /<your Command> #add your Command to the script​
    /se.e.s #save the script​
    2. Make an onCommand(yourCommand)-trigger and link your script to it.
    /se.t.c myAliasTrigger #create a blank trigger​
    /se.t.e <trigger-name> #get into Edit-Mode​
    /se.e.e onCommand #set the trigger to get release when a command is used​
    /se.e.ent myAlias #set the trigger-entity to the new command "myAlias"​
    /se.e.scr <script-name> #link the trigger to your script​
    /se.e.s #save the trigger​

    Make a "Who am I?"-Command:
    1. Make the script that sends the players name to the triggering player:
    /se.script create whoamiScript​
    /se.script.edit whoamiScript​
    /se.edit.add messageTo(<triggeringPlayer>,Your name is <triggeringPlayer>!)​
    /se.edit.save​
    2. Make a trigger for the new Command:
    /se.trigger.create whoamiTrigger​
    /se.trigger.edit whoamiTrigger​
    /se.edit.event onCommand​
    /se.edit.entity whoami​
    /se.edit.script whoamiScript​
    /se.edit.save​

    Make a button that tells you the ID of an item:
    1. Make an onInteract()-trigger checking the following condition.
    2. Make a condition that checks if the <clickedLocation> equals the location of your button.
    3. Link a script that sends you a message containing <itemInHand>.

    Define "important places":
    1. Make a script that sends a message to the triggering player containing the name of the triggering cuboid.
    2. Make a cuboid for every important place
    3. Make a trigger for every cuboid that executes the script you've created, or if you don't have any other cuboid than the important places, make one trigger without including a trigger-cuboid.

    Code:
    # create a new cuboid with the name 'myNewCuboid'
    /SE.cuboid.create myNewCuboid
    # get into Edit-Mode for the cuboid myNewCuboid
     /SE.cuboid.edit myNewCuboid
    
    # create a new blank trigger with the name 'myNewTrigger'
    /SE.trigger.create myNewTrigger
    
    # get into Edit-Mode for the trigger myNewTrigger
     /SE.trigger.edit myNewTrigger
    # sets the name of the edited trigger or cuboid to 'newName'
    /SE.edit.name newName
    # sets the event of the edited trigger to onCommand
    /SE.edit.event onCommand
    # sets the trigger-entity, in this case the trigger-Command, to myCMD
    /SE.edit.entity myCMD
    # saves alle the changes to file
    /SE.edit.save
    
    # create a new blank script with the name 'myNewScript'
    /SE.script.create myNewScript
    
    # get into Edit-Mode for the script myNewScript
    /SE.script.edit myNewScript
    # add a new action 'messageTo(<triggeringPlayer>,Hello there!)' to the script
    /SE.edit.add messageTo(<triggeringPlayer>,Hello there!)
    # saves alle the changes to file
    /SE.edit.save
    
    # create a variable with the name 'PlayerName' and the value 'nopants'
    /SE.variable.create string PlayerName nopants
    # change the value of the variable 'PlayerName' to 'Notch'
    /SE.variable.edit string PlayerName Notch
    
    # create a new blank condition-file with the name 'myNewConditions'
    /SE.condition.create myNewConditions
    
    # get into Edit-Mode for the condition-file myNewConditions
    /SE.condition.edit myNewConditions
    # add a new condition 'equals(<triggeringPlayer>,<PlayerName>)' to the condition-file
    /SE.edit.add equals(<triggeringPlayer>,<PlayerName>)
    # saves alle the changes to file
    /SE.edit.save
    


    READ BEFORE USING:
    Some self-made scripts can send your server into an infinite loop and block changing actions will obviously change your world, so test your own scripts before running them on a public server.

    Download
    ScriptedEvents (JAR): v.1.7.3 , v.1.7.2 , v.1.6.8 , v.1.6.5 , v.1.6.1 , v.1.6 , v.1.5.9 , v.1.5.3 , v.1.5 , v.1.3.5
    An example script: HERE.
    An example condition: HERE.

    Changelog:
    • Version 1.7.3
      • updated to 1.8.1
    • Version 1.7.2
      • added function: <playerLocationX>
      • added function: <playerLocationY>
      • added function: <playerLocationZ>
      • added variable: <clickedLocationX>
      • added variable: <clickedLocationY>
      • added variable: <clickedLocationZ>
      • added variable: <placedBlockLocationX>
      • added variable: <placedBlockLocationY>
      • added variable: <placedBlockLocationZ>
      • added variable: <brokenBlockLocationX>
      • added variable: <brokenBlockLocationY>
      • added variable: <brokenBlockLocationZ>
      • added variable: <cuboidBlockLocationX>
      • added variable: <cuboidBlockLocationY>
      • added variable: <cuboidBlockLocationZ>
      • changed action: teleport(<player>,<world>,<location>)
      • added variable: <clickedLocationID> #use in interact events
      • added action: broadcast(<message>) #sends a message to all online players on the server
      • changed config flag: ErrorDestination #can now be 'PLAYER<playerName>'.
    • Version 1.7.1
      • added config flag: ErrorDestination #can be 'LOG' or 'FILE'. Will create itself. 'LOG' is default.
      • added condition: inGroup(<world>,<player>,<group>)
      • added condition: hasPermission(<world>,<player>,<permission>)
    • Version 1.7
      • added condition: isInside(<player>,<cuboid>)
      • added Premade Variable: <deathCause> #usable in onDeath-events
      • added event: onDeath
      • added event: onJoin
      • added event: onQuit
      • added event: onKick
    Further Changelog (open)


    • Version 1.6.8
      • added action: toggleLever(<world>,<location>)
      • added condition: isSwitchedOn(<world>,<location>) #works with levers
      • added action: toggleDoor(<world>,<location>) #works with wooden doors, iron doors and trapdoors
      • added condition: isOpen(<world>,<location>) #works with wooden doors, iron doors and trapdoors
      • added condition: isEmpty(<set>)
      • added condition: online(<player>)
      • added action: setTime(<world>,<time>) #time reaches from '0' to '24000'
      • fixed bug in "slotInHand()" returning null if no item is in hand
    • Version 1.6.5
      • fixed cancel Interaction-Event bug
      • fixed bracket bug inside comments
      • fixed saving trigger bug
      • added Packages
    • Version 1.6.1
      • added action: teleport(<player>,<location>)
      • added function: playerWorld(<player>)
      • fixed a couple of bugs
    • Version 1.6
      • added the possibility to mask strings with " #messageTo(<player>,"This is a masked string, that may contain a comma!")
      • added event: onRespawn
      • added event: onBlockPlace
      • added variable: <placedBlockLocation>
      • added variable: <placedBlockID>
      • added variable: <placedBlockData>
      • added event: onBlockBreak
      • added variable: <brokenBlockLocation>
      • added variable: <brokenBlockID>
      • added variable: <brokenBlockData>
    • Version 1.5.9
      • added Interpreter
      • added comments #begin with '#'
      • empty lines are okay from now on
      • changed the way server commands have to appear in scripts. they MUST begin with the typical '/' now
      • added action: removeItemAt(<player>,<slot>[,<amount>]) #amount is optional. '1' is default
      • added action: giveItem(<player>,<itemID>[,<amount>]) #amount is optional. '1' is default
      • added action: giveItemAt(<player>,<slot>[,<amount>]) #amount is optional. '1' is default
      • changed action: messageTo(<player-name>,<message>) #sends a message to a player without the
      • changed action: playerCommand(<player-name>,<command>) #let a player execute a server command
      • changed action: doForCuboidBlocks(<cuboid-name>,<action>)
      • changed action: doForSetItems(<set-name>,<action>)
      • added function: itemAtSlot(<player>,<slot>) #will be dissolved to the itemID of the item at <slot>
      • added function: searchItem(<player>,<itemID>[,<amount>]) #will be dissolved to a slot holding the searched item. amount is optional. '1' is default
      • added function: slotInHand(<player>) #will be dissolved to the slot wich is in hand
      • added function: isSneaking
      • added function: calc(<mathematic expression>) #will be dissolved to a simple integer
      • added function: size(<set-name>) #will be dissolved to the number of items in the given set
      • changed function: arg(<argument-position>) #/mycommand nopants test => arg(0) = mycommand; arg(1) = nopants; arg(2) = test
      • changed variable: <item> to <setItem>
      • changed variable: <blockLocation> to <cuboidBlockLocation>
    • Version 1.5.3
      • added set-variable-type #all set-names are strings and so are all set-items
      • changed Command: /se.v.e string <string-name> <new value> #changed from /se.v.e <string-name> <new value>
      • changed Command: /se.v.e int <int-name> <new value> #changed from /se.v.e <int-name> <new value>
      • added Command: /se.v.e set <set-name> onlinePlayers #will clear the set and add all online players names to it
      • added Command: /se.v.e set <set-name> add <item-string> #will add the item to the passed set
      • added Command: /se.v.e set <set-name> remove <item-string> #will remove the item from the passed set
      • added Command: /se.v.c set <set-name> #will create a blank set-variable
      • added Action: doForItems(<set-name>) <action> #the action will be executed for every item in the passed set. the respective item can be used with <item>
      • added Predefined Variable: <item> #use in doForItems(<set-name>)
      • added Condition: contains(<set>,<item>) #checks if a set contains the passed item
      • added getFunction: getSize(<set>) #gets resolved to the size of the passed set
    • Version 1.5
      • added Action: changeBlockData(<world>,<Location>,<new Data>)
      • added Action: playerCommand(<player-name>) <command>
      • added Action: executeScript(<script-name>)
      • added Variable: time(<world>)
      • added Variable: isInBed(<player>)
      • added Variable: playerLocation(<player>)
      • added Variable: blockID(<world>,<location>)
      • added Variable: blockData(<world>,<location>)
      • added Support: Permissions
      • whitespaces at the begining or the end of actions will be ignored
    • Version 1.4
      • changed the read- and write-method so files don't need ids and line-numbers
      • playEffect(<player>,<effect>)
      • do #will execute every following action that begins with "| " as one action. use to execute mutiple lines in then() and else()
      • changed the variables <health> and <itemInHand> to the functions "heath(<player-name>)" and "itemInHand(<player-name>)"
    • Version 1.3.5
      • added Action: cancelEvent() #can be used to cancel an interact()-Event
      • added Condition: hasItem(<player>,<itemID>,<requiredAmount>) #requiredAmount is optional. '1' is default
      • added Action: removeItem(<player>,<itemID>,<amountToRemove>) #amountToRemove is optional. '1' is default
      • added Action: loop(<cycles>) #NEEDS TO BE ADDED AS THE LAST LINE
      • added Action: while(<condition>) #NEEDS TO BE ADDED AS THE LAST LINE
      • added Action: setRandomRange(<range>) OR setRandomRange(<min>,<max>) #it will set the range for <randomInt>
      • added Variable: <randomInt> #will be dissolved to a random integer
    • Version 1.3
      • added Variable: <health>
      • added Action: setHealth(<player>, <new value>)
      • added Variable: <arg<i>> #arguments of custom commands get resolved. use <arg1> for the first and so on
      • added Action: doForCuboidBlocks(<cuboid-ID>) <action> #use with changeBlockType() and <blockLocation>
      • added Variable: <blockLocation>
    • Version 1.2
      • added command: /SE.edit.condition
      • added command: /SE.refresh
      • made the plugin catch some exceptions caused by wrong usage
    • Version 1.1
      • added multiworld-support
      • changed the event "InteractAt()" to "Interact()"
      • added variable to Interact-Event: <clickedLocation> #contains <x>;<y>;<z>
      • added variable to Interact-Event: <rightClick> #contains <true|false>
      • changed the variable <triggerItem> to <itemInHand> #contains <itemID>
      • added custom function removeItemInHand(<player-name>)
      • added custom function changeBlockType(<world-name>,<block-location>,<new Type-ID>)
      • made it impossible to create two variables (int and string) with the same name
      • added teleportation and portal-usage to the check if a player is inside a cuboid
      • got rid of the "counts" in all files
      • added the possibility to use if-then-else in scripts
    • Version 1.0
      • create/delete/edit conditions ingame
      • create/delete/edit string and integer variables ingame
      • resolve variables in scripts and in Edit-Mode
      • resolve calculations inserted as a value for an integer-variable
    • Version 0.4.9
      • conditions get loaded into the plugin
      • before a trigger executes a script it will check if it's conditions are fulfilled
      • added condition equals()
      • added condition bigger()
      • added condition and()
      • added condition or()
    • Version 0.4.5
      • scripts get loaded into the plugin
      • scripts can be created
      • actions can be added to scripts via Edit-Mode
    • Version 0.4
      • added Edit-Mode
      • reworked parts of the code
    • Version 0.3.5
      • Exceptions caused by incomplete .yml or missing .script files fixed
      • added custom function delay()
      • added custom function trigger()
      • added custom function <triggeringCuboid>
      • added custom function <triggeringItem>
      • added the ability to release more than one trigger on an event
      • added the event onInteractAt()
      • added the event onCommand()
      • added the ability to include no cuboid in onEnter() and onLeave() to get triggered by all cuboids
    • Version 0.3
      • Release as a work in progress
     
    iPeace, p3king, JustinGuy and 2 others like this.
  2. Offline

    Guniv

    extremely annoying to do it ingame. i didn't know the edit command at the time i wrote the post so i just guessed. It said not to use slash for commands but now I get what it is. Thanks for the help man.
     
  3. Offline

    Nopants

    Oh, sorry. I forgot to change that in the example. I'm making so many major and minor changes to this plugin, updating the main post gets pretty stressful.
     
  4. Offline

    Guniv

    no problem man. just did /se.e.a /manuadd <triggeringPlayer> Red and it still dosen't seem to be working. lemme see what server.log says...

    everything seems to be working, now its just fault of groupmanager. Thanks man.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  5. Offline

    Nopants

    Happy to hear that! If you need any more help, info or additional functionality feel free to post.
     
  6. Offline

    Guniv

    sadly i don't think it'll work because of groupmanager's per-world functionality. it wants me to use /manselect (worldname), and if i add it to the script it breaks
     
  7. Offline

    Nopants

    No problem. I will add a "world(<player>)" function. It will however take some time, as i'm currently developing a much bigger feature which has to get finished first. I guess it will take a few hours.
     
  8. Offline

    Guniv

    you are awesome
     
  9. Offline

    Nopants

    @Guniv your requested function has been added. There is only one problem:

    v.1.6.1 may be kind of unstable, as i'm still developing the next big feature. Anyway you have to include a new flag into all your triggers and cuboids.

    Code:
    A line in cuboid.dat:
    world:world,name:Gate1,owner:Nopants,vertex1:348;75;399,vertex2:348;75;403
    A line in trigger.dat:
    name:SilenceCmd,owner:Nopants,event:onCommand(Silence),condition:none,script:Silence
    Version 1.6.1
    • added action: teleport(<player>,<location>) #a location looks like this: <x>;<y>;<z>
    • added function: playerWorld(<player>)
    • fixed a couple of bugs
     
  10. Offline

    Guniv

    sooo, for the event could i put playerWorld(<player>), or how would i add it proper
     
  11. Offline

    Nopants

    Okay. Here is a full tutorial. It should work if you enter the right command for groupmanager:

    This is the script-file that will execute the action you want to use:
    /se.script.create yourScript
    /se.script.edit yourScript
    /se.edit.add /menuadd playerWorld(<triggeringPlayer>) <triggeringPlayer>
    #I don't know how this command should look like.
    #I assumed the syntax is "/menuadd <world> <player>",
    #but I hope you get the point
    /se.edit.save

    This is the condition-file that will check if the right spot has been clicked:
    /se.condition.create yourCondition
    /se.condition.edit yourCondition
    /se.edit.add equals(<the Location of your button>,<clickedLocation>)
    #inser your Location like this: <x>;<y>;<z>
    /se.edit.save

    This is the trigger that will check yourCondition and execute yourScript:
    /se.trigger.create yourTrigger
    /se.trigger.edit yourTrigger
    /se.edit.event onInteract
    /se.edit.condition yourCondition
    /se.edit.script yourScript
    /se.edit.save

    Again: Creating stuff ingame is still a pain, but until now the ingame creation hasen't been that important. Maybe I will change that in the near future.
     
  12. Offline

    Guniv

    the usage of manuadd is /manuadd (player) (group), fyi. but that still looks right to me. I know the right spot is being clicked because when i press it is when it starts erroring in server.log. It's just a pain that I can upload everything BUT a script.

    se.s.id is broken.

    ooh i see you changed it, cool

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  13. Offline

    Nopants

    Maybe you cannot upload scripts because of their file-format ".script"? Couldn't you try to upload them as .txt and rename then?
     
  14. Offline

    Guniv

    No, the FTP is just not giving me access to that folder. Already sent a ticket in to Brohoster about it.

    okay so here is what I have
    trigger.dat
    Code:
    name:redtrig,owner:Guniv,event:onInteract,condition:redbut,script:redscr
    
    redbut.condition
    Code:
    equals(<clickedLocation>,-97;45;354) #x,y,z have to be the coordinates of the button you want to use
    and I imagine redscr.script looks something like this
    Code:
    /manuadd playerWorld(<triggeringPlayer>) <triggeringPlayer> Red
    because thats what I put, and none of this is working. no errors in server.log or anything.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  15. Offline

    Nopants

    "redbut.condition" should contain "LogicalOperator: and" as the first line.

    If
    using "/manuadd playerWorld(<triggeringPlayer>) <triggeringPlayer> Red" makes no sense, as "playerWorld(<triggeringPlayer>)" returns the world <triggeringPlayer> is in.

    Anyway, maybe we should finish this topic in our private conversation.
     
  16. Offline

    Guniv

    alright.
     
  17. Offline

    repeat

    Can I manipulate (place/remove into chest some item, open/close door) chest, door, trap_door and so on?
    Some block have additional data. I can place door to four ways, tree have few type. Can i can change this using
    blockchangeBlockData(<world>,<location>,<new Data>)?

    To place block me need use changeBlockType(<world-name>,<block-location>,<new Type-ID>)?

    p.s. how i can know where to look player? (at debug info when press F3 this is f:number. number = 0...3)
     
  18. Offline

    undeadmach1ne

    this sounds like its going to be off the chart awesome. cant wait to try it out. thanks =)
     
  19. Offline

    Nopants

    @repeat I haven't yet looked into manipulating blocks in detail. Chest managment isn't yet implemented and I don't know if the status of a door/trapdoor (open/close) is stored in it's data, or if the material is stored in there and the status has another field. I will however add specific actions to access and change those values, as far it is possible, in the near future.
    • "changeBlockData(<world>,<location>,<new Data>)" will change a blocks data field. That could change a logs type from birch to pine, or a slaps type from stone to plank.
    • Yes, "changeBlockType(<word>,<location>,<new typeID>)" is used to place blocks, as it can change an air block into a block of your choice.
    • You can get a players location by using the function "playerLocation(<player>)". For now you can not use the accurate line of sight or the first block a player is looking at, as I haven't looked into vector based calculations.
    @undeadmach1ne thanks man, and welcome. If you need any help, feel free to ask.
     
  20. Offline

    mavbear

    Excellent idea! Here are some thoughts for new functions:

    setWorldFlag(world, flag, value) - set a defined flag (variable) for the world
    getWorldFlag(world, flag) - get the value of a predefined flag

    setWorldPlayerFlag(world, player, flag, value) - set a defined flag for a player for a specific world
    getWorldPlayerFlag(world, player, flag) - get the value of a predefined flag

    setPlayerFlag(player, flag, value) - set a defined flag for a player (global)
    getPlayerFlag(player, flag) - get the value of a predefined flag

    toString(variable) - get the string version of a variable
    toInteger(variable) - get the integer version of a variable
     
  21. Offline

    Nopants

    Per player and per world variables are an interesting concept and will definitely get into the plugin. For now I use /se.variable.create <type> <triggeringPlayer>-myVar to set a per player variable and use/edit it like this: <<triggeringPlayer>-myVar>.
     
  22. I feel dumb but I can't figure out how to use playerCommand. I'm trying like this

    playerCommand(<triggeringPlayer>, /kill )

    and it keeps saying "unkown console command" when the player activates the trigger instead of /killing him.
     
  23. Offline

    Nopants

    @heylookoverthere
    No need to feel dumb at all! Simply don't use whitespaces inbetween action-input.
    "playerCommand(<triggeringPlayer>,/kill )" should work.

    Plus: I don't really know if there has to be a '/'. I currently have no server running to check that, but you can try both.
     
  24. I just tried
    playerCommand(<triggeringPlayer>,kill )
    playerCommand(<triggeringPlayer>,/kill )
    playerCommand(<triggeringPlayer>,/kill)
    playerCommand(<triggeringPlayer>,kill)

    and none seemed to work. Also my triggers don't seem to be saving. if I do a /se.r or server reload, all my triggers (1 at the moment) are gone.

    thanks for your help.
     
  25. Offline

    Nopants

    Everything should get stored on the harddrive in the moment you create it. Maybe the trigger.dat cannot be written? That should get displayed in the log.
    I just tested "playerCommand(<triggeringPlayer>,heal)" on my server and it workes perfectly fine. So if you want the command to be "/kill" you need to enter "kill". Are you sure "/kill" is a valid command on your server? Which plugin provides this command? Maybe the problem is caused by the nature of this plugins kill-command.
     
  26. ok I tried it with heal and home and they both worked. for some reason it does not like /kill. My triggers still aren't saving however. otherwise I love the plugin.
     
  27. Offline

    Nopants

    I will check the saving bug asap.

    I suppose the command you want to use is not built up as a "normal" command. Commands in bukkit plugins have to get registered. If you enter something into the chat starting with a slash the server will check if the command is mathing any of the registered ones. If it doesn't it's an unknown command. However as a plugin developer you can hook into chat- or so called "commandpreprocess"- events and interpret the inserted message by yourself. If the message contains your command, you let your plugin execute something.

    Now this is where the problem with "playerCommand()" occures: This action uses a method bukkit provides called "server.dispatchCommand(Player, Command)". So the commands you can execute with "playerCommand()" bypass the chat-event (maybe even the commandpreprocess-event) and get directly dispatched by the server.

    I THINK this is the problem and I might add a "playerChat()" to adress it, if bukkit provides an adequate method.

    On a sidenote: I have to pass some exams, so development on this plugin will slow down for some days. All features that where mentioned to be on the to-do-list will get implemented. It's just a matter of time.
     
  28. Thanks again for the timely response, good luck with your exams.
     
  29. Offline

    repeat

    req: onDeath
    return: <player>, <location>, <causes>

    script must be run before die (for example remove items and no drop are on grass and then restore their)

    causes:
    • CONTACT - when died from a cactus
    • FALL - when died due to fall damage
    • FIRE - when died of fire
    • FIRE_TICK - when died because player was burning
    • LAVA - when died in lava
    • DROWNING/WATER - when died because player drowned in water
    • SUFFOCATION - when died because player was stuck in a block
    • EXPLOSION/ENTITY_EXPLOSION - when an explosion killed the player
    • VOID - when player died in the void
    • CREEPER - when player was killed by a creeper explosion
    • PVP/PLAYER - when player was killed by another player (pvp)
    • MOB/ENTITY - when player was killed by a mob
    • UNKNOWN - when player was killed without a reason - this is usually useless
    bugreport:
    in comments can't use brackets

    trigger:
    #не получится строить, блоки не будут ставиться ))

    console:
    [WARNING] SE: Opening bracket expected in line: 17 (test.script)
     
  30. Offline

    Shukaro

    Awesome work so far, I'm really looking forward to using this. It would be cool if you could add onDeath, onDamage, and onTarget events at some point. For example, onDamage would return the amount and source of a damage, and onTarget could return the target of a monster and possibly the targeting monster.
     
  31. Offline

    austin1397

    Well I've been playing with this plugin for the past few days, and I have come across two things that I need help with. The first is, how do I add a second line to a script using a command (not going into plugin folder and manually changing it)? And the second is that I was trying to add a trigger that would say "Your name is NAME" using the same script at the example but it didn't work.
     

Share This Page