Jump to content

jebus495

Active Members
  • Posts

    163
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

jebus495's Achievements

Prodigy

Prodigy (4/7)

0

Reputation

  1. 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.
  2. 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.
  3. I have used this for many different things over the years and I suspect it may be appropriately suited for your needs.
  4. 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.
  5. Found this poking around in the Help File under "Window Titles and Text (Advanced)" WinClose("[ACTIVE]", "") This should help you.
  6. 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.
  7. Have a look at _IsPressed. If _IsPressed([hex value for Fx]) Then WinMove(blah blah) That might work.
  8. 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?
  9. 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
  10. 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
  11. 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.
  12. #Include <Misc.au3> While 1 Sleep(50) If _IsPressed(01) Then Send("S", 1) Sleep(500) WEnd Look up _IsPressed in the Help File.
  13. 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.
  14. 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.
×
×
  • Create New...