Jump to content

AmphetaMarinE

Active Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by AmphetaMarinE

  1. Hi Guys, I have had the wonderful idea to create an addon to a program which I use all the time. The problem is, the program (MP3Tag - www.mp3tag.de) does not support plugins. So my idea was to write a script with the functionality I need, and have it kind of "Dock" Itself to the bottom of the main mp3tag window. I also would like it to auto resize if the mp3tag window is resized. I have no problem creating the gui, but can anyone point me in the right direction to have my gui perform this way please??
  2. Hi guys, I want to write an app that inverts the colours of the screen it is run on. Is it possible using autoit to directly affect the system pallette?
  3. Hi, I am writing a script with user-defineable hotkeys... As part of this, I have used GuiCtrlCreateInput to create small input boxes where the user can type a key to use as a hotkey. Is there a way to limit the amount of characters allowed to be entered into the input boxes? (In my case, limit to one character only) Amph. Edit:]/b] Nevermind... I just descovered the GuiCtrlSetLimit() Function....
  4. Thanks guys... I found the problem... the extra ,0 at the end was stopping $BS_DEFPUSHBUTTON from working as it should.... (I had tried that before posting...)
  5. Hi Guys, In a gui I am designing, the first thing the user sees is a login prompt, with input controls for username and password, a login button, and a cancel button, as per the following... $Username = GUICtrlCreateInput('Username', 128, 136, 241, 21) $Password = GUICtrlCreateInput('', 128, 176, 241, 21,$ES_PASSWORD) $Login = GUICtrlCreateButton('Login', 312, 216, 75, 25, 0) $Cancel = GUICtrlCreateButton('Cancel', 400, 216, 75, 25, 0)oÝ÷ Ø-êÞj|°k+h±ëm«mꮢÑ'µêêºd{*'¶¤{&èj·pYZ²²Ç§vØ^z«¢½©^Újëh×6Case $Login Regardless of which control currently has focus? Similar to how "ESC" key will always send an exit command? I have tried using hotkeys, but this causes me further problems later in the script.
  6. Well picaxe... I am unsure what was causing that behaviour, but I rewrote my backup app, still basing off your code, and all worked perfectly. Thanks you so much for your help.
  7. I understand that, but it is a relatively simple thing to modify that byte in the header and turn it into a console app... Regardless, thanks for your help guys. Much appreciated
  8. Hi Guys, I am writing a console based app, and was wondering if there is any way using autoit, that I could check if the script has been run from the command line, or is being double clicked on in explorer? Cheers, Amph.
  9. Must be something up in my end... I will retry. Thank you tho picaxe for the work you put in. I could never have come up with this..
  10. Working fine except for one thing, The script picks up the second oldest file, rather than the oldest, if there is no subfolder in the directory stored in $path I guess its something to do with the while loop, but loops is the part of autoit i have trouble with. (Along with arrays) It is this that stops me from actually understanding how the script works... Guess I'll have to read over the help file once again to try and wrap my head around looping...
  11. Nope. No Good. It returns for me the second created file as the oldest. When modifying them, it still returns the same results... I wonder if its something on my end? I am testing with a 2 folders on my c drive, c:\backup1 and c:\backup2 In each of these i create 4 new text files, named 1.txt, 2.txt, 3.txt and 4.txt in that order. I then modify them from 1 to 4, and the oldest file returned should move up in number as each preceeding file is modified.... But then again, could be just me... Wish I understood more about this function... it is very complex to me.... But thank you picaxe, i think it is definately a big step up from where i was trying.. I could not get anything to work after modifying the original... >.<
  12. I hate to dig up an old thread, but I'm revisiting this one. I have no idea how that revised _FindNewestFile function works, but what would it take to add an extra switch to enable it to find the oldest file in a directory? (By modified Date) It would then be the perfect function for what I need. Cheers for any help.
  13. Hi all, I am in the brainstorming phase for an app, and would really like to be able to make it modular. I was wondering, is it possible to write basically a container script, with an empty gui, and have it get its functionality from other au3 scripts? Essentially, I want to make a script which will read the contents of a folder, and embed the functionality from the au3 files stored there into the main script. Is this possible?? And any pointers to which part of the manual or forum i should be reading? I ask because I'm not sure what to even type as a search query to find this answer. Thanks for any help Amph.
  14. Ahhh thanks so much for the explanation.Now I can see how it all works Cheers, Amph.
  15. Ahhh now that works perfectly Danny35d Thanks a million for that one! Could I trouble you for one last question though? What do the numbers represent in this line? For $x = 67 To 90 I found I can change them and drives below C: are then listed, but I am unsure how you know which numbers to use, and what they actually represent... Thanks again, Amph.
  16. Thanks Zedna, at least I know I'm on the right track... I have been trying by using DriveGetDrive("all") But that returns currently assigned drive letters... I am stuck trying to return all unassigned driveletters... I am quite new to all things programming, including autoit scripting... Not saying I need someone to do the work for me, just a nudge in the right direction....
  17. Hi, I am absolutely stuck here... How might I go about listing all available drive letters on a PC? I want to put them into a combobox to enable choosing of an available (unused) drive letter for mapping a path to.... Completely stumped hey.... Thanks for any ideas, Amph.
  18. Hrmm... a tough one, I have no idea where to start with the check, as some PC's will have dual core cpu's... Made a test, and it works fine on a single core CPU, but not on a dual core.... Currently looking at a UDF called CompInfo.au3.... Will report back after playing with that. Thanks heaps for the idea fear1313
  19. Hi, I'm writing a basic script to restart a PC after 30 secs. The idea behind it is to automate the rebooting of a PC, in the workshop at my workplace. (Many repairs have intermittent boot problems, and it is a waste of time having a technician keep checking and manually rebooting the PC) The script works fine, except that on slower PC's, the 30sec timer is pretty much finished before the login process is complete. Does anyone know of a way to have the script wait until the PC is active and responsive, short of changing to a longer timeout? (The bootup process is quite different across different PC's so a longer wait time would not be my first choice obviously.) I have tried searching, but cant find any relevant results in the forum, and the help txts only give me ideas for things like processwait etc... Problem there is I must wait for a process to close, meaning I can't do say a, ProcessWait ('explorer.exe') or anything like that, as the script will remain paused indefinately there.... My code so far: #include <GUIConstants.au3> ; Set the script to autorun on next boot. RegWrite('HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce', 'Restart Timer', 'REG_SZ', @ScriptDir & '\Restart Timer.exe') $MainWindow = GUICreate("ACW Restart Timer", 218, 129, 502, 275) $CancelButton = GUICtrlCreateButton("Cancel", 72, 96, 73, 25, 0) $TimerText = GUICtrlCreateLabel("Restart in:", 56, 16, 52, 17) $Timer = GUICtrlCreateLabel("0:30", 112, 16, 38, 17) $TextLabel1 = GUICtrlCreateLabel("Press cancel to remove autorun", 32, 56, 154, 17) $TextLabel2 = GUICtrlCreateLabel("entries and exit the restart timer.", 32, 72, 153, 17) GUISetState(@SW_SHOW) $time = TimerInit() WinWaitActive('ACW Restart Timer') While 1 $nMsg = GUIGetMsg() Switch $nMsg ;If Cancel Button Pressed, or the dialogue is closed, remove the autorun entry and exit the script Case $GUI_EVENT_CLOSE RegDelete('HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce', 'Restart Timer') ; Create a logfile to allow for monitoring of total number of restarts $logfile = FileOpen('Restart Log.txt', 1) ; Check if file opened for writing OK If $logfile = -1 Then MsgBox(0, 'Error', 'Unable to open file.') Exit EndIf ; Write the time and date of the cancellation to the logfile FileWrite($logfile, '!!Restart aborted on ' & @MDAY & '/' & @MON & '/' & @YEAR & ' at ' & @HOUR & ':' & @MIN & ':' & @SEC & '!!' & @CRLF) ; Close the logfile for writing FileClose($logfile) Exit ;If Cancel Button Pressed, or the dialogue is closed, remove the autorun entry and exit the script Case $CancelButton RegDelete('HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce', 'Restart Timer') ; Create a logfile to allow for monitoring of total number of restarts $logfile = FileOpen('Restart Log.txt', 1) ; Check if file opened for writing OK If $logfile = -1 Then MsgBox(0, 'Error', 'Unable to open file.') Exit EndIf ; Write the time and date of the cancellation to the logfile FileWrite($logfile, 'Computer Name: ' & @ComputerName & ' - !!Restart aborted on ' & @MDAY & '/' & @MON & '/' & @YEAR & ' at ' & @HOUR & ':' & @MIN & ':' & @SEC & '!!' & @CRLF) ; Close the logfile for writing FileClose($logfile) Exit EndSwitch ;Set the initial timer length. (Alter the middle value in $new to change the amount of seconds) $new = (1 * 30 * 1000) - TimerDiff($time) $seconds = Round($new / 1000) $newMin = Floor($seconds / 60) $newSec = Mod($seconds, 60) If $newSec < 10 Then $newSec = "0" & $newSec If ($newMin > 0 Or Number($newSec) > 0) Then GUICtrlSetData($Timer, $newMin & ":" & $newSec) Else GUICtrlSetData($Timer, "0:00") ; Create a logfile to allow for monitoring of total number of restarts $logfile = FileOpen('Restart Log.txt', 1) ; Check if file opened for writing OK If $logfile = -1 Then MsgBox(0, 'Error', 'Unable to open file.') Exit EndIf ; Write the time and date of each restart to the logfile FileWrite($logfile, 'Computer Name: ' & @ComputerName & ' - Restarted on ' & @MDAY & '/' & @MON & '/' & @YEAR & ' at ' & @HOUR & ':' & @MIN & ':' & @SEC & @CRLF) ; Close the logfile for writing FileClose($logfile) ; Perform a forced restart of the PC Shutdown(6) Exit EndIf WEnd ; Finished! Thanks for any help AmphetaMarinE
  20. Wow man! Thank you so much for taking the time to go through all that xcal. It is all very clear now. I really do appreciate you taking that much time to explain what happens there... I'm very new to autoit, and scripting in general, so this kind of help is golden to me. Cheers, Amph.
  21. Wow xcal, I only wanted a nudge in the right direction, sorta helps me to learn quicker.... But I gotta say, you definately saved me some time... That worked perfectly. I just wish I actually understood what you did there... I think I have some more reading of the manual to do But, Thank you very much, you guys are awesome!
  22. Hi guys, I am writing a sort of backup script, and as a part of it, I need to check a directory containing multiple backup files, and put the filename of the newest file into a variable. I have tried everything I can find, and am not even getting close. Please guys, could someone give me a hand? Assuming I have this sort of thing... $backuppath = 'C:\backup' $dest = 'C:\newbackup' $backupfilename = with C:\backup containing up to 8 files. How would I populate $backupfilename with the filename of the newest created file in C:\Backup??
  23. Wow, If only I could think as logically as that november!! Thank you. Something must be up with my input file It works fine after doing the same thing you mentioned. JdeB, The file was originally from the signature files produced by MS Outlook. I have kept a master copy and only ever copied it to my working folder. Have you any idea where I should look to see if there is a 0x00 at the beginning of the file? Thank you both so much for your help
  24. Nope, input file is exactly as stated above at the moment, and no 0x00 anywhere. It is a plain text file. Or have I misunderstood you? I'm still pretty new to autoit.
×
×
  • Create New...