Join us on Discord!
You can help CodeWalrus stay online by donating here.

Karma Tracking IRC Bot?

Started by Unicorn, September 03, 2015, 03:44:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Unicorn

I was thinking that we should have a karma tracking IRC bot. I have one set up, all it needs is a little more tuning and to join the channel. (nothing complicated, just has !karma <nick> and <nick>++/-- ) Would you staff like to use mine? If you are concerned about privileges, and other things, you can go through all the files and say what will work, and what won't.

And its a premade bot, I'm just editing the commands available.

Anyhow, just asking you guys, @DJ Omnimaga @Juju @Streetwalrus .
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

allynfolksjr

Does it send public messages to the channel? If so, why? A web interface may be a more compelling use case rather than extra public messages.

Dream of Omnimaga

Ideally, I would prefer that if such bot goes into the channel that it is like this:

1: End up getting banned



2: If it doesn't (:P), then it needs flood control (eg 1 karma change every 8 or 24 hour or whatever the forums have its karma config setup like). It could get abused like mad. 24 hours per people for a max of 1 vote overall every 8 hour seems more viable.
3: It could be tied to the forum karma system, but we encourage forum users to use it to vote good contributions, so the IRC nature of an IRC karma bot would kinda ruin that a bit.
4: Private message commands? (or public channel output could also have a flood control to prevent spam)


Honestly I'm not too thrilled about the idea, because I don't think we need two karma systems simultaneously, but I guess it also depends of Streetwalrus, Juju and Eiyeron.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Yuki

If it's like on Cemetech, I wouldn't really object at that. Write me a description of what the bot does exactly and, if it's not too annoying, I should allow it.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Unicorn

Quote from: Juju on September 03, 2015, 03:59:02 AM
If it's like on Cemetech, I wouldn't really object at that. Write me a description of what the bot does exactly and, if it's not too annoying, I should allow it.
Here is the github: https://github.com/cjones/madcow
Essentially, it has a ton of commands that it supports, but only 3 are enabled:

!karma - Allows users to increase, and decrease another persons karma
!google - allows a google search
!calc - calculates values


I can remove and add if need be.
Here is the whole settings file:

"""Settings for madcow"""

###################
### MAIN CONFIG ###
###################

PROTOCOL = 'irc'  # irc, aim, pysilc, shell, cli
BOTNAME = 'unibot'  # will use this nickname in irc/silc and for addressing
ALIASES = ['!' ]  # list of other nicks the bot will also respond to
DETACH = False  # set to True to run as a daemon (UNIX only)
WORKERS = 5  # how many threads to process requests
LOG_PUBLIC = True  # set to False to avoid logging public chatter
LOG_BY_DATE = True  # set to False to have channel logs all one file instead of split by day
IGNORE_NICKS = ['spammer', 'otherbot']  # list of nicknames to completely ignore
IGNORE_REGEX = ['NOBOT', 'my\.secret\.domain']  # regular expressions that if they match on input text, will be ignored by the bot. this is handy to prevent certain urls being broadcast to delicious, if you have that enabled.
PIDFILE = 'madcow.pid'  # file (relative to base) for pid for current bot
ENCODING = 'utf-8'  # default character set, None for auto (generally utf-8)
OWNER_NICK = ''  # in irc/silc/aim set to your name to be given auto-admin
ALLOW_REGISTRATION = True  # allow other users to register with the bot
DEFAULT_FLAGS = ''  # flags given to registered users o=auto-op (irc only), a=admin
PRIVATE_HELP = True  # if True, redirects "help" output to private message

###############
### LOGGING ###
###############

LOGGING_LEVEL = 'INFO'  # DEBUG, INFO, WARN, ERROR
LOGGING_FORMAT = '[%(time)s - %(level)s] %(message)s'
LOGGING_TIME_FORMAT = '%Y/%m/%d %H:%M:%S'
LOGGING_ENCODING = ENCODING
UNIQUE_TIMESTAMP_FORMAT = '%Y%m%d'
UNIQUE_MAX_FILES = 1000

###############
### MODULES ###
###############

