Hi, I'm currently coding a clans script and I'm stuck at this point where I want to order all my clans into the most members online.
Code:
Currently all my clans are listing in the /c list but are not being shown in order of members online.
I hope there is a way to do this, thanks
[doublepost=1576023924,1575680884][/doublepost]Anyone got any ideas on this?
Code:
Code:
else if arg-1 is "list":
set {_number} to arg-2 parsed as an integer
clear {_online::*}
if {_number} is not set:
set {_page} to 1
send "%{p}% &6Clans list &b(%{_page}%/undefined)"
loop {clan::list::*}:
set {_c} to loop-value
set {_online} to size of {clan::%{_c}%::online::*}
set {_total} to {_online} + size of {clan::%{_c}%::offline::*}
set {_i} to loop-index parsed as int
{_i} >= {_page} * 10 - 9 #where if {_page} is 1, all integers above 0 is valid
{_i} <= {_page} * 10 #where if {_page} is 1, all integers below 11 is valid
#meaning all integers between 1 and 10 are valid equaling to 10 results
#send "&c%{_c}% &b%{_online}%/%{_total}%"
add "&b%{_c}% &a%{_online}%/%{_total}%" to {_online2::*}
set {_clan::listmessage::*} to sorted {_online2::*}
loop {_online2::*}:
set {_reversed::%loop-index-2%} to last element of {_clan::listmessage::*}
remove {_reversed::%loop-index-2%} from {_clan::listmessage::*}
send "%{_reversed::%loop-index-2%}% Online"
clear {_online2::*}
Currently all my clans are listing in the /c list but are not being shown in order of members online.
I hope there is a way to do this, thanks
[doublepost=1576023924,1575680884][/doublepost]Anyone got any ideas on this?