C
C
CatRoys2020-06-05 17:35:44
Python
CatRoys, 2020-06-05 17:35:44

How to add one point to a variable every 100 messages?

Hello, I would like to make some kind of "reward system" for an asset in a conversation. So that for example every 100 messages one number is added to the "points" variable.
I'm not interested in the message count, but how to do something every 100 messages.
Here is the script that counts the messages:

if event.type == VkBotEventType.MESSAGE_NEW:
    messages = messages + 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Potato-and-Cucmber, 2020-06-05
@Potato-and-Cucmber

for event in longpoll.listen():
    if event.type == VkBotEventType.MESSAGE_NEW:
        for a in range(0, 100):
            if a >= 100:
                #Действие

Not tested

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question