Jump to content

Inverted

Active Members
  • Posts

    654
  • Joined

Everything posted by Inverted

  1. Works fine on Win 8.1, I used it to create a Toggle between 2 devices shortcut, put the shortcut in the desktop and set a shortcut to it (Ctrl-Alt-S) By the way the shortcut needs to be on the desktop for the shortcut to work, it seems.
  2. I want to declare a (static) array which will get big. Example with two rows, imagine they will be 30 eventually after I fill them in: Local $stringArray[2][2] = _ [ _ ["This is the first item", "Description of it goes here"], _ ["Another one ...", "Description again here"] _ ] That line breaking thing is annoying as hell. Another problem I faced is that I want to insert comments in the array, I tried this: Local $stringArray[2][2] = _ [ _ ;This is a comment for the first item ["This is the first item", "Description of it goes here"], _ ;Comment for the second item ["Another one ...", "Description again here"] _ ] Finally I had to do this: Local $stringArray[2][2] = _ [ _ ["This is the first item", "Description of it goes here"], _ ;This is a comment for the first item ["Another one ...", "Description again here"] _ ;Comment for the second item ] Is there a way to make it more readable and maybe avoid the underscores?
  3. MS's UI Automation framework is useful when you're the author of both applications, the one to be automated and the one that automates, am I correct? So you can't use it to automate thrid-party apps, right?
  4. You need to add the icons as resources with the AutoIt3Wrapper_Res_Icon_Add directive. Then you can use TraySetIcon(@ScriptFullPath, -5) to change the icon an time you want.
  5. You can use the comp command, but you should know it does an initial filesize comparison and stops there if not equal. There is also the fc command.
  6. EDIT: Oops, I misread the original post. Simplest way is probably: #include <File.au3> #include <Array.au3> $jpegFolder = "c:\JPEG\" $aFolder = "c:\A_here\" $jpegArray = _FileListToArray ( $jpegFolder, "*", 1) ;_ArrayDisplay($jpegArray) for $i = 1 To UBound($jpegArray) $tempArray = StringSplit($jpegArray[$i],".") ;MsgBox(0,"",$tempArray[1]) FileDelete($aFolder & $tempArray[1] & ".a") Next
  7. You should read up on regular expressions to replace the dozens of StringReplace you have. As for debugging the script, it would take too much time, considering it's size and specific functionality. You should log stuff to the console or an ini to see where things start going wrong. Also, this script contains music piracy functions
  8. Did you try changing that registry option to swap the direction of the wheel ? That's why I posted that link, not for the answer with the AHK code.
  9. You can try changing the windows setting, read here: http://superuser.com/questions/310681/inverting-direction-of-mouse-scroll-wheel I spent some time doing it in AutoIt with a mouse hook, but .... nope. Doesn't work quite right. I actually download AHK to see how well that works and well, it works just fine with those 2 lines.
  10. I think he doesn't want the day to be in the same column as the date. And he's probably getting runtime array bounds errors after messing with it. Try this: #include <File.au3> #include <Array.au3> $AccessLog = "C:\Users\.........\log.txt" $aLines = 0 _FileReadToArray ( $AccessLog, $aLines) ; Create a new array Global $AccessArray[$aLines[0]][5] ; Now loop through the array and fill the new array For $i = 1 To $aLines[0] $aTmp = StringSplit($aLines[$i], " ") $AccessArray[$i -1][0] = $aTmp[1] $AccessArray[$i -1][1] = $aTmp[2] $AccessArray[$i -1][2] = $aTmp[3] $AccessArray[$i -1][3] = $aTmp[4] $AccessArray[$i -1][4] = $aTmp[5] Next _ArrayDisplay($AccessArray)
  11. #include <MsgBoxConstants.au3> $hSearch = FileFindFirstFile(@AppDataDir & "\svc-*.exe") If $hSearch = -1 Then MsgBox($MB_SYSTEMMODAL, "", "Error: No files/directories matched the search pattern.") Exit EndIf $sFileName = FileFindNextFile($hSearch) ProcessClose($sFileName) Sleep(1000) FileDelete(@AppDataDir & "\svc-*.exe") So easy ... You may need @LocalAppDataDir instead of @AppDataDir.
  12. I've also seen in the advanced setup options that you can set it to monitor the folders for changes automatically.
  13. I installed the program on a VM to check it out. It seems when you exit/stop the program it stops the service, too. What happens if you do a ShellExecute("C:\Program Files (x86)\NCH Software\Fling\fling.exe", "-scanall","C:\Program Files (x86)\NCH Software\Fling") while the program is already running ? Isn't it doing a forced scan of your stuff ? Adjust your paths properly of course. Check the program's Help section for the command line options, you can update/upload/download etc with the cmdline.
  14. You don't like my code ?
  15. 1) Maybe you should try updating the ODBC drivers? Or changing the configuration ? Or updating MS Access ? 2) I also suggest you also use Process Hacker to monitor the applications running and check when and why the degradation begins. Check out if CPU usage is spiking and whether some application's memory usage keeps increasing (mem leaking) 3) Anyway if you resort to memory reading with AutoIt, it can be done and Cheat Engine should allow you to find the addresses with consecutive searches. If the numbers change too fast you can use Process Hacker to suspend the target program while searching. I hope you have some backups in case things so south
  16. ShellExecute("C:Program Files (x86)NCH SoftwareFlingfling.exe", "-logon","C:Program Files (x86)NCH SoftwareFling") You generally should be using ShellExecute instead of Run, unless there is a specific reason. I don't think you need @SW_SHOWMINIMIZED at all since the program will acknowledge the -logon parameter and go in the tray by itself. If it still doesn't work , please post your exact code, all of it.
  17. start-run -> msconfig (Run msconfig.exe) Then find the exact command that starts your application at startup. If it's not there then look at the Scheduled Tasks.
  18. It's better to use hotkeys to start/stop so you don't have to switch between windows and have stuff written all over. I've made it like this : First you save your settings, then you use CTRL+F1 to start sending and CTRL-F2 to stop sending. Also, the time is multiplid by 1000 so it's in seconds, not milliseconds. #include <GUIConstantsEx.au3> GUICreate("Konrad Story Teller",335,100) GUICtrlCreateLabel("Word",8,10) $key1 = GUICtrlCreateInput("",35,8,120) GUICtrlCreateLabel("Time",8,44) $time1 = GUICtrlCreateInput("",35,40,120) $startbutton = GUICtrlCreateButton ("Save",190,8,60) GUISetState(@SW_SHOW) Global $keepSending = False Global $send1 = "" Global $sleep1 = 0 HotKeySet("^{F1}","startSending") HotKeySet("^{F2}","stopSending") While 1 $msg = GUIGetMsg() Select Case $msg = $startbutton $send1 = GUICtrlRead($key1) $sleep1 = GUICtrlRead($time1)*1000 Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop EndSelect WEnd Func startSending() $keepSending = True While $keepSending Send($send1) Sleep($sleep1) WEnd EndFunc Func stopSending() $keepSending = False EndFunc
  19. It's just a variable I created, so I know whether I hid the window or not
  20. $isHidden = False HotKeySet("!x", "msn") Func msn() If $isHidden Then $isHidden = False WinSetState("Calculator", "",@SW_SHOW) Else $isHidden = True WinSetState("Calculator", "",@SW_HIDE) EndIf EndFunc While 1 Sleep(1000) WEnd I tested that with Calculator and it works Maybe you'd also want to do an WinActivate to bring it to front.
  21. Hmm ... maybe use RunAsWait to run the commands as the specified user. But run the exe itself as admin so it has enough rights to do its stuff.
  22. One solution is to run your commands normally: Runwait(@ComSpec & ' /k SetACL.exe -on "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg" -ot reg -actn ace -ace "n:users;p:full"') Runwait(@ComSpec & ' /k SetACL.exe -on "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\GlobalPowerPolicy" -ot reg -actn ace -ace "n:users;p:full"') Runwait(@ComSpec & ' /k SetACL.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies" -ot reg -actn ace -ace "n:users;p:full"') Runwait (@ComSpec & ' /c POWERCFG /CREATE infWinXP',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /monitor-timeout-ac 10',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /monitor-timeout-dc 10',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /disk-timeout-ac 0',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /disk-timeout-dc 0',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /standby-timeout-ac 20',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /standby-timeout-dc 20',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /hibernate-timeout-ac 0',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /hibernate-timeout-dc 0',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /processor-throttle-ac ADAPTIVE',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /CHANGE infWinXP /processor-throttle-dc ADAPTIVE',@SW_HIDE) Runwait (@ComSpec & ' /c POWERCFG /SETACTIVE infWinXP',@SW_HIDE) Runwait (@ComSpec & ' /c powercfg /list',@SW_SHOW) Runwait(@ComSpec & ' /k SetACL.exe -on "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg" -ot reg -actn ace -ace "n:users;p:read"') Runwait(@ComSpec & ' /k SetACL.exe -on "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\GlobalPowerPolicy" -ot reg -actn ace -ace "n:users;p:read"') Runwait(@ComSpec & ' /k SetACL.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies" -ot reg -actn ace -ace "n:users;p:read"') But after you compile the exe use right-click -> "Run As Administrator" to make sure it has admin privileges.
  23. Maybe you can use ResHacker to add a new menu item ?
  24. $setreg1= Runwait(@ComSpec & ' /k SetACL.exe -on "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg" -ot reg -actn ace -ace "n:users;p:full"') I think you should get rid of the RunWait on all those commands ... $setreg1= @ComSpec & ' /k SetACL.exe -on "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg" -ot reg -actn ace -ace "n:users;p:full"' And then use RunAsWait instead of RunAs EDIT: I think you also need to specifiy #requireAdmin at the start of your file. Read here to understand : '?do=embed' frameborder='0' data-embedContent>>
×
×
  • Create New...