
jebus495
Active Members-
Posts
163 -
Joined
-
Last visited
Everything posted by jebus495
-
WinMove won't move a certain window - (Locked)
jebus495 replied to jebus495's topic in AutoIt General Help and Support
I have used the window info tool and I used the WinList function with an _ArrayDisplay and they both confirm that the window title is Diablo II If it blocks all automation tools then I find it hard to understand why WinActivate works but WinMove does not. The only workaround I have at this point is using MouseClickDrag to move it xD I found _WinAPI_MoveWindow() and I tried that function but the same result. It will move other windows but not Diablo II. -
WinMove won't move a certain window - (Locked)
jebus495 replied to jebus495's topic in AutoIt General Help and Support
Here is a more basic explanation WinMove("Diablo II", "", 0, 0) This will work if it matches a notepad window with Diablo II in the title but it will not work with the actual game window Diablo II. ;$d2hndle = WinGetHandle("Diablo II") ;WinActivate($d2hndle) ;WinMove($d2hndle, "", 0, 0) I tested this by uncommenting this section and then commenting out the entire For loop. It will activate the window but it will not move it. -
Search Picture in Picture - (Moved)
jebus495 replied to macerau's topic in AutoIt General Help and Support
I have used this for many different things over the years and I suspect it may be appropriately suited for your needs. -
This one really has me scratching my head, so much so that I've resorted to the help of wonderful friendly internet people. So I made a simple script to move and resize half a dozen windows into their proper positions for my twitch stream. The problem is that one of these windows does not want to cooperate. Here is my script: #include <Array.au3> HotKeySet("{END}", "_Terminate") HotKeySet("{INSERT}", "_WinMove") Global $aWin[][] = _ [["Chat - Twitch", 1051, 557, 872, 495] _ , ["Raid and Host - Twitch", 0, 625, 404, 397] _ , ["Stream Information - Twitch", 808, 261, 242, 763] _ , ["Stream Markers - Twitch", 406, 625, 400, 399] _ , ["Stats - Twitch", 807, 0, 243, 261] _ , ["OBS", 1050, 0, 873, 557] _ , ["Diablo", 0, 0, "", ""]] ;_ArrayDisplay($aWin) While 1 Sleep(50) WEnd Func _WinMove() ;$d2hndle = WinGetHandle("Diablo II") ;WinActivate($d2hndle) ;WinMove($d2hndle, "", 0, 0) For $i = 0 To 6 $aWinHan = WinActivate($aWin[$i][0]) WinWaitActive($aWinHan) Sleep(50) WinMove($aWinHan, "", $aWin[$i][1], $aWin[$i][2], $aWin[$i][3], $aWin[$i][4]) Next EndFunc Func _Terminate() Exit EndFunc So I set up an array with all the data I want to use and then use a loop to move all the windows. The diablo window is the only window that will not move to the x, y location specified. As a test I made a text file with "Diablo II" in its title and tested the script on that, it moves the text window to 0, 0 as expected. The Diablo 2 window responds to WinActivate but it will not move to the 0, 0 position (or any position) using the WinMove function for reasons I can't comprehend. I specifically recall using AutoIt to do this exact same thing several years ago.
-
How do I determine which IE browser window is on top?
jebus495 replied to Capel's topic in AutoIt General Help and Support
Found this poking around in the Help File under "Window Titles and Text (Advanced)" WinClose("[ACTIVE]", "") This should help you. -
Run a function as long as X key is pressed
jebus495 replied to Its2l82die's topic in AutoIt General Help and Support
You may also want to try the _IsPressed() function. Every key has a numerical value for use with the function. You can find the number for every key in the help file for the function. You could do something like this: While _IsPressed(55) ;DO SOME STUFF WHILE KEY IS PRESSED WEnd Loop begins when the key is pressed and loops until the key is released. -
Have a look at _IsPressed. If _IsPressed([hex value for Fx]) Then WinMove(blah blah) That might work.
-
A fun problem for you to solve
jebus495 replied to jebus495's topic in AutoIt General Help and Support
I have honestly missed how this relates to what I want to do. Where do I put the cursor position? What other values do I need to get and where do they go? -
A fun problem for you to solve
jebus495 replied to jebus495's topic in AutoIt General Help and Support
So how do I even use this formula? lol. Got me a bit confused. What numbers do I actually need to put where? O.o -
A fun problem for you to solve
jebus495 replied to jebus495's topic in AutoIt General Help and Support
This isn't fun anymore. -
A fun problem for you to solve
jebus495 replied to jebus495's topic in AutoIt General Help and Support
Thank you for wording it that way! It gave me an idea! Ironically the center point of the window I want to use is 404. xD -
A fun problem for you to solve
jebus495 replied to jebus495's topic in AutoIt General Help and Support
As requested: #Include <Misc.au3> While 1 $winpos = WinGetPos("Untitled - Notepad") If _IsPressed(11) Then $mospos = MouseGetPos() MouseMove($winpos[0]+($winpos[2]/2), $winpos[1]+($winpos[3]/2), 100) Sleep(500) MouseMove($mospos[0], $mospos[1], 0) EndIf WEnd This is not really a working example. What this does is move your mouse from its current position to the center of the notepad screen and then puts it back. Yes I know all about MouseGetPos() and MouseMove() but my confusion begins with calculating my final desired mouse position. There really isn't much room to make an attempt for this particular problem. Only a few lines and I can't for the life of me figure out how I would need to work that out. It would be fine if it did nothing in that case. -
attaching a send to a mouseclick
jebus495 replied to MasonMill's topic in AutoIt General Help and Support
#Include <Misc.au3> While 1 Sleep(50) If _IsPressed(01) Then Send("S", 1) Sleep(500) WEnd Look up _IsPressed in the Help File. -
What exactly do you want your script to do? What pixelchecksum does is essentially add of the value of every pixel in a given rectangle. You normally compare the sum of pixels in the same area to determine if something has changed. It will return with a change even if only 1 pixel changes.
-
I would like to write a script that: Moves the mouse to the outside edge of a window relative to the position of the mouse. For example if my mouse was 100 pixels above the center of the window I would want the mouse to move up to the top of the window. Here is a screenshot to better illustrate what I mean: Seems like it would take some math (possibly trig?) which I'm pretty good at generally. This situation has be lost on even where to begin though. Thought it might seem like a fun thing to do.
-
Oh well, look at this. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1_1 = GUICreate("Form1", 634, 448, 192, 124) $MenuItem1 = GUICtrlCreateMenu("&MenuItem1") $MenuItem2 = GUICtrlCreateMenuItem("MenuItem2", $MenuItem1) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
-
i don't know but did you try just declaring it somewhere in your script?
-
After a good nights rest I figured out what was going on. _WinAPI_SetLayeredWindowAttributes() It sets the current color of your gui as transparent. $Form1 = GUICreate("Form1", 633, 35, 192, 124, $WS_POPUP, $WS_EX_LAYERED) _WinAPI_SetLayeredWindowAttributes($Form1, 0x0000F4, 255) ^ will not work $Form1 = GUICreate("Form1", 633, 35, 192, 124, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0xABCDEF) _WinAPI_SetLayeredWindowAttributes($Form1, 0x0000F4, 255) ^ also will not work $Form1 = GUICreate("Form1", 633, 35, 192, 124, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0xABCDEF) _WinAPI_SetLayeredWindowAttributes($Form1, 0xABCDEF, 255) ^ does work
-
OMG that is perfect. <3 Of course it had to be RegExp... >.>
-
*raises eyebrow*
-
The thing is that I need to turn 111 into 112 not 111 into 222. (I realize now that part wasn't clear) Also needs to be a single line. (nvm just needed to remove last @CRLF)
-
That is strange. Not sure why that is. This should work though. #include <file.au3> Opt("SendKeyDelay", 25) WinWaitActive("Untitled - Notepad") Sleep(500) $hFile = FileOpen(@ScriptDir & "\a_4.txt", 0) $lines = _FileCountLines(@ScriptDir & "\a_4.txt") For $i = 1 To $lines $Contents = FileReadLine($hFile, $i) Send($Contents & @CR) Next FileClose($hFile)
-
Here are some examples of the strings I will be dealing with xxx xxxx111 xxx11 xxxx-xxxx-1 I basically want to copy everything that isn't a number and increment what is a number by one, merge them back and paste it somewhere. Here is what I have tried. I have also tried 3-4 other methods that have also resulted in failure. #Include <Clipboard.au3> #Include <string.au3> #Include <array.au3> Global $i, $NEWpost $CBsplit = StringSplit(_ClipBoard_GetData($CF_TEXT), "") _ArrayDisplay($CBsplit) For $i = 1 To UBound($CBsplit) -1 If StringIsInt($CBsplit[$i]) Then _StringInsert($CBsplit[$i], $NEWpost, 0) Next MsgBox(0, $NEWpost, "") Exit I this particular case it would seem that _StringInsert is where I'm going wrong. =\
-
ooooh now I'm pretty sure I can help there lol. _GUICtrlMenu_EnableMenuItem enable/disable(grey out)
-
GUICtrlSetFont(-1, "", 2) Adding that should work.