Skip to content

Currency

AnkhHeart edited this page Feb 26, 2018 · 11 revisions

Adding Currency to a Single user

Function

bool AddPoints(string userid, string username, long amount)

Use in Python

Parent.AddPoints(data.User,data.UserName,100)

Removing Currency from a Single user

Function

bool RemovePoints(string userid, string username, long amount)

Use in Python

Parent.RemovePoints(data.User,data.UserName,100)

Batch Adding

Function

//--------------------------
// Syncronous
//--------------------------
List<string> AddPointsAll(PythonDictionary<string userid,long amount> data)

//--------------------------
// Asyncronous
//--------------------------
List<string> AddPointsAllAsync(PythonDictionary<string userid,long amount> data,
Action callback)

Usage

#--------------------------
# Syncronous
#--------------------------
dict = {
'ankhheart': 100,
'momo': 10
}

# Returns a list of users that could not receive currency because they were not in chat
failedUsers = Parent.AddPointsAll(dict)

#--------------------------
# Asyncronous
#--------------------------

Parent.AddPointsAll(dict,callback)

def callback(result):
    failedUsers = result # Returns a list of users that could not receive currency because they were not in chat
    return

Batch Removing

Function

//--------------------------
// Syncronous
//--------------------------
List<string> AddPointsAll(PythonDictionary<string userid,long amount> data)

//--------------------------
// Asyncronous
//--------------------------
List<string> AddPointsAllAsync(PythonDictionary<string userid,long amount> data,
Action callback)

Usage

#--------------------------
# Syncronous
#--------------------------
dict = {
'ankhheart': 100,
'momo': 10
}

# Returns a list of users that could not lose currency because they were not in chat
failedUsers = Parent.RemovePointsAll(dict)

#--------------------------
# Asyncronous
#--------------------------

Parent.RemovePointsAll(dict,callback)

def callback(result):
    failedUsers = result # Returns a list of users that could not losecurrency because they were not in chat
    return

Retrieving User's Currency

Function

long GetPoints(string userid)

Usage

result = Parent.GetPoints("ankhheart")

Retrieving User's Hours Watched

Function

long GetHours(string userid)

Usage

result = Parent.GetHours("ankhheart")

Retrieving User's Rank

Function

long GetRank(string userid)

Usage

result = Parent.GetRank("ankhheart")

Retrieving Top X Users Based on Currency

Function

PythonDictionary<string userid,long amount> GetTopCurrency(int top)

Usage

result = Parent.GetTopCurrency(10)

Retrieving Top X Users Based on Hours Watched

Function

PythonDictionary<string userid,long amount> GetTopHours(int top)

Usage

result = Parent.GetTopHours(10)

Batch Retrieving User's Points

Function

PythonDictionary<string userid,long amount> GetPointsAll(List<string> userids)

Usage

# Import List from .NET at the top of your page
from System.Collections.Generic import List

mylist = List[str](){
'ankhheart',
'momo',
'castorr91',
'must13',
'wellbrained'
}

result = Parent.GetPointsAll(mylist)

Batch Retrieving User's Ranks

Function

PythonDictionary<string userid,long amount> GetRanksAll(List<string> userids)

Usage

# Import List from .NET at the top of your page
from System.Collections.Generic import List

mylist = List[str](){
'ankhheart',
'momo',
'castorr91',
'must13',
'wellbrained'
}

result = Parent.GetRanksAll(mylist)

Batch Retrieving User's Hours

Function

PythonDictionary<string userid,long amount> GetHoursAll(List<string> userids)

Usage

# Import List from .NET at the top of your page
from System.Collections.Generic import List

mylist = List[str](){
'ankhheart',
'momo',
'castorr91',
'must13',
'wellbrained'
}

result = Parent.GetHoursAll(mylist)

Batch Retrieving User's Currency Information

Currency Object

Variable Usage
string UserId obj.UserId
string UserName obj.UserName
long Points obj.Points
long TimeWatched (In Minutes) obj.TimeWatched
string Rank obj.Rank

Function

List<Currency> GetCurrencyUsers(List<string> userids)

Usage

# Import List from .NET at the top of your page
from System.Collections.Generic import List

mylist = List[str](){
'ankhheart',
'momo',
'castorr91',
'must13',
'wellbrained'
}

result = Parent.GetCurrencyUsers(mylist)

Clone this wiki locally