Jump to content

red0fireus

Active Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by red0fireus

  1. For anyone who has the same issue as me. https://forum.rainmeter.net/viewtopic.php?f=103&t=35808&p=181235#p181235
  2. Hello, I want to create a Run command that starts Rainmeter with "Bangs" Bangs are the variables that rainmeter uses to kill specific skins from running. I have figured out how to do it with: Run(@ComSpec & " /c " & '""C:\Program Files\Rainmeter\Rainmeter.exe" !DeactivateConfig "DeuXx\Visualizer\" "Visualizer v.2.ini""', @SystemDir, @SW_HIDE) But my question is how do I change "DeuXx\Visualizer\" and "Visualizer v.2.ini" to variables like $fileFolder and $fileINI I'm very confused on where the " " should start and end to achieve this. Here is my attempt: Global $fileFolder = "Minimalist Weather Standalone\" Global $fileINI = "Minimalist Weather.ini" Run(@ComSpec & " /c " & '""C:\Program Files\Rainmeter\Rainmeter.exe" !DeactivateConfig"' & $fileFolder & $fileINI, @SystemDir, @SW_HIDE) Thank you!
  3. I believe I got it working, I will report back if I still receive the error. Thank you Jos
  4. I'm trying to create a script to detect the Action Center in Windows 10: Opt("WinTitleMatchMode", 4) Opt("WinSearchChildren", 1) While 1 Sleep(50) $hControl = ControlGetHandle("[CLASS:TrayNotifyWnd]", "", "Action Center, No new notifications") If not $hControl = 0x00000000 and Not WinActive("[CLASS:TrayNotifyWnd]") Then ConsoleWrite("True") EndIf Wend I'm having issues detecting the Main Class and Window name of Action Center. I have used the Autoit Window Info Tool without success and I'm currently trying Microsoft Spy++. I want to detect the window when it is active. If anyone has figured this out before or could lend some support it would be much appreciated. I have also done research and think the Class could be Dwm and the Window Title is DWM Notification Window but I have been unsuccessful with both Thank you - red Here is the Failed test with Autoit WindowInfo Tool: Opt("WinTitleMatchMode", 4) Opt("WinSearchChildren", 1) While 1 _ActionCenter() Wend Func _ActionCenter() ;If @error Then MsgBox(16, "Error", "System tray not found") if WinExists("[TITLE:Action center; CLASS:Windows.UI.Core.CoreWindow]") then ConsoleWrite("True") EndIf EndFunc
  5. Hello, I've been playing with Arrays and I'm receiving this error code: "C:\Users\datea\Desktop\New AutoIt v3 Script.au3" (32) : ==> Subscript used on non-accessible variable.: If BitAND(WinGetState($var[$i][1]), 2) and ($aWinRect[2] >= @DesktopWidth) Or ($aWinRect[3] >= @DesktopHeight) then If BitAND(WinGetState($var[$i][1]), 2) and ($aWinRect[2] >= @DesktopWidth) Or ($aWinRect^ ERROR I have found that by opening certain windows when checking for a Maximized window for instance [Class:Shell_TrayWnd] or [CLASS:NotifyIconOverflowWindow] or Opening the Calendar, Side Windows 10 Panel or Volume button I receive this error. I believe it's mostly irrelevant because it only happens sometimes and the code works just find most of the time. I'm new to error checking and creating an "@error" for arrays. I think I need to implement a If @error then ContinueLoop   But I'm not exactly sure how to achieve this because the error is inside the Array I believe? Here is my code snippet that I'm working on #include <WinAPI.au3> Opt("WinTitleMatchMode", 4) Opt("WinSearchChildren", 1) AdlibRegister("_AggIsFullScreen") While 1 $tmp = _AggIsFullScreen() sleep(1000) If $tmp = 1 and ProcessExists("rainmeter.exe") then run("cmd.exe /c taskkill /im rainmeter.exe /f", "", @SW_HIDE) ConsoleWrite("true") elseif $tmp = 0 and not ProcessExists("rainmeter.exe") then Run("C:\Program Files\Rainmeter\rainmeter.exe", "C:\Program Files\Rainmeter", @SW_HIDE) ConsoleWrite("false") EndIf WEnd Func _AggIsFullScreen() $xMousePos = MouseGetPos(0) $yMousePos = MouseGetPos(1) Local $iPid ; Local $iWin Local $hwnd = WinGetHandle ("[ACTIVE]") Local $aWinRect = WinGetPos ($hwnd) Local $var = WinList("[REGEXPTITLE:^(?!Microsoft Text Input Application|Program Manager)(?s).*]") If $xMousePos >= 0 AND $xMousePos < @DesktopWidth AND $yMousePos >= 0 AND $yMousePos < @DesktopHeight and Not WinActive("[CLASS:NotifyIconOverflowWindow]") And Not WinActive("[Class:Shell_TrayWnd]") Then For $i = 1 To $var[0][0] ; $iWin = $var[$i][1] If BitAND(WinGetState($var[$i][1]), 2) and ($aWinRect[2] >= @DesktopWidth) Or ($aWinRect[3] >= @DesktopHeight) then ; is visible $iPid = WinGetProcess($var[$i][1]) If ProcessExists($iPid) Then return 1 else return 0 endIf EndIf Next else return -1 Endif EndFunc Thank you - red
  6. #include <WinAPI.au3> Global $iMonitor AdlibRegister("_AggIsFullScreen") While 1 $tmp = _AggIsFullScreen() sleep(1000) If $tmp = 1 and ProcessExists("rainmeter.exe") then run("cmd.exe /c taskkill /im rainmeter.exe /f", "", @SW_HIDE) ConsoleWrite("monitor 1") elseif $tmp = 0 and not ProcessExists("rainmeter.exe") then Run("C:\Program Files\Rainmeter\rainmeter.exe", "C:\Program Files\Rainmeter", @SW_HIDE) ConsoleWrite("monitor 2") EndIf WEnd Func _AggIsFullScreen() $xMousePos = MouseGetPos(0) $yMousePos = MouseGetPos(1) Local $iPid Local $iWin Local $var = WinList("[REGEXPTITLE:^(?!Microsoft Text Input Application|Program Manager)(?s).*]") If $xMousePos >= 0 AND $xMousePos < @DesktopWidth AND $yMousePos >= 0 AND $yMousePos < @DesktopHeight then For $i = 1 To $var[0][0] $iWin = $var[$i][1] If BitAND(WinGetState($var[$i][1]), 2) and BitAND(WinGetState($iWin), 2) and (StringInStr(WinGetClassList($iWin), 'SHELLDLL_DefView') = 0) And (BitAND(WinGetState($iWin), 2) = 2) And (_WinAPI_GetClientWidth($iWin) = @DesktopWidth) And (_WinAPI_GetClientHeight($iWin) = @DesktopHeight) then ; is visible $iPid = WinGetProcess($var[$i][1]) If ProcessExists($iPid) Then return 1 else return 0 endIf EndIf Next else return -1 Endif EndFunc I took a break and came back and I figured it out. If anyone is interested here is my code
  7. If this is not possible with multiple monitors then that would be good to know too.
  8. #include <WinAPI.au3> while 1 sleep(1000) If IsVisible() = 1 then ConsoleWrite("TRUE") Elseif IsVisible() = 0 then ConsoleWrite("FALSE") EndIF WEnd Func IsVisible() Local $hWnd = DllCall('user32.dll', 'hwnd', 'GetForegroundWindow') $hWnd = $hWnd[0] If (@error) Or ($hWnd = 0) Then Return SetError(1, 0, -1) EndIf If (StringInStr(WinGetClassList($hWnd), 'SHELLDLL_DefView') = 0) And (BitAND(WinGetState($hWnd), 2) = 2) And (_WinAPI_GetClientWidth($hWnd) = @DesktopWidth) And (_WinAPI_GetClientHeight($hWnd) = @DesktopHeight) Then return 1 else return 0 EndIf EndFunc I'm running in to an issue with this script. Currently it finds the Most Active Foreground Window but if I click on another monitor it starts to return False instead of True. I was thinking the best way to fix this would be to get the active windows pid and then if that ProcessExists then keep returning true. I've been working on this for 2 days now (it's probably simple) I'm pretty much worn out and need some kind of hint. (I want to keep returning true even if I click on another monitor) - that's my goal Thank you -
  9. I was able to execute the inner if statement. The inner if statement will only be executed if there are no exe files running stated in the exefiles.txt So my setup is I have a exefiles.txt file where each line has a different running or not running process --------------------------------------------- Exefiles.txt --------------------------------------------- test.exe (fake program) help.exe (fake program) rainmeter.exe (real program) (running) abc.exe (fake program) --------------------------------------------- End --------------------------------------------- With this setup the inner loop will not run and it will return true. If I were to remove the (real program) "rainmeter.exe" then my script will return false. I don't doubt that there was a better way of doing this, I'm trying to write a universal script for people to edit and I thought this would be the best option. The process must also be running for it to return true or 1
  10. #include <File.au3> AdlibRegister("_readFile") If _readFile() = 1 then ConsoleWrite("True!") Elseif _readFile() = 0 then ConsoleWrite("False!") EndIf While 1 Sleep(10) WEnd Func _readFile() $sFilePath = @ScriptDir & "\ExeFiles.txt" FileOpen($sFilePath, 0) For $i = 1 to _FileCountLines($sFilePath) $line = FileReadLine($sFilePath, $i) If ProcessExists($line) then return 1 If not ProcessExists($line) then return 0 endif EndIf Next FileClose($sFilePath) EndFunc Alright, I got it. Thank you
  11. #include <File.au3> AdlibRegister("_readFile") While 1 Sleep(10) WEnd If _readFile() = 1 then ConsoleWrite("True!") Elseif _readFile() = 0 then ConsoleWrite("False!") EndIf Func _readFile() $sFilePath = @ScriptDir & "\ExeFiles.txt" FileOpen($sFilePath, 0) For $i = 1 to _FileCountLines($sFilePath) $line = FileReadLine($sFilePath, $i) If ProcessExists($line) then Return 1 EndIf Return 0 Next FileClose($sFilePath) EndFunc I have the above script and for some reason it will not return 1 or 0. If I replace "Return 1" with ConsoleWrite("True") it returns just fine. I'm not sure what I'm doing wrong.
  12. It's 3:00AM I figured it out! Sorry for the post!
  13. #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Description=Rainmeter Suspend #AutoIt3Wrapper_Res_Fileversion=0.0.0.1 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_ProductName=Rainmeter Suspend #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPI.au3> #include <WindowsConstants.au3> Opt("TrayAutoPause",0) while 1 sleep(5000) _IsFullScreen() WEnd Func _IsFullScreen () Local $hwnd = WinGetHandle ("[ACTIVE]") Local $aWinRect = WinGetPos ($hwnd) If ($aWinRect[2] >= _WinAPI_GetSystemMetrics($SM_CXSCREEN)) OR ($aWinRect[3] >= _WinAPI_GetSystemMetrics($SM_CYSCREEN)) Then _ProcessSuspend("rainmeter.exe") Else _ProcessResume("rainmeter.exe") EndIf EndFunc Func _ProcessSuspend($process) $processid = ProcessExists($process) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFunc Func _ProcessResume($process) $processid = ProcessExists($process) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFunc I'm getting this error when running my script: "Error: Subscript used on non-accessible variable" I'm very confused because the script works 99% of the time and then I just get the random error. What am I missing?
  14. #include "DeviceAPI.au3" $DeviceName = "NVIDIA Geforce GTX 1050" $classname = "Display adapters" ;$objWMIService = ObjGet("winmgmts:" & $strComputer & "rootCIMV2") ;$m_MediaConnectWatcher = $objWMIService.ExecNotificationQuery("SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_DiskDrive'") AdLibRegister("HWDevice_Detect") While 1 ; ConsoleWrite(@CRLF & "Checking for [" & $DeviceName & "]...") Sleep(5000) WEnd Func HWDevice_Detect($devicename, $classname) Local $DeviceListed = False Local $aClasses = _DeviceAPI_GetClassArray() For $X = 0 to Ubound($aClasses)-1 If $aClasses[$X][2] = $classname Then Local $aDevices = _DeviceAPI_GetDeviceArray($aClasses[$X][0]) For $Y = 0 to Ubound($aDevices)-1 If $aDevices[$Y][1] = $devicename Then $DeviceListed = True EndIf Next EndIf Next If $DeviceListed = True Then Do ConsoleWrite("Device Active") sleep(2000) Until $DeviceListed = False ; AdlibUnRegister("HWDevice_Detect") ElseIf $DeviceListed = False then Do ConsoleWrite("Device Deactive") sleep(2000) Until $DeviceListed = True ; Run(@Comspec & " /c " & "devcon rescan") EndIf EndFunc I got the script working, i just need it to update when it's running. Right now even when the graphics card is connected or disconnected it will still say the same thing. When I run the script and the device is active and then if I temporarily disconnected the Graphics card, it says graphics card is still active and vise versa
  15. #include "DeviceAPI.au3" $DeviceName = "NVIDIA Geforce GTX 1050" $classname = "Display adapters" ;$objWMIService = ObjGet("winmgmts:" & $strComputer & "rootCIMV2") ;$m_MediaConnectWatcher = $objWMIService.ExecNotificationQuery("SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_DiskDrive'") AdLibRegister("HWDevice_Detect") While 1 ; ConsoleWrite(@CRLF & "Checking for [" & $DeviceName & "]...") Sleep(5000) WEnd Func HWDevice_Detect($devicename, $classname) Local $DeviceListed = False Local $aClasses = _DeviceAPI_GetClassArray() For $X = 0 to Ubound($aClasses)-1 If $aClasses[$X][2] = $classname Then Local $aDevices = _DeviceAPI_GetDeviceArray($aClasses[$X][0]) For $Y = 0 to Ubound($aDevices)-1 If $aDevices[$Y][1] = $devicename Then $DeviceListed = True EndIf Next EndIf Next If $DeviceListed = True Then ConsoleWrite("Device active") Exit ; AdlibUnRegister("HWDevice_Detect") Else ConsoleWrite("Device Deactive") Exit ; Run(@Comspec & " /c " & "devcon rescan") EndIf EndFunc I changed it a bit and got it somewhat working. Now the issue is getting it to check correctly and repeatedly. It checks correctly first and then i have to exit or it will switch to deactive
  16. Please move my post: "Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums." Just saw this...
  17. Hello, I'm a college student, and I have a Surface Book 2. Currently Microsoft has a stick up their ass and Windows Surface Books, after the 1903 windows update, have issues where the graphics card disconnects from the computer for no reason. (They still haven't fixed it) I have the Surface Book 2 13.5 Inch with a 1050 graphics card. I was looking for a fix online and decided to code something to try and fix it. I found that if I scan for hardware changes on the Device Manager then the graphics card will reappear. *Face Palm* I went and downloaded Devcon.exe last night and looked for example code online on how to check if a device no longer exists and if it doesn't then do "devcon rescan" and I'm going to assume this works. If anyone has any better ideas, please post some. I've checked Reddit on how to fix this, and I've installed the Surface Book 2 Drivers. No Luck. Any recommendations would be helpful Things I've tried: Updating Windows to the Skip Beta version Reinstalling the Drivers multiple times with many different scenarios Checking for Updates (A lot) Uninstalling Software Running software as Administrator Cleaning the Devices Metal connector with Isopropyl alcohol 91% (Someone recommended it on Reddit) Installing the new NVIDIA graphic drivers (this just made it worse) Current Drivers: NVIDIA Update 31.1.10.0 NVIDIA Graphics Driver 391.40 Uninstalling the Graphic Drivers in Safe Mode with DDU Uninstaller #include "DeviceAPI.au3" $DeviceName = "NVIDIA Geforce GTX 1050" $DeviceClass = "Display adapters" ;$objWMIService = ObjGet("winmgmts:" & $strComputer & "rootCIMV2") ;$m_MediaConnectWatcher = $objWMIService.ExecNotificationQuery("SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_DiskDrive'") Do ConsoleWrite(@CRLF & "Checking for [" & $DeviceName & "]...") Sleep(5000) Until HWDevice_Detect($DeviceName, $DeviceClass) = True Func HWDevice_Detect($devicename, $classname) Local $DeviceListed = False Local $aClasses = _DeviceAPI_GetClassArray() For $X = 0 to Ubound($aClasses)-1 If $aClasses[$X][2] = $classname Then Local $aDevices = _DeviceAPI_GetDeviceArray($aClasses[$X][0]) For $Y = 0 to Ubound($aDevices)-1 If $aDevices[$Y][1] = $devicename Then $DeviceListed = True EndIf Next EndIf Next If $DeviceListed = True Then Sleep(1000) Else Run(@Comspec & " /c " & "devcon rescan") EndIf EndFunc This is the code i found and i tried to edit it but it doesn't work for what i need. It exits after it's true. I need it to constantly scan (and not cause high CPU usage) if that's possible. I was thinking scan every 15min? Proof of issue: Link Here to Microsoft
  18. I wouldn't recommend deleting Windows DLL files because it can cause issues else where in the OS. You should try the fix below and then delete the DLL if the issue persists. https://superuser.com/questions/118104/how-to-remove-the-volume-icon-in-w7-taskbar/118106
  19. Opt("TrayAutoPause",0) $blackops4 = "BlackOps4.exe" $overwatch = "Overwatch.exe" $rainmeter = "Rainmeter.exe" While 1 If ProcessExists($blackops4) Or ProcessExists($overwatch) Then Send("^+!{F12}") ElseIf Not ProcessExists($blackops4) Or Not ProcessExists($overwatch) Then Send("^+!{F11}") EndIf Sleep(1000) WEnd Is there any better way to write this? I can't seem to figure it out and this is causing issues with my system because it keeps sending the same keystroke over and over again. This is NOT a game "Hacking" script or anything like that. Its to boost my Battle.net games using Razer Cortex because Battle.Net games have issues with the Razer Cortex Boosting software. Thank you.
  20. Okay, that seems to work! Thank you
  21. Hello. So I have this code and It works when you run it once but I cant seem to get it to loop correctly so it runs without lagging my system or just loop in general. I know I need to put the loop somewhere around the $stdout but it doesn't seem to like it. This is probably really stupid but I'm really stumped and would appreciate help with this. Thank you! Basically I want it to check the service over and over again. #RequireAdmin Opt("TrayAutoPause",0) $servicename = "dnscrypt-proxy" $chrome = "chrome.exe" $stdout = Run('sc.exe query ' & $servicename, '', @SW_HIDE, 2) $data = _StdOut($stdout) Func _StdOut($stdout) Local $data While 1 $data = StdOutRead($stdout) If $data Then If StringInStr($data, 'Running') Then If ProcessExists($chrome) Then run("cmd.exe /c sc stop dnscrypt-proxy", "", @SW_HIDE) EndIf ElseIf StringInStr($data, 'Stopped') Then If Not ProcessExists($chrome) Then run("cmd.exe /c sc start dnscrypt-proxy", "", @SW_HIDE) EndIf EndIf Else Sleep(10) EndIf WEnd EndFunc
  22. Yeah its fixed. Thank you!
  23. Thank you for your help. That does work however it removes all the text like "NVIDIA Disable/Enable SLI" And "Status: " It just returns Enabled or Disabled
  24. Okay, so I'm really stumped with this and I KNOW its a stupid question but I would really appreciate it if some one could lead me in the right direction. #include <MsgBoxConstants.au3> Example() Func Example() Local $iCount = ControlCommand("NVIDIA Control Panel","","[CLASS:Button; TEXT:Maximize 3D pe&rformance]", "IsChecked", "") MsgBox($MB_SYSTEMMODAL, "", "NVIDIA Disable/Enable SLI" & @CRLF & @CRLF & "Status: " & $iCount & @CRLF) EndFunc ;==>Example This is what I have and it returns 1 if its selected and 0 if its not which is great but I was wondering how I could make it so the 1 Shows up as Enabled and the 0 shows up as Disabled (As Text in the MsgBox).
  25. Hi I am looking for a way to get value from Visible Text. >>>> Window <<<< Title: NVIDIA Control Panel Class: Afx:00007FF6CFB40000:b:0000000000010007:0000000000000006:0000000002F21B43 Position: 965, 540 Size: 974, 620 Style: 0x14CF0000 ExStyle: 0x00010100 Handle: 0x0000000000B11C78 >>>> Control <<<< Class: Static Instance: 26 ClassnameNN: Static26 Name: Advanced (Class): [CLASS:Static; INSTANCE:26] ID: 206 Text: Position: 275, 113 Size: 953, 531 ControlClick Coords: 202, 73 Style: 0x5400000E ExStyle: 0x00000004 Handle: 0x00000000004E1C9E >>>> Mouse <<<< Position: 1450, 777 Cursor ID: 0 Color: 0xF3F3F3 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< D&isable SLI I'm looking to get the Value for D&isable SLI and then move my mouse to it. I'm having trouble with this because I can't use the Advanced Class because there are multiple buttons with the same class so i have to resort to using Visible Text. Is this possible to do? I found some example code on the forum but I'm not sure how to use the RegExp $Text=ControlGetText("[CLASS:Notepad]","","[CLASSNN:Edit1]") $Value=StringSplit($Text,@CRLF) For $i=1 To $Value[0] If StringRegExp($Value[$i],"[0-9][^:alpha:]") Then MsgBox(0,"",$Value[$i]) EndIf Next That's the example.
×
×
  • Create New...