Category:
Economy
Suggested name: none
What I want:
I have my SkEco skript, and in it, I have a /baltop command, which runs the top balances of players. (The baltop function was written by someone else) Now my problem is, there is ONE line in the function that requires TuSke.... and I do not want to have to depend on TuSke for ONE line. If someone could please help me re-write that part that would NOT require Tuske I would greatly appreciate it. Currently the skript depends on SkQuery (For checking skript version info from pastebin - Will be changing to reqn in my next update) as well as Vault/SkVault. I would prefer to not have to add anymore addons. I want to keep this simple, with the least amount of add-ons as possible. Thanks
Ideas for commands:
none required
Ideas for permissions:
none required
When I'd like it by: Soon would be nice
Here is the function (and the command, just so you can see how the function is run)
Line 16 is the one I want re-written
Economy
Suggested name: none
What I want:
I have my SkEco skript, and in it, I have a /baltop command, which runs the top balances of players. (The baltop function was written by someone else) Now my problem is, there is ONE line in the function that requires TuSke.... and I do not want to have to depend on TuSke for ONE line. If someone could please help me re-write that part that would NOT require Tuske I would greatly appreciate it. Currently the skript depends on SkQuery (For checking skript version info from pastebin - Will be changing to reqn in my next update) as well as Vault/SkVault. I would prefer to not have to add anymore addons. I want to keep this simple, with the least amount of add-ons as possible. Thanks
Ideas for commands:
none required
Ideas for permissions:
none required
When I'd like it by: Soon would be nice
Here is the function (and the command, just so you can see how the function is run)
Line 16 is the one I want re-written
code_language.skript:
function baltop(p: sender, page: Number):
loop {eco::balance::*}:
set {_loop::%loop-index%} to loop-index
set {_playersSorted::*} to sortHighestToLowest({_loop::*}, {eco::balance::*})
set {_maxPage} to rounded up (size of {_playersSorted::*}/10)
if {_maxPage} is less than 1:
set {_maxPag} to 1
if {_page} is greater than {_maxPage}:
send "{@prefix} &cThat is not a valid page!" to {_p}
stop
if {_page} is less than 1:
send "{@prefix} &cThat is not a valid page!" to {_p}
stop
set {_pos} to 1
add (({_page}-1) * 10) to {_pos}
set {_objects::*} to page {_page} of {_playersSorted::*} with 10 lines #<----- THIS LINE
if {_objects::*} is set:
send "" to {_p}
send "{@prefix} - &l&nTop Balances" to {_p}
send "" to {_p}
loop {_objects::*}:
set {_name} to loop-value parsed as offlineplayer
set {_bal} to regex({eco::balance::%loop-value%})
send "&b##%{_pos}% &b%{_name}% &8&l» &f$%{_bal}%" to {_p}
add 1 to {_pos}
send "" to {_p}
send "&7&o(( You are on page %{_page}% / %{_maxPage}% ))" to {_p}
else:
send "{@prefix} &cThat is not a valid page!" to {_p}
command /baltop [<number=1>]:
aliases: /balancetop
trigger:
if sender has permission "eco.baltop":
baltop(sender, arg-1)