After pasting the code in your Snippets JSON file, type "splashmg" to bring it up
Code: Select all
"splash msg gui": {
"prefix": "splash msg gui",
"body": [
";-------------------------------------- BEGIN ----------------- SPLASH MSG ---------------------------------------------------",
"Gui, splashmsg: New",
"Gui, splashmsg: +Labelsplashmsg -border",
"Gui, splashmsg:Font,% \"s14 c\" ${1|Orange:=\"fb8500\",Dark_Cornflower_Blue:=\"023e8a\",Linen:=\"ece4db\",Burnt_Sienna:=\"e76f51\"|}, Tahoma",
"Gui, splashmsg:color,% ${2|Antique_Brass:=\"cb997e\",Desert_Sand:=\"ddbea9\",Champagne_Pink:=\"ffe8d6\",Ash_Gray:=\"b7b7a4\",Artichoke:=\"a5a58d\",Ebony:=\"6b705c\"|}",
"Gui, splashmsg: Add, ${3|Text,Edit,ComboBox|}, % \"vtext1 xm ym w400 r$4\", % \"$5\"",
"Gui, splashmsg: Add, Button, % \"vsplashmsgbtn1 gsplashmsggoBTN xm y+10 ${8|w100,w150,w200,w250,w300,w350,w400,w450,w500|}\", % \"$6\"",
"Gui, splashmsg: Add, Button, % \"vsplashmsgbtn2 gsplashmsggoBTN x+10 ${8|w100,w150,w200,w250,w300,w350,w400,w450,w500|}\", % \"$7\"",
"; Gui, splashmsg: Add, Button, % \"vsplashmsgbtn3 gsplashmsggoBTN x+10 ${8|w100,w150,w200,w250,w300,w350,w400,w450,w500|}\", % \"Custom name\"",
"; Gui, splashmsg: Add, Button, % \"vsplashmsgbtn4 gsplashmsggoBTN x+10 ${8|w100,w150,w200,w250,w300,w350,w400,w450,w500|}\", % \"Custom name\"",
"; Gui, splashmsg: Add, Button, % \"vsplashmsgbtn5 gsplashmsggoBTN x+10 ${8|w100,w150,w200,w250,w300,w350,w400,w450,w500|}\", % \"Custom name\"",
"Gui, splashmsg: Show, Autosize",
"",
"splashmsg_guiwait:=TRUE",
"While (splashmsg_guiwait=TRUE) {",
" sleep, 10",
"}",
"Gui, splashmsg: Destroy",
"",
";----------------------BUTTON ACTIONS--------------- SPLASH MSG ---------------------------------------------------",
"Switch splashmsggoBTN {",
" Case \"splashmsgbtn1\":",
" ; do action",
"",
" Case \"splashmsgbtn2\":",
" ; do action",
"",
" Case \"splashmsgbtn3\":",
" ; do action",
"",
" Case \"splashmsgbtn4\":",
" ; do action",
"",
" Case \"splashmsgbtn5\":",
" ; do action",
"",
"}",
"; Empty all btn variables",
"",
"splashmsgbtn1:=\"\", splashmsgbtn2:=\"\", splashmsgbtn3:=\"\", splashmsgbtn4:=\"\", splashmsgbtn5:=\"\", "
"Return",
"",
";SplashmsgClose:",
";Gui, splashmsg:Destroy",
";Return",
"",
"splashmsggoBTN() {",
"global splashmsg_guiwait, SplashMsgGoBtn",
"SplashMsgGoBtn:=A_GuiControl",
"splashmsg_guiwait:=False",
"Gui, splashmsg:Destroy",
"}",
";-------------------------------------- END ----------------- SPLASH MSG ---------------------------------------------------"
],
"description": "splash msg gui with WAIT"
},
"pixel color wait": {
"prefix": "pixel color wait",
"body": [
"WinActivate, ahk_exe ${1:appname}.exe",
"CoordMode, pixel",
"CoordMode, Mouse",
"color:=\"\"",
"While !(instr(color,\"${2:9B9B9B}\")) {",
" sleep, 500",
" PixelGetColor, color, ${3:xcoord} , ${4:ycoord}",
" IF (A_Index = ${5|20,30,40,50,60,80,100|}) {",
" Msgbox,% Obj2String(\"Color not found`nLast Color:\" color) \"`n`n`nCode line #:\" A_LineNumber",
" Return",
" }",
"}",
"msgbox, Color found, press ok to click",
"Mouseclick,Left, ${3:xcoord}, ${4:ycoord},1,0",
"CoordMode,pixel,Window",
"CoordMode,Mouse,Window"
],
"description": "Wait for pixel color to appear"
},