MODULES = [#'alias',               # allow users to make command aliases
           #'area',                # look up area codes
           #'bbcnews',             # bbc news headlines
           #'beer',                # beer
           'calc',                # google calculator
           #'clock',               # world clock
           #'cnn',                 # show cnn headline
           #'dictionary',          # definition of words
           #'election',            # current electoral vote predictor for 2008 US election
           'google',              # i'm feeling lucky query
           #'learn',               # used for various modules to cache per-user data
           #'movie',               # rate movie on imdb & rotten tomatoes
           #'noaa',                # alternative to wunderground (us-only, more accurate)
           #'nslookup',            # look up ip of hostnames
          #'seen',                # keep track of last thing everyone in channel said
           #'spellcheck',          # spellcheck a word/phrase using google
           #'stockquote',          # get yahoo stock quotes
           #'summon',              # summon users (send email/sms)
           #'sunrise',             # get sunrise/sunset from google for your area
           #'translate',           # language translations
           #'urban',               # look up word/phrase on urban dictionary
           #'weather',             # look up weather from wunderground
           #'wikimedia',           # look up summaries from various wikis
           #'wikiquotes',          # look up quotes from wikiquotes
           #'yelp',                # get restaraunt rating/address
           #'youtube',             # scrape youtube titles
           #'staff',               # mark users as 'staff'
           #'company',             # set company name for nick (req. staff module)
           #'realname',            # set real name for nick (req. staff module)
           #'notes',               # add a note to a nick (req. staff module)
           #'xray',                # see all staff-set data on a nick (req. staff module)
           #'blog',                # get the latest blog posts from RSS feed (specify URL below)
           #'links',               # create shortcut links (req. staff module)
           #'welcome',             # send a user a welcome message (set message below)
           #
           # the following modules are either silly, or potentially annoying/offensive.
           # they are disabled by default so you can make the decision about how
           # obnoxious your bot is able to be.
           #
           #'artfart',             # random ascii art
           #'bash',                # bash (irc/im) quotes
           #'bible',               # get a quote from the bible
           #'care',                # generate a high-precision care-o-meter
           #'chp',                 # california real-time traffic reports
           #'delicious',           # post all urls to delicious (see config below)
           #'factoids',            # makes madcow remember stuff from chatter
           #'figlet',              # generate ascii fonts
           #'fmylife',             # fmylife complaint, random or by ID
           #'grufti',              # random response triggeres, like grufti bot
           #'jinx',                # someone owes you a coke for being unoriginal
           #'joke',                # random joke
           'karma',               # keep track of karma (nick++, nick--)
           #'livejournal',         # get livejournal entries (random or by nick)
           #'lyrics',              # look up song lyrics (spammy!)
           #'megahal',             # markov bot (requires you build C extension!)
           #'memebot',             # track urls and lay smackdown on old memes
           #'obama',               # countdown since change.. such as it has been
           #'pollmail',            # poll an email account using IMAP for messages to echo to IRC
           #'roll',                # roll ad&d dice
           #'slut',                # how slutty is the phrase? (safesearch vs. regular)
           #'steam',               # allow queries into your steam group about who's online
           #'terror',              # current status of TERROR
           #'texts',               # random texts from last night
           #'trek',                # generate star trek technobabble
           #'webtender',           # how to make drinks!
           #'woot',                # latest woot offer
           #'djmemebot',           # memebot's django app backend integration
           #'wikihow',             # mashup instructions from wikihow
           #'wunderground',        # advanced weather api access, (needs api key from wunderground.com)
           #'wolfram',             # wolfram alpha api access (see WOLFRAM_* settings below if you enable this)
           ]

# these are modules that run on their own periodically if enabled. settings are below
TASKS = [
        #'ircops',                 # automatically provide ops in irc
        #'pollmail'                # automatically poll imap mail
        #'tweets',                 # gateway for tweet timeline
        ]

PRIVATE_MODULES = ['lyrics', 'company', 'realname', 'notes', 'xray']  # list of modules (from MODULES above) that only respond in private message

