Esempio n. 1
0
from api import Plugin, A
from dateutil.parser import parser
import time, datetime

P = Plugin(A, "UrTTV", 0.1, "B1naryTh1ef")
dp = parser()

GTV_COMMANDS = [
    'servers', 'addserver', 'rmvserver', 'editserver', 'seven', 'addmatch',
    'editmatch', 'rmvmatch'
]
GTV_PUB_COMMANDS = ["upcoming", "last", "suggest", 'matches']

add_match_usage = 'Usage: !gtv addmatch team1=Blue team2=Red date=dd.mm.yyyy time=22:30 (GMT +1) league=UZ gtype=CTF'


def getOrdredList(keys):  #shitty code works :D
    li = {}
    for key in keys:
        v = A.red.hgetall(key)
        li[int(v['id'])] = v
    li = li.keys()
    li.sort()
    res = []
    for k in li:
        res.append(li[k])
    return res


def editGtvServer(id, kwargs):
    return A.red.hmset('i.p.urttv.server.%s' % id, kwargs)
Esempio n. 2
0
# -*- coding: utf-8 -*-
from api import Plugin, A
import json, time, random, os

P = Plugin(A, "Core", 0.2, "B1naryTh1ef")

s_actions = ['slap', 'smite', 'wack', 'pwn', 'rm -rf', 'destroy', 'obliterate', 'refactor', 'git reset --hard']
s_bodyparts = ['tentacle', 'face', 'head', 'dick', 'eye', 'inner thigh']
s_tools = ['gun', 'neek', 'bread', 'black hole', 'stick', 'knife', 'rawrbot', 'python', 'hashtag', 'a.out', 'http://']
s_opmsgs = ['Enjoy your +o', 'IMA PUT MY OP IN YOU', 'There you go', '<3', 'Now can we mode +b *!*@* plz?', 'Whose the best bot evar?']

@P.cmd('addadmin', usage="{cmd} name chan=#mychan", gadmin=True, kwargs=True)
def addAdmin(obj):
    if len(obj.m) < 2: return obj.usage()
    if obj.kwargs.get('chan'):
        s = 'i.%s.chan.%s.admins' % (obj.nid, obj.kwargs.get('chan'))
    else:
        s = 'i.%s.admins' % obj.nid
    if A.red.sismember(s, obj.m[1].lower()):
        return obj.reply('That user is already an admin!')
    else:
        A.red.sadd(s, obj.m[1].lower())
        if obj.kwargs.get('chan'):
            obj.reply('Added %s as a admin for %s!' % (obj.m[1], obj.kwargs.get('chan')))
        else:
            obj.reply('Added %s as a global admin!' % obj.m[1])

@P.cmd('rmvadmin', usage="{cmd} name chan=#mychan", gadmin=True, kwargs=True)
def rmvAdmin(obj):
    if len(obj.m) < 2: obj.usage()
    if obj.kwargs.get('chan'): s = 'i.%s.chan.%s.admins' % (obj.nid, obj.kwargs.get('chan'))
Esempio n. 3
0
        except:
            if not self.handshake(): return False
            return self.full_stat()    
        buff = buff[11:]
        items, players = buff.split('\x00\x00\x01player_\x00\x00')
        items = 'motd' + items[8:] 
        items = items.split('\x00')
        data = dict(zip(items[::2], items[1::2])) 
        players = players[:-2]
        if players: data['players'] = players.split('\x00')
        else:       data['players'] = []
        for k in ('numplayers', 'maxplayers', 'hostport'):
            data[k] = int(data[k])
        return data

P = Plugin(A, "Utils", 0.1, "B1naryTh1ef")

@P.cmd('urt', usage="{cmd} [IP/Host[:port]]", desc="Get info for a UrT Server")
def cmdUrt(obj):
    if len(obj.m) < 2: return obj.usage()
    if ':' in obj.m[1]: host, port = obj.m[1].split(':', 1)
    else: 
        host = obj.m[1]
        port = 27960
    o = rcon.RCON(server=host, port=int(port), password="").getstatus()
    print o

@P.cmd('mc', usage="{cmd} [IP/Host[:port]]", desc="Get info for a mc server (needs to have querying enabled!)")
def cmdMc(obj):
    if len(obj.m) < 2: return obj.usage()
    if ':' in obj.m[1]: host, port = obj.m[1].split(':', 1)
Esempio n. 4
0
#FOR _BOTH_ MUSIC and VIDEO (URT SC's)
from api import Plugin, A
from data import ConfigFile
import requests

P = Plugin(A, "Shoutcaster", 0.1, "B1naryTh1ef")

default_cfg = {
    'channels': [{
        'name':
        'Urban Zone',
        'id':
        'urbanzone',
        'nid':
        0,
        'chan':
        'urban-zone.radio',
        'spam':
        True,
        'spams': [{
            'chans': ['urban-zone', 'b1naryth1ef', 'urt-tv'],
            'delay': 10
        }, {
            'chans': ['urban-terror'],
            'delay': 20
        }]
    }]
}

config = ConfigFile(name="scer",
                    default=default_cfg,
Esempio n. 5
0
from api import Plugin, A
import time

P = Plugin(A, "Clans", 0.1, "B1naryTh1ef")

#REDIS
#i.p.clan.cw.CHANNEL (hash)
#i.p.clan.cw.LAST

#!cws practice=bool ignore=#chana, #chanb, #chanc
#!addcw players=X gm=CTF notes=blah blah blah
#[#owls-team] (PRACTICE) 5v5 TS: "My notes here"


def getID():
    return A.red.incr('i.p.clan.cwinc')


def genMessage(args):
    msg = []
    msg.append('CLAN WAR #{id}:')
    msg.append('[{chan}]')
    if args['practice']:
        msg.append('(PRACTICE)')
    msg.append('{nump}vs{nump}')
    if args['notes']: msg.append('{gm}: "{notes}"')
    else: msg.append('{gm}')
    return ' '.join(msg).format(**args)


# def onLoad(): #@DEV stacks up, unload call?
Esempio n. 6
0
from api import Plugin, A
from data import ConfigFile

P = Plugin(A, "Admin", 0.1, "B1naryTh1ef")

default_cfg = {'admin_chans': ['b1naryth1ef', 'rawrbot.admins']}

cfg = ConfigFile(name='admin', path=['plugins', 'config'], default=default_cfg)


@P.apih('admin_add_report')
def adminAddReport(msg, nick, chan, net):
    id = A.red.incr('i.p.core.reportid')
    k = 'i.p.core.rep.%s' % id
    A.red.hset(k, 'user', nick)
    A.red.hset(k, 'chan', chan)
    A.red.hset(k, 'msg', msg)
    A.red.hset(k, 'active', 1)
    for i in cfg.admin_chans:
        if chan: c = '[%s]' % chan
        else: c = ''
        A.write(net, i,
                'NEW REPORT #%s FILED BY %s: %s %s' % (id, nick, msg, c))
    return True, id


@P.apih('admin_edit_report')
def adminEditReport():
    pass

Esempio n. 7
0
# Just derpin
from api import Plugin, A

P = Plugin(A, "PugBot", 0.1, "B1naryTh1ef")


@P.cmd("testy")
def testy(obj):
    return obj.reply("Successful!")