-
Notifications
You must be signed in to change notification settings - Fork 0
/
Source Code 1.4.ahk
1315 lines (969 loc) · 26.9 KB
/
Source Code 1.4.ahk
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#SingleInstance, force
#Persistent
#NoEnv
/*
-------------------------------------------------- ■ --------------------------------------------------
START
*/
/*
╔══◈*.·:·.★ ۩ ✦ ۩ ★・:・:*◈ ══╗
بسم الله الرحمن الرحيم
╚══◈*.·:·.★ ۩ ✦ ۩ ★・:・:*◈ ══╝
╔═══════════✦◈◉◈✦ ══════════╗
Surah Viewer v1.0
By Turbofan20
╚═══════════✦◈◉◈✦ ══════════╝
https://github.com/turbofan20
*/
/*
---------------------------------------------------❃---------------------------------------------------
Question Boxes
*/
AtWhenBismillah = 0
AtCoordinates = 0
blank := ""
DoNotShowRequirementsLocation := A_Temp "\DoNotShowRequirementsAgain.tmp"
if !FileExist(DoNotShowRequirementsLocation)
{
RunRequirementsMessageBox:
{
{
SetTimer, ChangeButtonNames, 0
SetTimer, MoveRequirementsBack, -500
MsgBox, 262726, Requirements, This program is written in AutoHotKey.`n`nYou need AHK to use this application.`n`nIf you do not have AHK on your system`, download it here:`n`nhttps://www.autohotkey.com/download`n`n-------------------------------------------------------------------------------`n`nAlso make sure that you have Notepad++.`n`nIf you do not have Notepad++ on your system`, download it here:`n`nhttps://notepad-plus-plus.org/downloads/`n`n▶ Ensure sure that all text files in Notepad++ are closed before using this application ◀`n`n-------------------------------------------------------------------------------`n`nPlease read Readme.txt before using Surah Viewer
IfMsgBox, Cancel ; Exit
{
ExitApp
}
IfMsgBox, TryAgain ; Don't Show Again
{
FileAppend, %blank%, %DoNotShowRequirementsLocation%, UTF-16
Goto SurahName
}
IfMsgBox, Continue ; Continue
{
Goto SurahName
}
}
ChangeButtonNames:
{
WinGetPos , Xrequirements, Yrequirements, , , Requirements, , ,
WinMove, Requirements,, 10000, 10000
IfWinNotExist, Requirements
return ; Keep waiting.
ControlSetText, Button1, Exit ; Cancel - Exit
ControlSetText, Button2, Don't Show Again ; Try Again - Don't Show Again
ControlSetText, Button3, Continue ; Continue
ControlMove, Button1,135,, ; Cancel - Exit
ControlMove, Button2,240,,150 ; Try Again - Don't Show Again
ControlMove, Button3,30,, ; Continue
SetTimer, ChangeButtonNames, Off
return
}
MoveRequirementsBack:
{
WinMove, Requirements,, Xrequirements,Yrequirements
Return
}
}
}
SurahName:
{
SetTimer, ontop, -50
InputBox, Name, Surah Viewer - by Turbofan20, What is the name of the Surah?`n`nHold F1 to select text and copy upon release`n`nPress F2 to automatically paste and move onto next prompt`n ,,,,,,locale ; 1) Input Surah Name
if ErrorLevel
ExitApp
else if (Name = "")
{
MsgBox Please enter a Surah Name
goto SurahName
}
}
SurahAHKPath := A_Desktop "\" Name ".ahk" ; Declares the location of the .ahk file and stores it in a variable
SurahEXEPath := A_Desktop "\" Name ".exe" ; Declares the (eventual) location of the .exe file and stores it in a variable
; As of yet, automatic EXE compilation of the script will not be supported until
; an adequate GUI interface is programmed in the hotkey generator
if FileExist(SurahAHKPath) ; Alerts the user if a file with the same name already exists on the desktop
{
MsgBox, 262195, Surah Viewer File already exists, The Surah Viewer file for > %Name% < already exists. `n`nAre you sure you want to overwrite it?
; ^ Asks the user if they want to procede with overwriting the existing file with new data
IfMsgBox Yes ; Procedes with writing
goto SurahLinkRequest
IfMsgBox No ; Asks the user again for a file name if they choose No
goto SurahName
IfMsgBox Cancel ; Exits the application if cancel is pressed
ExitApp
}
SurahLinkRequest:
{
MsgBox, 262180, Link?, Would you like to enter a Youtube URL for `n> %Name% < ?
IfMsgBox Yes
goto SurahLink
IfMsgBox No
goto AskNumVerses
return
}
SurahLink:
{
SetTimer, ontop, -50
Gui Font, s10, Segoe UI
Gui Add, Text, x86 y32 w392 h23 +0x200, What is the Youtube URL of %Name%?
Gui Font
Gui Add, Edit, x24 y83 w442 h21 vLink
Gui Add, Button, x24 y136 w98 h36, Continue
Gui Add, Button, x136 y136 w98 h36, Go Back
Gui Add, Button, x368 y136 w98 h36, Exit
Gui Add, Button, x248 y136 w105 h36, Do not use URL
Gui Show, w491 h190, Surah Viewer - by Turbofan20
Return
Gui, Show, w375 h175, Surah Viewer - by Turbofan20, What is the Youtube URL of %Name%?
return
msgbox %link%
buttonContinue:
Gui, submit
if (Link = "")
{
MsgBox 0x10, Error, Please enter a URL or select "Do not use URL"
gui, destroy
gosub SurahLink
return
}
else
{
gosub AskNumVerses
}
return
buttonGoBack:
Gui destroy
gosub SurahLinkRequest
return
buttonDonotuseURL:
Gui destroy
gosub AskNumVerses
return
buttonExit:
Gui destroy
exitapp
return
buttonCancel:
GuiClose:
ExitApp
}
AskNumVerses:
{
Gui, destroy
SetTimer, ontop, -50
Gui Font, s14, Segoe UI
Gui Add, Text, x0 y24 w384 h29 +0x200 +Center, How many verses are in %Name%?
Gui Font
Gui Font, s14, Segoe UI
Gui Add, Edit, vNumberOfVerses x120 y72 w126 h33
Gui Font
Gui Add, Button, gContinue x16 y128 w99 h44, Continue
Gui Add, Button, gEnterLink x136 y128 w99 h44, Enter Link
Gui Add, Button, gExit x256 y128 w99 h44, Exit
Gui Show, w372 h192, Surah Viewer - by Turbofan20
Return
Continue:
Gui, submit
if NumberOfVerses < 3
{
msgbox Number of verses must be more than or equal to 3
Gosub AskNumVerses
return
}
else if NumberOfVerses is not integer
{
msgbox Number of verses must be a whole number
Gosub AskNumVerses
return
}
else if NumberOfVerses > 286
{
msgbox Number of verses must be less than or equal to 286
Gosub AskNumVerses
return
}
else:
gosub atcoordinates
return
EnterLink:
Gui destroy
gosub SurahLink
return
Exit:
Exitapp
return
If ErrorLevel
{
exitapp
return
}
}
atcoordinates:
{
Gui, destroy
AtCoordinates = 1
}
if NumberOfVerses > 30
{
Gui, Destroy
hIconAsterisk := DllCall("user32\LoadIcon", Ptr,0, Ptr,32516, Ptr) ;IDI_ASTERISK := 32516
Gui, Add, Picture,x24 y48 w60 h60, % "HICON:" hIconAsterisk
Gui Font, s10, Segoe UI
Gui Add, Text, x105 y32 w456 h23 +0x200, Be aware that in long videos, you may not be able to accurately set the
Gui Font
Gui Font, s10, Segoe UI
Gui Add, Text, x105 y56 w456 h24 +0x200, coordinates of certain verses.
Gui Font
Gui Font, s10, Segoe UI
Gui Add, Text, x105 y88 w456 h24 +0x200, You could fix this by partitioning the video into smaller chunks, and
Gui Font
Gui Font, s10, Segoe UI
Gui Add, Text, x105 y112 w456 h24 +0x200, creating separate hotkey coordinates for those segments.
Gui Font
Gui Font, s12 q5, Segoe UI
Gui Add, Button, gContinueLargeNumVerses x27 y160 w129 h41, Continue
Gui Font
Gui Font, s12 q5, Segoe UI
Gui Add, Button, gGoBackLargeNumVerses x211 y160 w129 h41, Go Back
Gui Font
Gui Font, s12 q5, Segoe UI
Gui Add, Button, gExitLargeNumVerses x395 y160 w129 h41, Exit
Gui Font
Gui Show, w551 h228, Large Number Of Verses
Return
If ErrorLevel
{
exitapp
return
}
ExitLargeNumVerses:
ExitApp
return
GoBackLargeNumVerses:
AtCoordinates = 0
GoSub AskNumVerses
return
ContinueLargeNumVerses:
Gui, Destroy
gosub GotoWhenBismillah
return
}
GotoWhenBismillah:
{
SetTimer, EnableScreenCoordinates, -1
Settimer, OnePixelMove, -1
gosub WhenBismillah
return
}
WhenBismillah:
{
Gui, destroy
AtWhenBismillah = 1
Gui Font, s10, Segoe UI
Gui Add, Text, x8 y8 w364 h23 +0x200 +Left, What are the coordinates of Bismillah?
Gui Font
Gui Font, s10, Segoe UI
Gui Add, Text, x8 y72 w177 h23 +0x200 +Center, > Must be in the form [x, y] <
Gui Font
Gui Font, s10, Segoe UI
Gui Add, Text, x8 y40 w367 h23 +0x200 +Left, Please make sure that the video is fullscreen
Gui Font
Gui Font, s11, Segoe UI
Gui Add, Edit, vBismillahCoordinates x8 y136 w392 h27
Gui Font
Gui Font, s10, Segoe UI
Gui Add, Button, gBismillahCoordsOK x40 y176 w80 h23, OK
Gui Font, s10, Segoe UI
Gui Add, Button, gBismillahCoordsGoBack x168 y176 w80 h23, Go Back
Gui Add, Button, gBismillahCoordsExit x296 y176 w80 h23, Exit
Gui Font
Gui Font
Gui Font
Gui Font, s10, Segoe UI
Gui Add, Text, x8 y104 w268 h23 +0x200 +Left, There are %NumberOfVerses% verses in %Name%
Gui Font
Gui Show, w410 h212, Surah Viewer
WinSet, AlwaysOnTop , On, Surah Viewer
Return
if ErrorLevel
ExitApp
BismillahCoordsExit:
ExitApp
return
BismillahCoordsGoBack:
Gui, Destroy
SetTimer, Coordinateshelp, Off
Settimer, OnePixelMove, off
Tooltip
gosub AskNumVerses
return
BismillahCoordsOK:
Gui, Submit
if (BismillahCoordinates = "")
{
MsgBox Please enter the coordinates of Bismillah
Gui, Destroy
GoSub WhenBismillah
}
else
{
gosub AskCoordsOfEachVerse
return
}
return
}
AskCoordsOfEachVerse:
{
Loop
if A_index > %NumberOfVerses%
break
else
{
WhenAtVerse:
{
SetTimer, ontop, -50
InputBox, CurrentVerseCoordinates, Verse %A_Index%, What are the coordinates of Verse %A_Index%?`n`n> Must be in the form [x`, y] <`n`nPlease make sure that the video is fullscreen,,,,,,locale
if ErrorLevel
ExitApp
else if (CurrentVerseCoordinates = "")
{
MsgBox Please enter the coordinates of Verse %A_index%
goto WhenAtVerse
}
}
VerseCoords%A_Index% := CurrentVerseCoordinates
}
SendLevel 1
Send {Esc}
SendLevel 0
Goto RunTextFile
}
/*
---------------------------------------------------❃---------------------------------------------------
Subprograms
*/
/*
-------------------------❃-------------------------
Hotkeys for Word Questions
*/
F1Check:
{
#if AtWhenBismillah = 0
F1::
MouseClick, left,,, 1, 0, D ; Hold down the left mouse button.
Loop
{
Sleep, 0
if !GetKeyState("F1", "P") ; The key has been released, so break out of the loop.
break
; ... insert here any other actions you want repeated.
}
MouseClick, left,,, 1, 0, U ; Release the mouse button.
SendInput ^c
return
}
Ctrl & 1::ExitApp ; for some reason this doesn't work when it is at the bottom of the script
/*
-------------------------❃-------------------------
Hotkeys for Coordinate Questions
*/
EnableScreenCoordinates:
{
#if AtWhenBismillah = 1
Tooltip
Esc Up::
If !ON := !ON { ; Change this to "If ON := !ON" if you don't want tooltip to show on startup
SetTimer, Coordinateshelp, Off
ToolTip
Return
} Else SetTimer, Coordinateshelp, 0
Coordinateshelp:
CoordMode, Mouse, Window
MouseGetPos, A, B
CoordMode, Mouse, Screen
MouseGetPos, x, y
ToolTip , x: %x%` `ny: %y%`nF1 to copy`nF2 to paste `nWASD to move by 1 pixel`nPress x to click`nEsc to toggle this box, A+25, B+32, 1
Return
; Detects SCREEN mouse coordinates and pastes it into clipboard AFTER WORD QUESTIONS
F1 Up::
CoordMode, Mouse, Screen
MouseGetPos, x, y
Clipboard := "", Clipboard := x ", " y
ClipWait, 0
/*
If ErrorLevel
MsgBox, 48, Error , An error occurred while waiting for the clipboard.
Else MsgBox, 64, Coordinates, %Clipboard%
*/
SoundBeep, 523, 225
Return
F2:: ;THIS IS ONLY WHEN COORDINATES OF VERSES ARE NEEDED IE. AFTER THE WORD QUESTIONS
Mouseclick, left
sleep 10
SendInput ^v
sleep 10
SendInput {enter}
return
}
Ctrl & 1::ExitApp ; Ctrl + 1 to quit the application
OnePixelMove:
Hotkey, If, AtWhenBismillah = 1
Changetopixelmove:
{
#if AtWhenBismillah = 1
w::MouseMove,0,-1,0,R ;Moves the mouse cursor 1 pixel down from its current position.
a::MouseMove,-1,0,0,R ;Moves the mouse cursor 1 pixel left from its current position.
s::MouseMove,0,1,0,R ;Moves the mouse cursor 1 pixel up from its current position.
d::MouseMove,1,0,0,R ;Moves the mouse cursor 1 pixel right from its current position.
x::MouseClick
}
ontop:
WinSet, AlwaysOnTop, On, A
return
/*
---------------------------------------------------❃---------------------------------------------------
Opens up Notepad to display the hotkeys and other information
*/
RunTextFile:
{
SetTimer, Coordinateshelp, Off
Tooltip
TempFileforTextHotkeys := A_Temp "\tempfile4surahgen.txt" ; This is where the temporary file will be made
if !FileExist(TempFileforTextHotkeys)
FileAppend, %blank%, %TempFileforTextHotkeys%, UTF-16
if FileExist(TempFileforTextHotkeys)
FileDelete, %TempFileforTextHotkeys%
FileAppend, %blank%, %TempFileforTextHotkeys%, UTF-16
SetTitleMatchMode, 2
sleep 150
FileDelete, %SurahAHKPath%
sleep 200
IfWinExist Notepad++
MsgBox, 262193, Close all text files, Make sure that all text files in Notepad++ are closed
ifMsgBox, Cancel
ExitApp
WinKill Notepad++
sleep 100
WinMinimizeAll
sleep 250
Run, %TempFileforTextHotkeys%,,Max
sleep 50
}
/*
---------------------------------------------------❃---------------------------------------------------
Checks if the text file is open before writing
*/
active = 0
while active = 0 ; Uses a condition instead of a timer
{
if WinActive(TempFileforTextHotkeys)
{
active = 1
goto DeleteEverythingInFile
}
else
{
SetTitleMatchMode, 2
WinActivate, tempfile4surahgen
}
}
/*
---------------------------------------------------❃---------------------------------------------------
Text Contents of Generated File
*/
DeleteEverythingInFile:
{
SendInput ^{a}
SendInput {Backspace}
sleep 20
}
clipboard =
(
/*
-------------------------------------------------- ■ --------------------------------------------------
START
*/
/*
╔══◈*.·:·.★ ۩ ✦ ۩ ★・:・:*◈ ══╗
بسم الله الرحمن الرحيم
╚══◈*.·:·.★ ۩ ✦ ۩ ★・:・:*◈ ══╝
╔═══════════✦◈◉◈✦══════════╗
Surah Viewer
By Turbofan20
╚═══════════✦◈◉◈✦══════════╝
https://github.com/turbofan20
*/
/*
----------------------------------------------------
Surah Name : %Name%
----------------------------------------------------
*/
#SingleInstance, force
#Persistent
#NoEnv
SetDefaultMouseSpeed 0
SetMouseDelay 1
/*
---------------------------------------------------❃---------------------------------------------------
Instant Changeable Hotkey Settings
*/
TurnBeepOn = True
VerseNumberHotkeyLevel = 0
GoSub, AskOpeninBrowser ; GoSub, AskOpeninBrowser
InstantHotkeysAndBeeps:
{
CoordMode, Mouse, Screen
BeepFrequency = 600
BeepDuration = 125
F1::
Tooltip
MouseClick, left, `%A`%, `%B`%
;SoundBeep, , BeepDuration
return
F2::
Tooltip
MouseClick, left, `%C`%, `%D`%
;SoundBeep, , BeepDuration
return
F3::
Tooltip
MouseClick, left, `%E`%, `%F`%
;SoundBeep, , BeepDuration
return
F4::
Tooltip
MouseClick, left, `%G`%, `%H`%
;SoundBeep, , BeepDuration
return
F5::
MouseGetPos, A, B
if TurnBeepOn = True
{
SoundBeep, BeepFrequency+400, BeepDuration
return
}
else
return
F6::
MouseGetPos, C, D
if TurnBeepOn = True
{
SoundBeep, BeepFrequency+150, BeepDuration
return
}
else
return
F7::
MouseGetPos, E, F
if TurnBeepOn = True
{
SoundBeep, BeepFrequency, BeepDuration
return
}
else
return
F8::
MouseGetPos, G, H
if TurnBeepOn = True
{
SoundBeep, BeepFrequency-200, BeepDuration
return
}
else
return
return
}
/*
---------------------------------------------------❃---------------------------------------------------
Other Hotkeys
*/
x::MouseClick
a::MouseMove,-1,0,0,R ;Moves the mouse cursor 1 pixel left from its current position.
d::MouseMove,1,0,0,R ;Moves the mouse cursor 1 pixel right from its current position.
^!s::
Suspend
if (A_IsSuspended)
{
settimer, SuspendedTooltip, 20
SetTimer, GlossaryCorner, Off
Tooltip, , , , 2
Tooltip, , , , 3
SetTimer, ShowHotkeyNumberLevel, Off
SuspendedTooltip:
{
MouseGetPos, x, y, Screen
Tooltip, Script is suspended``nPress Ctrl+Alt+S to reactivate hotkeys, (x+37), (y-5), 1
return
}
}
else
{
settimer, SuspendedTooltip, off
settimer, SuspendedTooltipOff, 20
settimer, getridofsuspend, -1000
SuspendedTooltipOff:
{
MouseGetPos, x, y, Screen
Tooltip, Hotkeys Activated, (x+37), (y-5), 1
return
}
getridofsuspend:
{
settimer, SuspendedTooltipOff, off
Tooltip, , , , 1
}
if GlossaryOn = True
GlossaryOn = False
else
GlossaryOn = True
gosub NumpadAdd
return
}
return
/*
---------------------------------------------------❃---------------------------------------------------
Toggle Beep Sounds
*/
Pause::
{
if TurnBeepOn = True
{
TurnBeepOn = False
return
}
else if TurnBeepOn = False
{
TurnBeepOn = True
return
}
}
/*
---------------------------------------------------❃---------------------------------------------------
Question boxes
*/
AskOpeninBrowser:
{
Link = %Link%
if (Link = "")
{
Goto NoPressed
}
MsgBox, 262179, Open in browser?, Would you like to open > %Name% < in your default browser?
IfMsgBox Yes
{
Run, `%Link`%
Goto YesPressed
}
IfMsgBox No
Goto NoPressed
IfMsgBox Cancel
ExitApp
}
/*
---------------------------------------------------❃---------------------------------------------------
Tooltip Guides
*/
/*
-------------------------❃-------------------------
Initial Tooltip
*/
/*
---------------------------------------------------
If "Yes" was pressed
*/
YesPressed:
{
firstdone = 0
TimeForInitialTooltip := 1000*( 5.5 ) ; Number in brackets indicates how long the initial tooltip will last for in seconds
SetTimer, InitialTooltipTimerWhenYesIsPressed, -`%TimeForInitialTooltip`%
; ▶✦◀ alhamdulillah
IfMsgBox Yes
{
Loop
{
CoordMode, Mouse, Window
MouseGetPos, x, y
Tooltip, -----------▶ Surah Viewer ◀------------``n``n-----------▶ By Turbofan20 ◀-----------``n``n■ Press Ctrl + 1 to exit when finished ■``n``n > Loading Video and Settings... <,(x+30), (y-10), 1
} Until firstdone = 1 ; does not close the initial tooltip until "first done" is equal to 1,
; which will happen after 5.5 seconds (cf. TimeForInitialTooltip - Line 190)
; This is a custom timer that had to be made because tooltip doesn't have one built in (but msgBox does for some reason)
return
}
InitialTooltipTimerWhenYesIsPressed:
{
firstdone = 1
}
gosub OpenGlossaryUponStartup
return
}
/*
---------------------------------------------------
If "No" was pressed
*/
NoPressed:
{
Countdown = 4
(IfMsgBox No) OR (Link = "")
{
TooltipForNo:
{
Loop
{
CoordMode, Mouse, Window
MouseGetPos, x, y
Tooltip, -----------▶ Surah Viewer ◀------------``n``n-----------▶ By Turbofan20 ◀-----------``n``n■ Press Ctrl + 1 to exit when finished ■``n``n > `%Countdown`% <,(x+30), (y-10), 1
sleep 20
if Countdown > 3
gosub Timer
}
until countdown = -1
Tooltip
gosub OpenGlossaryUponStartup
}
Timer:
{
{
SetTimer, DecreaseTimer, 1000
}
DecreaseTimer:
{
Countdown -= 1
return
}
}
}
}
/*
-------------------------❃-------------------------
Tooltip Guide Settings
*/
OpenGlossaryUponStartup:
{
goto NumpadAdd
}
NumpadAdd::
{
if GlossaryOn = True
GlossaryOn = False
else
GlossaryOn = True
{
gosub Glossary
return
}
return
}
Glossary:
{