Advertisement
Najeebsk

ALL-TESTER.ahk

Oct 27th, 2022
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. #SingleInstance, Force
  3. SetTitleMatchMode, 2
  4. FileInstall , C:\Users\Najeeb\Desktop\APP\ALL-TESTER.ahk,ALL-TESTER.ahk
  5. FileSetAttrib +HS, %A_ScriptDir%\ALL-TESTER.ahk, 2
  6. ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  7. OnExit, GuiClose
  8. GuiShowFlag := 1
  9. Gui, Font, S12 CDefault Bold, Times New Roman
  10. Gui, Add, Edit, x22 y60 w640 h370 vTempCode WantCtrlA, Input code here
  11. Gui, Font, S24 CRed Bold, Times New Roman
  12. Gui, Add, Text, x92 y10 w490 h40 +Center, Najeeb Input Test Code
  13. Gui, Font, S12 CDefault Bold, Times New Roman
  14. Gui, Add, Button, x362 y435 w100 h30 gTestTempCode, Test AHK
  15. Gui, Add, Button, x462 y435 w100 h30 gTestBatch, Test Batch
  16. Gui, Add, Button, x562 y435 w100 h30 gTestAutoIt, Test AutoIt
  17. Gui, Add, Button, x262 y435 w100 h30 gTestVBS, Test VBS
  18. Gui, Add, Button, x123 y435 w100 h30 gEndTest, End TestCode
  19. Gui, Add, Button, x22 y435 w100 h30 gClearTempCode, Clear Code
  20. Gui, Show, x127 y87 h480 w680, RealTime Najeeb Code Tester
  21. Return
  22. $F1::
  23. KeyWait, F1, T.5
  24. If !ErrorLevel
  25. {
  26. Send, {F1}
  27. return
  28. }
  29. If (GuiShowFlag = 1)
  30. {
  31. Gui, Hide
  32. GuiShowFlag--
  33. }
  34. Else If (GuiShowFlag = 0)
  35. {
  36. Gui, Show
  37. GuiShowFlag++
  38. }
  39. KeyWait, F1
  40. return
  41. $F11::
  42. KeyWait, F11, T1
  43. If !ErrorLevel
  44. {
  45. Send, {F11}
  46. return
  47. }
  48. EndTest:
  49. PostMessage("Slave script", 1)
  50. TrayTip, Status:, Test code ended and deleted.
  51. KeyWait, F11
  52. return
  53. ClearTempCode:
  54. GuiControl,, TempCode,
  55. return
  56. GuiClose:
  57. PostMessage("Slave script", 1)
  58. ExitApp
  59. $F12::
  60. KeyWait, F12, T1
  61. If !ErrorLevel
  62. {
  63. Send, {F12}
  64. return
  65. }
  66. GuiControl,, TempCode,
  67. Sleep 200
  68. Clipsave := ClipboardAll
  69. Send, ^c
  70. GuiControl,, TempCode, %Clipboard%
  71. Clipboard := Clipsave
  72. TestTempCode:
  73. DetectHiddenWindows, On
  74. If Winexist("TempTestCode.ahk")
  75. {
  76. PostMessage("Slave script", 1)
  77. }
  78. DetectHiddenWindows, Off
  79. Gui, Submit, NoHide
  80. FileAppend,
  81. (
  82. #Persistent
  83. #SingleInstance, Force
  84. Progress, m2 b fs13 Y0 zh0 WMn700, Test script is running
  85. Gui 99: show, hide, Slave script ; hidden message receiver window
  86. OnMessage(0x1001,"ReceiveMessage")
  87. %TempCode%
  88. return
  89.  
  90. ReceiveMessage(Message) {
  91.    if Message = 1
  92.    ExitApp
  93. }
  94. ), %A_ScriptDir%\TempTestCode.ahk
  95. Run, %A_ProgramFiles%\AutoHotkey\AutoHotkey.exe "%A_ScriptDir%\TempTestCode.ahk"
  96. Sleep, 100
  97. IfWinExist, ahk_class #32770
  98. {
  99. Sleep 20
  100. WinActivate, ahk_class #32770
  101. Clipsave := ClipboardAll
  102. Send, ^c
  103. CheckWin := Clipboard
  104. Clipboard := Clipsave
  105. IfInString, CheckWin, The program will exit.
  106. {
  107. IfExist, %A_ScriptDir%\TempTestCode.ahk
  108. FileDelete, %A_ScriptDir%\TempTestCode.ahk
  109. TrayTip, ERROR, Error executing the code properly
  110. return
  111. }
  112. }
  113. TrayTip, Status:, Test code is now running on your machine.
  114. return
  115. PostMessage(Receiver, Message) {
  116. oldTMM := A_TitleMatchMode, oldDHW := A_DetectHiddenWindows
  117. SetTitleMatchMode, 3
  118. DetectHiddenWindows, on
  119. PostMessage, 0x1001,%Message%,,, %Receiver% ahk_class AutoHotkeyGUI
  120. SetTitleMatchMode, %oldTMM%
  121. DetectHiddenWindows, %oldDHW%
  122. IfExist, %A_ScriptDir%\TempTestCode.*
  123. FileDelete, %A_ScriptDir%\TempTestCode.*
  124. }
  125. TestVBS:
  126. Gui, Submit, NoHide
  127. GuiControl,, TempCode, %Clipboard%
  128. Clipboard := Clipsave
  129. FileAppend, %TempCode%, TempTestCode.vbs
  130. Run, TempTestCode.vbs
  131. return
  132. TestBatch:
  133. Gui, Submit, NoHide
  134. GuiControl,, TempCode, %Clipboard%
  135. Clipboard := Clipsave
  136. FileAppend, %TempCode%, TempTestCode.bat
  137. Run, TempTestCode.bat
  138. return
  139. TestAutoIt:
  140. Gui, Submit, NoHide
  141. GuiControl,, TempCode, %Clipboard%
  142. Clipboard := Clipsave
  143. FileAppend, %TempCode%, TempTestCode.au3
  144. Run, TempTestCode.au3
  145. Return
  146. ;-=-=-=-=-=-=-=-END-=-=-=-=-=-=-=-=-
  147. #R::Reload  ;<--  ~ Reload Script ~
  148. #S::Suspend ;<--  ~ Suspend Script ~
  149. #P::Pause   ;<--  ~ Pause Script ~
  150. #M::WinMinimize, ;<--  ~ Minimize Script ~
  151. ESC::ExitApp     ;<--  ~ Exit Script ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement