Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. I see, that is interesting. I do the same, it works good enough when you follow safe practices. Not sure about MalwareBytes, I never used it.
  3. Today
  4. Could create a batch file that hopefuly grabs the original username $RF = Random(100000, 999999, 1) & '.bat' $FO = FileOpen($RF, 10) $FW = FileWrite($FO, 'cd %UserProfile%' & @CRLF & 'pause'); 'del ' & $RF) FileClose($FO) Run($RF) This is a proof of concept, if it does work, this can be changed to write into a txt file or something.
  5. @Musashi's script works well because it basically traps the flow of the script at any time, meaning you can pause between actions in a function. There are some cases where you may need that the script continues and not be stuck in a loop like that, for those cases you can go with something like this: Global $g_bPaused = 1 HotKeySet("{F2}", "_TogglePause") HotKeySet("{ESC}", "_Terminate") While 1 If $g_bPaused = 0 Then ;Stuff EndIf WEnd Func _TogglePause() If $g_bPaused = 0 Then $g_bPaused = 1 ToolTip('Script is "Paused"', 0, 0) Else $g_bPaused = 0 ToolTip('Script is "Running"', 0, 0) EndIf Sleep(1000) ToolTip("") EndFunc ;==>_TogglePause Func _Terminate() Exit EndFunc ;==>_Terminate It's different in that, the loop keeps going and other things may still work, if you have them in the main loop, but this would not stop in the middle of the action, it would only pause at the end of the actions, i hope i can get the message across, sometimes is difficult to me.
  6. Thanks for your reply. that's doing quite exactly, what I was asking for. Except, that the script has to be compiled. ;~ must *NOT* be used: #RequireAdmin ;~ Script needs to be compiled to work ;~ Running directly will use the executors UserProfileDir as a switch and then prompt for UAC ;~ Can also use <@ScriptFullPath> --UserProfileDir %UserProfile% #include <WinAPIProc.au3> Global $g_sUserProfileDir = _GetCmdLineValue("UserProfileDir", @UserProfileDir) If Not _WinAPI_IsElevated() Then ShellExecute(@ScriptFullPath, "--UserProfileDir " & $g_sUserProfileDir, "", "RunAs") Exit EndIf MsgBox(4096, "UserProfileDir", $g_sUserProfileDir) Func _GetCmdLineValue($sCmdLine, $vResult = Null) For $i = 1 To $CmdLine[0] If $CmdLine[$i] = "/" & $sCmdLine Or $CmdLine[$i] = "-" & $sCmdLine Or $CmdLine[$i] = "--" & $sCmdLine Then If $CmdLine[0] >= $i + 1 Then If StringLeft($CmdLine[$i + 1], 1) = "/" Or StringLeft($CmdLine[$i + 1], 1) = "-" Or StringLeft($CmdLine[$i + 1], 2) = "--" Then Return $vResult Else Return $CmdLine[$i + 1] EndIf EndIf EndIf Next Return $vResult EndFunc
  7. If i understand corretly, i believe so, a simple question of setting that macro @UserProfileDir into a variable on the top of the script, and then use it afterwards. As an extreme measure, you could have another exe, that runs and writes to an ini file the profile dir, and then your main script would read from ini. Or maybe im just complicating things without need.
  8. post the code comunity will help you , dont be shy
  9. There's the possibility of opening another window into the new path, and once that one is present, place it exactly under the current window, same size and all, and then just close the current window, and change focus to the new one. It's a mess, i know. I think explorer was not designed to be explored programmaticaly, and really, why would anyone need something like that? People have a mouse, they can click to wherever they need, you see?
  10. I'm *NOT* interested in *SELF* elevating the script. Exactly that's, what I don't want to work: The regular users shall not be granted the possibility to bypass UAC in any means. What I need is to write few registry values to parts of the registry, the normal user has no write access to. (An for security reasons *SHALL* not have write access to! It would be an easy thing to simply grant write access to the "Local-User-Windows-Group", but that's what I don't want to do) I want to *PASS* the information of the currently-logged-on-userprofile-dir-path to the script to be processed within the script itself, after I personally entered the credentials for the UAC elevation process.
  11. Here a simulation with MouseMove : ; Press Esc to terminate script, Pause/Break to "pause" Global $g_bPaused = False HotKeySet("{PAUSE}", "_TogglePause") HotKeySet("{ESC}", "_Terminate") HotKeySet("+!d", "_StartScript") ; Shift-Alt-d While True Sleep(100) WEnd Func _TogglePause() $g_bPaused = Not $g_bPaused While $g_bPaused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>_TogglePause Func _Terminate() Exit EndFunc ;==>_Terminate Func _StartScript() ToolTip("Script is running > move mouse to 10,100", 0, 0) MouseMove(10, 100) Sleep(2000) ToolTip("move mouse to 200,200", 0, 0) MouseMove(200, 200) Sleep(2000) ToolTip("move mouse to 400,200", 0, 0) MouseMove(400, 200) Sleep(2000) ToolTip("move mouse to 600,300", 0, 0) MouseMove(600, 300) Sleep(2000) ToolTip("", 0, 0) EndFunc ;==>_StartScript Automation or script interaction with games or game servers, regardless of the game, is not allowed.
  12. pdvos, That error is often caused by your AV thinking that Aut2Exe is acting strangely by trying to amend the resource table of an executable file. Try adding that folder to your AV exceptions list and see if it works then. M23
  13. Hello I tried to compile with the latest autoit version and scite editor available but it fails during the process with a aut2exe error (see below) I saw some fixes in the posts before this page. So I added #include <WinAPISys.au3> #include <WinAPISysWin.au3> #include <WinAPIProc.au3> Set Global Const $WH_CBT = 5 And commented out ;~ Global Const $SND_ASYNC = 0x00000001 ;~ Global Const $SND_MEMORY = 0x00000004 ;~ Global Const $SND_NOSTOP = 0x00000010 But it fails during the compile with a Aut2Exe error --------------------------- Aut2Exe Error --------------------------- Error: Unable to add resources. C:\Users\pdv\AppData\Local\AutoIt v3\Aut2Exe\aut4148.tmp.exe --------------------------- OK --------------------------- I wanted to use this tool to convert blat.dll and try if I could make ik work with that subrogation script and see if I can include a dll in my program. would there be somebody willing to point me in the right direction? Beste regards, Peter
  14. No, isn't posting automation about gaming not allowed?
  15. Been dorking around with Autoit for about a week and this language is the first i've ever even attempted to learn and i'm really loving all the cool automation that is possible with this languie. In no, shape, or form am I an expert as you'll see below from my very basic code. I've made a basic outline of this very basic script I am trying to make and it works flawlessly, only issue is I want this script to run until I press a hotkey. How would I go about making a start and a stop hotkey for a whole script? WinActivate("Runner") sleep(250) MouseClick("left",957,590) Sleep(5500) MouseClick("left",951,637) Sleep(3500) MouseClick("left",939,585) sleep(2500) MouseClick("left",1037,568) Sleep(6750) MouseClick("left",1036,572) Sleep(2000) MouseClick("left",951,472) Sleep(3750) MouseClick("left",927,501) Sleep(7250) MouseClick("left",780,584) Sleep(4000)
  16. thank you careca, it indeed works, thank you. I will use it so far. It would be more elegant, if the path changes "silently" in the background. Hopefully someone has an good idea.
  17. Really? I dropped eset ys ago due to all it’s windows issues. It’s garbage. Use windows built-in defender and that’s all you need maybe Malwarebytes in addition
  18. Maybe there is a better way, but this is what i got $Title = 'Program Files' ShellExecute('explorer.exe', 'C:\Program files') Sleep(2000) If WinActive($Title) Then ControlClick($Title, "", 1001, "left", 1) Send('C:\Windows'&"{ENTER}") EndIf
  19. @careca thankyou when i runit as admin it works with me thank you very much
  20. From https://www.autoitscript.com/site/autoit/downloads/ -- P.S. Why would you still be developing for such an out-of-date OS?
  21. i tried chrome.exe, skype.exe and NVDA.exe and jfw.exe all give me 0
  22. @DonChunior I haven't used that browser, so I'm not sure how much help I can be. I did have a few questions / comments -- You are using an older version of the Webdriver UDF. Please update to the latest version (0.3.0.1) There's a newer version of the WinHTTP UDF. Grab the source from here. What version of Geckodriver are you attempting to use? Why the switch from port 4444 to 9150?
  23. in the inputbox you have to put one processname that is currently running, which one did you put in, if any? The default is firefox.exe, do you have firefox running? What is the process name of the application you want to change the volume of?
  24. @careca always give me 0 i've windows 10 can you scan it please?
  25. #include "wd_core.au3" #include "wd_helper.au3" #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> Local $sDesiredCapabilities, $iIndex, $sSession SetupGecko() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.autoitscript.com/forum/topic/202976-check-if-page-is-full-loaded/?tab=comments#comment-1457262") _WD_LoadWait($sSession, Default, Default, Default) MsgBox($MB_ICONINFORMATION, "Demo complete!", "Click ok to shutdown the browser and console") _WD_DeleteSession($sSession) _WD_Shutdown() Func SetupGecko() _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}' EndFunc
  26. Had this code saved from somewhere in the forum, made some tweaks to allow volume to be changed with the keyboard arrows. The only thing you have to give is a processname. Adapt to your needs. #include-once ;https://www.autoitscript.com/forum/topic/174460-is-there-a-way-to-detect-any-sound-file-played/ ;Special Thanks to Danyfirex 02/08/2015 #include <WinAPIProc.au3> #include <Array.au3> #include <Misc.au3> Global Const $sCLSID_MMDeviceEnumerator = "{BCDE0395-E52F-467C-8E3D-C4579291692E}" Global Const $sIID_IMMDeviceEnumerator = "{A95664D2-9614-4F35-A746-DE8DB63617E6}" Global Const $sTagIMMDeviceEnumerator = _ "EnumAudioEndpoints hresult(int;dword;ptr*);" & _ "GetDefaultAudioEndpoint hresult(int;int;ptr*);" & _ "GetDevice hresult(wstr;ptr*);" & _ "RegisterEndpointNotificationCallback hresult(ptr);" & _ "UnregisterEndpointNotificationCallback hresult(ptr)" Global Const $sIID_IMMDevice = "{D666063F-1587-4E43-81F1-B948E807363F}" Global Const $sTagIMMDevice = _ "Activate hresult(struct*;dword;ptr;ptr*);" & _ "OpenPropertyStore hresult(dword;ptr*);" & _ "GetId hresult(wstr*);" & _ "GetState hresult(dword*)" Global Const $sIID_IAudioSessionManager2 = "{77aa99a0-1bd6-484f-8bc7-2c654c9a9b6f}" Global Const $sTagIAudioSessionManager = "GetAudioSessionControl hresult(ptr;dword;ptr*);" & _ "GetSimpleAudioVolume hresult(ptr;dword;ptr*);" Global Const $sTagIAudioSessionManager2 = $sTagIAudioSessionManager & "GetSessionEnumerator hresult(ptr*);" & _ "RegisterSessionNotification hresult(ptr);" & _ "UnregisterSessionNotification hresult(ptr);" & _ "RegisterDuckNotification hresult(wstr;ptr);" & _ "UnregisterDuckNotification hresult(ptr)" Global Const $sIID_IAudioSessionEnumerator = "{e2f5bb11-0570-40ca-acdd-3aa01277dee8}" Global Const $sTagIAudioSessionEnumerator = "GetCount hresult(int*);GetSession hresult(int;ptr*)" Global Const $sIID_IAudioSessionControl = "{f4b1a599-7266-4319-a8ca-e70acb11e8cd}" Global Const $sTagIAudioSessionControl = "GetState hresult(int*);GetDisplayName hresult(ptr);" & _ "SetDisplayName hresult(wstr);GetIconPath hresult(ptr);" & _ "SetIconPath hresult(wstr;ptr);GetGroupingParam hresult(ptr*);" & _ "SetGroupingParam hresult(ptr;ptr);RegisterAudioSessionNotification hresult(ptr);" & _ "UnregisterAudioSessionNotification hresult(ptr);" Global Const $sIID_IAudioSessionControl2 = "{bfb7ff88-7239-4fc9-8fa2-07c950be9c6d}" Global Const $sTagIAudioSessionControl2 = $sTagIAudioSessionControl & "GetSessionIdentifier hresult(ptr)" & _ "GetSessionInstanceIdentifier hresult(ptr);" & _ "GetProcessId hresult(dword*);IsSystemSoundsSession hresult();" & _ "SetDuckingPreferences hresult(bool);" ; http://answers.awesomium.com/questions/3398/controlling-the-sound-using-pinvoke-the-volume-mix.html Global Const $sIID_ISimpleAudioVolume = "{87CE5498-68D6-44E5-9215-6DA47EF883D8}" Global Const $sTagISimpleAudioVolume = _ "SetMasterVolume hresult(float;ptr);" & _ "GetMasterVolume hresult(float*);" & _ "SetMute hresult(int;ptr);" & _ "GetMute hresult(int*)" Global $__oIAudioSessionManager2 Local $PList = ProcessList() _ArrayDisplay($PList) $SoundAPP = InputBox('Process name', 'What is the process name?', 'firefox.exe') Local $CurrentVolume = Audio_GetMasterVolume(_GetProcessID_by_name($SoundAPP)) * 100 Local $Vol = $CurrentVolume MsgBox(64 + 262144, $Vol, $SoundAPP) Local $SMV While 1 If _IsPressed(26) Then ConsoleWrite('UP! ' &$Vol&@CRLF) $Vol = $Vol+1 Audio_SetMasterVolume(_GetProcessID_by_name($SoundAPP), $Vol/ 100) ConsoleWrite('$SMV:'& $SMV&@CRLF) Sleep(10) EndIf If _IsPressed(28) Then ConsoleWrite('DOWN! ' &$Vol&@CRLF) $Vol = $Vol-1 $SMV=Audio_SetMasterVolume(_GetProcessID_by_name($SoundAPP), $Vol/ 100) ConsoleWrite('$SMV:'& $SMV&@CRLF) Sleep(10) EndIf $CurrentVolume = Round(Audio_GetMasterVolume(_GetProcessID_by_name($SoundAPP)) * 100, 0) ConsoleWrite('CV:'&$CurrentVolume &@CRLF) Sleep(100) WEnd Func _GetProcessID_by_name($process_name) Local $Process_list = ProcessList() Local $ProcessID_Func = 0 For $i = 1 To UBound($Process_list) - 1 If $Process_list[$i][0] = $process_name Then $ProcessID_Func = $Process_list[$i][1] ExitLoop EndIf Next Return $ProcessID_Func EndFunc ;==>_SoundAPP_setVolume Func Audio_SetMasterVolume($pid, $value) If Not IsObj($__oIAudioSessionManager2) Then $__oIAudioSessionManager2 = Audio_GetIAudioSessionManager2() EndIf If Not IsObj($__oIAudioSessionManager2) Then Return Local $pIAudioSessionEnumerator, $oIAudioSessionEnumerator If $__oIAudioSessionManager2.GetSessionEnumerator($pIAudioSessionEnumerator) < 0 Then Return $oIAudioSessionEnumerator = ObjCreateInterface($pIAudioSessionEnumerator, $sIID_IAudioSessionEnumerator, $sTagIAudioSessionEnumerator) If Not IsObj($oIAudioSessionEnumerator) Then Return SetError(1) Local $i, $nSessions, $pIAudioSessionControl2, $oIAudioSessionControl2 Local $ProcessID, $oISimpleAudioVolume Local $bMute = 0, $error = 1 If $oIAudioSessionEnumerator.GetCount($nSessions) >= 0 Then For $i = 0 To $nSessions - 1 If $oIAudioSessionEnumerator.GetSession($i, $pIAudioSessionControl2) >= 0 Then $oIAudioSessionControl2 = ObjCreateInterface($pIAudioSessionControl2, $sIID_IAudioSessionControl2, $sTagIAudioSessionControl2) If @error Then ContinueLoop $oIAudioSessionControl2.GetProcessId($ProcessID) If $ProcessID = $pid Then $oISimpleAudioVolume = ObjCreateInterface($pIAudioSessionControl2, $sIID_ISimpleAudioVolume, $sTagISimpleAudioVolume) If @error Then ContinueLoop $oIAudioSessionControl2.AddRef() ;stabilize If $oISimpleAudioVolume.SetMasterVolume($value, 0) >= 0 Then $error = 0 ExitLoop EndIf EndIf EndIf Next EndIf $oISimpleAudioVolume = 0 $oIAudioSessionControl2 = 0 $oIAudioSessionEnumerator = 0 ;MsgBox(0, $error, "App muted: " & $bMute) Return SetError($error, 0, $bMute) EndFunc ;==>Audio_SetMasterVolume Func Audio_GetMasterVolume($pid) If Not IsObj($__oIAudioSessionManager2) Then $__oIAudioSessionManager2 = Audio_GetIAudioSessionManager2() EndIf If Not IsObj($__oIAudioSessionManager2) Then Return Local $pIAudioSessionEnumerator, $oIAudioSessionEnumerator If $__oIAudioSessionManager2.GetSessionEnumerator($pIAudioSessionEnumerator) < 0 Then Return $oIAudioSessionEnumerator = ObjCreateInterface($pIAudioSessionEnumerator, $sIID_IAudioSessionEnumerator, $sTagIAudioSessionEnumerator) If Not IsObj($oIAudioSessionEnumerator) Then Return SetError(1) Local $i, $nSessions, $pIAudioSessionControl2, $oIAudioSessionControl2 Local $ProcessID, $oISimpleAudioVolume Local $bMute = 0, $error = 1 If $oIAudioSessionEnumerator.GetCount($nSessions) >= 0 Then For $i = 0 To $nSessions - 1 If $oIAudioSessionEnumerator.GetSession($i, $pIAudioSessionControl2) >= 0 Then $oIAudioSessionControl2 = ObjCreateInterface($pIAudioSessionControl2, $sIID_IAudioSessionControl2, $sTagIAudioSessionControl2) If @error Then ContinueLoop $oIAudioSessionControl2.GetProcessId($ProcessID) If $ProcessID = $pid Then $oISimpleAudioVolume = ObjCreateInterface($pIAudioSessionControl2, $sIID_ISimpleAudioVolume, $sTagISimpleAudioVolume) If @error Then ContinueLoop $oIAudioSessionControl2.AddRef() ;stabilize If $oISimpleAudioVolume.GetMasterVolume($bMute) >= 0 Then $error = 0 ExitLoop EndIf EndIf EndIf Next EndIf $oISimpleAudioVolume = 0 $oIAudioSessionControl2 = 0 $oIAudioSessionEnumerator = 0 ;MsgBox(0, $error, "App muted: " & $bMute) Return SetError($error, 0, $bMute) EndFunc ;==>Audio_GetMasterVolume Func Audio_GetIAudioSessionManager2() Local $oIAudioSessionManager2 = 0 Local Const $eMultimedia = 1, $CLSCTX_INPROC_SERVER = 0x01 Local $pIMMDevice, $oMMDevice, $pIAudioSessionManager2 Local $oMMDeviceEnumerator = ObjCreateInterface($sCLSID_MMDeviceEnumerator, $sIID_IMMDeviceEnumerator, $sTagIMMDeviceEnumerator) If IsObj($oMMDeviceEnumerator) Then If $oMMDeviceEnumerator.GetDefaultAudioEndpoint(0, $eMultimedia, $pIMMDevice) >= 0 Then $oMMDevice = ObjCreateInterface($pIMMDevice, $sIID_IMMDevice, $sTagIMMDevice) If IsObj($oMMDevice) Then If $oMMDevice.Activate(__uuidof($sIID_IAudioSessionManager2), $CLSCTX_INPROC_SERVER, 0, $pIAudioSessionManager2) >= 0 Then $oIAudioSessionManager2 = ObjCreateInterface($pIAudioSessionManager2, $sIID_IAudioSessionManager2, $sTagIAudioSessionManager2) EndIf $oMMDevice = 0 EndIf EndIf $oMMDeviceEnumerator = 0 EndIf If IsObj($oIAudioSessionManager2) Then Return $oIAudioSessionManager2 EndIf EndFunc ;==>Audio_GetIAudioSessionManager2 Func __uuidof($sGUID) Local $tGUID = DllStructCreate("ulong Data1;ushort Data2;ushort Data3;byte Data4[8]") DllCall("ole32.dll", "long", "CLSIDFromString", "wstr", $sGUID, "struct*", $tGUID) If @error Then Return SetError(@error, @extended, 0) Return $tGUID EndFunc ;==>__uuidof Func CLSIDFromString($sGUID) Local $tGUID = DllStructCreate("ulong Data1;ushort Data2;ushort Data3;byte Data4[8]") DllCall("ole32.dll", "long", "CLSIDFromString", "wstr", $sGUID, "struct*", $tGUID) Return $tGUID EndFunc ;==>CLSIDFromString
  1. Load more activity
×
×
  • Create New...