Advertisement
Guest User

Full Code

a guest
Jul 14th, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. options:
  2. token: ()
  3. sname: ()
  4.  
  5. on skript load:
  6. create vixio bot:
  7. login to "{@token}" with the name "FreeTrack Receiver"
  8.  
  9. on guild message received seen by "FreeTrack Receiver":
  10. if discord id of event-channel is "()":
  11. set {_msg} to event-message
  12. set {_msg} to "%{_msg}%"
  13. if {_msg} in lowercase contains "{@sname}":
  14. replace "[VIP]" in {_msg} with ""
  15. replace "[PRO]" in {_msg} with ""
  16. replace "[LEGEND]" in {_msg} with ""
  17. replace "[PATRON]" in {_msg} with ""
  18. replace "[YOUTUBE]" in {_msg} with ""
  19. replace "[HELPER]" in {_msg} with ""
  20. replace "[MOD]" in {_msg} with ""
  21. replace "[ADMIN]" in {_msg} with ""
  22. replace "[<3]" in {_msg} with ""
  23. replace "/join " in {_msg} with ""
  24. set {_split::} to {_msg} split at ":"
  25. replace " " in {_split::1} with ""
  26. set {_uuid} to "%{_split::1}%" parsed as offline player's uuid
  27. set {_servername::} to {_split::2} split at " "
  28. set {_servername::2} to {_servername::2} in lowercase
  29. if {_servername::2} is "{@sname}":
  30. set {adcount::%{_uuid}%} to {adcount::%{_uuid}%} + 1
  31. set {totalads::%{_uuid}%} to {totalads::%{_uuid}%} + 1
  32.  
  33. on join:
  34. if {adcount::%player's uuid%} is greater than 0:
  35. loop {adcount::%player's uuid%} times:
  36. set {adcount::%player's uuid%} to {adcount::%player's uuid%} - 1
  37. give player tripwire_hook 1 name:&dAd_Key lore:&bUse_this_key_to_open_&dAd_&bcrate! lure:4341 itemflags:HIDE_ENCHANTS"
  38. broadcast "&a%player% advertized the server and got rewards!" # change to whatever message you want
  39.  
  40. command /adtop:
  41. trigger:
  42. set {_sorted::} to sort((indices of {totalads::}), {totalads::})
  43. loop 5 times:
  44. set {_player} to {_sorted::%loop-value%} parsed as offline player
  45. set {_uuid} to {_sorted::%loop-value%} parsed as offline player's uuid
  46. set {_value} to {totalads::%{_uuid}%}
  47. send "&a%loop-value%&7. &9%{_player}%: &3%{_value}%" to player
  48.  
  49. command /adstats <offline player=%player%>:
  50. trigger:
  51. send "&aTotal ads: &3%{totalads::%arg-1's uuid%}%"
  52.  
  53. function sort(indices: strings, values: numbers, descending: boolean = true) :: strings:
  54. loop {_indices::}:
  55. set {_sort::%{_values::%loop-index%}%.%loop-index%} to loop-value
  56. return (reversed {_sort::}) if {_descending} is true, else {_sort::}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement