Exemplo n.º 1
0
def eventAchievement(data):

    time, name, ach = data

    q.put(("INSERT INTO achievements VALUES (?,?,?)", (datetime.datetime.now(),
                                                       name, ach)))
    vanillabean.tweet('{} just got "{}"'.format(name, ach))
Exemplo n.º 2
0
def playtimeStat():

    top = dbQuery(dbfile, 30, (
        'select count(getStat(stats, "stat.playOneMinute")) as total, name from playeractivity natural join playerUUID where datetime >= datetime("now", "-7 days") group by name order by total desc limit 1',
    ))[0]

    vanillabean.tweet(
        "Congrats to {} for playing {} minutes this week!".format(
            top[1], str(top[0])))
Exemplo n.º 3
0
def eventAchievement(data):

    time, name, ach = data

    conn = sqlite3.connect(dbfile)
    cur = conn.cursor()

    q.put(("INSERT INTO achievements VALUES (?,?,?)", (datetime.datetime.now(), name, ach)))
    vanillabean.tweet('{} just got "{}"'.format(name, ach))
    conn.commit()
    conn.close()
Exemplo n.º 4
0
def playtimeStat():
    def getStat(stats, stat):
            return eval(stats).get(stat,0)


    conn = sqlite3.connect(dbfile)
    conn.create_function("getStat", 2, getStat)
        
    
    cur = conn.cursor()
    cur.execute('select count(getStat(stats, "stat.playOneMinute")) as total, name from stats natural join playerUUID where datetime >= datetime("now", "-7 days") group by name order by total desc limit 1')
    top = cur.fetchall()[0]
    
    conn.commit()
    conn.close()  
    vanillabean.tweet("Congrats to {} for playing {} minutes this week!".format(top[1], str(top[0])))
Exemplo n.º 5
0
def sneakStat():
    name, stat = stats("stat.sneakTime")
    vanillabean.tweet("Congrats to {} for sneaking {} m this week!".format(name, stat / 100 ))
Exemplo n.º 6
0
def minecartStat():
    name, stat = stats("stat.minecartOneCm")
    vanillabean.tweet("Congrats to {} for sitting in a minecart for {} m this week!".format(name, stat / 100 ))
Exemplo n.º 7
0
def flyStat():
    name, stat = stats("stat.aviateOneCm")
    vanillabean.tweet("Congrats to {} for flying {} kms this week!".format(name, stat / 100 / 1000))
Exemplo n.º 8
0
def boatStat():
    name, stat = stats("stat.boatOneCm")
    vanillabean.tweet("Congrats to {} for boating {} m this week!".format(name, stat / 100 ))
Exemplo n.º 9
0
def boatStat():
    name, stat = stats("stat.boatOneCm")
    vanillabean.tweet("Congrats to {} for boating {} m this week!".format(
        name, stat / 100))
Exemplo n.º 10
0
def sneakStat():
    name, stat = stats("stat.sneakTime")
    vanillabean.tweet("Congrats to {} for sneaking {} m this week!".format(
        name, stat / 100))
Exemplo n.º 11
0
def minecartStat():
    name, stat = stats("stat.minecartOneCm")
    vanillabean.tweet(
        "Congrats to {} for sitting in a minecart for {} m this week!".format(
            name, stat / 100))
Exemplo n.º 12
0
def flyStat():
    name, stat = stats("stat.aviateOneCm")
    vanillabean.tweet("Congrats to {} for flying {} kms this week!".format(
        name, stat / 100 / 1000))