Esempio n. 1
0
async def daily(message, client, arguments):

    # deciding what day since epoch
    day = day_splitted_by_time(46800)

    # Checking for redeems for specific day
    redeems = users_daily_redeem_by_day(message.author.id, day)

    # Getting user points
    user_points = users_get_daily_points(message.author.id)[0]

    # Random
    amount = randint(daily_min, daily_max)

    # name
    name = author_nickanme(message.author)

    # Message
    if not redeems:
        await client.send_message(
            message.channel,
            ":moneybag: **| You redeemed your daily points worth of {} memes! You now have {} memes!**"
            .format(amount, user_points + amount))
        points_stats_insert(message.server.id, message.author.id, 2, "Daily",
                            "", "", "+" + str(amount), "", "", "", "", "", 0,
                            amount, 0)
        try:
            users_daily_redeem_by_day_add(message.author.id, name, day, amount)
        except:
            users_daily_redeem_by_day_add(message.author.id, "dailyLUL", day,
                                          amount)
        users_set_points_to_plus(amount, message.author.id)
    else:
        await client.send_message(
            message.channel,
            ":moneybag: **| Check again when the clock is `15:00`**")
Esempio n. 2
0
async def fishing(message, client, arguments):

    # Getting name
    name = author_nickanme(message.author)

    # Sending message
    temporary = await client.send_message(
        message.channel,
        ":fishing_pole_and_fish: **| {} is fishing.... (wait)**".format(name))

    # Sleep for
    randomizer_sleep = randint(100, 300)
    await asleep(randomizer_sleep)

    # GET item rand
    randomizer_item = randint(0, 400)

    # What item
    if randomizer_item <= 10:
        spot = 0
    elif randomizer_item >= 10 and randomizer_item < 50:
        spot = 1
    else:
        spot = 2

    # Picking item randomly LUL
    hand = inventory[2][randint(0, len(inventory[0]) - 1)]

    # Sending message
    await client.delete_message(temporary)
    temporary_reaction = await client.send_message(
        message.channel,
        ":fishing_pole_and_fish: **| {}, you got {}! \n\nDo you want to sell it for: {} memes**"
        .format(name, hand["name"], hand["value"]))

    # Add reactions
    for item_emoji in ["✅", "❌"]:
        await client.add_reaction(temporary_reaction, item_emoji)

    # Wait for reaction
    react_result = await client.wait_for_reaction(user=message.author,
                                                  timeout=30,
                                                  check=emoji_check)

    # Del message
    await client.delete_message(temporary_reaction)

    # If wanting to sell
    try:
        if react_result.reaction.emoji.startswith("✅"):

            # Must get at this point because updates and optimization
            users_wealth = users_get_daily_points(message.author.id)[0]

            users_set_points_to_plus(hand["value"], message.author.id)
            points_stats_insert(message.server.id, message.author.id, 4,
                                "Fishing", "", "", "+" + str(hand["value"]),
                                "", hand["display_name"], "", "", "", 0,
                                hand["value"], 0)
            msg = ":fishing_pole_and_fish: **| {}, you got: {} from fishing! \n\nYou sold it for: {} memes and now have {}**".format(
                name, hand["name"], hand["value"], users_wealth)

        # AFK or deny to sell
        else:
            msg = ":fishing_pole_and_fish: **| {}, you got {}, {} memes, but you chose to not sell it!**".format(
                name, hand["name"], hand["value"])
    except:
        msg = ":fishing_pole_and_fish: **| {}, you got {}, {} memes, but you chose to not sell it!**".format(
            name, hand["name"], hand["value"])

    # Send message
    await client.send_message(message.channel, msg)
