daily pastebin goal
72%
SHARE
TWEET

Untitled

a guest Aug 10th, 2015 1,294 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # javascript_placeholders.yml
  2. # You can create custom placeholders which utilize javascript to determine the result of the custom placeholder you create.
  3. # You can specify if the result is based on a boolean or the actual javascript.
  4. #
  5. # If you do not specify a type: the placeholder will default to a boolean type
  6. # A boolean type must contain a true_result: and false_result:
  7. #
  8. # A string type only requires the expression: entry
  9. #
  10. # Javascript placeholders can contain normal placeholders in the expression, true_result, or false_result
  11. # These placeholders will be parsed to the correct values before the expression is evaluated.
  12. #
  13. # Your javascript placeholders will be identified by: %javascript_<identifier>%
  14. #
  15. # Javascript placeholder format:
  16. #
  17. #     BOOLEAN TYPE
  18. # <identifier>:
  19. #   expression: <expression>
  20. #   type: 'boolean'
  21. #   true_result: <result if expression is true>
  22. #   false_result: <result if expression is false>
  23. #
  24. #     STRING TYPE
  25. # <identifier>:
  26. #   expression: <expression>
  27. #   type: 'string'
  28. #
  29. #
  30. #  ==== ADVANCED VARIABLES ====
  31. # DO NOT USE THESE VARIABLES UNLESS YOU KNOW WHAT YOU ARE DOING!
  32. #
  33. # You can access a few Bukkit API classes and methods using certain keywords:
  34. #
  35. # Using "BukkitServer" in your javascript will return Bukkit.getServer()
  36. # You can use any methods inside of the Server class:
  37. #
  38. # Example: BukkitServer.getBannedPlayers().size().toFixed()
  39. # Will return how many players are banned
  40. #
  41. # This variable is handy if you want to iterate through all online players.'
  42. #
  43. # Using "BukkitPlayer" in your javascript will return the Player object you are setting placeholders for.
  44. # You can use any methods inside of the Player class:
  45. #
  46. # Example: BukkitPlayer.hasPermission("some.permission")
  47. # Will return if the player has a specific permission
  48. # This variable is handy if you want to check a players permission node, or access other methods inside of
  49. # the player class for the specified player.
  50. #
  51. # More advanced variables are coming soon! Only use these variables if you know what you are doing!
  52. #
  53. #  ==================
  54. #
  55. #
  56. # Javascript placeholder examples:
  57. #
  58. # millionaire:
  59. #   expression: '%vaulteco_balance% >= 1000000'
  60. #   type: 'boolean'
  61. #   true_result: '&aMillionaire'
  62. #   false_result: '&cbroke'
  63. # is_staff:
  64. #   expression: '"%vault_group%" == "Moderator" || "%vault_group%" == "Admin" || "%vault_group%" == "Owner"'
  65. #   type: 'boolean'
  66. #   true_result: '&bStaff'
  67. #   false_result: '&ePlayer'
  68. # health_rounded:
  69. #   expression: 'Math.round(%player_health%)'
  70. #   type: 'string'
  71. # staff_online:
  72. #   expression: 'var i = 0; for (var p in BukkitServer.getOnlinePlayers()) { if (BukkitServer.getOnlinePlayers()[p].hasPermission("staff.online")) {i = i+1;};} i.toFixed();'
  73. #   type: 'string'
  74. #
  75. #
  76. # You can optionally specify a file that the javascript expression will be loaded from if your expression
  77. # is bigger than 1 line. To specify javascript be loaded from a file, follow this format:
  78. #
  79. # is_op:
  80. #   expression: 'file: is_op.js'
  81. #   type: 'string'
  82. #
  83. # The following placeholder will attempt to load javascript from the /plugins/DeluxeChat/javascripts/is_op.js file
  84. # if the folder/file exists. If the folder/file does not exist it will be created.
  85. # You must specify the file extension with the file name. Any file extension is accepted.
  86.  
  87. is_op:
  88.   expression: 'file: is_op.js'
  89.   type: string
  90. staff_online:
  91.   expression: var i = 0; for (var p in BukkitServer.getOnlinePlayers()) { if (BukkitServer.getOnlinePlayers()[p].hasPermission("staff.online")) {i = i+1;};} i.toFixed();
  92.   type: string
  93. banned:
  94.   expression: BukkitServer.getBannedPlayers().size().toFixed()
  95.   type: string
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top