Example #1
0
    def peep_incdec(self, target, source, args):
        input = args[-1]
        matches = re.match('^([a-zA-Z0-9_\\\[\]\{\}\^`\|]+)([\+|\-]{2}(?![\+|\-])).*', input)

        if not matches: return

        entity = matches.group(1)
        method = matches.group(2)

        if not entity: return

        source = Id(source)

        if not source.name or not source.is_authenticated: return

        if source.name == entity:
            self.chat("No self love.")
            simpleupdate(entity, -1000000)
            return

        mod = 1
        if method == '--':
            mod = -1

        if not simpleupdate(entity, False, random.randint(1, 100000) * mod, True):
            self.chat("mongodb seems borked", target=target)
            return

        self.chat('%s brought %s to %d' % (source.name, entity,
            entityScore(entity)), target=target)
Example #2
0
    def decrement(self):
        if not self.values:
            self.chat("you need to give someone your hate")
            return
        entity = " ".join(self.values)
        if entity == 'jcb':
            return

        if not simpleupdate(entity, False, random.randint(1, 100000) * -1, True):
            self.chat("mongodb seems borked")
            return
        return self.lastsender + " brought " + entity + " to " + str(entityScore(entity))
Example #3
0
    def workat(self):
        if not self.values:
            self.chat("If you're unemployed, that's cool, just don't abuse the bot")
            return

        name = self.lastsender
        company = " ".join(self.values)

        if not simpleupdate(name, "company", company):
            self.chat("Busto, bro.")
            return

        self.chat("Company updated.")
Example #4
0
    def checkwin(self):
        breaker = self.players[self.playerorder[self.turn]]

        if not breaker['broke']: return False

        self.gethigh()

        tally = 0

        for player in self.players:

            if player == self.winner: continue

            spread = self.top - self.players[player]['score']
            tally += spread
            simpleupdate(player, 'cash', spread * -1, True)

        if not tally:
            tally = self.top

        simpleupdate(player, 'cash', tally, True)

        return '%s wins it with %s.' % (self.winner, self.top)
Example #5
0
    def workat(self):
        if not self.values:
            self.chat(
                "If you're unemployed, that's cool, just don't abuse the bot")
            return

        name = self.lastsender
        company = " ".join(self.values)

        if not simpleupdate(name, "company", company):
            self.chat("Busto, bro.")
            return

        self.chat("Company updated.")
Example #6
0
    def checkwin(self):
        breaker = self.players[self.playerorder[self.turn]]

        if not breaker['broke']: return False

        self.gethigh()

        tally = 0

        for player in self.players:

            if player == self.winner: continue

            spread = self.top - self.players[player]['score']
            tally += spread
            simpleupdate(player, 'cash', spread * -1, True)

        if not tally:
            tally = self.top

        simpleupdate(player, 'cash', tally, True)

        return '%s wins it with %s.' % (self.winner, self.top)
Example #7
0
    def addphone(self):
        if not self.values:
            self.chat("What number?")
            return

        phone = self.values[0]

        if not re.search("^[0-9]{10}$", phone):
            self.chat("Just one good ol'merican ten-digit number, thank ya kindly.")
            return

        name = self.lastsender

        if not simpleupdate(name, "phone", phone):
            self.chat("Some shit borked.")
            return

        self.chat("Number updated.")
Example #8
0
    def addphone(self):
        if not self.values:
            self.chat("What number?")
            return

        phone = self.values[0]

        if not re.search("^[0-9]{10}$", phone):
            self.chat(
                "Just one good ol'merican ten-digit number, thank ya kindly.")
            return

        name = self.lastsender

        if not simpleupdate(name, "phone", phone):
            self.chat("Some shit borked.")
            return

        self.chat("Number updated.")
Example #9
0
    def passwd(self):
        if not self.values:
            self.chat("Enter a password.")
            return

        if self.context == CHANNEL:
            self.chat("Not in the main channel, you twit.")
            return

        whom = self.lastsender

        h = hashlib.sha1()
        h.update(' '.join(self.values))
        pwd = h.hexdigest()

        if not simpleupdate(whom, "password", pwd):
            self.chat("Fail.")
            return

        self.chat("Password set.")
Example #10
0
    def passwd(self):
        if not self.values:
            self.chat("Enter a password.")
            return

        if self.context == CHANNEL:
            self.chat("Not in the main channel, you twit.")
            return

        whom = self.lastsender

        h = hashlib.sha1()
        h.update(' '.join(self.values))
        pwd = h.hexdigest()

        if not simpleupdate(whom, "password", pwd):
            self.chat("Fail.")
            return

        self.chat("Password set.")