Esempio n. 3
0
async def roll(message, client, arguments):

    for i in arguments:
        try:
            int(i)
        except:
            return

    if len(arguments) == 0:
        first_slot = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ""]
        second_slot = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
        first = str(first_slot[randint(0, 10)])
        second = str(second_slot[randint(0, 9)])
        if first == "0" and second in [
                "1", "2", "3", "4", "5", "6", "7", "8", "9"
        ]:
            first = ""
        token, meme, double, memes, tokens = "", "", False, 0, 0

        # Checking if double
        if first == second:
            double = True

        # Getting roll history
        previous = stats_roll_get_previous(message.author.id, 10)

        # Cheking if double, no history(for abuse)
        insert_meme = ""
        insert_token = ""
        info2 = ""
        win_asd = 0
        if first == second:
            info2 = "tuplat"
            if not previous:

                # Add tokens
                if randint(0, 1000) == 342:  # one in 10000
                    tokens = 1
                    users_set_tokens_to_plus(tokens, message.author.id)
                    meme = " | You have won a token from roll!"
                    insert_token = "+" + str(tokens)
                    win_asd = 1

                # Add memes
                if randint(1, 5) == 2:
                    memes = 10
                    users_set_points_to_plus(memes, message.author.id)
                    token = " | You have won a {}memes from roll!".format(
                        memes)
                    insert_meme = "+" + str(memes)
                    win_asd = 1

        # Add roll stats
        stats_roll_add(message.author.id, first, second, double, memes, tokens)
        if win_asd == 1:
            points_stats_insert(message.server.id, message.author.id, 1,
                                "Roll", "", "", insert_meme, insert_token,
                                first + second, info2, "", "", 0, 0)

        # Formatting and sending message
        letter = "**{}{}{}{}**".format(first, second, token, meme)
        await client.send_message(message.channel,
                                  "<@" + message.author.id + "> " + letter)

    elif len(arguments) == 1:
        kek = randint(1, int(arguments[0]))
        await client.send_message(message.channel,
                                  "<@" + message.author.id + "> " + str(kek))
    elif len(arguments) == 2:
        kek = randint(int(arguments[0]), int(arguments[1]))
        await client.send_message(message.channel,
                                  "<@" + message.author.id + "> " + str(kek))
    return
Esempio n. 4
0
async def shop(message, client, arguments):
    #if message.channel.id in ["404356322595962880","404356266886955009"]:
    #    return
    if message.channel.id != "404356266886955009":

        letter = "You can use shop only in #Golden Frog Casino >>> #shop When it's open"
        await client.send_message(message.channel, letter)
        return

    letter = generate_menu(message, client, arguments)

    # Sending message
    sent_1 = await client.send_message(message.channel, letter[0])

    # Confirming channel
    def confirmation(m):
        if m.channel == message.channel:
            return True
        else:
            return False

    # Making a shop loop
    while True:

        guess = await client.wait_for_message(timeout=60.0,
                                              author=message.author,
                                              check=True)
        await client.delete_message(sent_1)

        if guess is None:
            letter = ":x: **| Shop has been closed due to inactivity!**"
            sent_1 = await client.send_message(message.channel, letter)
            await asyncio.sleep(10.0)
            await client.delete_message(sent_1)
            return

        elif guess.content == "!shop":
            try:
                await client.delete_message(sent_1)
            except:
                audiovisuaali.send(
                    1, "Not able to open shop prob a restart was issued")
            return

        elif guess.content == "!exit" or guess.content == "exit":
            letter = ":x: **| You have left the shop!**"
            sent_1 = await client.send_message(message.channel, letter)
            await asyncio.sleep(10.0)
            await client.delete_message(sent_1)
            return

        elif guess.content.isdigit():

            # 1. give server group
            # 2. set memes
            # 3. set tokens
            # getting item that user wants to get
            do_stuff = letter[1][int(guess.content) - 1]
            switch_type = int(do_stuff[5])

            author_wealth_memes = mysqlfiles.users_get_points(
                message.author.id)[0]
            author_wealth_tokens = mysqlfiles.users_get_total_tokens(
                message.author.id)[0]

            if switch_type == 1:
                audiovisuaali.send(1, "State 1")
                if ((author_wealth_memes > do_stuff[2])
                        and (author_wealth_tokens > do_stuff[3])):

                    for role in message.server.roles:
                        if role.id == do_stuff[6]:
                            give_role_is = role
                    client.add_roles(message.author, give_role_is)
                    mysqlfiles.users_set_tokens_to_minus(
                        str(do_stuff[3]), message.author.id)
                    mysqlfiles.users_set_points_to_minus(
                        str(do_stuff[2]), message.author.id)
                    extra = "You have purchased role {}".format(
                        give_role_is.name)
                    letter = generate_menu(message, client, arguments, 1,
                                           extra)
                else:
                    extra = "Get more currency"

                    letter = generate_menu(message, client, arguments, 0,
                                           extra)

                sent_1 = await client.send_message(message.channel, letter[0])

            elif switch_type == 2:

                audiovisuaali.send(1, "State 2")
                if ((author_wealth_memes > do_stuff[2])
                        or (author_wealth_tokens > do_stuff[3])):

                    mysqlfiles.users_set_points_to_plus(
                        str(do_stuff[2]), message.author.id)
                    mysqlfiles.users_set_tokens_to_minus(1, message.author.id)

                    extra = "Item bought"
                    letter = generate_menu(message, client, arguments, 1,
                                           extra)

                else:
                    extra = "Get more memes"
                    letter = generate_menu(message, client, arguments, 0,
                                           extra)

                sent_1 = await client.send_message(message.channel, letter[0])

            # ITEM BUY TODO
            elif switch_type == 3:

                if author_wealth_memes < do_stuff[2]:
                    extra = "Get more memes!"
                    letter = generate_menu(message, client, arguments, 0,
                                           extra)
                    sent_1 = await client.send_message(message.channel,
                                                       letter[0])

                else:

                    mysqlfiles.users_set_points_to_minus(
                        str(do_stuff[2]), message.author.id)
                    mysqlfiles.users_set_tokens_to_plus(1, message.author.id)

                    extra = "item bought"
                    letter = generate_menu(message, client, arguments, 1,
                                           extra)

                    sent_1 = await client.send_message(message.channel,
                                                       letter[0])

            else:
                error = "Your command was not identified!1"
                letter = generate_menu(message, client, arguments, 0, error)

                sent_1 = await client.send_message(message.channel, letter[0])

        else:
            error = "Your command was not identified!2"
            letter = generate_menu(message, client, arguments, 0, error)

            sent_1 = await client.send_message(message.channel, letter[0])
