[INFO] rTriggers v2.4 - Messages/commands on login, death, commands and timers [1240]

Discussion in 'Plugin Releases' started by Reil, Jan 8, 2011.

     
  1. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    rTriggers
    MotD + Tips + Obituaries + Customization
    Trigger messages on login, disconnect, timers, commands, death and more. Personalize those messages with tag replacements.

    Thanks to: Nossr50 for linebreak code, Fluff for the 'fictional Player' code, and ioScream for line continuation code!
    1.0 Features:
    • Trigger messages or commands on login, disconnect, timers, or even player death and command uses.
    • Decide exactly who can set off a message, and who gets it. Name players individually or by group (via Permissions).
    • Line breaks on words, colour continuations (thanks to modified vMinecraft code!)
    • Personalized, fill-in-the-blanks style messages (insert the triggerer or recipient's name/IP/whatever here.)
    2.0 Messages format:
    Example properties file is in the section 4.0. rTriggers will make a properties file at plugins/rTriggers/rTriggers.properties, where plugins is in your server's folder.

    The properties file consists of a list of your messages. Each message is formatted like this:
    Code:
    triggerers=recipients:options:message
    The triggerers tell rTriggers who can set this message off, while the recipients are the ones who see the message when a triggerer sets it off. Options tell when and in what manner a triggerer can set off a message (like when logging in, dying, or using a certain command). The message is the actual thing that gets sent.

    One can specify multiple things in the triggerers, recipients, and options fields by using commas (no spaces). What each field does is described in a section below.

    If it has <<>> around it, you need to include those!
    bold: The name of the option/group/whatever
    italics: An optional part of the tag. You can leave this out (leave out any | in front of it, too).
    underlined: You replace this with something (like a number, or a group name). Necessary, unless it's italics.

    Triggerers tell rTriggers who can set this message off. Recipients tell who sees this message whenever a triggerer sets it off.
    Leaving the recipients field blank will default the recipient to just the triggerer.
    • groupname: Members in this group will trigger the message (or receive it, if they're in the recipients field).
    • <<everyone>>: Everyone!
    • <<player|&rTriggers>>: Makes the recipient a fake player called &rTriggers. Use with <<command-recipient>> and give &rtTriggers permissions, and you can give players access to specific versions of commands!
    • <<hasperm|permissionnode>>: People with the stated permission trigger/receive this message.
    • <<player|playername>>: Replace playername with the name of the player you want to be a triggerer (or a recipient).
    • <<command-triggerer>> and <<command-recipient>: Makes the player use the message as if it were a command.
    • <<command-console>>: Makes the server console use the message as if it were a command.
    • <<say-triggerer>> and <<say-triggerer>>: Makes the player say the message.
    • <<timer|interval>>: (Triggerer only) Will repeat this message (replace 'interval' with how often you want to repeat the message in seconds). Use with lists to make tips!
    • <<t|minutes>>: This message will repeat every hour at this minute (<<t|30>> happens at 1:30, 2:30, etc.)
    • <<server>>: (Recipient only)Message is sent to the server.
    • <<triggerer>>: (Recipient only) The person who triggered the message.
    • <<twitter>>: (Recipient only) Sends the message to Twitter (ServerEvents required!!!)
    • <<near-triggerer|dist>>: (Recipient only) Everyone inside a dist x dist square around the triggerer gets the message. Replace 'distance' with the active area of this.
    • not|groupname and not|<<player|playername>> and not|<<triggerer>> and not|<<hasperm|permission>>: (Recipient only, except for hasperm) Works like the versions without 'not|' in front of them, except it makes sure that the message WON'T get sent to that person/those persons.
    • <<craftirc|tagname>>: (Recipient only) Replace 'tagname' with the name of the tag you want CraftIRC to send the message to.

    Options tell rTriggers when the message should trigger, and how.
    Leaving this blank is the same as using the onlogin option.
    • onlogin|override - Triggers when a triggerer logs in. Override will replace the default message with a blank line.
    • ondisconnect|override - Triggers when a triggerer logs out. Override will replace the original disconnect message with a blank line.
    • oncommand|commandname|override|number - Triggers when a triggerer uses the specified command. Override doesn't let the command move to other plugins (removes the 'unknown command!' prompts). The number specifies the number of required arguments.
    • onload|pluginname - Whenever the plugin called pluginname is loaded by CraftBukkit. Use with <<customtrigger>> as the triggerer.
    • onkick - Triggers when a triggerer gets booted from the server.
    • ondeath|natural|deathcause - Triggers when a triggerer dies. If deathcause is specified, will only trigger on that manner of death. Possible death causes are: "contact", "entity_attack", "fall", "fire", "fire_tick", "lava", "drowning", "block_explosion", "entity_explosion", "suffocation", "custom", "lightning", and "something." If the natural option is used, then it will not trigger if the player died by playerkilling, or from a mob.
    • ondeath|playerkill - Triggers when a triggerer is killed by a fellow player.
    • delay|seconds - Makes the message wait a few seconds after being triggered before happening
    • limit|seconds|pertrigger - Keeps a message from triggering faster than specified. If pertrigger is specified, then this limit is done on a per-player basis, rather than being for everyone.

    This is what you want rTriggers to say or do. You can customize it with replacement tags, which rTriggers will find and replace with the appropriate information. Here's a list of replacement tags:
    • <<triggerer>> - The name of person who triggered the message (by logging in, getting kicked, etc).
    • <<recipient>> - The name of the person who the message is being sent to (may be the same as triggerer in many cases).
    • <<recipient-displayname>> and <<triggerer-displayname>> - The display name (as opposed to the raw name).
    • <<player-list>> - A list of all the players online.
    • <<color>> - Replaced with §. Follow up with a hexadecimal number to get a color! (0-9 or A-F)
    • <<triggerer-balance>> and <<recipient-balance>> - The player's iConomy balance.
    • <<death-cause>> -- (ondeath only!) The cause of death.
    • <<killer>> -- (ondeath only!) The killer (player name, creature name, etc.)
    • <<kick-reason>> -- (onkick only!) The reason given for kicking the player.
    • oncommand only!
      • <<param#>> -- Replace the # with parameter number, like <<param1>>, etc. It's replaced by what the player puts into the command.
      • <<param#+>> and <<param#->> -- is replaced by all the parameters up to and including that number/starting with and following that number.
      • <<params>> -- Is replaced by all the parameters put into the command
    • <<list|listname|rand>> -- Will be replaced by an item in the list called "listname." If rand is specified, it will give a random one from the list. If not, it will go down the list sequentially.
    • IP Address/Location related:
      • <<triggerer-ip>> and <<recipient-ip>> - The player's IP Address.
      • <<triggerer-locale>> and <<recipient-locale>> - The player's location.
      • <<triggerer-country>> and <<recipient-country>> - The player's country.
    • <<time>>, <<hour>>, and <<minute>>: These do what you probably think they do.


    3.0 List format:

    These go in the same file as the messages.
    Code:
    <<list|Bob>>=This text goes in the 'Bob' list.
    <<list|Bob>>=This is also in the 'Bob' list.
    <<list|haha>>=This is in a separate list called  'haha'
    
    You replace "listname" with whatever name you want. You can use replacement tags here, if you like.

    If you use either the replacement tag <<list|listname|rand>> or <<list|listname>> will be replaced by an item in the list called "listname." If 'rand' is specified, this item will be randomly selected from the list. If not, it will just pick the 'next' item on the list. Order is determined by the order you put it in the file.


    4.0 Example:
    Code:
    #################
    # MOTD Example:
    # Basic MotD for humans group
    humans=::§b Hey <<triggerer>>!@ Type /rules for a list of rules.
    
    #  News that shows when players log in.
    #  Also shows up when players type /news.
    # Use $ to continue on the next line, and @ to insert a linebreak.
    <<everyone>>=:onlogin,oncommand|/news|override:<<color>>b Here's our latest events:$
    @[URL='http://forums.bukkit.org/members/nothing.2505/']NothinG[/URL] at all, really!
    
    # Tells anyone in the 'humans' or 'gods' group who's online when they log in.
    humans,gods=::<<player-list>>
    
    #Displays rules when people use the /rules command
    <<everyone>>=<<triggerer>>:oncommand|/rules|override:1) Don't break things.$
    @2) Have fun.$
    @3) RESPECT MAH AUTHORATAH!
    
    # Announces the login and disconnect of anyone in the 'gods' group to the server
    gods=<<everyone>>:onlogin,ondisconnect:<<recipient>> pay heed, and hail <<triggerer>>, your god!
    
    ####################
    # Tips/Timer Example
    
    # This one does it sequentially
    <<timer|300>>=<<everyone>>::<<list|TipList>>
    # This version will pick a random tip
    <<timer|300>>=<<everyone>>::<<list|Burn|rand>>
    
    # Here are your tips
    <<list|TipList>>=This tip comes first.
    <<list|TipList>>=You see this tip 5 minutes (300 seconds) later.
    <<list|TipList>>=This one comes 5 minutes after the one above!
    
    # This timer makes the server use the backup command every 10 minutes!
    <<timer|600>>=<<command-console>>::backup
    
    ##############
    # Commands/Aliases example
    
    # Will announce whenever someone /tps to someone.
    <<everyone>>=<<everyone>>:oncommand|/tp:<<triggerer>> tp'd to <<param1>>!
    
    #    Map multiple commands to one!
    # /suitup <target>
    # Gives the target player a full suit of iron armor and then teleports you to the target.
    gods=<<command-triggerer>>:oncommand|/suitup:give <<param1>> ironchestplate 1$
    @give <<param1>> ironpants 1$
    @give <<param1>> ironboots 1$
    @give <<param1>> ironhelmet 1$
    @tp <<param1>>
    
    ##############
    #Death Related stuff
    
    # Will announce the weakness of a god when he or she dies.
    god=<<everyone>>:ondeath:Even a god like <<triggerer>> can die...
    
    # Will randomly select something in the list "Burn" whenever someone burns to death.
    <<everyone>>=<<everyone>>:ondeath|fire:<<list|Burn|rand>>
    <<list|Burn>>=Let it burn!  Just like <<triggerer>>.
    <<list|Burn>>=Would you like your <<triggerer>> medium or well done?
    
    5.0 Versions:
    2.1.1 (2011/05/19)
    • OH NO, A REMOVAL: ondeath|entity and ondeath|creaturename are gone; these are redundant to MonsterTriggers hooks, and MonsterTriggers does it better.
    • New replacement tag: ondeath|playerkill gets a <<weapon>>, which tells you what the murder weapon was.
    • New option: ondeath|natural and ondeath|natural|cause for when the death wasn't caused by a mob or a player (fire, drowning, falling, etc).
    • Lightning is now an option for death causes/ will now fill in correctly
    • (from Fluff of CommandSigns) Fake player code strengthened, no longer sends output of fake player to the player we've spoofed.
    • New trigger: <<t|minutes>>. The message will trigger at that point in the hour. <<t|30>> will happen at 1:30, 2:30, and so on.
    • New replacement tags: <<time>>, <<hour>>, and <<minute>>. These do what you probably think they do.
    • <<param#>> tags now modify recipients and options. Go crazy, like <<param1>> for a group, or <<player|param1>> for a specific player, or delay|<<param2>> to have a variable delay on your command!
    • oncommand option now has an optional setting for number of parameters. Example: oncommand|/say|override|4 or oncommand|/say|4 will only activate if the player uses exactly 4 parameters.
    • Lots and lots of code refactoring
    • <<triggerer-displayname>> and <<recipient-displayname>> tags for display name usage.

    2.0_2 (2011/05/15)
    • Support for Register 1.5
    • Better regexes for split functions means better performance, and whitespace all you want. (You can put spaces around your =, commas and colons now.
    • New recipient: <<player|&rTriggers>>. You can use this with <<command-recipients>> to have the fake player named "&rTriggers" use the command. Give &rTriggers permissions, and then you can alias commands for the player so they could do things they normally couldn't!
    • New options:
      • delay|seconds - Lets you have the message happen however many seconds after the actual trigger happens.
      • limit|seconds - Won't let this message trigger again until after this many seconds have passed
      • limit|seconds|pertriggerer - Won't let this message trigger for this triggerer again until a certain amount of time has passed. Other triggerers can still set it off, however.
      • onrespawn - Pretty self explanatory.
    1.9 (2011/05/13)
    • Support for iConomy has been replaced by support for Register!
    • New replacement tag: <<params>> <<param#+>> and <<param#->> allow for cooler use of oncommand!
    • New Recipients: not|<<triggerer>>, not|groupname, not|<<player|playername>> allow you to remove would-be recipients
    • New Triggerer: <<hasperm|permission>> lets you have people with a certain permission trigger a message!
    • Manly refactoring: replaces many uses of ArrayList with nicer use of HashSets; less overhead on unused options!

    v1.8 (2011/05/11)
    • <<near-triggerer|radius>> recipient added!
    • A whole ton of optimizations and refactorings.
    • Hey, why don't you check out MonsterTriggers?


    v1.7.1 (2011/05/09)
    • Bugfixes, code refactoring
    • Timers redone! No more weird options, just <<timer|interval>>
    • Added <<command-console>>
    v1.7 (2011/05/05)
    • Support for iConomy updated to iConomy 5.0
    • CraftIRC support, with new recipient psuedo-group: <<craftirc|irctaghere>>
    • Added new tags: <<say-triggerer>> and <<say-recipient>>. Now you can make everyone say 'lol' at the guy who just drowned, or make someone who just died call himself an idiot!
    • Made pseudo-groups like <<triggerer>> case-insensitive
    v1.6 (2011/04/27)
    • \@ works properly now.
    • You can now use & instead of § or <<color>>
    • Continue a message on the next line using $ at the very end of the line.
    • <<command-triggerer>> and <<command-recipient>> can execute multiple commands if they are seperated by @.
    • Playerlist no longer has a trailing comma!
    v1.5.2 (2011/04/25)
    • New option: onload|pluginname. Triggers after the chosen plugin gets loaded.
    • New option: onlogin|override. Suppresses the default login option.
    • New option: ondisconnect|override. Same as previous, but for disconnects.
    • Fix for IndexOutOfBounds error on smaller group names.
    • Some code refactoring/performance upgrades.
    v1.4 (2011/04/16)
    • Fix for NullPointerException on seemingly random deaths.
    • Fix small memory leak.
    • Smaller memory footprint in general (better use of HashTables)
    • General restructuring.
    v1.3_1 (2011/04/09)
    • Lists are actually properly done now!
    v1.2 (2011/03/29) - Update to match Bukkit 600. Added ondeath|entity, ondeath|playerkill, ondeath|creaturename, <<killer>>, and Lists!
    v1.1 - Refactoring (now only registers events that are used!). Better code reuse, fixes bug where @ and <<color>> were not being replaced in timers.
    v1.0 - Finally, Permissions (and indirectly, GroupUsers) support! Added parameter support to oncommand and onrtriggers!
    v0.6_7 - New event: onkick. New tags: <<color>> and <<kick-reason>>. Some code cleanup/improvement, catching up with iConomy API changes. Fixed doubling of <<oncommand|>> triggers.
    v0.5 - New recipients: <<command-triggerer>> and <<command-recipient>>
    v0.4.5 - Updated to use new onEntityDeath hook. Should fix at least a few of the things about ondeath.
    v0.4 - New recipient: Twitter. ServerEvents required for this.
    v0.3_2 - ondeath trigger! Kind of. Only works with certain means of death. A few rebuilds to match changes to Bukkit APIs.
    v0.2 - Reimplemented IP address. This time, it also does countries!
    v0.1 - Initial porting from rMotD (HMod)!

    This post has been edited 1 times. It was last edited by Reil Mar 2, 2012.
  2.  
  3. Offline

    Tahkeh

    Darn you Reil, stealing my thunder once again. D: How did you get iConomy support?
    MonkeyBoy4 likes this.
  4. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Well, the iConomy support should work so long as Niji's own support plugin didn't break in the bajillion updates since he release it.

    That is, it's probably broken. xD
  5. Offline

    Tahkeh

    oh em gee flas advertizign!!!1!!!11!

    I guess we're both waiting for iConomy API, then?
  6. Offline

    Nijikokun

    You can get iData / iProperty and use them as custom classes and still support it, but its a bit of a hassle :p
  7. Offline

    Tahkeh

    Oh, well in that case... :p
  8. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Wait, so then my plugin DOES have iConomy support. =p
  9. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Updated to use IP-addresses and give locations! For the triggerer, at least. Requires a second .jar.
  10. Offline

    Nate204

    If I joined a server, and I got a message saying this..... I would instantly leave.
    Might even deleted Minecraft from my PC, and go outside.

    Just a heads up, that you might have a limited audiance.... lol

    Cool plugin though.
  11. Offline

    TotempaaltJ

    I am guessing this is just an example and that you can customize this any way you'd want.
  12. Offline

    Tahkeh

    Cool story bro.

    I think it was just an example message... :rolleyes:
  13. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Heh, I actually used variations of the theme for when I tested it a few months ago. xP

    I've added the IP/location things to the recipient too (instead of just for the triggerer).

    EDIT: Also, cleaned up the first post a bit. :3
  14. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Hurp, forgot to put plugin.yml in there.
  15. Offline

    M3t

    I added this to the file:

    <<timer>>=<<everyone>>:tips,300,1:Random tip one! <<timer>>=<<everyone>>:tips,300,1:Random tip two!] <<timer>>=<<everyone>>:tips,300,1:Random tip three!
    and it gives me an error and now i can't start the server.
  16. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Are you putting them all on one line like that in your file? o_o
  17. Offline

    M3t

    no 3 lines
  18. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Works for me...

    PM me your error. Try redownloading the plugin in the meantime.
  19. Offline

    M3t

    dunno why but it works now gg
    --- merged: Jan 15, 2011 7:39 AM ---
    can you make a whitelist that doesnt suck ass?

    like please, make one that isnt case sensitive to players names, and one that i can edit and not have to restart the server to accommodate each name one by one
  20. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    This isn't a whitelist plugin. o_o Are you requesting a whitelist from me? *confused*
    --- merged: Jan 15, 2011 7:58 AM ---
    Also: Rebuilt for newest Bukkit (which kind of breaks all the plugins)...
  21. Offline

    M3t

    yeah I am
  22. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Rebuilt for rearranged Bukkit packages! W00t!
  23. Offline

    M3t

    is this good for #41?
  24. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Should be. :3
  25. Offline

    Kiruwagaka

    i'm kind of new to this and i was wondering... I need another plugin for groups before i can make this one work correct?
  26. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Ah, sorry for the confusion. No, you don't. It's just that the group-related stuff doesn't work yet, and won't until after Bukkit implements a group system of its own.
  27. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    Update:
    I've added support for an ondeath option. However, it only works with being set on fire at the moment, due to Bukkit's incomplete onEntityDamage hook.
  28. Offline

    iSushi

    I got a request, make it work for right click on signs, please. :)

    So if a sign says [rTrigger] or [Command] on the first line and "Bonus thingy" on the second line, it has a text file on the server that goes does that command, and I'd like to make it fully customizable.
    The third and fourth line would be more like comments, to for example inform the player what the sign does.


    So lets say you got a sign with the setup above, [Command] on the first line and "Bonus thingy" on the second line.

    -A player then right clicks.
    -The server enters the file with the commands, and it says something like:
    sign:Server:Bonus thingy:give <<recipient>> 20 10*say <<recipient>> Just got 10 pieces of glass;
    -And the server gives the player 10 pieces of glass.

    #Set up/explanation is like this when no code is added,
    Triggerers (sign):Who is the command going to? Server,Player or All?:Name of the sign (which is Bonus thingy):The commands

    NOTE! After the name of sign":" and "*". It should automatically add a "/" after the ":" and convert the "*" to ",/"
    The comma is there to seperate the commands. I think you already got that, but whatever, I just discovered this plugin.
    The ";" is there to end it all, and tell the server to execute the command(s).

    So if the commands in the properities is:
    sign:server:sign name:give <<recipient>> 20 10*say <<recipient>> Just got 10 pieces of glass;

    The output to the server will be (if the triggerers and recipient's name is iSushi):
    /give iSushi 20 10,/say iSushi just got 10 pieces of glass;

    Or however you want your setup to be set up.

    Result:
    This would remove the need for long lines of code on signs. As well as it hides the code from the player, which will decrease the confusion that the code might cause for people that don't know commands. And it can be a surprise ;)



    I am sorry if I mis-spelled or anything like that, as my native language isn't English.
    I also added a lot of details for how I/ME want it, and how I find it simple.
    I tried to explain in a proper manner, so I don't need to cause any unnecessary questions. Sorry about the lenght of the post.
    Feel free to add anything, or modify anything, this is just an idea/suggestion.


    I'd like some feedback on this, as I might ask Anotony to do something like that if you can't or wont do it for some reason.

    Question: Can you use other plugin commands?, do they have to be supported or not?.
  29. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    That's interesting. If I do implement this (I'll have to see what's possible w/ Bukkit at the moment), it would be slightly different in format than what you've proposed, though (so it can match the format I've been doing for other things). It'd be something like:

    Code:
    <groups that can right click this sign>=<<server-command>>:onsignclick|signname:commandsgohere.
    No promises yet, especially not today, since I'll be driving for a few hours to get to campus; my semester is starting tomorrow!
  30. Offline

    iSushi

    Thank you for taking it to consideration, And I'm happy with it as long as it has this feature. Edited in a question, Sorry, I didn't think I'd get a reply that fast ;)

    And sure, take your time. And have a good time at the campus, heh. :p
    I'll just be busy with everything else while (tons of homework, modify server, buy a VPS server etc. etc.)

    I'll be checking this plugin frequently to see if there's any more updates though.
  31. Offline

    Reil

    dev.bukkit.org profile:
    Reilaos
    My Plugins
    The plugin commands systems is kind of wonky at the moment. I'll be able to fake commands by a player, and fake console commands eventually.

    Update! Rebuilt against Bukkit 56. Now supports ondeath by getting shot by skeletons, and by creepers.

Share This Page