WhaleJesus Posted September 23, 2021 Share Posted September 23, 2021 expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Add_Constants=n #AutoIt3Wrapper_Run_Tidy=y #AutoIt3Wrapper_Run_Au3Stripper=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include "MiscUdf.au3" Global $Class, $Date, $Day, $Mon, $Year, $DateCheck Global $TooltipToggle = True HotKeySet("+{esc}", "KillSwitch") HotKeySet("+{F5}", "Create") HotKeySet("{f6}", "ToggleST") Main() Func Main() NowDate() NowClass() While 1 Sleep(250) WEnd EndFunc ;==>Main Func NowDate() Local $DateSS $Date = StringReplace(_NowDate(), "/", "-") $DateSS = StringSplit($Date, "-") $Day = $DateSS[1] $Mon = $DateSS[2] $Year = $DateSS[3] $DateCheck = _DateDayOfWeek(_DateToDayOfWeek($Year, $Mon, $Day), 1) $debug = _DateToDayOfWeek($DateSS[3], $DateSS[2], $DateSS[1]) _ConsoleWriteLong($Day & " " & $Date & " " & $DateCheck & " " & $debug) EndFunc ;==>NowDate Func NowClass() $Class = @ScriptDir If $DateCheck = "Mon" Then $Class &= "\webAnimatie2" ElseIf $DateCheck = "Wed" Then $Class &= "\webProductie2" ElseIf $DateCheck = "Thu" Then $Class &= "\osacu" Else MsgBox(16, "Warning", "You have no classes registered for today", 10) EndIf EndFunc ;==>NowClass Func Create() $ClassArray = _FileListToArrayRec($Class, "*", 2) $DummyFile = $Class & "\Les_0_" & $Day - 1 & "-" & $Mon & "-" & $Year If Not IsArray($ClassArray) Then DirCreate($DummyFile) $ClassArray = _FileListToArrayRec($Class, "*", 2) ;_ArrayDisplay($ClassArray) EndIf $PrevLesson = $ClassArray[$ClassArray[0]] $PrevLessonSS = StringSplit($PrevLesson, "_") $iLesson = $PrevLessonSS[2] $PrevLessonDate = $PrevLessonSS[3] $PrevLessonDateSS = StringSplit($PrevLessonDate, "-") If $PrevLessonDate <> $Date Then $iLesson += 1 $ClassLesson = $Class & "\Les_" & $iLesson & "_" & $Date $iOef = 1 _ConsoleWriteLong($PrevLessonDate & " " & $Date) Else $ClassLesson = $Class & "\" & $PrevLesson $LessonArray = _FileListToArray($ClassLesson) $iOef = _StringSplit($LessonArray[$LessonArray[0]], "f", 0) + 1 ;_ArrayDisplay($LessonArray) EndIf If FileExists($DummyFile) Then DirRemove($DummyFile) $Oef = $ClassLesson & "\oef" & $iOef DirCreate($Oef & "\img") DirCreate($Oef & "\css") _FileCreate($Oef & "\css\style.css") _FileCreate($Oef & "\index.html") ShellExecute($Oef) EndFunc ;==>Create Func ToggleST() $TooltipToggle = Not ToolTip If $TooltipToggle = True Then SplashTextOn("", "Shift + F5 create, Shift + F6 toggle Help, Shift + Esc exit", "430", "37", "0", "0", 5, "Days One", "10", "400") Else SplashOff() EndIf EndFunc ;==>ToggleST Func KillSwitch() Exit EndFunc ;==>KillSwitch I'm having the problem that in the function "ToggleST" at the bottom of the script both tooltip and splashtext won't dissappear using the normal splashOff or Tooltip(""), is there something obvious i'm missing/don't know about yet? Also "MiscUdf" are just some quality of life functions i made like the "_ConsoleWriteLong()" i'm using in this script Link to comment Share on other sites More sharing options...
mikell Posted September 23, 2021 Share Posted September 23, 2021 I suppose you meant this Func ToggleST() $TooltipToggle = Not $TooltipToggle JockoDundee and WhaleJesus 2 Link to comment Share on other sites More sharing options...
JockoDundee Posted September 24, 2021 Share Posted September 24, 2021 Ah, the price of having function pointers Code hard, but don’t hard code... 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