# Blacklist mechanism to disable modules when "better" ones are enabled, as
# defined here. The master module is the dictionary key, and its subservients
# are in the list. In the default below, for example, enabling wunderground.py
# will force noaa.py and weather.py to unload. They have conflicting triggers,
# as well as basically do the same thing. wunderground.py is the superior
# plugin, however it requires one to enroll for (free) API access, which may
# not be to everyone's taste or means.
MODULE_SUPERCEDES = {'wunderground': ['noaa', 'weather']}
TASK_SUPERCEDES = {}

#######################
### PROTOCOL CONFIG ###
#######################

# connection settings for irc plugin
IRC_HOST = 'irc.efnet.pl'
IRC_PORT = 6667
IRC_SSL = False
IRC_DEBUG = False  # enable for lots of details. noisy!
IRC_PASSWORD = None
IRC_CHANNELS = ['#unicorn-uploads']
IRC_RECONNECT = True
IRC_RECONNECT_WAIT = 3
IRC_RECONNECT_MESSAGE = None
IRC_REJOIN = True
IRC_REJOIN_WAIT = 3
IRC_REJOIN_MESSAGE = None
IRC_QUIT_MESSAGE = None
IRC_OPER = False
IRC_OPER_USER = None
IRC_OPER_PASS = None
IRC_IDENTIFY_NICKSERV = False
IRC_NICKSERV_USER = 'NickServ'
IRC_NICKSERV_PASS = None
IRC_FORCE_WRAP = 400
IRC_DELAY_LINES = 0  # miliseconds
IRC_KEEPALIVE = True
IRC_KEEPALIVE_FREQ = 30
IRC_KEEPALIVE_TIMEOUT = 120
IRC_GIVE_OPS_FREQ = 30

# settings for the aim protocol
AIM_USERNAME = 'aimusername'
AIM_PASSWORD = 'aimpassword'
AIM_PROFILE = 'Madcow InfoBot'
AIM_AUTOJOIN_CHAT = True
AIM_AUTOJOIN_LEVEL = 'o'  # who to accept invites from. o=owner, a=admin, r=registered, *=anyone. owner is set with OWNER_NICK above, the others are handled via internal admin management. the bot will always accept invites from owner.

# settings for the silc protocol
SILC_CHANNELS = ['#madcow']
SILC_HOST = 'localhost'
SILC_PORT = 706
SILC_PASSPHRASE = None
SILC_RECONNECT = True
SILC_RECONNECT_WAIT = 3
SILC_DELAY = 350  # miliseconds

#######################
### MODULE SETTINGS ###
#######################

# for steam plugin
STEAM_GROUP = None
STEAM_SHOW_ONLINE = True

# for delicious plugin
DELICIOUS_AUTH_TYPE = 'http'  # http or oauth
# http username/password
DELICIOUS_USERNAME = None
DELICIOUS_PASSWORD = None
# oauth tokens (run contrib/get_delicious_auth_keys.py to get this)
DELICIOUS_CONSUMER_KEY = None
DELICIOUS_CONSUMER_SECRET = None
DELICIOUS_TOKEN_KEY = None
DELICIOUS_TOKEN_SECRET = None
DELICIOUS_SESSION_HANDLE = None

# for the yelp plugin
YELP_DEFAULT_LOCATION = 'San Francisco, CA'

# for the blog plugin
BLOG_RSS_URL = 'http://www.activestate.com/blog/rss.xml'

# for the welcome plugin
WELCOME_MSG = 'Have a good time!'

# for pollmail plugin
POLLMAIL_FREQUENCY = 60
POLLMAIL_USE_PASSWORD = False
POLLMAIL_PASSWORD = None
POLLMAIL_AUTOSTART = False
POLLMAIL_JSON_REGEX = r'{({.+})}'
IMAP_SERVER = 'localhost'
IMAP_PORT = 993
IMAP_USERNAME = None
IMAP_PASSWORD = None
IMAP_USE_SSL = True

# for wolfram alpha api access
WOLFRAM_API_APPID = None  # you need to sign up at wolframalpha.com and register for free api access
WOLFRAM_API_URL = None  # only change this to override the standard api access url

################
### FEATURES ###
################

