Example #1
0
def isk(inp, nick='', chan='', db=None, say=None, input=None):
    ".isk [Nick]"
    db_init(db)
    locale.setlocale(locale.LC_ALL, '')

    if not inp:
        pass
    else:
        nick = inp

    try:
        res=evemisc.get_apiID_by_nick(db, nick)
        if res == None:
            return "No entry found. Please use .eveadd"

        keyID, vCode, charName = res
        api, auth, cid=evemisc.get_characterID(keyID, vCode, charName)
        if cid == None:
            return "No character found"

        wallet = auth.char.AccountBalance(characterID=cid)
        isk = wallet.accounts[0].balance
        if isk:
            say(u"%s has \u0002%s\u000f ISK." % (charName.title(), locale.format('%.2f', isk, True)))
        else:
            say("No character found.")
    except (RuntimeError, ssl.SSLError) as e:
        return "Error: " + e.message
Example #2
0
def timeout(inp, nick='', chan='', db=None, say=None, input=None):
    ".timeout [Nick]"
    db_init(db)

    if not inp:
        pass
    else:
        nick = inp

    try:
        res=evemisc.get_apiID_by_nick(db, nick)
        if res == None:
            return "No entry found. Please use .eveadd"

        keyID, vCode, charName = res
        api, auth, cid=evemisc.get_characterID(keyID, vCode, charName)
        if cid == None:
            return "No character found"

        accountStatus = auth.account.AccountStatus()
        timeOut = accountStatus.paidUntil
        logonMinutes = accountStatus.logonMinutes
        playTime = datetime(1, 1, 1) + timedelta(minutes = float(logonMinutes))
        playTimeStr = (u"(you played %dd %dh %dmn %ds)" % (playTime.day - 1, playTime.hour, playTime.minute, playTime.second))
        now = time.time()
        t, d = evemisc.sectostr(now, timeOut)
        remainingTime = u"\u000310" + t + u"\u000f"
        if t.index('-'):
            remainingTime = u"\u000304" + t + u"\u000f"
        say(u"%s account expires in %s, on \u000307%s\u000f, %s" % (nick, remainingTime, d, playTimeStr))
    except (RuntimeError, ssl.SSLError) as e:
        return "Error: " + e.message
Example #3
0
def next(inp, nick='', chan='', db=None, say=None, input=None):
    ".next [Nick]"
    db_init(db)

    if not inp:
        pass
    else:
        nick = inp

    try:
        res=evemisc.get_apiID_by_nick(db, nick)
        if res == None:
            return "No entry found. Please use .eveadd"

        keyID, vCode, charName = res
        api, auth, cid=evemisc.get_characterID(keyID, vCode, charName)
        if cid == None:
            return "No character found"
        queue = auth.char.SkillQueue(characterID=cid).skillqueue
        if len(queue) > 1:
            s=api.eve.TypeName(ids=queue[1].typeID)
            skillName=s.types[0].typeName
            t, d=evemisc.sectostr(time.time(), queue[1].endTime)
            msg = u"\u0002%s\u000f: Next skill in queue \u000308%s\u000f to level \u000308%d\u000f (finish in \u000310%s\u000f, %s)" \
                  % (charName.title(), skillName, queue[0].level, t, d)
            say(msg)
        else:
            say("No skill in queue.")
    except (RuntimeError, ssl.SSLError) as e:
        return "Error: " + e.message
Example #4
0
def eta(inp, nick='', chan='', db=None, say=None, input=None):
    ".eta [Nick]"
    db_init(db)

    if not inp:
        pass
    else:
        nick = inp

    try:
        res=evemisc.get_apiID_by_nick(db, nick)
        if res == None:
            return "No entry found. Please use .eveadd"

        keyID, vCode, charName = res
        api, auth, cid=evemisc.get_characterID(keyID, vCode, charName)
        if cid == None:
            return "No character found"

        skill = auth.char.SkillInTraining(characterID=cid)
        if skill.skillInTraining == 0:
            say("No skill in training")
        else:
            print "Skill in training"
            s=api.eve.TypeName(ids=skill.trainingTypeID)
            skillName=s.types[0].typeName
            t, d=evemisc.sectostr(time.time(), skill.trainingEndTime)
            msg = u"\u0002%s\u000f: Currently training \u000308%s\u000f to level \u000308%d\u000f (finish in \u000310%s\u000f, %s)" \
                  % (charName.title(), skillName, skill.trainingToLevel, t, d)
            say(msg)
    except (RuntimeError, ssl.SSLError) as e:
        return "Error: " + e.message
Example #5
0
def market(inp, nick='', chan='', db=None, say=None, input=None):
    ".market [Nick]"
    db_init(db)

    if not inp:
        pass
    else:
        nick = inp

    try:
        res=evemisc.get_apiID_by_nick(db, nick)
        if res == None:
            return "No entry found. Please use .eveadd"

        keyID, vCode, charName = res
        api, auth, cid=evemisc.get_characterID(keyID, vCode, charName)

        if cid == None:
            return "No character found"
        orders = auth.char.MarketOrders(characterID=cid).orders

        if not orders:
            say("No market orders in training")
        else:
            msg=""
            i = 0
            for order in orders:
                if order.orderState == 0:
                    i = i + 1
                    name=evemisc.get_name_from_id(api, order.typeID)
                    price=order.price
                    startVol=order.volEntered
                    currentVol=order.volRemaining
                    if order.bid == 1:
                        msg = u"%d: [Buy \u000308%d\u000f unit of \u000310%s\u000f for \u0002%.2f\u000f ISK]" % (i, startVol, name, price)
                    else:
                        msg = u"%d: [Sell \u000308%d\u000f/\u000303%d\u000f unit of \u000310%s\u000f for \u0002%.2f\u000f ISK]" % (i, currentVol, startVol, name, price)
                    say(msg)
            if msg == "":
                say("No market orders in training")
    except (RuntimeError, ssl.SSLError) as e:
        return "Error: " + e.message
Example #6
0
def queue(inp, nick='', chan='', db=None, say=None, input=None):
    ".queue [nick]"
    db_init(db)

    if not inp:
        pass
    else:
        nick = inp

    try:
        res=evemisc.get_apiID_by_nick(db, nick)
        if res == None:
            return "No entry found. Please use .eveadd"

        keyID, vCode, charName = res
        api, auth, cid=evemisc.get_characterID(keyID, vCode, charName)
        if cid == None:
            return "No character found"

        queue = auth.char.SkillQueue(characterID=cid).skillqueue
        snk=""
        qEnd=0
        if len(queue) > 0:
            for sk in queue:
                s=api.eve.TypeName(ids=sk.typeID)
                skillName=s.types[0].typeName
                snk = snk + u"[\u000308" + skillName + u"\u000f lvl. \u000308" + str(sk.level) + u"\u000f] "
                qEnd = sk.endTime
        else:
            return "No skill in queue."
        print snk
        t, d=evemisc.sectostr(time.time(), qEnd)
        msg = u"%s: Skill in queue: %s (finish in \u000310%s\u000f, %s)" % (charName.title(), snk, t, d)
        say(msg)
    except (RuntimeError, ssl.SSLError) as e:
        return "Error: " + e.message