from super_bot import SuperBot, hours
from super_bot.interval import Interval
from datetime import timedelta
from pynput.keyboard import Key

bot = SuperBot()
timer = hours(8)

def press_overload():
    bot.press_key('7')

def press_loot():
    bot.press_key(' ')

overload = Interval(timedelta(seconds=330), press_overload)
loot = Interval(timedelta(seconds=70), press_loot)

bot.super_random_sleep(5000,6000)

# Prayer
bot.press_key(Key.f3)
# Book
bot.press_key('i')

while timer.ongoing():
    overload.check_and_execute()
    bot.super_random_sleep(1000,2000)
    loot.check_and_execute()
    bot.super_random_sleep(20_000,40_000)

    print(f"Time left: {timer.time_left()}")