Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- token: ()
- sname: ()
- on skript load:
- create vixio bot:
- login to "{@token}" with the name "FreeTrack Receiver"
- on guild message received seen by "FreeTrack Receiver":
- if discord id of event-channel is "()":
- set {_msg} to event-message
- set {_msg} to "%{_msg}%"
- if {_msg} in lowercase contains "{@sname}":
- replace "[VIP]" in {_msg} with ""
- replace "[PRO]" in {_msg} with ""
- replace "[LEGEND]" in {_msg} with ""
- replace "[PATRON]" in {_msg} with ""
- replace "[YOUTUBE]" in {_msg} with ""
- replace "[HELPER]" in {_msg} with ""
- replace "[MOD]" in {_msg} with ""
- replace "[ADMIN]" in {_msg} with ""
- replace "[<3]" in {_msg} with ""
- replace "/join " in {_msg} with ""
- set {_split::} to {_msg} split at ":"
- replace " " in {_split::1} with ""
- set {_uuid} to "%{_split::1}%" parsed as offline player's uuid
- set {_servername::} to {_split::2} split at " "
- set {_servername::2} to {_servername::2} in lowercase
- if {_servername::2} is "{@sname}":
- set {adcount::%{_uuid}%} to {adcount::%{_uuid}%} + 1
- set {totalads::%{_uuid}%} to {totalads::%{_uuid}%} + 1
- on join:
- if {adcount::%player's uuid%} is greater than 0:
- loop {adcount::%player's uuid%} times:
- set {adcount::%player's uuid%} to {adcount::%player's uuid%} - 1
- give player tripwire_hook 1 name:&dAd_Key lore:&bUse_this_key_to_open_&dAd_&bcrate! lure:4341 itemflags:HIDE_ENCHANTS"
- broadcast "&a%player% advertized the server and got rewards!" # change to whatever message you want
- command /adtop:
- trigger:
- set {_sorted::} to sort((indices of {totalads::}), {totalads::})
- loop 5 times:
- set {_player} to {_sorted::%loop-value%} parsed as offline player
- set {_uuid} to {_sorted::%loop-value%} parsed as offline player's uuid
- set {_value} to {totalads::%{_uuid}%}
- send "&a%loop-value%&7. &9%{_player}%: &3%{_value}%" to player
- command /adstats <offline player=%player%>:
- trigger:
- send "&aTotal ads: &3%{totalads::%arg-1's uuid%}%"
- function sort(indices: strings, values: numbers, descending: boolean = true) :: strings:
- loop {_indices::}:
- set {_sort::%{_values::%loop-index%}%.%loop-index%} to loop-value
- return (reversed {_sort::}) if {_descending} is true, else {_sort::}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement