Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # !/usr/bin/env python
- # -*- coding: utf-8 -*-
- import sys
- import threading
- import vk_api
- from vk_api.longpoll import VkLongPoll, VkEventType
- from vk_api.keyboard import VkKeyboard, VkKeyboardColor
- from datetime import datetime
- import random
- import time
- import os
- import pymysql.cursors
- import logging
- import vkcoin
- file_log = logging.FileHandler('Log.log')
- console_out = logging.StreamHandler()
- merchant = vkcoin.VKCoinApi(user_id=242193778, key='G7Y0tMmvqOPfXInBSYkO,JawJ42GonTpyC,7h-VV4_6aXv0Oxd') # Ваш ID и ключ
- logging.basicConfig(handlers=(file_log, console_out),
- level=logging.INFO)
- logging.basicConfig(filename="sample.log", level=logging.INFO)
- """ БД """
- def connecti():
- conn = pymysql.connect(host='127.0.0.1',
- user='root',
- password='',
- db='vkbot',
- charset='utf8mb4',
- cursorclass=pymysql.cursors.DictCursor)
- return conn
- def register(imid):
- connection = connecti()
- try:
- with connection.cursor() as cursor:
- result = cursor.execute(f"SELECT * FROM account WHERE idvk={imid}")
- row = cursor.fetchone()
- if result == 0:
- cursor.execute(f"INSERT INTO account(idvk) VALUES({imid})")
- connection.commit()
- else:
- return row
- finally:
- connection.close()
- def getdate (imid):
- connect = connecti()
- try:
- with connect.cursor() as cursor:
- result = cursor.execute(f"SELECT * FROM account WHERE idvk={imid}")
- row = cursor.fetchone()
- if result == 1:
- return row
- finally:
- connect.close()
- def savedate (imid, iq1, nickname1, job1, jobn1, timeend1, pazle1, paper1, excoins1, frac1, chees,doc,prog,sprog,atack,defend,regen,vs,statsb,vkcoin,testing):
- connect = connecti()
- try:
- with connect.cursor() as cursor:
- result = cursor.execute(f"UPDATE account SET testing={testing}, iq={iq1}, nickname='{nickname1}', job='{job1}', jobn={jobn1}, timeend={timeend1}, pazle={pazle1}, paper={paper1}, excoins={excoins1}, frac='{frac1}', chees={chees}, doc={doc}, prog = {prog}, sprog = {sprog}, atack = {atack}, defend = {defend}, regen = {regen}, vs={vs}, statsb={statsb}, vkcoin={vkcoin} WHERE idvk={imid}")
- connect.commit()
- return result
- finally:
- connect.close()
- def savedatecoin (imid, vkcoin):
- connect = connecti()
- try:
- with connect.cursor() as cursor:
- result = cursor.execute(f"UPDATE account SET vkcoin={vkcoin} WHERE idvk={imid}")
- connect.commit()
- return result
- finally:
- connect.close()
- # БД
- token = "d1e176c0a8f1e69f6e07c76b4b4a7c361a31852b348960f8867f807846f21c4608e19b6bd2b226bd8e936" #Авторизация
- vk_session = vk_api.VkApi(token=token)
- session_api = vk_session.get_api()
- longpoll = VkLongPoll(vk_session)
- def captcha_handler(captcha):
- key = input("Enter captcha code {0}: ".format(captcha.get_url())).strip()
- return captcha.try_again(key)
- # Клавиатуры
- def create_keyboard(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('Я', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('Работы', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Магазин', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Дела', color=VkKeyboardColor.DEFAULT)
- keyboard.add_button('Vkcoin', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Битва', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Казино', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Работать', color=VkKeyboardColor.DEFAULT)
- keyboard = keyboard.get_keyboard()
- return keyboard
- def create_rabota(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('Уборщик', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Дворник', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Строитель', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Архитектор', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Спасатель', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Юрист', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Дизайнер', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Разработчик', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Я', color=VkKeyboardColor.NEGATIVE)
- keyboard = keyboard.get_keyboard()
- return keyboard
- def create_dela(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('Собирать пазлы', color=VkKeyboardColor.DEFAULT)
- keyboard.add_button('Читать газету', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Играть в шахматы', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Читать техническую документацию', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Практиковаться в программировании', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Написать высоконагруженный проект', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Я', color=VkKeyboardColor.NEGATIVE)
- keyboard = keyboard.get_keyboard()
- return keyboard
- def create_magaz(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('Пистолет', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('Деревянный щит', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Пистолет - пулемёт', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('Металлический щит', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('АКМ', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('Энергетический щит', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Самонаводящяяся базука', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('Энергетическая стена', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Автоматическая пушка ', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('Щит из сверхпрочной стали', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Щит из тёмной материи', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Я', color=VkKeyboardColor.DEFAULT)
- keyboard = keyboard.get_keyboard()
- return keyboard
- def create_fractionkey(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('Фракция1', color=VkKeyboardColor.DEFAULT)
- keyboard.add_button('Фракция2', color=VkKeyboardColor.POSITIVE)
- keyboard = keyboard.get_keyboard()
- return keyboard
- def create_kazs(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('Угадай число', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('Я', color=VkKeyboardColor.DEFAULT)
- keyboard = keyboard.get_keyboard()
- return keyboard
- def create_atackkey(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('Атака', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_button('Защита', color=VkKeyboardColor.POSITIVE)
- keyboard.add_line()
- keyboard.add_button('Назад', color=VkKeyboardColor.DEFAULT)
- keyboard = keyboard.get_keyboard()
- return keyboard
- def create_nz(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('я', color=VkKeyboardColor.NEGATIVE)
- keyboard = keyboard.get_keyboard()
- return keyboard
- def create_vkcoinkey(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('Пополнить', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('Я', color=VkKeyboardColor.NEGATIVE)
- keyboard = keyboard.get_keyboard()
- return keyboard
- def kaz(stav):
- random.randint(0,100)
- def create_stav4(response):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('100', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('500', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('1000', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('5000', color=VkKeyboardColor.NEGATIVE)
- keyboard.add_line()
- keyboard.add_button('10000', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('15000', color=VkKeyboardColor.NEGATIVE)
- keyboard = keyboard.get_keyboard()
- return keyboard
- while True:
- for event in longpoll.listen():
- if event.type == VkEventType.MESSAGE_NEW:
- print(f'<{str(datetime.strftime(datetime.now(), "%H:%M:%S"))}> ({str(event.user_id)}) -> {str(event.text)}')
- response = event.text.lower()
- if event.from_user and not event.from_me and imid == event.user_id:
- if response=="100":
- def create_kaz2(response,imid):
- keyboard = VkKeyboard(one_time=True)
- keyboard.add_button('1-49', color=VkKeyboardColor.POSITIVE)
- keyboard.add_button('51-99', color=VkKeyboardColor.NEGATIVE)
- keyboard = keyboard.get_keyboard()
- return keyboard
- while True:
- for event in longpoll.listen():
- if event.type == VkEventType.MESSAGE_NEW:
- print(f'<{str(datetime.strftime(datetime.now(), "%H:%M:%S"))}> ({str(event.user_id)}) -> {str(event.text)}')
- response = event.text.lower()
- if event.from_user and not event.from_me and imid == event.user_id:
- if response == "1-49":
- am = 1
- keyboard = create_stav4(response,am)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"Выбери ставку",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- break
- elif response == "51-99":
- am = 2
- keyboard = create_stav4(response,am)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"Выбери ставку",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- break
- def noiq(imid, iqneed,iq):
- keyboard = create_rabota(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f'У вас не достаточно {iqneed-iq} IQ, чтобы его прокачать, зайдите в пункт дела', 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- """
- Основная функция
- """
- def mesed (imid, responsce):
- row = register(imid)
- row = getdate(imid)
- job = row['job']
- iq = row['iq']
- nickname = row['nickname']
- excoins = row['excoins']
- timeend = row['timeend']
- jobn = row['jobn']
- pazle = row['pazle']
- paper = row['paper']
- frac = str(row['frac'])
- chees = row['chees']
- doc = row['doc']
- prog = row['prog']
- strongprog = row['sprog']
- atack = row['atack']
- defend = row['defend']
- regen = row['regen']
- vs = row['vs']
- statsb = row['statsb']
- vkcoin = row['vkcoin']
- testing = row['testing']
- if nickname == "":
- vk_session.method('messages.send', {'user_id': event.user_id, 'message': 'У вас не установлен ник, пожалуйста введите его :) ', 'random_id': random.randint(0, 9999999999), 'captcha_handler': captcha_handler})
- nickname = "*"
- elif nickname == "*":
- nickname = response
- keyboard = create_fractionkey(response)
- vk_session.method('messages.send',{'user_id': event.user_id, 'message': ' /*Ник установлен*/ Так же, тебе надо выбрать фракцию за которую ты будешь играть ', 'keyboard': keyboard,'random_id': random.randint(0, 9999999999), 'captcha_handler': captcha_handler})
- frac = "404"
- elif frac == "404":
- vk_session.method('messages.send', {'user_id': imid, 'message': "/*Фракция выбрана*/ \n О чём игра? \n Ты уже выбрал фракцию за которую ты будешь воевать, теперь именно они твои братья. \n Каждый день в 3 часа проходит битва в которой ты должен сражаться как атакующий или защищающий \n Чтобы увеличить урон или защиту, нужно купить предметы в магазине за excoins \n Чтобы заработать деньги нужно устроиться на работу, но не все работы будут доступны тебе сразу, для некоторых работ требуется равзитие тоесть очки IQ которые можно заработать в разделе Дела. \n Ну что-ж! Начнём. Для продолжения введите Я", 'random_id': random.randint(0, 9999999999), 'captcha_handler': captcha_handler})
- if response == "фракция1":
- frac = "фракция1"
- if response == "фракция2":
- frac = "фракция2"
- else:
- keyboard = create_stav4(response)
- if response == "я":
- d1 = datetime.utcnow()
- d2 = datetime(d1.year,d1.month,d1.day,19)
- sc = round((d2-d1).total_seconds())
- mc = int(sc/60)
- hc = mc/60
- if hc < 0 and mc < 0:
- timebitva = f"Завтра в 18:00"
- elif hc < 1:
- timebitva = f"через {mc} минут"
- elif hc >=1:
- timebitva = f"через {round(hc)} часов {mc - (round(hc)*60)} минут"
- keyboard = create_keyboard(response)
- if statsb == 1:
- stb = "атаковать"
- elif statsb == 2:
- stb = "защищать"
- messa = "🔎Я, " + str(nickname) + f"\n🚧Ваша фракция {frac}"
- messa = messa + "\n\n🔥Ваша работа: " + str(job) + " \n🧬Ваш IQ: " + str(iq) + "\n💰Ваш баланс: " + str(excoins) + f" excoins | {vkcoin} vkcoins"+f"\n\n 🧰Навыки: \n\n ⚔Атака:{atack} \n 🧯Защита:{defend} \n ⚒Регенерация:{regen} \n 🔋Выносливость:{vs} \n\n 🚨Битва {timebitva} \n 🚦Вы собрались {stb}"
- vk_session.method('messages.send', {'user_id': imid, 'message': messa, 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response =="vkcoin":
- keyboard = create_vkcoinkey(response)
- vk_session.method('messages.send', {'user_id': event.user_id,
- 'message': 'Меню действий с vkcoin',
- 'keyboard': keyboard, 'random_id': random.randint(0, 9999999999),
- 'captcha_handler': captcha_handler})
- elif response == "пополнить":
- keyboard = create_nz(response)
- result = merchant.get_payment_url(amount=10, payload=78922, free_amount=True)
- vk_session.method('messages.send', {'user_id': event.user_id,
- 'message': f'Вот ваша ссылка - {result} Сумму выбирайте сами.',
- 'keyboard': keyboard, 'random_id': random.randint(0, 9999999999),
- 'captcha_handler': captcha_handler})
- elif response == "битва":
- keyboard = create_atackkey(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'Это меню битвы, выберите будите вы атаковать или защищаться\n При атаке важен навыки ⚔Атака и 🔋Выносливость \n При Защите навыки ⚒Регенерация и 🧯Защита. \n Точный алгоритм битвы засекречен, но есть смысл и атаковать и защищаться. \n А теперь выбирите, будете вы защищться или атаковать', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response == "атака":
- statsb = 1
- keyboard = create_nz(response)
- vk_session.method('messages.send', {'user_id': event.user_id,
- 'message': 'Вы установили статус битвы, чтобы вернуться нажмите Я ',
- 'random_id': random.randint(0, 9999999999),
- 'captcha_handler': captcha_handler, 'keyboard': keyboard} )
- elif response == "защита":
- statsb = 2
- keyboard = create_nz(response)
- vk_session.method('messages.send', {'user_id': event.user_id,
- 'message': 'Вы установили статус битвы, чтобы вернуться нажмите Я ',
- 'random_id': random.randint(0, 9999999999),
- 'captcha_handler': captcha_handler, 'keyboard': keyboard})
- elif response == "работы":
- keyboard = create_rabota(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': 'Работы: \n Название\iq необходимо\время\зарплата \nУборщик 0iq 1мин 1coin \nДворник 5iq 1.5 мин 3coin\nСтроитель 10iq 2мин 8сoin\nАрхитектор 30iq 2мин 10 coin\nСпасатель 50iq 2мин 20coin\nЮрист 100iq 3 мин 40coin\nДизайнер 120iq 4мин 50coin\nРазработчик 300iq 5мин 100coin', 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response == "уборщик":
- job = "уборщик"
- jobn = 1
- keyboard = create_keyboard(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'Вы устроились на работу {job}', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response == "дворник":
- if iq>=5:
- job = "дворник"
- jobn = 2
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f'Вы устроились на работу {job}', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- noiq(imid,5,iq)
- elif response == "строитель":
- if iq >= 10:
- job = "строитель"
- jobn = 3
- keyboard = create_keyboard(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'Вы устроились на работу {job}', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- noiq(imid,10,iq)
- elif response == "архитектор":
- if iq >= 30:
- job = "архитектор"
- jobn = 4
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f'Вы устроились на работу {job}', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- noiq(imid,30,iq)
- elif response == "спасатель":
- if iq >= 50:
- job = "спасатель"
- jobn = 5
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f'Вы устроились на работу {job}', 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- noiq(imid,50,iq)
- elif response == "юрист":
- if iq >= 100:
- job = "юрист"
- jobn = 6
- keyboard = create_keyboard(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'Вы устроились на работу {job}', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- noiq(imid,100,iq)
- elif response == "дизайнер":
- if iq >= 120:
- job = "дизайнер"
- jobn = 7
- keyboard = create_keyboard(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'Вы устроились на работу {job}', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- noiq(imid,120,iq)
- elif response == "разработчик":
- if iq >= 300:
- job = "разработчик"
- jobn = 8
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f'Вы устроились на работу {job}', 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- noiq(imid,300,iq)
- elif response == "дела":
- keyboard = create_dela(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f'Дела нужны чтобы прокачать ваш IQ \n 1) Собрать пазлы Стоимость: {pazle} +0.1iq \n2) Читать газету Стоимость: {paper} +0.2 iq \n3) Играть в шахматы Стоимость:{chees} +0.5iq \n4) Читать техническую документацию Стоимость: {doc} + 1iq \n5) Практиковаться в программировании Стоимость: {prog} +3iq Только при iq>50 \n6) Написать высоконагруженный проект Стоимость: {strongprog} +10 iq Только при iq>150', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response == "собирать пазлы":
- if int(excoins) >= float(pazle):
- excoins = excoins - pazle
- pazle = pazle*1.5
- iq = iq+0.1
- keyboard = create_dela(response)
- vk_session.method('messages.send',
- {'user_id': imid, 'message': f'Вы собрали пазлы для детей от 3ёх лет. Не сильно помогло вам, но эффект явно есть ;-) \n +0.1 IQ, теперь у вас {iq}',
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- keyboard = create_dela(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'У вас не хватает 💰 {pazle - excoins} excoins', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response == "играть в шахматы":
- if int(excoins) >= float(chees):
- excoins = excoins - chees
- chees = chees * 1.5
- iq = iq + 0.5
- keyboard = create_dela(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f'Вы поиграли в шахматы, +0.5 IQ, теперь у вас {iq}',
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- keyboard = create_dela(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'У вас не хватает 💰 {chees - excoins} excoins', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response == "читать газету":
- if int(excoins) >= float(paper):
- excoins = excoins - paper
- paper = paper * 1.5
- iq = iq + 0.2
- keyboard = create_dela(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f'Вы прочитали газету, там было очень много жёлтых новостей, но попались и интерестные статьи \n +0.2 IQ, теперь у вас {iq}',
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- keyboard = create_dela(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'У вас не хватает 💰 {paper - excoins} excoins ', 'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response == "читать техническую документацию":
- if int(excoins) >= float(doc):
- excoins = excoins - doc
- paper = paper * 1.5
- iq = iq + 1
- keyboard = create_dela(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f'Вы прочитали техническую документацию, может быть, не до конца всё поняли, но определённая польза всё же была \n +1 IQ, теперь у вас {iq}',
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- keyboard = create_dela(response)
- vk_session.method('messages.send',
- {'user_id': imid, 'message': f'У вас не хватает 💰 {doc - excoins} excoins',
- 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,
- 'captcha_handler': captcha_handler})
- elif response == "практиковаться в программировании":
- if iq >= 50:
- if int(excoins) >= float(prog):
- excoins = excoins - doc
- doc = doc * 1.5
- iq = iq + 3
- keyboard = create_dela(response)
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f'Вы попрактиковались в программировании и написали не сложную программку \n +3 IQ, теперь у вас {iq}',
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- keyboard = create_dela(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'У вас не хватает 💰 {doc - excoins} excoins ',
- 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,
- 'captcha_handler': captcha_handler})
- else:
- keyboard = create_dela(response)
- vk_session.method('messages.send',
- {'user_id': imid, 'message': f'Вы ещё не достаточно умны чтобы программировать нехваатет {50-iq}IQ',
- 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,
- 'captcha_handler': captcha_handler})
- elif response == "написать высоконагруженный проект":
- if iq >= 150:
- if int(excoins) >= float(strongprog):
- excoins = excoins - strongprog
- strongprog = strongprog * 1.5
- iq = iq + 7
- keyboard = create_dela(response)
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f'Вы попрактиковались в программировании и написали не сложную программу \n +7 IQ, теперь у вас {iq}',
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- else:
- keyboard = create_dela(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f'У вас не хватает 💰 {strongprog - excoins} excoins',
- 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,
- 'captcha_handler': captcha_handler})
- else:
- keyboard = create_dela(response)
- vk_session.method('messages.send',
- {'user_id': imid, 'message': f'Вы ещё не достаточно умны чтобы писать сложные программы нехваатет {150-iq}IQ',
- 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,
- 'captcha_handler': captcha_handler})
- elif response == "работать":
- gg = 0
- if timeend != 0:
- ep = datetime(1970,1,1,0,0,0)
- timegagh = (datetime.utcnow()- ep).total_seconds()
- gg = timegagh - timeend
- if jobn == 0:
- keyboard = create_keyboard(response)
- vk_session.method('messages.send',
- {'user_id': imid, 'message': "🤣🤣Сначала вы должны устроиться на работу. \n ‼ Для этого в главном меню есть пункт работы.",
- 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,
- 'captcha_handler': captcha_handler})
- if jobn == 1:
- if gg >= 60 and timeend != 0:
- keyboard = create_keyboard(response)
- excoins = int(excoins)+1
- vk_session.method('messages.send', {'user_id': imid, 'message': "+1 excoin\nЧтобы вернуться нажмите Я", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- timeend = 0
- elif gg < 60 and timeend != 0:
- keyboard = create_keyboard(response)
- endf = round(60 - gg)
- endf = int(endf)
- if endf / 60 < 1:
- mf = 0
- else:
- mf = endf / 60
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f"Вы еще не доработали, осталось {mf} минут {endf % 60} секунд",
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif timeend == 0:
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': "Вы начали работать уборщиком, это займет 1 минуту. \nВажно, чтобы получить зарплату через 1 или более минуту сного нажмите Работать", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- ep = datetime(1970,1,1,0,0,0)
- timeend = round((datetime.utcnow()- ep).total_seconds())
- elif jobn == 2:
- if gg >= 90 and timeend != 0:
- keyboard = create_keyboard(response)
- excoins = int(excoins)+5
- vk_session.method('messages.send', {'user_id': imid, 'message': "+3 excoin\nЧтобы вернуться нажмите Я", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- timeend = 0
- elif gg < 90 and timeend != 0:
- keyboard = create_keyboard(response)
- endf = round(90 - gg)
- if endf/60 < 1:
- mf = 0
- else:
- mf = endf/60
- vk_session.method('messages.send', {'user_id': imid, 'message': f"Вы еще не доработали, осталось {mf} минут {endf%60} секунд" , 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif timeend == 0:
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"Вы начали работать Дворником, это займет 1.5 минуты. \nВажно, чтобы получить зарплату через 1.5 или более минут ещё раз нажмите Работать", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- ep = datetime(1970,1,1,0,0,0)
- timeend = round((datetime.utcnow()- ep).total_seconds())
- elif jobn == 3:
- timek = 120
- if gg >= timek and timeend != 0:
- keyboard = create_keyboard(response)
- excoins = int(excoins)+8
- vk_session.method('messages.send', {'user_id': imid, 'message': "+5 excoin\nЧтобы вернуться нажмите Я", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- timeend = 0
- elif gg < timek and timeend != 0:
- keyboard = create_keyboard(response)
- endf = round(timek - gg)
- if endf / 60 < 1:
- mf = 0
- else:
- mf = endf / 60
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f"Вы еще не доработали, осталось {mf} минут {endf % 60} секунд",
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif timeend == 0:
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"Вы начали работать Строителем, это займет {timek/60} минут. \nВажно, чтобы получить зарплату через {timek/60} или более минут ещё раз нажмите Работать", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- ep = datetime(1970,1,1,0,0,0)
- timeend = round((datetime.utcnow()- ep).total_seconds())
- elif jobn == 4:
- timek = 120
- if gg >= timek and timeend != 0:
- keyboard = create_keyboard(response)
- excoins = int(excoins)+10
- vk_session.method('messages.send', {'user_id': imid, 'message': "+20 excoin\nЧтобы вернуться нажмите Я", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- timeend = 0
- elif gg < timek and timeend != 0:
- keyboard = create_keyboard(response)
- endf = round(timek - gg)
- if endf / 60 < 1:
- mf = 0
- else:
- mf = endf / 60
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f"Вы еще не доработали, осталось {mf} минут {endf % 60} секунд",
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif timeend == 0:
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"Вы начали работать Архитектором, это займет {timek/60} минут. \nВажно, чтобы получить зарплату через {timek/60} или более минут ещё раз нажмите Работать", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- ep = datetime(1970,1,1,0,0,0)
- timeend = round((datetime.utcnow()- ep).total_seconds())
- elif jobn == 5:
- timek = 120
- if gg >= timek and timeend != 0:
- keyboard = create_keyboard(response)
- excoins = int(excoins)+20
- vk_session.method('messages.send', {'user_id': imid, 'message': "+20 excoin\nЧтобы вернуться нажмите Я", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- timeend = 0
- elif gg < timek and timeend != 0:
- keyboard = create_keyboard(response)
- endf = round(timek - gg)
- if endf / 60 < 1:
- mf = 0
- else:
- mf = endf / 60
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f"Вы еще не доработали, осталось {mf} минут {endf % 60} секунд",
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif timeend == 0:
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"Вы начали работать Спасателем, это займет {timek/60} минут. \nВажно, чтобы получить зарплату через {timek/60} или более минут ещё раз нажмите Работать", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- ep = datetime(1970,1,1,0,0,0)
- timeend = round((datetime.utcnow()- ep).total_seconds())
- elif jobn == 6:
- timek = 180
- if gg >= timek and timeend != 0:
- keyboard = create_keyboard(response)
- excoins = int(excoins)+40
- vk_session.method('messages.send', {'user_id': imid, 'message': "+40 excoin\nЧтобы вернуться нажмите Я", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- timeend = 0
- elif gg < timek and timeend != 0:
- keyboard = create_keyboard(response)
- endf = round(timek - gg)
- if endf / 60 < 1:
- mf = 0
- else:
- mf = endf / 60
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f"Вы еще не доработали, осталось {mf} минут {endf % 60} секунд",
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif timeend == 0:
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"🤔Вы начали работать Юристом, это займет {timek/60} минут. \nВажно, чтобы получить зарплату через {timek/60} или более минут ещё раз нажмите Работать", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- ep = datetime(1970,1,1,0,0,0)
- timeend = round((datetime.utcnow()- ep).total_seconds())
- elif jobn == 7:
- timek = 240
- if gg >= timek and timeend != 0:
- keyboard = create_keyboard(response)
- excoins = int(excoins) + 50
- vk_session.method('messages.send',{'user_id': imid, 'message': "+50 excoin\nЧтобы вернуться нажмите Я",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- timeend = 0
- elif gg < timek and timeend != 0:
- keyboard = create_keyboard(response)
- endf = round(timek - gg)
- if endf / 60 < 1:
- mf = 0
- else:
- mf = endf / 60
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f"Вы еще не доработали, осталось {mf} минут {endf % 60} секунд",
- 'random_id': random.randint(0, 9999999999),
- 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif timeend == 0:
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid,'message': f"🤔Вы начали работать Дизайнером, это займет {timek / 60} минут. \nВажно, чтобы получить зарплату через {timek / 60} или более минут ещё раз нажмите Работать", 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- ep = datetime(1970, 1, 1, 0, 0, 0)
- timeend = round((datetime.utcnow() - ep).total_seconds())
- elif jobn == 8:
- timek = 300
- if gg >= timek and timeend != 0:
- keyboard = create_keyboard(response)
- excoins = int(excoins) + 100
- vk_session.method('messages.send',{'user_id': imid, 'message': "+50 excoin\nЧтобы вернуться нажмите Я",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- timeend = 0
- elif gg < timek and timeend != 0:
- keyboard = create_keyboard(response)
- endf = round(timek - gg)
- if endf / 60 < 1:
- mf = 0
- else:
- mf = endf / 60
- vk_session.method('messages.send', {'user_id': imid,'message': f"Вы еще не доработали, осталось {mf} минут {endf % 60} секунд",'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif timeend == 0:
- keyboard = create_keyboard(response)
- vk_session.method('messages.send', {'user_id': imid,'message': f"🤔Вы начали работать Разработчиком, это займет {timek / 60} минут. \nВажно, чтобы получить зарплату через {timek / 60} или более минут ещё раз нажмите Работать",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- ep = datetime(1970, 1, 1, 0, 0, 0)
- timeend = round((datetime.utcnow() - ep).total_seconds())
- elif response == "магазин":
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid,'message': f"Это магазин тут вы можете купить разные предметы для повышения своих навыком, они вам помогут в битве\n Предмет | Навык | Стоимость \n-----------------------------------------------\nПистолет | Атака +1 | 10 excoins\nПистолет - пулемёт | Атака +4 | 20 excoins\nАКМ | Атака +7 | 50 excoins\nАвтоматический пулемёт | Атака +13 | 100 excoins\nРПГ | Атака +20 | 1000 excoins\nСамонаводящяяся базука | Атака +25 | 5000 excoins\nАвтоматическая пушка | Атака +50 | 10000 excoins\nДеревянный щит | Защита +1 | 5 excoins\nМеталлический щит | Защита +5 | 30 excoins\nЭнергетический щит | Защита +10| 50 excoins\nЭнергетическая стена | Защита +20| 300 excoins\nЩит из сверхпрочной стали | Защита +30| 1000 excoins\nЩит из тёмной материи | Защита +55| 8500 excoins\n ",'random_id': random.randint(0, 9999999999),'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response == "пистолет":
- if excoins>=10:
- atack = atack+1
- excoins = excoins - 10
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"Вы купили пистолет +1 к ⚔атаке \n Теперь у вас Атака:{atack}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {10-excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "пистолет - пулемёт":
- if excoins >= 20:
- atack = atack + 4
- excoins = excoins - 20
- keyboard = create_magaz(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f"Вы купили Пистолет - пулемёт +4 к ⚔атаке \n Теперь у вас Атака:{atack}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {20 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "акм":
- if excoins >= 50:
- atack = atack + 7
- excoins = excoins - 50
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid,'message': f"Вы купили АКМ +7 к ⚔атаке \n Теперь у вас Атака:{atack}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {50 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard, 'captcha_handler': captcha_handler})
- elif response == "автоматический пулемёт":
- if excoins >= 100:
- atack = atack + 13
- excoins = excoins - 100
- keyboard = create_magaz(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f"Вы купили Автоматический пулемёт +13 к ⚔атаке \n Теперь у вас Атака:{atack}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {100 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "рпг":
- if excoins >= 1000:
- atack = atack + 20
- excoins = excoins - 1000
- keyboard = create_magaz(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f"Вы купили РПГ +20 к ⚔атаке \n Теперь у вас Атака:{atack}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {1000 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "самонаводящяяся базука":
- if excoins >= 5000:
- atack = atack + 25
- excoins = excoins - 5000
- keyboard = create_magaz(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f"Вы купили Самонаводящяяся базука +25 к ⚔атаке \n Теперь у вас Атака:{atack}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {5000 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "автоматическая пушка":
- if excoins >= 10000:
- atack = atack + 25
- excoins = excoins - 10000
- keyboard = create_magaz(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f"Вы купили Автоматическая пушка +20 к ⚔атаке \n Теперь у вас Атака:{atack}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {10000 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "деревянный щит":
- if excoins >= 5:
- defend = defend + 1
- excoins = excoins - 5
- keyboard = create_magaz(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f"Вы купили Деревянный щит +1 к защите \n Теперь у вас Защита:{defend}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {5 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "металлический щит":
- if excoins >= 30:
- defend = defend + 5
- excoins = excoins - 30
- keyboard = create_magaz(response)
- vk_session.method('messages.send',{'user_id': imid, 'message': f"Вы купили Металлический щит +5 к защите \n Теперь у вас Защита:{defend}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {30 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "энергетический щит":
- if excoins >= 50:
- defend = defend + 10
- excoins = excoins - 50
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f"Вы купили Энергетический щит +10 к защите \n Теперь у вас Защита:{defend}",
- 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,
- 'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {50 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "энергетическая стена":
- if excoins >= 300:
- defend = defend + 20
- excoins = excoins - 300
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f"Вы купили Энергетическая стену +20 к защите \n Теперь у вас Защита:{defend}",
- 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,
- 'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {300 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "щит из сверхпрочной стали":
- if excoins >= 1000:
- defend = defend + 30
- excoins = excoins - 1000
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid,'message': f"Вы купили Щит из сверхпрочной стали +30 к защите \n Теперь у вас Защита:{defend}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {1000 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "щит из тёмной материи":
- if excoins >= 8500:
- defend = defend + 55
- excoins = excoins - 85
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid,'message': f"Вы купили Щит из тёмной материи +55 к защите \n Теперь у вас Защита:{defend}",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- else:
- keyboard = create_magaz(response)
- vk_session.method('messages.send', {'user_id': imid, 'message': f"😰Вам не хватает {8500 - excoins} excoins ",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- elif response == "казино":
- keyboard = create_kazs(response)
- vk_session.method('messages.send', {'user_id': imid,
- 'message': f"Вы в казино, 💰💰💰 здесь можно выйграть состояние, а можно и проиграть ;-)\n 🤓Пологайтесь только на свою удачу ",
- 'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,
- 'captcha_handler': captcha_handler})
- elif response == "угадай число":
- keyboard = create_kaz2(response,imid)
- vk_session.method('messages.send', {'user_id': imid,'message': f"Выбери промежуток для выгрыша, число может выпасть от 0 до 100",'random_id': random.randint(0, 9999999999), 'keyboard': keyboard,'captcha_handler': captcha_handler})
- savedate (imid, iq, nickname, job, jobn, timeend, pazle, paper, excoins, frac, chees,doc,prog,strongprog,atack,defend,regen,vs,statsb,vkcoin,testing)
- """
- Основной цикл
- """
- @merchant.lp_handler
- def payment_received(data):
- """
- При получении платежа будет запущена эта функция. Она может называться как угодно
- :param data.to_id: Ваш ID ВКонтакте
- :param data.id: ID платежа
- :param data.created_at: Unix timestamp, время когда был совершён платёж
- :param data.from_id: ID отправителя платежа
- :param data.amount: Количество полученных VK Coin
- """
- user_id = data.to_id
- amount = data.amount
- print('Получен платёж на сумму {amount} от {user_id}'.format(amount=amount, user_id=user_id))
- row = getdate(data.from_id)
- vkcoin = row['vkcoin']
- vkcoin = vkcoin + int(data.amount)/1000
- savedatecoin(data.from_id, vkcoin)
- def traz():
- while True:
- merchant.longpoll_start(tx=[1])
- while True:
- geg = threading.Thread(target = traz)
- geg.start()
- for event in longpoll.listen():
- if event.type == VkEventType.MESSAGE_NEW:
- print(f'<{str(datetime.strftime(datetime.now(), "%H:%M:%S"))}> ({str(event.user_id)}) -> {str(event.text)}')
- response = event.text.lower()
- if event.from_user and not event.from_me:
- idid = event.user_id
- t = threading.Thread(target = mesed,name = str(idid), args = (idid, response))
- t.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement