Jump to content

greenmachine

Active Members
  • Posts

    1,246
  • Joined

  • Last visited

Profile Information

  • Location
    California, U.S.

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

greenmachine's Achievements

Universalist

Universalist (7/7)

4

Reputation

  1. I just thought of something related to the clock and the click-through option. If you are considering implementing the option, keep reading. I would suggest that it is not used with a modifier key. Take this for example: suppose I have the clock enlarged (full-screen-ish, just for the sake of the story), and I want to be able to click through it and deal with the files and such in a folder behind the clock. If I'm currently pressing Ctrl or Alt or Shift or any combination, the action that I might want to take on the files will be affected by the modifier key used to toggle the click-through. In other words, you would want to be able to have those keys free to interact with the screen behind the clock (as if it wasn't there). Long story short, this is why it's a good reason for it to be a toggle from the tray (or something similar).
  2. I don't remember how it is in AutoIt, but this works in C++ to allow windows to be clicked-through. I used it as a context/tray menu toggle. It might be useful for you. if ( isClickable ) { SetWindowLong ( hWnd, GWL_EXSTYLE, GetWindowLong ( hWnd, GWL_EXSTYLE ) | WS_EX_TRANSPARENT ); } else { SetWindowLong ( hWnd, GWL_EXSTYLE, GetWindowLong ( hWnd, GWL_EXSTYLE ) ^ WS_EX_TRANSPARENT ); } isClickable = !isClickable;
  3. I saw that my topic had gotten recent replies, and you linked to this topic, so I figured I ought to take a look. I tried out your clock, and had to log in (for the first time in a long while) to voice my approval. I haven't fully tested it, but what I've seen so far is nice. Good work. [Edit] Also figured I'd give it 5 stars...
  4. What do you mean it does not work? It goes through the specified directory and lists all the files contained within. That sounds like a working piece of code to me.
  5. I shortened down the code for all the inputs to this: Global $Left[9] = [0, 5, 60, 120, 175, 235, 290, 350, 405] For $i = 1 To 8 If Mod ($i, 2) = 1 Then GUICtrlCreateInput ("100.00", $Left[$i], 40, 50, 20) For $j = 1 To 5 GuiCtrlCreateInput("100.00", $Left[$i], 65 + ($j-1)*25, 50, 20) Next Next Of course, you're going to want to store those in an array so that you can access them later. But you can figure that out yourself.
  6. I don't see how hard it is to look in the helpfile under FileFindFirstFile (as been suggested several times). Very slightly modified version of the helpfile script gives me this: $First = FileFindFirstFile (@ScriptDir & "\*.*") If $First = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf $filestr = "" While 1 $file = FileFindNextFile($First) If @error Then ExitLoop $filestr &= $file & @CRLF WEnd MsgBox(4096, "Files:", $filestr) FileClose($First)
  7. #include <GUIConstants.au3> opt ("GUIOnEventMode",1) ;make GUI1 $GUI1=GUICreate("GUI1") $button1=GUICtrlCreateButton("button1", 50, 50) GUICtrlSetOnEvent($button1, "action1") ;Make GUI2 $GUI2 = GUICreate("GUI2") $button2=GUICtrlCreateButton("button2", 50, 50) GUICtrlSetOnEvent($button2,"action2") GUISetOnEvent ($GUI_EVENT_CLOSE, "timetogo") GUIsetstate(@SW_SHOW,$GUI1) While 1 sleep (1000) WEnd func action1 () GUISetState(@SW_SHOW,$GUI2) endfunc func action2 () MsgBox(0,"OK","You pressed button2") endfunc Func timetogo() Exit EndFunc When you use GUIOnEventMode, it doesn't respond while inside functions (not sure why). Since all you're doing is sleeping inside the function, just let it return to the global sleep.
  8. I was reading Simucal's thread about his Sliding Toolbar, and I decided to make my own. This one places itself in either the upper-left or lower-right of the screen (can be changed to suit your needs), doesn't take up much space, and forms to the height of the desktop. It can be fully customized from within the script itself. Requires beta to run. Please let me know if there are any bugs left over - most of my scripting was done while I had a completed INI file ready, but I think it works as it should. Toolbar.au3
  9. Just so you guys know, the dealer in BlackJack always stops at 17 or higher - they do not try to get higher than the player. Thus, when the player has 18 and the dealer has 17, the dealer stops. It does not try to hit again (potentially getting a 2, 3, or 4 to win). The code fix is really simple, but I just thought you should know.
  10. This works. You were almost there, but you just have to put the window styles in the right places. HotKeySet ("+{ESC}", "IWannaQuit") Global $Width = 100, $Height = 100, $Left = MouseGetPos (0) - $Width/2, $Top = MouseGetPos (1) - $Height/2 $ClickWin = GUICreate ("Click Through Me", $Width, $Height, $Left, $Top, $WS_POPUP, BitOR ($WS_EX_TRANSPARENT, $WS_EX_LAYERED, $WS_EX_TOPMOST)) WinSetTrans ($ClickWin, "", 150) GUISetState () While 1 Sleep (10) TheMouseMoved() WEnd Func TheMouseMoved() $WinPos = WinGetPos ($ClickWin) WinMove ($ClickWin, "", MouseGetPos (0) - $Width/2, MouseGetPos (1) - $Height/2) EndFunc Func IWannaQuit() Exit EndFunc
  11. Created a quick digital clock based off the one in my room. It's really simplified right now, but I plan to combine it with the analog clock and have both work together. The alarm notification doesn't do anything right now because there is no alarm attached to it (it is on the analog clock). Global Const $SS_RIGHT = 2 HotKeySet ("{SPACE}", "SpeakTime") Global $Mid = 300, $MidStep = $Mid/3, $Alarm_OnOff = 0, $IsMilitary = 0 Global $Digital_Clock, $Alarm_Text, $PM_Text, $Military_Text, $Alarm_Light, $PM_Light, $Military_Light Global $Time_TensHours, $Time_Hours, $Time_Colon, $Time_TensMins, $Time_Minutes, $Hour, $Min $Digital_Clock = GUICreate ("Digital Clock", $Mid*2, 90, 100, 100, 0x80000000) GUISetBkColor (0x000000) $Alarm_Text = GUICtrlCreateLabel ("Alarm", 5, 10, 30, -1, $SS_RIGHT) GUICtrlSetColor (-1, 0xFFFFFF) $PM_Text = GUICtrlCreateLabel ("PM", 5, 40, 30, -1, $SS_RIGHT) GUICtrlSetColor (-1, 0xFFFFFF) $Military_Text = GUICtrlCreateLabel ("Military", 2, 70, 33, -1, $SS_RIGHT) GUICtrlSetColor (-1, 0xFFFFFF) GUISetFont (10, Default, Default, "Wingdings") $Alarm_Light = GUICtrlCreateLabel ("l", 40, 10) GUICtrlSetColor (-1, $Alarm_OnOff * 0xFF0000) $PM_Light = GUICtrlCreateLabel ("l", 40, 40) GUICtrlSetColor (-1, IsPM($IsMilitary) * 0xFF0000) $Military_Light = GUICtrlCreateLabel ("l", 40, 70) GUICtrlSetColor (-1, $IsMilitary * 0xFF0000) GUISetFont (60, 400, Default, "Lucida Console") $Time_TensHours = GUICtrlCreateLabel (GetTensHours($IsMilitary), $MidStep, 10) GUICtrlSetColor (-1, GetTensHoursColor($IsMilitary)) $Time_Hours = GUICtrlCreateLabel (GetHours($IsMilitary), $MidStep*2, 10) GUICtrlSetColor (-1, 0xFF0000) $Time_Colon = GUICtrlCreateLabel (":", $MidStep*3, 5) GUICtrlSetColor (-1, 0xFF0000) $Time_TensMins = GUICtrlCreateLabel (Int (@MIN/10), $MidStep*4, 10) GUICtrlSetColor (-1, 0xFF0000) $Time_Minutes = GUICtrlCreateLabel (@MIN - Int (@MIN/10)*10, $MidStep*5, 10) GUICtrlSetColor (-1, 0xFF0000) GUISetState () $Hour = @HOUR $Min = @MIN While 1 If @HOUR <> $Hour Then GUICtrlSetColor ($PM_Light, IsPM($IsMilitary) * 0xFF0000) GUICtrlSetData ($Time_TensHours, GetTensHours($IsMilitary)) GUICtrlSetColor (-1, GetTensHoursColor($IsMilitary)) GUICtrlSetData ($Time_Hours, GetHours($IsMilitary)) GUICtrlSetColor (-1, 0xFF0000) $Hour = @HOUR EndIf If @MIN <> $Min Then GUICtrlSetData ($Time_TensMins, Int (@MIN/10)) GUICtrlSetColor (-1, 0xFF0000) GUICtrlSetData ($Time_Minutes, @MIN - Int (@MIN/10)*10) GUICtrlSetColor (-1, 0xFF0000) $Min = @MIN EndIf Sleep (100) WEnd Func GetTensHours($MilitaryTime = 0) If @HOUR = "00" And Not $MilitaryTime Then Return 1 If $MilitaryTime Or @HOUR <= 12 Then Return Int (@HOUR/10) Return Int ((@HOUR-12)/10) EndFunc Func GetHours($MilitaryTime = 0) If @HOUR = "00" Then Return 2 If $MilitaryTime Or @HOUR <= 12 Then Return @HOUR - Int (@HOUR/10)*10 Return @HOUR - Int ((@HOUR-12)/10)*10 - 12 EndFunc Func GetTensHoursColor($MilitaryTime = 0) If $MilitaryTime Then Return 0xFF0000 If GetTensHours(0) = 0 Then Return 0x000000 Return 0xFF0000 EndFunc Func IsPM($MilitaryTime = 0) If $MilitaryTime Then Return 0 If @HOUR >= 12 Then Return 1 Return 0 EndFunc Func SpeakTime() Local $o_speech = ObjCreate("SAPI.SpVoice") If $IsMilitary Then $o_speech.Speak ("The time is " & @HOUR & @MIN) Else If @HOUR > 12 Then If @MIN = "00" Then $o_speech.Speak ("The time is " & @HOUR-12 & " O'Clock P M") Else $o_speech.Speak ("The time is " & @HOUR-12 & " " & @MIN & " P M") EndIf ElseIf @HOUR = "00" Then If @MIN = "00" Then $o_speech.Speak ("The time is 12 O'Clock A M") Else $o_speech.Speak ("The time is 12 " & @MIN & " A M") EndIf Else If @MIN = "00" Then $o_speech.Speak ("The time is " & @HOUR & " O'Clock A M") Else $o_speech.Speak ("The time is " & @HOUR & " " & @MIN & " A M") EndIf EndIf EndIf $o_speech = 0 EndFunc
  12. Hmm, lots to catch up on... @mr.underperson - Click+Drag to move, Ctrl+Click+Drag to resize, maybe Alt+Click+Drag to change transparency? I could do that with Larry's Mouse Hook dll... but if there's a way to do it without relying on third-party scripts I'd really like to know. INI saving is a piece of cake, I agree. I'll get to that too. @Neoborn - Allowing color changing shouldn't be too tough, but I don't know how to go about making my hands anti-aliased. Do you have any ideas? @odklizec - Could you clarify on how I would go about making the "jump" smoother? I'm not exactly sure what you mean. @Daniel W - What? @nitekram - Default settings and user-defined settings? I can do that.
  13. Just thought I'd let you know that I feel question #12 on the third exam is poorly worded. That was the only one I got stuck on because I couldn't figure out what it was trying to say.
  14. It would also work to change the placement of the checks: If (@Error=1) And (Not IsArray($FileList)) Then The reason is because each function resets the value of @error, which means that the IsArray function sets @error to 0 (unless it fails, which isn't the case here). That's why checking for @error = 1 after the IsArray check didn't get where you wanted to, and why checking it beforehand will work.
  15. In this part: For $i = 1 to $var[0] MsgBox(4096,"Drive " & $i, $var[$i]) Next Simply change the msgbox to include the labels. For $i = 1 to $var[0] MsgBox(4096,"Drive " & $i, $var[$i] & @CRLF & "label = " & DriveGetLabel ($var[$i])) Next
×
×
  • Create New...