SMTP_SERVER = 'localhost'
SMTP_FROM = '[email protected]'
SMTP_USER = None
SMTP_PASS = None

# a gateway for communicating with the bot over tcp
GATEWAY_ENABLED = False
GATEWAY_ADDR = 'localhost'
GATEWAY_PORT = 5000
GATEWAY_CHANNELS = 'ALL'  # or list of channels
GATEWAY_SAVE_IMAGES = False
GATEWAY_IMAGE_PATH = '/tmp/images'
GATEWAY_IMAGE_URL = 'http://example.com/images/'

# watch a twitter account and bridge tweets to channels you are in
TWITTER_CONSUMER_KEY = None
TWITTER_CONSUMER_SECRET = None
TWITTER_ACCESS_TOKEN_KEY = None
TWITTER_ACCESS_TOKEN_SECRET = None
TWITTER_UPDATE_FREQ = 45
TWITTER_OUTPUT = 'ALL'
TWITTER_TWEET_FORMAT = u'>> tweet from {tweet.user.screen_name}: {tweet.text_clean} <<'
TWITTER_DISABLE_CACHE = True
TWITTER_ERR_ANNOUNCE = True
TWITTER_ERR_ANNOUNCE_FREQ = 28800
TWITTER_SOFT_LIMIT = 10

# settings for modules that use http
HTTP_TIMEOUT = 10
HTTP_AGENT = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)'
HTTP_COOKIES = True

# for django memebot integration
DJMEMEBOT_SETTINGS_FILE = '/path/to/memebot/settings.py'

# for weather underground module: note: need an api key (api.wunderground.com)
# to enable this, you must add/uncomment the module "wunderground" first.
WUNDERGROUND_API_KEY = 'FILLMEIN'
WUNDERGROUND_LANG = 'EN'
WUNDERGROUND_PREFER_METRIC = False
WUNDERGROUND_PRIMARY_ONLY = False
WUNDERGROUND_API_SCHEME = 'http'
WUNDERGROUND_API_NETLOC = 'api.wunderground.com'
WUNDERGROUND_DO_COLOR = True
WUNDERGROUND_USER_AGENT = None
WUNDERGROUND_TIMEOUT = 10
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Dream of Omnimaga

The Cemetech one has no flood control at all. Given that some CW users tend to be quite random, such lack of protection wouldn't work well over here, so I prefer that such bot has flood control from the start. Otherwise, Rick Astley will end up with six times more votes than every member combined.

ALso juju make sure that if you use Cemetech's open-source bot, that the license allows calculator websites other than Cemetech and Omnimaga to use it.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

Quote from: DJ Omnimaga on September 03, 2015, 04:11:32 AM
The Cemetech one has no flood control at all. Given that some CW users tend to be quite random, such lack of protection wouldn't work well over here, so I prefer that such bot has flood control from the start. Otherwise, Rick Astley will end up with six times more votes than every member combined.
We could do an experiment to see if it gets abused, and then it could be taken off, and set up with flood control. But if there is a list of rules drafted up, I don't think there will be much, if any flooding.
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Dream of Omnimaga

We'll see, I guess. But of course it still needs the approval of the other staff.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Unicorn

Of course.

Also, if anyone wants to check it out, go to #unicorn-uploads in efnet.
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

novenary

Just allow one person to up/downvote another only once per hour and it will be fine. Such a bot would be pretty fun actually, if it stays quiet when voting.

Dream of Omnimaga

Maybe a web page could display all votes?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

novenary

Sure. Having a webpage with channel stats would be pretty cool actually.

Unicorn

Yeah, totally, I just need to figure out how to view the database of the karma :P And I'm also not sure about how to implement karma increment delays
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

Yuki

I have my idea of a karma bot I should integrate into YukiBot.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Dream of Omnimaga

Would it use the same karma as on the forums? If that's the case, then it definitively needs flood control. Forum karma needs to remain somewhat representative of how well user contributes and negative votes should probably be kept for forums only since they are normally when people are being rude and break the rules or are not doing much effort into avoiding starting controversy or making their posts decipherable.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal