Jump to content

msd1994

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by msd1994

  1. I have a script that just adds some keyboard shortcuts for things like displaying the current song and artist, moving the window to the side so it won't pop up in my way, and play/pause, next song, previous song (these are the only 3 to still work since they don't need the window handle.) In some update recently, Spotify's window class swapped from "[CLASS:SpotifyMainWindow]" to "[CLASS:Chrome_WidgetWin_0]". Using the new class in my controls doesn't seem to work, I've tried getting the window handle from the process handle (_GetHwndFromPID($PID)) but that seems to fail as well. Does anybody have some idea of a way I could get this script working again? edit: seems like discord has the same window class name, so could be some issue with this? Still not sure of a way to solve the issue though, I added a function to get the handle of the active window and can just use that now, but it was able to find it on its own before on spotify startup or script startup which would be preferred. Thanks!
  2. Got it working, with code below. This can be closed unless someone has a better suggestion #include <Misc.au3> HotKeySet("!+{R}", "pauseFunc") HotKeySet("{3 down}", "myLeftclick") HotKeySet("{4 down}", "myRightclick") Opt("MouseClickDelay", 500) Global $hDll = DllOpen("user32.dll") Global $p = False Global $xCoord = @DesktopWidth While 1 Sleep(100) WEnd Func pauseFunc() $p = Not $p HotKeySet("{3 down}") HotKeySet("{4 down}") ToolTip("P", 0, 0) While $p Sleep(100) WEnd HotKeySet("{3 down}", "myLeftclick") HotKeySet("{4 down}", "myRightclick") ToolTip("") EndFunc Func myLeftclick() While _IsPressed ("33") MouseClick("left") WEnd EndFunc Func myRightclick() While _IsPressed ("34") MouseClick("right") WEnd EndFunc
  3. It behaves differently with HotKeySet(). I tried it originally, but if i held the "3" key down, it would instead constantly call the function, which would then continue left clicking even after I stop holding the key. Is there some way to prevent this? (limit a function to be called every ___ milliseconds?) Thanks!
  4. Hello, I wrote a script to left click when I press or hold the 3 key, and right click when i press or hold the 4 key, except it still sends "3" or "4". Is there some way to suppress that input when this script is active, but still have the same behavior otherwise? This is my (simple) program. While 1 If _IsPressed ("33") Then MouseClick("left") Sleep(200) EndIf If _IsPressed ("34") Then MouseClick("right") Sleep(50) EndIf WEnd maximum speed when holding down the 3 key is approx. 5 clicks a second, which is a good speed. Any suggestions would be appreciated. Thanks!
  5. he could add a check for something that's neither "@" nor "." in between, but this is just the simplest way I thought to do without regex. Your app would most likely be a more foolproof method ,assuming it was made specifically to check if an email address is valid, if he chose to use it, I haven't personally looked at it
  6. Simple way to check, just loop through and check each char, if you find a "@" then look for a "." if you find that, you're good to go. Here's a very simple example. #include <MsgBoxConstants.au3> Global $i = 0 Global $str=String("blahblah@test.com") For $i = $i To StringLen($str)-1 If StringMid($str, $i, 1) == '@' Then ExitLoop EndIf Next For $i = $i To StringLen($str) -1 If StringMid($str, $i, 1) == '.' Then MsgBox(0, "Success", "Email address is valid") EndIf Next
  7. Download seems to be broken.
  8. I made a general utility file for volume and playback control, using the _W7sound UDF for muting spotify and only spotify, but when trying to automate it, so whenever the title has or contains "Spotify" spotify should be muted. Otherwise, it should unmute spotify. If i initiate muting spotify with a hotkey, it works, and will unmute properly, but I want it to mute automatically as well. I've tried many different ways to do this, most recently this. while 1 Sleep(300) ; give time for title of window to change $title = WinGetTitle("[CLASS:SpotifyMainWindow]") ; check what title is If (StringInStr($title, "Spotify")) Then ; if not song title, mute. If Not $autoUnmute Then autoMute() EndIf EndIf If $autoUnmute Then ;var set by "autoMute", if true, check when to unmute. ToolTip("Muted", 0, 0) While (StringInStr($title, "Spotify")) Sleep(200) $title = WinGetTitle("[CLASS:SpotifyMainWindow]") WEnd ToolTip("") Sleep(300) If $autoUnmute Then _SetVolume("[CLASS:SpotifyMainWindow]", _GetVolume("[CLASS:SpotifyMainWindow]")) EndIf $autoUnmute = False EndIf Sleep(200) WEnd Func autoMute() $title = WinGetTitle("[CLASS:SpotifyMainWindow]") ; double check still muted If (StringInStr($title, "Spotify")) Then ; if it is, mute, set var to true so while loop checks when to unmute. _MuteVolume("[CLASS:SpotifyMainWindow]") $autoUnmute = True EndIf EndFuncif i remove the part above "If $autoUnmute Then" and just call autoMute myself with the hotkey I set, it works and properly mutes, then unmutes. Trying like this seems to have trouble though. Anyone have some idea why I would be having trouble? I did notice a slight delay in the time of me pausing Spotify and the actual title changing in "SndVol.exe" (volume mixer), but haven't been able to figure out how to fix this if that was the issue.
  9. Found a workaround. Just added entries to task scheduler to start each script with highest permissions and run automatically when I log into my user. Still not sure why startup folder or registry entries weren't working though.
  10. Is there some way to send controlCommand to mute a specific program through windows mixer without having to keep the window open and alt-tabbing to it every few minutes? I made a program for general control of spotify, but the ads are a lot louder than the actual music volume, so i want something to mute them. I made something that control-clicks on windows mixer's "Mute Spotify" Text control, which works fine as long as 1: i keep the window for the mixer up, and 2: I activate that window every once in a while. Is there some way to do this without having to activate the window every so often, and not needing to keep the actual "Volume Mixer" opened? I'm not currently on my home computer which is the one with the source but I can add it when I get home if it would help knowing exactly how I'm calling ControlClick. Thansk in Advance!
  11. Still haven't found a solution for this, does anyone have an idea to what else could be preventing them from auto-starting?
  12. windows 7 x64 Okay I'll try this, but why would it need to wait a minute to start before trying to open just because of admin rights? If I make it so it doesn't need admin rights, it starts up just fine without any delay to when it starts.
  13. yes they do and it does have admin rights. I have checked msconfig and they are both enabled there as well.
  14. Hi all, I was wondering why even with a shortcut in the startup folder %APPDATA%MicrosoftWindowsStart MenuProgramsStartup of a few scripts I'd like to start with windows that I compiled to EXE's, they don't start with admin privilleges. The scripts aren't kept on the same drive as the boot drive, though both are internal drives, and other programs on the same drive as my compiled scripts start up with windows using the same method. Is there any alternative method I could try or any way to fix this issue? I do need them to run with admin privilleges. Thank you!
×
×
  • Create New...