-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
165 lines (151 loc) · 5.36 KB
/
main.py
File metadata and controls
165 lines (151 loc) · 5.36 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#necessary imports
import time
import tkinter as tk
import random
import web_blocker
sites=[]
temp =3600
task_file=open("tasks.data","r")
task_data=task_file.read()
tasks=task_data.split(",")
def eula():
def eula_destoyer():
notice.destroy()
agreee.destroy()
eula.destroy()
main_win()
eula_file=open("eula.txt","w")
eula_file.write("eula=True")
eula_file=open("eula.txt","r")
eula_data=eula_file.read()
if eula_data[5:]=="False":
eula = tk.Tk()
eula.title("Notice")
eula.geometry("720x400")
eula.configure(bg='black')
notice=tk.Label(text='''Hello User,
Welcome to the D!sConnect !
By clicking the big button on the next page you'll be
blocking your access to social media sites until the
clock gets to zero (which'll be an hour afterwards)
There'll be no way you'll be regain access to the
sites before the clock wants you to.
So, we hope you're sporting enough to take on
our little challenge
By agreeing you're pinky promising to join us
in our grand venture to disconnect from the virtually
and do something for yourself_''',font=("Courier", 15),bg="black",fg="SpringGreen")
notice.grid(row=0+2,column=0)
agreee=tk.Button(text="Agree",command=eula_destoyer,font=("Courier", 11))
agreee.grid(row=1+2,column=0)
eula.mainloop()
else:
main_win()
def main_win():
def changer():
quote_filer=open("quotes.data","r+")
quote_data=quote_filer.read()
quote_data_sep=quote_data.split("&")
quote_count=len(quote_data_sep)
quoter["text"]=quote_data_sep[random.randint(0,quote_count-1)]
quoter.after(20000,changer)
def cntdwn():
global temp
global tasks
dcbut["state"]="disabled"
mins,secs = divmod(temp,60)
hours=0
if mins >60:
hours, mins = divmod(mins, 60)
htim["text"]=hours
mtim["text"]=mins
stim["text"]=secs
temp -= 1
win.update()
if temp%600==0:
cheat["text"]='''Your task to get a 10 min cheat = '''+tasks[random.randint(0,len(tasks)-1)]
win.update()
cheatactivator["state"]="normal"
if temp!=0:
win.after(1000,cntdwn)
else:
web_blocker.unblock()
dcbut["state"]="normal"
cheat["text"]="Congrats"
temp=3600
def cheater():
global temp
temp=temp-600
cheatactivator["state"]="disabled"
def initiater():
if fbvar.get()==1:
web_blocker.block(["facebook.com"])
if igvar.get()==1:
web_blocker.block(["instagram.com"])
if rdvar.get()==1:
web_blocker.block(["reddit.com"])
if twvar.get()==1:
web_blocker.block(["twitter.com"])
cntdwn()
win=tk.Tk()
fbvar=tk.IntVar()
igvar=tk.IntVar()
rdvar=tk.IntVar()
twvar=tk.IntVar()
win.title("D!sConnect")
win.geometry("1920x720")
win.configure(bg='black')
#quote=tk.StringVar()
quoter=tk.Label(win,text="Welcome to Project D!sConnect",bg="black",font=("Courier", 17),fg="SpringGreen")
quoter.pack()
#Checkboxes
fb=tk.Checkbutton(text="Facebook",bg="black",fg="SpringGreen",font=("Courier", 15),variable=fbvar)
fb.pack()
fb.place(x=0,y=30)
fb.toggle()
ig=tk.Checkbutton(text="Instagram",bg="black",fg="SpringGreen",font=("Courier", 15),variable=igvar)
ig.pack()
ig.place(x=0,y=60)
ig.toggle()
rd=tk.Checkbutton(text="Reddit",bg="black",fg="SpringGreen",font=("Courier", 15),variable=rdvar)
rd.pack()
rd.place(x=0,y=90)
rd.toggle()
tw=tk.Checkbutton(text="Twitter",bg="black",fg="SpringGreen",font=("Courier", 15),variable=twvar)
tw.pack()
tw.place(x=0,y=120)
tw.toggle()
#Timer
h=tk.StringVar()
m=tk.StringVar()
s=tk.StringVar()
h.set("00")
m.set("00")
s.set("00")
htim=tk.Label(text=00,bg="black",fg="SpringGreen",font=("Courier", 80))
htim.pack()
htim.place(x=650-60,y=300-80)
mtim=tk.Label(text=00,bg="black",fg="SpringGreen",font=("Courier", 80))
mtim.pack()
mtim.place(x=800-60,y=300-80)
stim=tk.Label(text=00,bg="black",fg="SpringGreen",font=("Courier", 80))
stim.pack()
stim.place(x=950-60,y=300-80)
dcbut=tk.Button(text="D!sconnect",font=("Courier", 30),command=initiater)
dcbut.pack()
dcbut.place(x=640,y=500-80)
#CheatMaker
dividor=tk.Label(text="__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________",bg="black",fg="SpringGreen")
dividor.pack()
dividor.place(x=0,y=500)
cheat=tk.Label(text="No tasks yet",bg="black",fg="SpringGreen",font=("Courier", 15))
cheat.pack()
cheat.place(x=20,y=520)
cheatactivator=tk.Button(text="I did it",font=("Courier", 20),command=cheater)
cheatactivator.pack()
cheatactivator.place(x=1350,y=520)
cheatactivator["state"]="disabled"
quoter.after(5000,changer)
win.mainloop()
if __name__ == "__main__":
eula()