HOW-TO: Run a loop to get user share size and display it on main hub chat
 

HOW-TO: Run a loop to get user share size and display it on main hub chat

Started by RPGamer, 03 March, 2016, 08:33:02

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RPGamer

Basically I want to create a script where when the user types !sharegraph , the following things should happen:

  • Get the online users share size using Core.GetUserData and iShareSize and store it in an array
  • Create another array called size_count which will contain the count of share size of each user according to size category
  • Size categories will be: 0GB-200GB,200GB-400GB,400GB-600GB,600GB-800GB,800GB-1000GB,1000GB+
  • Run a comparison loop and update size_count array
  • Print on main hub chat the size by printing "*" for each user
[li]If a category has more than 50 users, it will print "+" at the end of 30 "*"
[/li][/list]
So lets say if the hub has 10 users where 2 users have less than 200GB , 4 users have 400-600GB and the rest have 1000GB+ , the output should be:
0GB-200GB:      **
200GB-400GB:
400GB-600GB:  ****
600GB-800GB:
800GB-1000GB:
1000GB+:         ****
Can someone please help me out?

SMF spam blocked by CleanTalk