BillMelater Posted March 25, 2015 Share Posted March 25, 2015 (edited) Needed a big clock to ride on top of a specialty program that lacked one. This runs in a fixed space on one computer only. everything is hard coded because of my inexperience and it's just for me. Not cleaned up, probably hogging memory, but I have about one hour a day to slap together needed interface elements to a very complex program that is lacking them. Got more includes than needed, cut and paste of other script examples, and comments that have nothing to do with the script, but it works. I'm not a programmer, but I did stay in a Holiday Inn Express® last nite. If it works, screw it, on to the next fire. Runs on a different box than the one coded on with no issues, although in the wrong X, Y. expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here ;Local $sDestination = ("d:\buttons\premiereon.gif") #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <Date.au3> ;ProcessClose ("deck1.exe") if _Singleton("time",1) = 0 Then ;Msgbox(0,"Warning","An occurence of test is already running") Exit EndIf ;ControlSetText("statusdeck", "", 18, $Status) GUICreate("time", 416, 92, 28, 752, BitOR($WS_SYSMENU,$WS_POPUP), BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST)) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Label1", 0, 15, 415, 90, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, 48, 800, 0, "Segoe UI") GUICtrlCreateLabel("Label2", 101, 0, 215, 21, $SS_CENTER) GUICtrlSetFont(-1, 12, 400, 0, "Segoe UI") WinSetTrans("time", "", 200) GUISetState(@SW_SHOW) ;SETS BOTTOM STATUS BAR TO SHOW RECORD TIME FOR GNN NEWS Local $sDayname = _DateDayOfWeek(@WDAY , $DMW_LOCALE_LONGNAME ) Local $sMonth = _DateToMonth(@MON, $DMW_LOCALE_LONGNAME) Local $sDayNum = _DateToDayValue(@YEAR, @MON, @MDAY) $sDayNum = StringMid($sDayNum, 1 , 2 ) Local $sYear = @Year While 1 Local $sDayname = _DateDayOfWeek(@WDAY , $DMW_LOCALE_LONGNAME ) Local $sMonth = _DateToMonth(@MON, $DMW_LOCALE_LONGNAME) Local $sDayNum = @MDAY ;$sDayNum = StringMid($sDayNum, 1 , 2 ) Local $sYear = @Year ControlSetText("time", "", 3, _NowTime(5)) ControlSetText("time", "", 4, $sDayname & ", " & $sMonth & " " & $sDayNum & ", " & $sYear) Sleep(999) ;ControlSetText("statusdeck", "", 19, "") ;ControlSetText("time", "", 3, _NowTime(5)) Wend Edited March 25, 2015 by BillMelater Link to comment Share on other sites More sharing options...
spudw2k Posted March 25, 2015 Share Posted March 25, 2015 Nice. Reminded me of an old clock/toy >I made once...so I added some color. expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here ;Local $sDestination = ("d:\buttons\premiereon.gif") #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <Date.au3> ;ProcessClose ("deck1.exe") if _Singleton("time",1) = 0 Then ;Msgbox(0,"Warning","An occurence of test is already running") Exit EndIf Global $updatetimer = TimerInit(), $blendtimer = 10000 Global $varColors[3], $varBlendRates[3], $varBlendDirections[3] PaintRand() ;ControlSetText("statusdeck", "", 18, $Status) $gui = GUICreate("time", 416, 92, 28, 752, BitOR($WS_SYSMENU,$WS_POPUP), BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST)) GUISetBkColor(0xFFFFFF) GUICtrlCreateLabel("Label1", 0, 15, 415, 90, BitOR($SS_CENTER,$SS_CENTERIMAGE)) GUICtrlSetFont(-1, 48, 800, 0, "Segoe UI") GUICtrlCreateLabel("Label2", 101, 0, 215, 21, $SS_CENTER) GUICtrlSetFont(-1, 12, 400, 0, "Segoe UI") WinSetTrans("time", "", 200) GUISetState(@SW_SHOW) ;SETS BOTTOM STATUS BAR TO SHOW RECORD TIME FOR GNN NEWS Local $sDayname = _DateDayOfWeek(@WDAY , $DMW_LOCALE_LONGNAME ) Local $sMonth = _DateToMonth(@MON, $DMW_LOCALE_LONGNAME) Local $sDayNum = _DateToDayValue(@YEAR, @MON, @MDAY) $sDayNum = StringMid($sDayNum, 1 , 2 ) Local $sYear = @Year While 1 Local $sDayname = _DateDayOfWeek(@WDAY , $DMW_LOCALE_LONGNAME ) Local $sMonth = _DateToMonth(@MON, $DMW_LOCALE_LONGNAME) Local $sDayNum = @MDAY ;$sDayNum = StringMid($sDayNum, 1 , 2 ) Local $sYear = @Year ControlSetText("time", "", 3, _NowTime(5)) ControlSetText("time", "", 4, $sDayname & ", " & $sMonth & " " & $sDayNum & ", " & $sYear) GUISetBkColor(Colorize()) Sleep(90) ;ControlSetText("statusdeck", "", 19, "") ;ControlSetText("time", "", 3, _NowTime(5)) Wend Func PaintBlend() If TimerDiff($blendtimer) > 10000 Then $blendtimer = TimerInit() BlendRates() EndIf For $i = 0 to 2 BlendColors($varColors[$i],$varBlendRates[$i],$varBlendDirections[$i]) Next EndFunc Func PaintRand() SRandom(Random(1,200)) For $i = 0 to 2 $varColors[$i] = Hex(Random(0,255,1),2) Next EndFunc Func BlendRates() For $i = 0 to 2 $varBlendDirections[$i] = Random(0,1,1) $varBlendRates[$i] = Random(3,10,1) Next EndFunc Func BlendColors(byref $varThisColor,$varBlendRate,byref $varBlendDir) If $varBlendDir = 1 Then $varThisColor += $varBlendRate Else $varThisColor -= $varBlendRate EndIf If $varThisColor > 255 Then $varThisColor -= $varBlendRate $varBlendDir = 0 EndIf If $varThisColor < 0 Then $varThisColor += $varBlendRate $varBlendDir = 1 EndIf EndFunc Func Colorize() PaintBlend() $varColor = "0x" For $i = 0 to 2 $varColor &= Hex(Int($varColors[$i]),2) Next Return $varColor EndFunc Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2015 Share Posted March 25, 2015 Colours introduce flicker for me. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
spudw2k Posted March 25, 2015 Share Posted March 25, 2015 Yep, it's not great. My original had better timing (not perfect), but I just threw the "color code" into his example. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Lakes Posted March 26, 2015 Share Posted March 26, 2015 "I'm not a programmer, but I did stay in a Holiday Inn Express® last nite." Booking in - Are you a programmer Sir? No, but can I throw something together that will work in Autoit. Very well Sir, you will be allowed to stay. 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
AZJIO Posted March 26, 2015 Share Posted March 26, 2015 @BillMelater Why every second to determine the day? '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> My. Look like the time a request is made. Each digit in a separate label My other projects or all Link to comment Share on other sites More sharing options...
BillMelater Posted June 17, 2016 Author Share Posted June 17, 2016 Uh, why not determine the day every second? Quick and Dirty and etc. I don't know, tell me why not. ...it works for me. Link to comment Share on other sites More sharing options...
BillMelater Posted June 17, 2016 Author Share Posted June 17, 2016 (edited) /CSB Time. I work with a DOS 6.22 Based Radio Automation Program running on Win 98. Last programmed version 2005. It does backups to a redundant harddrive. 6 years ago, lightning destroyed the system, leaving only the backup. We were able to move our backup hardware in, but when you put the backup drive in (after cloning it, to have another backup), the colors were horrible (for DOS) and a warning about contacting the company (no longer in bitnezz) on the screen. After much wailing and gnashing, and finger pointing as to why Lightning hit us (300 foot tower with transmitters on site, duh) I was able to determine the Volume Label of the Dos Drive that wasn't the backup was whateverPRIMARY, and the backup was whateverBACKUP. Hmm. Lets change the volume label of the backup. Ding Ding Ding. Never, Never ever underestimate quick and dirty. Actually, it usually wins. Edited June 17, 2016 by BillMelater better example Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now