diff --git a/.gitignore b/.gitignore index 9d90a83..56546e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ client.py *.pyc apikey.py +redditcredentials.py diff --git a/network.py b/network.py index ee735fb..efd0e08 100644 --- a/network.py +++ b/network.py @@ -2,7 +2,7 @@ import sopel.module import requests import re -networkurl = "http://api.minexmr.com:8080/stats" +networkurl = "http://node.xmrbackb.one:18081/getinfo" @sopel.module.commands('fork', 'forkening') def fork(bot, trigger): @@ -12,7 +12,7 @@ def fork(bot, trigger): except Exception,e: pass try: - height=j["network"]["height"] + height=j["height"] forkheight=1400000 if forkheight > height: bot.say("The current block height is {0:,}. Fork height is {1:,}. {2:,} blocks to go, happening in approximately {3:.2f} hours.".format(height,forkheight,forkheight-height,(forkheight-height)/30.0)) @@ -29,8 +29,8 @@ def network(bot, trigger): except Exception,e: pass try: - height=j["network"]["height"] - diff=j["network"]["difficulty"] + height=j["height"] + diff=j["difficulty"] hashrate=float(diff)/120 bot.say("The current block height is {0:,}. Difficulty is {1:,}. Hashrate is {2:.2f} Mh/s.".format(height,diff,hashrate/1e6)) except: @@ -62,3 +62,20 @@ def blocksize(bot, trigger): bot.say("Median blocksize over last 200 blocks is {0} bytes".format(size.group(1))) except: bot.say("Bomething sorked 0_0") + +@sopel.module.commands('mine') +def mine(bot, trigger): + try: + r=requests.get('https://supportxmr.com/api/network/stats') + j=r.json() + diff=float(j['difficulty']) + value=float(j['value'])/1e12 + hashrate=float(trigger.group(2)) + xmrperday=(hashrate/(diff/120))*720*value + bot.say("At {:.0f} h/s with network diff of {:.2e} and block reward {:.2f} you can expect {:.4f} XMR per day.".format(hashrate, diff, value, xmrperday)) + except: + bot.say("Mining is for suckers.") + +@sopel.module.commands('b2x') +def b2x(bot, trigger): + bot.say("Fuck off \\x") diff --git a/price.py b/price.py index c790ede..ff6ea8d 100644 --- a/price.py +++ b/price.py @@ -439,8 +439,11 @@ def tall(bot, trigger): usdcny = fixerjson['rates']['CNY'] usdeur = fixerjson['rates']['EUR'] usdjpy = fixerjson['rates']['JPY'] + usdkrw = fixerjson['rates']['KRW'] except: usdcny = 7 + usdkrw = 1100 + usdjpy = 112 # Bitstamp try: stampresult = requests.get(stampurl) @@ -484,14 +487,24 @@ def tall(bot, trigger): finexjson = False if finexjson: stringtosend += "Bitfinex last: {0:,.2f}, vol: {1:,.1f} | ".format(float(finexjson['last_price']), float(finexjson['volume'])) - # BTCC + # Bitthumb try: - btccresult = requests.get(btccurl) - btccjson = btccresult.json() + thumbresult = requests.get(thumbbtcurl) + thumbjson = thumbresult.json() + if thumbjson['data']: + pass except: - btccjson = False - if btccjson: - stringtosend += "BTCC last: {0:,.2f}, vol: {1:,.1f} | ".format(float(btccjson['ticker']['last'])/usdcny, float(btccjson['ticker']['vol'])) + thumbjson = False + if thumbjson: + stringtosend += "Bithumb last: {0:,.2f}, vol: {1:,.1f} | ".format(float(thumbjson['data']['buy_price'])/float(usdkrw), float(thumbjson['data']['volume_1day'])) + # BTCC + # try: + # btccresult = requests.get(btccurl) + # btccjson = btccresult.json() + # except: + # btccjson = False + # if btccjson: + # stringtosend += "BTCC last: {0:,.2f}, vol: {1:,.1f} | ".format(float(btccjson['ticker']['last'])/usdcny, float(btccjson['ticker']['vol'])) # Huobi try: huobiresult = requests.get(huobiurl) @@ -749,6 +762,23 @@ def gbp(bot, trigger): except: bot.say("Failed to retrieve price.") +@sopel.module.commands('inr') +def inr(bot, trigger): + # Get conversion rate + try: + fixerresult = requests.get(fixerurl) + fixerjson = fixerresult.json() + usdthb = fixerjson['rates']['INR'] + except: + usdthb = 64 + try: + r=requests.get('https://api.coinmarketcap.com/v1/ticker/monero/') + j=r.json() + price=float(j[0]['price_usd'])*usdthb + bot.say("Monero price in INR = β‚Ή{0:,.2f}".format(price)) + except: + bot.say("Failed to retrieve price.") + @sopel.module.commands('thb') def thb(bot, trigger): # Get conversion rate diff --git a/trifling.py b/trifling.py index f7c9697..2d96a2e 100644 --- a/trifling.py +++ b/trifling.py @@ -4,7 +4,7 @@ import random import re import requests import praw -from client import * +import client from threading import Timer @sopel.module.commands('4matter') @@ -54,6 +54,10 @@ def buyorsell(bot, trigger): silly_string = "Buy, buy, buy!" bot.say(silly_string) +@sopel.module.commands('cheerup') +def cheerup(bot, trigger): + bot.say('https://www.youtube.com/watch?v=NXfC16rv_fs') + @sopel.module.commands('china') def china(bot, trigger): bot.say('https://youtu.be/ZrNrleD2ZFs') @@ -100,12 +104,17 @@ def ded(bot, trigger): @sopel.module.commands('donate', 'donation') def donate(bot, trigger): - bot.say('45SkxgDmcLmW5ByS7w9AG78JuJRvCoVKCdGJWnd4US95CBUAtvdGAdM2oHgZgTGjkEAUcwdqcryM819aqdeiKxHSQC8HkmS', trigger.nick) + bot.say('XMR: 45SkxgDmcLmW5ByS7w9AG78JuJRvCoVKCdGJWnd4US95CBUAtvdGAdM2oHgZgTGjkEAUcwdqcryM819aqdeiKxHSQC8HkmS', trigger.nick) + bot.say('BTC: 14X8aMUtuxH2HWLtsNAxxN7j9uqQNUdMzB', trigger.nick) @sopel.module.commands('dump') def dump(bot, trigger): bot.say('https://www.youtube.com/watch?v=RHg8qIKJo1I') +@sopel.module.commands('encrypt') +def encrypt(bot, trigger): + bot.say("https doesn't hide the fact that i'm using https so that's why i don't use encryption because everyone is trying to crack encryption so i just don't use encryption because no one is looking at unencrypted data because everyone wants encrypted data to crack") + @sopel.module.commands('eth') def eth(bot, trigger): bot.say(u'The world computer πŸ’»πŸŒ'.encode('utf8')) @@ -151,15 +160,17 @@ def hitler(bot, trigger): @sopel.module.commands('hmm', 'hmmm') def hmm(bot, trigger): - # try: - sub=reddit.subreddit('hmmm') - posts=sub.new(limit=100) - n=random.randint(0,100) - for i, post in enumerate(posts): - if i==n: - bot.say(post.url) - # except: - # bot.say("Something something reddit's servers") + reddit = praw.Reddit(client_id=client.client_id, client_secret=client.client_secret, user_agent='asdfasdfasdfjhwrgth', username=client.username, password=client.password) + + #try: + sub=reddit.subreddit('hmmm') + posts=sub.new(limit=100) + n=random.randint(0,100) + for i, post in enumerate(posts): + if i==n: + bot.say(post.url) + #except: + # bot.say("Something something reddit's servers") herooptions = [ "https://video.twimg.com/tweet_video/DEnItJjV0AI81CK.mp4", @@ -196,9 +207,16 @@ def isittrue(bot, trigger): def jaxx(bot, trigger): bot.say(u'This command will be implemented soon. Honest. Especially if the devs can provide some unpaid assistance. Soonβ„’...') -@sopel.module.commands('joshua1234') +@sopel.module.commands('jimbell') +def jaxx(bot, trigger): + if not trigger.group(2): + bot.say(u'https://en.wikipedia.org/wiki/Jim_Bell') + else: + bot.say(u'{} has opened an assassination futures market predicting the impending demise of {}.'.format(trigger.nick, trigger.group(2))) + +@sopel.module.commands('john_alan') def joshua(bot, trigger): - bot.say(u'The first, second, third, and fourth amongst joshes.') + bot.say(u'I like smooth.') @sopel.module.commands('jwinterm') def jwinterm(bot, trigger): @@ -208,6 +226,10 @@ def jwinterm(bot, trigger): def kid(bot, trigger): bot.say(u'What up kid?') +@sopel.module.commands('koan') +def koan(bot, trigger): + bot.say("The use cases are many and varied") + @sopel.module.commands('kramer') def kramer(bot, trigger): bot.say("Waiting for a retrace to 0.007") @@ -277,6 +299,10 @@ odboptions = [ def odb(bot, trigger): bot.say(random.choice(odboptions)) +@sopel.module.commands('orff') +def orff(bot, trigger): + bot.say("O Fortuna velut luna statu variabilis, semper crescis aut decrescis; vita detestabilis nunc obdurat et tunc curat ludo mentis aciem, egestatem, potestatem dissolvit ut glaciem.") + @sopel.module.commands('pamp') def pamp(bot, trigger): bot.say("Pamp o clock yet?") @@ -302,6 +328,10 @@ def pony(bot, trigger): def primer(bot, trigger): bot.say("The point is not how much i made, point is fluffy did this on purpose, more than 10 people were in on it. His commit access needs to be revoked asap!") +@sopel.module.commands('pubg') +def pubg(bot, trigger): + bot.say("https://i.redd.it/o6o5gqmetacz.jpg") + confirmoptions = [ "I can confirm that it is true", "This is true", @@ -424,13 +454,9 @@ def trivia(bot, trigger): bot.say("No trivia for you!") -reddit=praw.Reddit(client_id=client_id, - client_secret=client_secret, - user_agent='monerobux', - username=username, - password=password) @sopel.module.commands('tinytrump') def tinytrump(bot, trigger): + reddit = praw.Reddit(client_id=client.client_id, client_secret=client.client_secret, user_agent='asdfasdfasdfjhwrgth', username=client.username, password=client.password) try: sub=reddit.subreddit('tinytrump') posts=sub.new(limit=100) @@ -474,6 +500,10 @@ urmomoptions = [ def urmom(bot, trigger): bot.say(random.choice(urmomoptions)) +@sopel.module.commands('verge', 'xvg', 'wraith') +def verge(bot, trigger): + bot.say(u"πŸ‘»πŸ• Don't wraith my dark doge bro! πŸ‘»πŸ•".encode('utf8')) + vitalikoptions = [ "https://pbs.twimg.com/media/CrWjczJXgAExF2S.jpg", "mETH, not even once: https://cdn-az.allevents.in/banners/e7df519e0808bac49fa3aaf503aff87d", @@ -484,13 +514,12 @@ vitalikoptions = [ def vitalik(bot, trigger): bot.say(random.choice(vitalikoptions)) - @sopel.module.commands('wat') def wat(bot, trigger): bot.say("https://www.destroyallsoftware.com/talks/wat") @sopel.module.commands('yoda') -def wat(bot, trigger): +def yoda(bot, trigger): bot.say("The optimism is strong in this one") @sopel.module.commands('xrp') @@ -516,6 +545,10 @@ def wave(bot, trigger): #@sopel.module.rule('[Tt]rump') #def politics(bot, trigger): # bot.reply("politics is the mind killer") + +@sopel.module.rule('.*1Dj34exPs3S9qAV1aiGAAADzbashsSVKVP*.') +def scamdouble(bot, trigger): + bot.say("{} is a scammer and bitcoin is a scam".format(trigger.nick)) @sopel.module.commands('asp') def asp(bot, trigger):