-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
69 lines (58 loc) · 1.86 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import pyttsx3
import pyjokes
import qrcode
import random
import phonenumbers
from phonenumbers import carrier
from phonenumbers import geocoder
import pyautogui
import cv2
import numpy as np
from threading import Thread
import threading
def greetings():
engine = pyttsx3.init()
responses = [
"Hi There! I am a play bot. Very nice to meet you.",
"Wonderful, It is so nice to be in touch with you. I am a play bot.",
"Warmest Welcome! I am a play bot.",
"Having you here is really a great honour!",
"I am very delighted to have you here. I am a play bot."
]
s = random.choice(responses)+" Enter your number with '+Country_codeYour_number' Ex: +918332834979 without quotes :"
engine.say(s)
print(s)
engine.runAndWait()
def comp_name(num):
engine = pyttsx3.init()
ph=phonenumbers.parse(num)
s = "Hi "+geocoder.description_for_number(ph,'en')+"n! Are you a "+carrier.name_for_number(ph,'en')+" user. Ok then Let's play a Tic-Tac-Toe game."
print(s)
engine.say(s)
engine.runAndWait()
def Recorder():
resolution = (1920, 1080)
codec = cv2.VideoWriter_fourcc(*"XVID")
filename = "game_rec.avi"
fps = 60.0
out = cv2.VideoWriter(filename, codec, fps, resolution)
cv2.namedWindow("Live", cv2.WINDOW_NORMAL)
cv2.resizeWindow("Live", 480, 270)
while True:
img = pyautogui.screenshot()
frame = np.array(img)
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
out.write(frame)
cv2.imshow('Live', frame)
if cv2.waitKey(1) == ord('q'):
break
out.release()
cv2.destroyAllWindows()
def bot():
greetings()
num = input()
comp_name(num)
Thread(target=Recorder).start()
import game
Thread(target=game).start()
bot()