Sharpman76

PlayerStatus.sk

Oct 10th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. # If need be, remove the 'broadcasts' from the 'on click' and '/afk', and add the variable changing lines to the original building and coding commands.
  2. # ...also add 'message' color. Not sure what looks good, because I can't see the output.
  3. # Personal note: 68 lines of code
  4.  
  5. on join:
  6. set {status.%player%} to "Active"
  7.  
  8. on quit:
  9. set {status.%player%} to "Offline"
  10.  
  11. on click:
  12. {status.%player%} is "AFK":
  13. broadcast "%player% is no longer AFK."
  14. set {status.%player%} to "Active"
  15.  
  16. on chat:
  17. {status.%player%} is "AFK":
  18. broadcast "%player% is no longer AFK."
  19. set {status.%player%} to "Active"
  20.  
  21. command /afk
  22. description: State that you are Away From Keyboard.
  23. executable by: players
  24. trigger:
  25. {status.%player%} is not "AFK":
  26. broadcast "%player% is now AFK."
  27. set {status.%player%} to "AFK"
  28. else:
  29. broadcast "%player% is no longer AFK."
  30. set {status.%player%} to "Active"
  31.  
  32. command /startbuilding
  33. description: State that you are about to build.
  34. permission: status.build
  35. executable by: players
  36. trigger:
  37. {status.%player%} is not "Working":
  38. broadcast "%player% is now building and may not answer messages."
  39. set {status.%player%} to "Working"
  40. else:
  41. broadcast "%player% is no longer building and may now answer messages."
  42. set {status.%player%} to "Active"
  43.  
  44. command /startcoding
  45. description: State that you are about to code.
  46. permission: status.code
  47. executable by: players
  48. trigger:
  49. {status.%player%} is not "Working":
  50. broadcast "%player% is now coding and may not answer messages."
  51. set {status.%player%} to "Working"
  52. else:
  53. broadcast "%player% is no longer coding and may now answer messages."
  54. set {status.%player%} to "Active"
  55.  
  56. command /activeplayers:
  57. description: Check the status of all players online.
  58. trigger:
  59. loop players
  60. {status.%loop-player%} is "Active":
  61. add loop-player to {_activePlayers::*}
  62. {status.%loop-player%} is "AFK":
  63. add loop-player to {_afkPlayers::*}
  64. {status.%loop-player%} is "Working":
  65. add loop-player to {_workingPlayers::*}
  66. message "Player Statuses: %number of all players% Players Online"
  67. message "%size of {_activePlayers::*}% Active: %{_active players::*}%"
  68. message "%size of {_afkPlayers::*}% AFK: %{_afkPlayers::*}%"
  69. message "%size of {_workingPlayers::*}% Working: %{_workingPlayers::*}%"
  70.  
  71. command /checkstatus <player>:
  72. description: Check the status of a specific player.
  73. usage: /playerstatus <player>
  74. trigger:
  75. {status.%arg 1%} is set:
  76. message "%arg 1% is currently %{status.%arg 1%}%."
  77. else:
  78. message "That player has not played on this server before."
Advertisement
Add Comment
Please, Sign In to add comment