-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHDChat.py
258 lines (229 loc) · 9.16 KB
/
HDChat.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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
from tkinter import *
import os
#######################
#######################
name = 'name'
#######################
#######################
root = Tk()
root.title('HD Tools')
root.attributes("-topmost", True)
def startingmessage():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Thank you for contacting Tech Support, my name is %s.' % (name))
tkvar1.set('Start, Middle, & End')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def makingaticket():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Let me create a ticket to reference this issue.')
tkvar1.set('Start, Middle, & End')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def research():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Is it okay if I take 2 to 3 minutes to investigate your issue?')
tkvar1.set('Start, Middle, & End')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def stillresearch():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('I’m sorry. I’m still investigating your issue. Can you please give me 2 to 3 minutes more?')
tkvar1.set('Start, Middle, & End')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def anythingelse():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Is there anything else I can assist with today?')
tkvar1.set('Start, Middle, & End')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def exitmessage():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Thanks again for contacting IT Support. If you need anything else please feel free to contact us again by chat or phone (x-xxx-xxx-xxxx) if we may be of further assistance. Have a nice day.')
tkvar1.set('Start, Middle, & End')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def askremote():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('May I remote in to your machine to further assist you?')
tkvar2.set('Remote')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def remoteconfidential():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Please make sure to close confidential information on your screen before I remote in.')
tkvar2.set('Remote')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def remotestop():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Thank you, I am now disconnected from your machine.')
tkvar2.set('Remote')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def abandonresolve():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('I am sorry you will need to reopen your internet browser and navigate to http://website in order to resume this same chat session with me.')
tkvar3.set('Abandoned Chat?')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def twominutes():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('I have not heard from you for a few moments. Would you like me to keep this chat session open for you?')
tkvar3.set('Abandoned Chat?')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def fiveminutes():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Since I have not heard from you in several minutes, I am going to assume you have everything you need. Please do not hesitate to click on the chat button again if you need any further assistance. Thank You.')
tkvar3.set('Abandoned Chat?')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def pchostname():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Could I get your PC Host Name? It is located in the top right corner on your desktop.')
tkvar2.set('Remote')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
r.combobox2.current(0)
def rebootingone():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('For the next step I will need to reboot your computer.\n\nPlease be aware this chat window will disappear during the reboot. Once the reboot completes, you will need to reopen your internet browser and navigate to http://techconnect in order to resume this same chat session with me.\n\nNote: Chat history will be preserved during the reboot and will automatically reappear after you launch your browser and navigate back to http://website.')
tkvar4.set('Troubleshooting Steps')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def rebootingtwo():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Do you have any questions or concerns about the plan I described? Please let me know once you’re ready for me to execute the reboot.')
tkvar4.set('Troubleshooting Steps')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def closebrowserone():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('For the next step I will need to close your internet browser.\n\nPlease be aware this chat window will disappear once I do this but I will still be connected to your computer. After I restart your internet browser, I will take you to a webpage that will allow you to resume typing with me.')
tkvar4.set('Troubleshooting Steps')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def closebrowsertwo():
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append('Do you have any questions or concerns about the plan I described? Please let me know once you’re ready for me to close your browser window.')
tkvar4.set('Troubleshooting Steps')
r.update() # now it stays on the clipboard after the window is closed
r.destroy()
def nslookup():
os.system("start cmd /c nslookup")
tkvar5.set('Tools')
######################################################
##### Calls the function that controls the text based on to text set in tkvar1 and 2
def show1(*entry):
if tkvar1.get() == "Greeting":
startingmessage()
elif tkvar1.get() == "Make ticket":
makingaticket()
elif tkvar1.get() == "Research":
research()
elif tkvar1.get() == "Still researching":
stillresearch()
elif tkvar1.get() == "Anything else?":
anythingelse()
elif tkvar1.get() == "Close":
exitmessage()
elif tkvar2.get() == "Remote in?":
askremote()
elif tkvar2.get() == "PC Host Name":
pchostname()
elif tkvar2.get() == "Close confidential info":
remoteconfidential()
elif tkvar2.get() == "Now Disconnected":
remotestop()
elif tkvar3.get() == "2 min":
twominutes()
elif tkvar3.get() == "5 min":
fiveminutes()
elif tkvar3.get() == "10 min & Close":
abandonresolve()
elif tkvar4.get() == "Need to reboot":
rebootingone()
elif tkvar4.get() == "Okay to reboot?":
rebootingtwo()
elif tkvar4.get() == "Need to close browser":
closebrowserone()
elif tkvar4.get() == "Okay to close browser?":
closebrowsertwo()
elif tkvar5.get() == "nslookup":
nslookup()
# Create a Tkinter variable
tkvar1 = StringVar(root)
tkvar2 = StringVar(root)
tkvar3 = StringVar(root)
tkvar4 = StringVar(root)
tkvar5 = StringVar(root)
# Add a grid
mainframe = Frame(root)
mainframe.grid(column=0,row=0)
mainframe.columnconfigure(0, weight = 1)
mainframe.rowconfigure(0, weight = 1)
mainframe.pack(pady = 5, padx = 5)
# Dictionary with options
choices1 = ['Greeting', 'Make ticket', 'Research', 'Still researching', 'Anything else?', 'Close']
choices2 = ['Remote in?', 'PC Host Name', 'Close confidential info', 'Now Disconnected']
choices3 = ['2 min', '5 min', '10 min & Close']
choices4 = ['Need to reboot', 'Okay to reboot?', 'Need to close browser', 'Okay to close browser?']
choices5 = ['nslookup']
#################################################sets the function to run on click
popupMenu = OptionMenu(mainframe, tkvar1, *choices1, command=show1)
popupMenu.grid(row = 1, column = 1)
popupMenu.configure(width=20)
tkvar1.set('Start, Middle, & End')
popupMenu = OptionMenu(mainframe, tkvar2, *choices2, command=show1)
popupMenu.grid(row = 2, column = 1)
popupMenu.configure(width=20)
tkvar2.set('Remote')
popupMenu = OptionMenu(mainframe, tkvar3, *choices3, command=show1)
popupMenu.grid(row = 3, column = 1)
popupMenu.configure(width=20)
tkvar3.set('Abandoned Chat?')
popupMenu = OptionMenu(mainframe, tkvar4, *choices4, command=show1)
popupMenu.grid(row = 4, column = 1)
popupMenu.configure(width=20)
tkvar4.set('Troubleshooting Steps')
popupMenu = OptionMenu(mainframe, tkvar5, *choices5, command=show1)
popupMenu.grid(row = 5, column = 1)
popupMenu.configure(width=20)
tkvar5.set('Tools')
root.mainloop()