[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

    Nopants

    @repeat thanks for the idea and bugreport.
    @Shukaro thx, I will look into "onDeath" at some point and "onDamage" sounds good too.
    @austin1397 You can add as many lines as you want by using "/se.edit.add" while editing a script. A bug has been reported that prevents triggers from being saved to the harddrive. Maybe that issue has an effect on scripts aswell, resulting in your first problem.
     
  3. Offline

    repeat

    bugreport: conflict with Residence
    setting flag at residence -use -build (use and build disabled)
    when i block use door, crafting table and other (use Residence) i can use they (when SE loaded)
    but can't bulid (it work correctly)

    CB: #1000

    i think in this place of source (SEplayerListener.java)
    Code:
            //---[ onInteract ]-----------------------------------------------------------//
            // get the triggers matching to the entered Cuboid and the event onEnter
            Map<String, SEtrigger> triggerList = plugin.triggerManager.getRelevantTriggers(new SEentitySet(SEtrigger.triggerEvent.onInteract));
            // release the triggers
            plugin.triggerManager.releaseTriggerList(triggerList, new SEentitySet(event));
            event.setCancelled(cancel);
            cancel = false;
            //----------------------------------------------------------------------------//
    
     
  4. Offline

    Nopants

    Hm ... the second line of the comment is wrong ... besides that: The problem is that the code uncanceles every Interaction-Event. I will take care of that. Very cool of you to search for the problem yourself! Great bugreport!

    Check "How things work in ScriptedEvents" to understand what Packages are.
    I don't have testers checking the new releases, so there may be more bugs. I will fix every bug reported as soon as possible.

    Version 1.6.5
    • fixed cancel Interaction-Event bug
    • fixed bracket bug inside comments
    • fixed saving trigger bug
    • added Packages

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

    repeat

    2011-07-20 23:02:35 [WARNING] SE: "playerWorld": Player not found/online given in line: 6 (SubScript)

    how i can check online player? or get player list? this string annoying my log file :)

    can u make when some inside "if"-statement it not send warning
    or make it = "nil"/"null" string if it not have value.
    or when any command start with @ it not be send warning (silence mode like in PHP).

    For check some condition like this (or your example please which work now)

    if(not equals(PlayerWorld(Greener,"null"))
    then(messageTo(<triggeringPlayer>,"searchItem Greener is searchItem(Greener,310,1)"))
     
  6. Offline

    Nopants

    I planed to make some more options for debugging. You will be able to choose where the output will go (send to a specific user, to the server log, to a log file) and which scripts/conditions will get debugged at all. Something like "/se.debug <entity>" would come in handy too. I will add a condition "online(<player>)" and a negator ("not"|"!").
     
  7. Offline

    Nopants

    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
     
  8. Offline

    austin1397

    Im still failing lol. Probably because I dont truely understand the usages of entity. Well here is what I did just about, i'm righting it in this post off the top of my head so please pardon any small errors.

    Code:
    /se.s.c script1
    /se.s.e script1
    /se.e.a messageTo(Hello <triggeringPlayer>, this is a testing script to tell you, you just died!)
    /se.e.s
    
    /se.t.c trigger1
    /se.t.c trigger1
    /se.e.e onRespawn
    #Didnt think I need an entity for a respawn trigger, bet this is the problem
    /se.e.s script1
    /se.e.s
     
  9. Offline

    Nopants

    @austin1397

    I fixed two bugs. Both affected saving triggers and one specifically affected triggers with the "onRespawn"-event. Please redownload v.1.6.8.
     
  10. Offline

    austin1397

    Oh great! Because I have been trying to convince my friend to install the plugin but when I noticed it wasn't saving the triggers I was kinda worried. However since its fixed then all is good. Do you ever think you'll add an auto-update configuration to it?
     
  11. Offline

    Nopants

    What do you mean with auto-update configuration? Updating the .jar or updating the user-created content to newer versions of the plugin, if changes were made to the syntax? The latter would actually fit into the concept of the plugin but I assume its use wouldn't be that great while the effort to implement a functionality like this would be.
     
  12. Offline

    austin1397

    I was mainly speaking of the .jar but you'd probably also need to do some changes to the user-created content if you did any such updates that required it. However you could also maybe have a message that appears to people with permission to use it, that would say something such as "A new version of ScriptedEvents has been released!" to clearly notify them rather then them complaining about a bug. I think that a user-created content updated would be fantastic though so people don't have to worry about loss of work.

    Note: I'm just giving you ideas, not trying to annoy you lol
     
  13. Offline

    AgentKid

    Wow, amazing plugin! This will come in VERY handy for some of the events I host on my server :D One thing I noticed, though, is that onEnter(<Cuboid>) doesn't seem to get triggered by logging in inside that area. Is that a bug or a feature? If it's a bug, it'd help me alot if that could be fixed, and if it's just how it works, can you make an onLogin event?
     
  14. Offline

    austin1397

    Oh! By the way, could you please re-explain the Packages thing, I had no idea what you were talking about :/
     
  15. Offline

    Nopants

    @AgentKid I think it's not a bug :p. In theorie you do not "enter" a cuboid on login if you have moved there before logout. I will make an "onLogin" event and a condition "isInside(<player>,<cuboid>)" to take care of all other needs.
    @austin1397 I changed the documentation on Packages in the main post. Here you go:

    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.​

    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

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

    AgentKid

    Awesome, thanks for those new events. I do have one minor issue regarding teleports. I've yet to see an example of how the teleport(<player>,<location>)'s location should work. Should it be something like teleport(<triggeringPlayer>,0,0,0) or teleport(<triggeringPlayer>,0;0;0) or what?
     
  17. Offline

    Nopants

    The latter. Locations look like this "<x>;<y>;<z>" as described in the documentation of some other actions.
     
  18. Offline

    austin1397

    Is there a way to check ranks of Group Manager and/or Permissions? That would come in handy for making signs/commands usable only if the user meets the required rank. Though that would probably take quite a bit of work on your part.
     
  19. Offline

    Nopants

    @repeat
    @austin1397

    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>) #works with the Permissions plugin
    • added condition: hasPermission(<world>,<player>,<permission>) #works with the Permissions plugin
     
  20. Offline

    austin1397

    Nopants... How dare you amaze me so quickly! That just isn't acceptable! Lol :D
     
  21. Offline

    Nopants

    I recommend using v.1.3.5 for a few hours. That should calm you down :p
     
  22. Offline

    JustinGuy

    Does this till work? I can't get it to. Thanks :)
     
  23. Offline

    Nopants

    @JustinGuy nope this doesn't work anymore. I stoped enhancing this plugin and I would have to add a map-type to reinclude this feature. Interested?
     
  24. Offline

    JustinGuy

    No thanks man, just wondered, was looking for a quick script but I just coded a quick plugin instead.
     
  25. Offline

    ggaub1

    I am getting java.lang.NullPointerException when ever I try to use the teleport action
    at org.bukkit.craftbukkit.entity.CraftPlayer.teleport(CraftPlayer.java:244)
    at me.nopants.ScriptedEvents.SEinterpreter.teleport(SEinterpreter.java:1272)
    at me.nopants.ScriptedEvents.SEinterpreter.executeLine(SEinterpreter.java:561)
    at me.nopants.ScriptedEvents.SEinterpreter.executeScript(SEinterpreter.java:379)
    at me.nopants.ScriptedEvents.SEinterpreter.run(SEinterpreter.java:333)
    I had tried disabling all other plugins and switching back to old versions, all attempt resulted in failure
    could u please look into this problem?

    Here is the teleportation line in my script
    teleport(<triggeringPlayer>,-84.3;71;-1.7)

    This plugin is great with or with out this bug!
     
  26. Offline

    Nopants

    @ggaub1 Thanks for the bugreport. Fixed. Download 1.7.2 and use the new syntax "teleport(<player>,<world>,<location>)".
    Good to hear that there are still some people using this plugin. Over the time I made some scripts that I'm going to share soon. If anyone else wants to contribute something, you're very welcome.
     
  27. Offline

    ggaub1

    Thanks for the quick reply and quick fix!
    I also have some questions and suggestions
    1.How does ScriptedEvents determine the priority when dealing with multiple condition?
    This is a condition file for an "OnInteract" event
    Code:
    LogicalOperator: and
    isInside(<triggeringPlayer>,trap)
    equals(itemInHand(<triggeringPlayer>),278)
    equals(blockID(world,<clickedLocation>),49)
    The trigger works perfectly except when I click on air,I would get a console error
    Code:
    "blockID": Invalid Location given in line: 1
    blockID is clearly used on the last line in my condition file however it is the first thing ScriptedEvents checks.
    Just judging from the error message, ScriptedEvents doesn't determine the priority of conditions by line.
    If that is the case I would suggest changing it to do so as this change will enable higher efficiency and less error message.
    (exit whole checking routine when one condition don't meet(LogicalOperator: and))

    2. It would be nice to have a built in variable <clickedBlockID> because it simplifis coding when using "OnInteract" event

    3.Colored message support for messageTo() would be very useful since messageTo() is mostly used for sending notice/warnings color support.

    Thanks for taking your time reading all these and developing this powerful engine!
    I bow to you sir:)
     
  28. Offline

    Nopants

    @ggaub1
    1. The output in which line an error has occured in a condition file is incorrect. There is a bug caused by the first line, which contains the logical operator flag. Actually the priority of conditions is determined by their line. Unfortunately I do not cancel the process when the result is already certain.
    2. Included! Use <clickedLocationID>.
    3. I will do that soon. No time left today.
    Redownload 1.7.2 to get your hands onto the new change. Have fun!
     
  29. Offline

    ggaub1

    Thank you
    You are such a responsible dev!
    keep up the good work :)
     
  30. Offline

    Nopants

    Um ... I just realized color-code already works :p
    Use "messageTo(<some uncolored text>§<color-code><your colored text>)".
     
  31. Offline

    Buckethead

    No offense but it seems more difficult to code with switches then to actually do it
     

Share This Page