Esempio n. 5
0
async def roulette(message, client, arguments):

    # Catching errors so you won't get tiemd out forever
    if 1:
    #try:

        #if not message.channel.id in ["404356322595962880"]:
        #    return
        if len(arguments) == 1:

            #VALUES
            min_points = ROULETTE_MIN_POINTS
            winrate = ROULETTE_WINRATE
            special_winrate = ROULETTE_SPECIAL_WINRATE
            rand_low = ROULETTE_RAND_LOW
            rand_high = ROULETTE_RAND_HIGH
            special_channels = ROULETTE_SPECIAL_CHANNELS

            # Variables
            multiplier_outcome_str = "" # DO NOT TOUCH
            multiplier_outcome_multiplier_str = "" # DO NOT TOUCH
            amount = arguments[0] # DO NOT TOUCH

            # Getting name
            try:
                name = message.author.nick
                if name is None:
                    name = message.author.name
            except:
                name = message.author.name

            # Getting the amount of points
            user_points = users_get_daily_points(message.author.id)[0]

            #Validating input and roulette amount
            if amount != "all":

                # all in
                all_in = False

                # Checking for k=1000 points
                if "k" in amount:
                    amount = float(arguments[0].lower().replace("k","")) * 1000

                #Checking if number
                try:
                    user_gamble = int(amount)
                except ValueError:
                    return

            # Assigning users all points for !roulette all
            else:
                user_gamble = user_points
                all_in = True

            # Checking if user gambled mreo than x aoumnt of points
            if user_gamble < min_points:
                await client.send_message(message.channel, "<@{}> **You have to gamble at least {} memes!**".format(message.author.id, min_points))
                return

            # Checking pointsif user_gamble > user_points   :
            if user_gamble > user_points:
                await client.send_message(message.channel, "<@{}> **You don't have enough memes to gamble, you need {} memes!**".format(message.author.id, user_gamble - user_points))
                return

            # Cpecial channels
            if message.channel.id in special_channels:
                if randint(1,100) > special_winrate:
                    winrate = special_winrate
                    # Creating multiplier and some other stuff
                    mvalue = float(randint(rand_low, rand_high) / 100)
                    moutcome = int(mfloor(user_gamble * mvalue - user_gamble))
                    multiplier_outcome_str = "**+" + str(moutcome) + "**"
                    multiplier_outcome_multiplier_str = "Multiplier " + str(mvalue)
                    info3 = str(mvalue)
                else:
                    info3 = ""
            else:
                info3 = ""

            info1 = ""
            info2 = ""

            # Win
            if randint(1,100) < winrate:

                # Calculations for message formation later on
                outcome_total = user_gamble # + multiplier TODO
                total_points = user_points + outcome_total

                # Adding points and logging event for user
                users_set_points_to_plus(user_gamble, message.author.id)
                #points_history_roulette_add(message.author.id, "", user_gamble, "win", all_in)

                # Determine afterfix
                if all_in:
                    win_afterfix = ":confetti_ball: :confetti_ball:"
                    info2 = "All in"
                else:
                    win_afterfix = ":confetti_ball:"

                # Creating message
                letter = "** :slot_machine:  | {}, you have won {}{} memes, you now have {} memes! {} {}** ".format(name, outcome_total, multiplier_outcome_str, total_points, win_afterfix, multiplier_outcome_multiplier_str)
                try:
                    win_str_plus = "+" + str(int(outcome_total)+int(moutcome))
                    plus = int(outcome_total)+int(moutcome)
                except:
                    win_str_plus = "+" + str(int(outcome_total))
                    plus = int(outcome_total)

                minus = 0
                info1 = "Win"
            # Lose
            else:
                info3 = ""
                # Calculations for message formation later on
                outcome_total = user_gamble # + multiplier disabled cause not fair LUL
                total_points = user_points - outcome_total

                # Adding points and logging event for user
                users_set_points_to_minus(user_gamble, message.author.id)
                #points_history_roulette_add(message.author.id, "", user_gamble, "lose", all_in)

                # Determine afterfix
                if all_in:
                    win_afterfix = "<:angery:280761870447673344>"
                    info2 = "All in"
                else:
                    win_afterfix = "<:feelsrageman:318490463323553795>"



                # Creating message
                letter = "** :slot_machine:  | {}, you have lost {} memes, you now have {} memes! {}** ".format(name, outcome_total, total_points, win_afterfix)
                win_str_plus = "-" + str(user_gamble)
                plus = 0
                minus = int(user_gamble)
                info1 = "Lose"

            points_stats_insert(message.server.id, message.author.id, 5, "Roulette", str(user_gamble), "", win_str_plus, "", info1, info2, info3, "", 0, plus, minus)

            # Sending message, checking if worth of excitement
            if user_gamble / user_points > 0.8:
                                                                    # TODO add expression system to config file
                msg = await client.send_message(message.channel, "**<:VenskerChamp:313049600984612865> Rolling **")
                await sleepS(4.0)
                await client.edit_message(msg, letter)
                return

            # if not high bet do this no excitement
            else:
                await client.send_message(message.channel, letter)
