Ejemplo n.º 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)
Ejemplo n.º 2
0
    def score(self):
        if not self.values: return "For what?"

        s = entityScore(self.values[0])
        if not s: return "Couldn't retrieve score"

        return str(s)
Ejemplo n.º 3
0
    def cashmoney(self):

        whom = self.lastsender
        if self.values:
            whom = self.values[0]

        s = entityScore(whom)

        self.chat("%s gots $%.02f" % (whom, s))
Ejemplo n.º 4
0
    def decrement(self):
        if not self.values:
            self.chat("you need to give someone your hate")
            return
        entity = " ".join(self.values)

        if not incrementEntity(entity, -1):
            self.chat("mongodb seems borked")
            return
        return self.lastsender + " brought " + entity + " to " + str(entityScore(entity))
Ejemplo n.º 5
0
    def decrement(self):
        if not self.values:
            self.chat("you need to give someone your hate")
            return
        entity = " ".join(self.values)

        if not incrementEntity(entity, -1):
            self.chat("mongodb seems borked")
            return
        return self.lastsender + " brought " + entity + " to " + str(
            entityScore(entity))
Ejemplo n.º 6
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))
Ejemplo n.º 7
0
    def increment(self):
        if not self.values:
            self.chat("you need to give someone your love")
            return
        entity = " ".join(self.values)
        if entity == 'jcb': 
            return

        if not incrementEntity(entity, random.randint(1, 100000)):
            self.chat("mongodb seems borked")
            return
        return self.lastsender + " brought " + entity + " to " + str(entityScore(entity))
Ejemplo n.º 8
0
    def increment(self):
        if not self.values:
            self.chat("you need to give someone your love")
            return
        entity = " ".join(self.values)
        if entity == 'jcb':
            return

        if not incrementEntity(entity, random.randint(1, 100000)):
            self.chat("mongodb seems borked")
            return
        return self.lastsender + " brought " + entity + " to " + str(
            entityScore(entity))