Created
August 10, 2016 09:31
-
-
Save Onurtag/0590fff4b857c48dafaf5987ea6a63b5 to your computer and use it in GitHub Desktop.
Show a splash screen with a text message every x minutes for x seconds. With fade effect.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NoEnv | |
#SingleInstance Force | |
SetWorkingDir %A_ScriptDir% | |
;YOU GOTTA EDIT THE TEXT IN THE SCRIPT. | |
Timer := 30 | |
KillTimer := 3 | |
PopupText := "NOT WORKING, ADJUST IT MANUALLY" | |
Poppingup := 0 | |
savetoini := 1 | |
Transparency := 50 | |
Menu, Tray, Icon,,, 1 | |
Menu, Tray, NoStandard | |
Menu, Tray, Add, TPopup Wizard, theWizard | |
Menu, Tray, Add, Start Popup Timer, TogglePopups | |
Menu, Tray, Add, Exit, Exited | |
Menu, Tray, Tip, TPopup | |
Menu, Tray, Default, TPopup Wizard | |
IfExist, TPopup.ini | |
{ | |
IniRead, PopupText, TPopup.ini, TPopup, PopupText | |
IniRead, Timer, TPopup.ini, TPopup, Timer | |
IniRead, KillTimer, TPopup.ini, TPopup, KillTimer | |
} | |
Gosub, TogglePopups | |
;WizardGui() | |
Return | |
theWizard: | |
WizardGui() | |
Return | |
WizardGui() | |
{ | |
Global | |
Gui, Wizard: Destroy | |
Gui, Wizard: Color, 292929 | |
Gui, Wizard: Font, s14 c836DFF bold, Segoe UI | |
Gui, Wizard: Add, Text, x242 y12, TPopup Wizard | |
Gui, Wizard: Font, s10 norm | |
Gui, Wizard: Add, Text, x70 y76 h13, Popup Text: | |
Gui, Wizard: Add, Text, x70 y106 h13, Timer (Seconds): | |
Gui, Wizard: Add, Text, x70 y136 h13, Kill Popup Timer (Seconds): | |
Gui, Wizard: Font, s10 bold | |
Gui, Wizard: Add, Edit, x250 y75 w315 h20 vPopupText Disabled, %PopupText% | |
Gui, Wizard: Add, Edit, x250 y105 w84 h20 vTimer, %Timer% | |
Gui, Wizard: Add, Edit, x250 y135 w84 h20 vKillTimer, %KillTimer% | |
Gui, Wizard: Font, s9 cDCDCCC norm | |
Gui, Wizard: Add, Checkbox, x430 y215 Checked%savetoini% vsavetoini, Save to .ini | |
Gui, Wizard: Font, s10 cDCDCCC norm bold | |
if (Poppingup) | |
{ | |
Gui, Wizard: Add, Button, x237 y191 w164 h66 vToggleButton gTogglePopups, Stop TPopup Timer | |
} else { | |
Gui, Wizard: Add, Button, x237 y191 w164 h66 vToggleButton gTogglePopups, Start TPopup Timer | |
} | |
Gui, Wizard: Show, w640 h290, TPopup Wizard | |
} | |
TogglePopups: | |
Gui, Submit, NoHide | |
if (savetoini) | |
{ | |
IniWrite, %PopupText%, TPopup.ini, TPopup, PopupText | |
IniWrite, %Timer%, TPopup.ini, TPopup, Timer | |
IniWrite, %KillTimer%, TPopup.ini, TPopup, KillTimer | |
} | |
if (Poppingup) | |
{ | |
KillPopups() | |
GuiControl, , ToggleButton, Start Popup Timer | |
Menu, Tray, Rename, Stop Popup Timer, Start Popup Timer | |
} else { | |
Poppingup := 1 | |
Popup() | |
GuiControl, , ToggleButton, Stop Popup Timer | |
Menu, Tray, Rename, Start Popup Timer, Stop Popup Timer | |
} | |
Return | |
Popup() | |
{ | |
Global | |
if (Poppingup) | |
{ | |
MSTimer := Timer*1000 | |
SetTimer, Popup, %MSTimer% | |
} else { | |
} | |
PopupWindow() | |
Return | |
} | |
WizardGuiEscape: | |
Gui, Wizard: Destroy | |
Return | |
/* | |
F11:: | |
ListVars | |
Return | |
*/ | |
PopupWindow() | |
{ | |
Global | |
Gui, Popup: Destroy | |
Gui, Popup: +AlwaysOnTop -Caption +ToolWindow | |
Gui, Popup: Color, 292929 | |
Gui, Popup: Font, s24 c836DFF, Meiryo | |
Gui, Popup: Add, Text, x100 y44, What Are You ;MANUALLY ADJUST TEXT | |
Gui, Popup: Add, Text, x46 y88, Doing Right Now? ;MANUALLY ADJUST TEXT | |
Gui, Popup: Show, w300 h180 NoActivate, PopupTPopup | |
Transparency := 16 | |
WinSet, Transparent, %Transparency%, PopupTPopup | |
TransparencyUp() | |
CheckActive() | |
MSKillTimer := KillTimer*1000 | |
SetTimer, KillPopupWindow, %MSKillTimer% | |
} | |
CheckActive() | |
{ | |
IfWinActive, PopupTPopup | |
{ | |
SetTimer, TransparencyUp, Off | |
SetTimer, CheckActive, Off | |
KillPopupWindow() | |
} else { | |
SetTimer, CheckActive, 75 | |
} | |
} | |
TransparencyUp() | |
{ | |
Global | |
Transparency += 4 | |
WinSet, Transparent, %Transparency%, PopupTPopup | |
if (Transparency > 236) { | |
SetTimer, TransparencyUp, Off | |
} else { | |
SetTimer, TransparencyUp, 10 | |
} | |
} | |
TransparencyDown() | |
{ | |
Global | |
Transparency -= 4 | |
WinSet, Transparent, %Transparency%, PopupTPopup | |
if (Transparency < 3) { | |
SetTimer, TransparencyDown, Off | |
Gui, Popup: Destroy | |
} else { | |
SetTimer, TransparencyDown, 10 | |
} | |
} | |
KillPopupWindow() | |
{ | |
Global | |
TransparencyDown() | |
SetTimer, KillPopupWindow, Off | |
} | |
KillPopups() | |
{ | |
Global | |
SetTimer, Popup, Off | |
Poppingup := 0 | |
GuiControl, , ToggleButton, Start Popup Timer | |
Return | |
} | |
Exited: | |
ExitApp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment