tabnation

pipeline v1.2

Jul 4th, 2022 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.80 KB | None | 0 0
  1.  
  2. sites= Winmove|WinMaximize|WinMinimize|WinClose
  3.  
  4. ;file menu
  5. Menu, FileMenu, Add, Run F1, runnow
  6. Menu, FileMenu, Add, Clear F2, clearall
  7. Menu, FileMenu, Add,
  8. Menu, FileMenu, Add, Save Ctrl+s, savenow
  9. Menu, FileMenu, Add, Exit F12, GuiClose
  10.  
  11. ;sample menu
  12. Menu, SampleMenu, Add, Toggle If, togglesample1
  13. ;Menu, SampleMenu, Add, Toggle While, togglesample2
  14.  
  15. ;aboutmenu
  16. Menu, AboutMenu, Add, Info, infobox
  17.  
  18. ; Attach the sub-menus that were created above.
  19. Menu, MyMenuBar, Add, File, :FileMenu
  20. Menu, MyMenuBar, Add, Samples, :SampleMenu
  21. Menu, MyMenuBar, Add, About, :AboutMenu
  22.  
  23.  
  24. Gui, Menu, MyMenuBar ; Attach MyMenuBar to the GUI
  25. Gui, Add, Edit, x12 y9 w440 h350 vcodestring +Multi +WantTab,
  26. Gui, Add, Button, x12 y369 w70 h50 grunnow, RUN
  27. Gui, Add, Button, x92 y369 w70 h50 gclearall, CLEAR
  28. Gui, Add, ListBox, x462 y9 w200 h354 vcommandlookup, %sites%
  29. Gui, Add, Button, x462 y359 w90 h30 gDOCgo, DOC
  30. Gui, Add, Button, x572 y359 w90 h30 gYTgo, YT
  31. Gui, Add, Edit, x462 y399 w200 h20 gsearchchange vSearch,
  32. Gui, Add, Text, x182 y389 w260 h20 vsynhelp ginputsyn, %synhelp%
  33. Gui, Add, GroupBox, x172 y369 w280 h50 , Syntax Helper --- Click to auto fill
  34. Gui, Show, x615 y348 h432 w682, Code Tester v.1.1
  35. Return
  36.  
  37. ;==================================================
  38. ;save code
  39. ;==================================================
  40. savenow:
  41. Gui,Submit,NoHide
  42. InputBox, filename, Enter File Name, Name your file and will be saved at desktop as AHK file.
  43. FileAppend, %codestring%, %A_Desktop%\%filename%.ahk
  44. Return
  45.  
  46. ;==================================================
  47. ;syntx helper
  48. ;==================================================
  49. :*?b0:msgbox::
  50. GuiControl, , synhelp, MsgBox , Options, Title, Text, Timeout
  51. synhelp=, Options, Title, Text, Timeout
  52. Return
  53.  
  54. inputsyn:
  55. Gui,Submit,NoHide
  56. send %synhelp%
  57. Return
  58.  
  59. ;==================================================
  60. ;Sample drop down
  61. ;==================================================
  62. togglesample1:
  63. sampleshow =
  64. (
  65. Toggle := !Toggle`r
  66. If Toggle`r
  67. msgbox,T=1`r
  68. else`r
  69. msgbox,T=0`r
  70. return
  71. )
  72. clipboard = %sampleshow%
  73. msgbox, Copied to clipboard `n`n`n %sampleshow%
  74. Return
  75.  
  76. sampleshow:
  77. Gui,Submit,NoHide
  78. ;Toggle if
  79. if samplepick = Toggle If
  80. {
  81. sampleshow =
  82. (
  83. Toggle := !Toggle`r
  84. If Toggle`r
  85. msgbox,T=1`r
  86. else`r
  87. msgbox,T=0`r
  88. return
  89. )
  90. clipboard = %sampleshow%
  91. msgbox, Copied to clipboard `n`n`n %sampleshow%
  92. Return
  93. }
  94.  
  95. Return
  96.  
  97. ;==================================================
  98. ;search updater
  99. ;==================================================
  100. ; on edit change
  101. searchchange:
  102. Gui,Submit,NoHide
  103. if !(InStr(sites, commandlookup, false)) {
  104. #Persistent
  105. GuiControl, , commandlookup
  106. return
  107. }
  108. sitesArr := StrSplit(sites, "|")
  109. newArr := []
  110. newStr := ""
  111. for k,v in sitesArr
  112. {
  113. if InStr(v, Search, false)>0
  114. {
  115. newArr.push(v)
  116. }
  117. }
  118. for k,v in newArr
  119. newStr .= "|" v
  120. GuiControl, , commandlookup, % newStr
  121. GuiControl, Choose, commandlookup, 1
  122. Return
  123.  
  124. ;==================================================
  125. ;YouTube links
  126. ;==================================================
  127. YTgo:
  128. gui, submit, nohide
  129. if commandlookup = Winmove
  130. {
  131. run, "https://www.youtube.com/watch?v=bQmfe04o1uI&list=PLfHPAKSz_DJqmJJIW1P3DM9hMlaP24ivp&index=7&t=146s"
  132. }
  133. gui, submit, nohide
  134. if commandlookup = WinMaximize
  135. {
  136. run, https://www.youtube.com/watch?v=bQ
  137. }
  138. gui, submit, nohide
  139. if commandlookup = WinMinimize
  140. {
  141. run, https://www.youtube.com/watch?v=bQ
  142. }
  143. gui, submit, nohide
  144. if commandlookup = WinClose
  145. {
  146. run, https://www.youtube.com/watch?v=bQ
  147. }
  148. Return
  149.  
  150.  
  151. ;==================================================
  152. ;AHK doc links
  153. ;==================================================
  154. DOCgo:
  155. gui, submit, nohide
  156. if commandlookup = Winmove
  157. {
  158. run, https://www.autohotkey.com/docs/commands/WinMove.htm
  159. }
  160. if commandlookup = WinMaximize
  161. {
  162. run, https://www.autohotkey.com/docs/commands/WinMaximize.htm
  163. }
  164. if commandlookup = WinMinimize
  165. {
  166. run, https://www.autohotkey.com/docs/commands/WinMinimize.htm
  167. }
  168. if commandlookup = WinClose
  169. {
  170. Run, https://www.autohotkey.com/docs/commands/WinClose.htm
  171. }
  172. return
  173.  
  174. ;==================================================
  175. ;random gui contrals
  176. ;==================================================
  177. GuiClose:
  178. ExitApp
  179.  
  180. clearall:
  181. GuiControl,, codestring,
  182. GuiControl, , synhelp,
  183. Return
  184.  
  185. infobox:
  186. infoshow=
  187. (
  188. v1.1
  189. by TAB Nation
  190. Much to be done so let me know of any bugs at tadamm88@gmail.com
  191. ToDo:
  192. change between v1 and v2 code (v1 only right now)
  193. make pretty
  194. add all v1 commands to list with links
  195. add all commands to helper
  196. add syntax highlighting
  197. )
  198. msgbox, %infoshow%
  199.  
  200. ;==================================================
  201. ;test run the code
  202. ;==================================================
  203. runnow:
  204. gui, submit, nohide
  205.  
  206. ;InputBox, codestring, Enter code, Enter one line code
  207.  
  208. PipeRun(codestring)
  209. return ; End of auto-execute
  210.  
  211.  
  212. PipeRun(Script) {
  213. pipe := "\\.\pipe\AHK" A_TickCount
  214. loop 2 {
  215. pipe%A_Index% := DllCall("Kernel32\CreateNamedPipe", "Str",pipe, "UInt",2
  216. , "UInt",0, "UInt",255, "UInt",0, "UInt",0, "UInt",0, "Ptr",0)
  217. }
  218. if (pipe1 = -1 || pipe2 = -1) {
  219. ErrorLevel := -1
  220. return false ; Couldn't create pipes
  221. }
  222. Run % A_AhkPath " " pipe,, UseErrorLevel
  223. if (ErrorLevel) {
  224. ErrorLevel := -2
  225. return false ; Couldn't run the pipe
  226. }
  227. DllCall("Kernel32\ConnectNamedPipe", "Ptr",pipe1, "Ptr",0)
  228. DllCall("Kernel32\CloseHandle", "Ptr",pipe1)
  229. DllCall("Kernel32\ConnectNamedPipe", "Ptr",pipe2, "Ptr",0)
  230. if (!FileOpen(pipe2, "h", "UTF-8").Write(Script)) {
  231. ErrorLevel := -2
  232. return false ; Couldn't write to pipe
  233. }
  234. DllCall("Kernel32\CloseHandle", "Ptr",pipe2)
  235. return true
  236. }
  237.  
  238.  
Add Comment
Please, Sign In to add comment