Esempio n. 6
0
async def slot_machine(message, client, arguments):

    # Checking for states
    users_points = int(users_get_points(message.author.id)[0])
    if len(arguments) == 0:
        await client.send_message(
            message.channel,
            ":slot_machine: **| You need to gamble atleast 10 memes!**")
        return

    # if not all run through letter check 1k = 1000
    if arguments[0] != "all":

        # Checking for k=1000 points
        if "k" in arguments[0]:
            arguments[0] = float(arguments[0].lower().replace("k", "")) * 1000

        #Checking if number
        try:
            arguments[0] = int(arguments[0])
        except ValueError:
            send(1, "Invalid currency or amount")
            return

    # if all set pot amount to users max points
    else:
        arguments[0] = users_points

    # checking if user has enough points to gamble
    if users_points < int(arguments[0]):
        await client.send_message(
            message.channel,
            ":slot_machine: **| You don't have enough points to gamble!**")
        return

    # Gambled more than 10 memes?
    if int(arguments[0]) < 10:
        await client.send_message(
            message.channel,
            ":slot_machine: **| You need to gamble atleast 10 memes!**")
        return

    # if user has more points than 10?
    if users_points < 10:
        await client.send_message(
            message.channel,
            ":slot_machine: **| You need to gamble atleast 10 memes!**")
        return

    # message state 1
    header1_stuff = create_slots_frame(message, 0)
    header1 = header1_stuff[1]

    # Message state 2
    header2_stuff = create_slots_frame(message, 0)
    header2 = header2_stuff[1]

    # Message state Final
    header_og = create_slots_frame(message, 1)
    kappa = header_og[0]
    header = header_og[1] + "\n"

    # values
    multiplier = 0.0
    straights = 0
    emojis = []
    """        # O O O
        # O O X
        # X X O
        if kappa[0][2] == kappa[1][2] == kappa[2][1]:
            straights += 1
            item = kappa[0][2]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # O O X
        # X X O
        # O O O
        if kappa[0][1] == kappa[1][1] == kappa[2][0]:
            straights += 1
            item = kappa[0][1]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # O O O
        # X O O
        # O X X
        if kappa[0][1] == kappa[1][2] == kappa[2][2]:
            straights += 1
            item = kappa[0][1]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # X O O
        # O X X
        # O O O
        if kappa[0][0] == kappa[1][1] == kappa[2][1]:
            straights += 1
            item = kappa[0][0]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # X X O
        # O O X
        # O O O
        if kappa[0][0] == kappa[1][0] == kappa[2][1]:
            straights += 1
            item = kappa[0][0]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # O O O
        # X X O
        # O O X
        if kappa[0][1] == kappa[1][1] == kappa[2][2]:
            straights += 1
            item = kappa[0][1]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # O O O
        # O X X
        # X O O
        if kappa[0][2] == kappa[1][1] == kappa[2][1]:
            straights += 1
            item = kappa[0][2]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # O X X
        # X O O
        # O O O
        if kappa[0][1] == kappa[1][0] == kappa[2][0]:
            straights += 1
            item = kappa[0][1]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # O X O
        # X O X
        # O O O
        if kappa[0][1] == kappa[1][0] == kappa[2][1]:
            straights += 1
            item = kappa[0][1]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # O O O
        # O X O
        # X O X
        if kappa[0][2] == kappa[1][1] == kappa[2][2]:
            straights += 1
            item = kappa[0][2]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # O O O
        # X O X
        # O X O
        if kappa[0][1] == kappa[1][2] == kappa[2][1]:
            straights += 1
            item = kappa[0][1]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)

        # X O X
        # O X O
        # O O O
        if kappa[0][0] == kappa[1][1] == kappa[2][0]:
            straights += 1
            item = kappa[0][0]
            multiplier += floor(fruit_multiplier(item)*0.2)
            header += "You've got a {} streak\n".format(item)
            emojis.append(item)"""

    # X X X
    # O O O
    # O O O
    if kappa[0][0] == kappa[1][0] == kappa[2][0]:
        straights += 1
        item = kappa[0][0]
        multiplier += fruit_multiplier(item)
        header += "You've got a {} streak\n".format(item)
        emojis.append(item)

    # O O O
    # X X X
    # O O O
    if kappa[0][1] == kappa[1][1] == kappa[2][1]:
        straights += 1
        item = kappa[0][1]
        multiplier += fruit_multiplier(item)
        header += "You've got a {} streak\n".format(item)
        emojis.append(item)

    # O O O
    # O O O
    # X X X
    if kappa[0][2] == kappa[1][2] == kappa[2][2]:
        straights += 1
        item = kappa[0][2]
        multiplier += fruit_multiplier(item)
        header += "You've got a {} streak\n".format(item)
        emojis.append(item)

    # X O O
    # O X O
    # O O X
    if kappa[0][0] == kappa[1][1] == kappa[2][2]:
        straights += 1
        item = kappa[0][0]
        multiplier += fruit_multiplier(item)
        header += "You've got a {} streak\n".format(item)
        emojis.append(item)

    # O O X
    # O X O
    # X O O
    if kappa[0][2] == kappa[1][1] == kappa[2][0]:
        straights += 1
        item = kappa[2][0]
        multiplier += fruit_multiplier(item)
        header += "You've got a {} streak\n".format(item)
        emojis.append(item)

    # Multiplier for 2 straights
    if straights == 2:
        multiplier += 5.0
    elif straights == 3:
        multiplier += 15.0

    # Multiplier
    if multiplier == 0.0:
        win_amount = arguments[0]
        win_str_plus = "-" + str(win_amount)
        minus = int(win_amount)
        plus = 0
    else:
        win_amount = floor(int(arguments[0]) * multiplier)
        if straights > 0:
            win_str_plus = "+" + str(win_amount - int(arguments[0]))
            minus = 0
            plus = win_amount - int(arguments[0])

    # gamble logging
    try:
        info1 = emojis[0]
    except:
        info1 = ""

    # gamble logging
    try:
        info2 = emojis[1]
    except:
        info2 = ""

    # gamble logging
    try:
        info3 = emojis[2]
    except:
        info3 = ""

    # Creating message
    if straights > 0:
        header += "\n:white_check_mark: **| <@{}>, you have won {} memes, you now have {} memes!**".format(
            message.author.id, str(win_amount),
            str(int(users_points) + int(win_amount)))
        users_set_points_to_plus(win_amount, message.author.id)
    else:
        header += "\n:x: **| <@{}>, you have lost {} memes, you now have {} memes!**".format(
            message.author.id, str(win_amount),
            str(int(users_points) - int(win_amount)))
        users_set_points_to_minus(win_amount, message.author.id)

    # gamble logging adding
    points_stats_insert(message.server.id, message.author.id, 8, "Slots",
                        arguments[0], "", win_str_plus, "", info1, info2,
                        info3, "", 0, plus, minus)
    # Send state 1
    sent = await client.send_message(message.channel, header1)

    # Send state 2
    await asleep(.5)
    await client.edit_message(sent, header2)

    # send state Final
    await asleep(.5)
    await client.edit_message(sent, header)