Compare commits
No commits in common. "a6967ece6f40f23d97add40b7b79d60bb5151c31" and "550a2c33e273852791b74d7325340a567e08b52d" have entirely different histories.
a6967ece6f
...
550a2c33e2
|
@ -2,7 +2,6 @@
|
||||||
import pinhook.plugin
|
import pinhook.plugin
|
||||||
import importlib
|
import importlib
|
||||||
import subprocess
|
import subprocess
|
||||||
import util.tilde
|
|
||||||
|
|
||||||
@pinhook.plugin.command('&tw',help_text='Alias -- &tildewait')
|
@pinhook.plugin.command('&tw',help_text='Alias -- &tildewait')
|
||||||
@pinhook.plugin.command('&tildewait', help_text='See how much time you have to wait for ju\'s game')
|
@pinhook.plugin.command('&tildewait', help_text='See how much time you have to wait for ju\'s game')
|
||||||
|
@ -18,7 +17,7 @@ def tilde_wait(msg):
|
||||||
usertime = timestamp
|
usertime = timestamp
|
||||||
found = True
|
found = True
|
||||||
if found:
|
if found:
|
||||||
timecalc = int(float(usertime)) + util.tilde.WAIT_TIME - int(float(importlib.import_module('time').time()))
|
timecalc = int(float(usertime)) + 60*60*4 - int(float(importlib.import_module('time').time()))
|
||||||
if timecalc > 1:
|
if timecalc > 1:
|
||||||
return pinhook.plugin.message("{}: wait {} until playing again (talking about {})".format(
|
return pinhook.plugin.message("{}: wait {} until playing again (talking about {})".format(
|
||||||
msg.nick, importlib.import_module('datetime').timedelta(seconds=timecalc), '\u200b'.join(nicktouse)
|
msg.nick, importlib.import_module('datetime').timedelta(seconds=timecalc), '\u200b'.join(nicktouse)
|
||||||
|
|
|
@ -28,8 +28,7 @@ def cleanwash_money(msg):
|
||||||
balance = Decimal(subprocess.check_output(['/home/jmjl/bin/coin','Ju','internal_balance',nick],universal_newlines=True))
|
balance = Decimal(subprocess.check_output(['/home/jmjl/bin/coin','Ju','internal_balance',nick],universal_newlines=True))
|
||||||
if balance == Decimal(0): return pinhook.plugin.message("You don't have any tildecoins with us, so you can't cleanwash")
|
if balance == Decimal(0): return pinhook.plugin.message("You don't have any tildecoins with us, so you can't cleanwash")
|
||||||
subprocess.check_output(['/home/jmjl/bin/coin','Ju','add_internal_balance',nick,f'-{str(balance)}'],universal_newlines=True).strip()
|
subprocess.check_output(['/home/jmjl/bin/coin','Ju','add_internal_balance',nick,f'-{str(balance)}'],universal_newlines=True).strip()
|
||||||
#new_balance = Decimal(randint(80,110))/Decimal(100)*Decimal(balance)
|
new_balance = Decimal(randint(80,110))/Decimal(100)*Decimal(balance)
|
||||||
new_balance = Decimal(randint(59,110))/Decimal(100)*Decimal(balance)
|
|
||||||
new_balance = new_balance.quantize(Decimal('1.'), rounding=ROUND_DOWN)
|
new_balance = new_balance.quantize(Decimal('1.'), rounding=ROUND_DOWN)
|
||||||
percentage_return = new_balance/balance * Decimal(100)
|
percentage_return = new_balance/balance * Decimal(100)
|
||||||
percentage_return = percentage_return.quantize(Decimal('.00'), rounding=ROUND_DOWN)
|
percentage_return = percentage_return.quantize(Decimal('.00'), rounding=ROUND_DOWN)
|
||||||
|
@ -41,12 +40,7 @@ def cleanwash_money(msg):
|
||||||
jackpot_now = str(jackpot + jackpot_balance)
|
jackpot_now = str(jackpot + jackpot_balance)
|
||||||
jackpotfile.write(jackpot_now)
|
jackpotfile.write(jackpot_now)
|
||||||
message = f"{msg.nick}: Cleanwashed {balance}TCN, and given the user {new_balance}TCN ({percentage_return}%) and contributed {jackpot_balance}TCN to the balance, jackpot at {jackpot_now}TCN"
|
message = f"{msg.nick}: Cleanwashed {balance}TCN, and given the user {new_balance}TCN ({percentage_return}%) and contributed {jackpot_balance}TCN to the balance, jackpot at {jackpot_now}TCN"
|
||||||
time_to_file = __import__('time').time()
|
util.tilde.admin_update_tilde(nick,amount=new_balance,time=msg.timestamp,comment=message)
|
||||||
if float(msg.time) - float(time) < 86400: # Limit gain time to 24 hours
|
|
||||||
time_to_file = float(msg.timestamp) + float(util.tilde.WAIT_TIME)
|
|
||||||
else:
|
|
||||||
time_to_file = float(msg.timestamp) - float(86400) + float(util.tilde.WAIT_TIME)
|
|
||||||
util.tilde.admin_update_tilde(nick,amount=new_balance,time=time_to_file,comment=message)
|
|
||||||
return pinhook.plugin.message(message)
|
return pinhook.plugin.message(message)
|
||||||
|
|
||||||
@pinhook.plugin.command('&brainwashreturnbeforeplaying', help_text='Alias -- &cleanwashreturnbeforeplaying')
|
@pinhook.plugin.command('&brainwashreturnbeforeplaying', help_text='Alias -- &cleanwashreturnbeforeplaying')
|
||||||
|
|
Loading…
Reference in New Issue