Jump to content

bootybay

Active Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by bootybay

  1. When changing the window transparency, the background transparency is completely lost. In the base example from the AutoIt Help you can move merlin across the screen without the white box around him since it's transparent. Now I wanted to add a fade in and fade out function (TransUp, TransDown) to make the example 2 a little more spooky: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $g_hGui, $g_aGuiPos, $g_hPic, $g_aPicPos, $trans = 0 Example() Func Example() $g_hGui = GUICreate("test transparentpic", 200, 100) $g_hPic = GUICreate("", 68, 71, 10, 20, $WS_POPUp, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $g_hGui) GUICtrlCreatePic("..\GUI\merlin.gif", 0, 0, 0, 0) GUISetState(@SW_SHOW, $g_hPic) GUISetState(@SW_SHOW, $g_hGui) HotKeySet("{ESC}", "Main") HotKeySet("{Left}", "Left") HotKeySet("{Right}", "Right") HotKeySet("{Down}", "Down") HotKeySet("{Up}", "Up") HotKeySet("{PGUP}", "TransUp") HotKeySet("{PGDN}", "TransDown") $g_aPicPos = WinGetPos($g_hPic) $g_aGuiPos = WinGetPos($g_hGui) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd HotKeySet("{ESC}") HotKeySet("{Left}") HotKeySet("{Right}") HotKeySet("{Down}") HotKeySet("{Up}") EndFunc ;==>Example Func Main() $g_aGuiPos = WinGetPos($g_hGui) WinMove($g_hGui, "", $g_aGuiPos[0] + 10, $g_aGuiPos[1] + 10) EndFunc ;==>Main Func Left() $g_aPicPos = WinGetPos($g_hPic) WinMove($g_hPic, "", $g_aPicPos[0] - 10, $g_aPicPos[1]) EndFunc ;==>Left Func Right() $g_aPicPos = WinGetPos($g_hPic) WinMove($g_hPic, "", $g_aPicPos[0] + 10, $g_aPicPos[1]) EndFunc ;==>Right Func Down() $g_aPicPos = WinGetPos($g_hPic) WinMove($g_hPic, "", $g_aPicPos[0], $g_aPicPos[1] + 10) EndFunc ;==>Down Func Up() $g_aPicPos = WinGetPos($g_hPic) WinMove($g_hPic, "", $g_aPicPos[0], $g_aPicPos[1] - 10) EndFunc ;==>Up Func TransUp() $trans -= 15 If $trans < 15 Then $trans = 15 If $trans > 255 Then $trans = 255 WinSetTrans($g_hPic, "", $trans) EndFunc Func TransDown() $trans += 15 If $trans < 0 Then $trans = 0 If $trans > 255 Then $trans = 255 WinSetTrans($g_hPic, "", $trans) EndFunc It fades in and out but now you see the white box around merlin. I sadly can't think of a workaround. I tried changing $g_hGUI and $g_hPic both and in different orders with no effect. This is very important to me. Please guide me!
  2. I'm aware that you can manipulate existing windows with WinMove and WinSetState, but not the style of the window. Can anyone tell me if I can somehow change the style of an existing window similar to the GUI Control Styles?
  3. I wanted to change the window style of an old game and resize it, so it basically acts as pseudo fullscreen or borderless fullscreen. I thought this would be pretty easy to do, since I worked with GUI before and those have all kinds of styles. Unfortunately I was unable to find an appropriate option for the Window Management. Here is an AHK script that solves this problem but I still would like to know how to solve it in AutoIt. <snip>
  4. I'm using a edit field in my GUI as an event log. I usually stored all the lines in an array of size 100 and pushing through it when adding further lines. I then combined the while array to a string and set the text in the edit. Now I switched to _GUICtrlEdit_AppendText since it seemed so practical. Problem is after about 800 lines it stops writing to the edit. There seems to be a limit reached. Is there away to circumvent the limit or push the value like i did with _ArrayPush ?
  5. Is the transparency working for anyone? I'm using the Imagesearch2015 of guestscripter . ;                   $transparency - TRANSBLACK, TRANSWHITE or hex value (e.g. 0xffffff) of ;                                  the color to be used as transparency; can be omitted if ;                                  not needed The imagesearch without transparency works perfect. But using the transparency like instructed above is just strange. Example: _ImageSearch("icon.bmp", 0, $x, $y, 0, 0xffffff) ; This will always return True with $x = 0, $y = 0 ; icon.bmp is a green + sign with white background. ; It also doesn't matter if there is white in the image or not or if the copy of the image is displayed. It will always return True,0,0 ; If I perform the search on a limited area with _ImageSearchArea it will return True and x, y the top, left corner coordinates. ; when icon.bmp is a green + sign with BLACK background, ; using 0x000000 will always return False (unless you could find the image without transparency because its the exact same) ; Using TRANSBLACK / TRANSWHITE will also always return false So either I don't understand something or something doesn't work. Since this is ported from AutoHotkey, I decided to try it out the original and that works with the same images. If someone with more knowledge could tell how to troubleshoot this. That would be great.
  6. Thank you all for all the super fast responses. Your example clarified this for me @Melba23.
  7. I'm having problems grasping some concepts. I'll show you what I want to try and if it makes sense to you. Func Stat() Static $Region = StringSplit(StringStripWS (IniRead("win7.ini", "Update", "Complete", "600, 500, 620, 520, 0x00FF00"), 8), ",", 2) PixelSearch($Region[0], $Region[1], $Region[2], $Region[3], $Region[4]) If Not @error Then Return True EndFunc Func Test() While True If Stat() = True Then ExitLoop Sleep(5000) WEnd MsgBox(0, "Update", "complete!") EndFunc So Stat() gets called over and over again. I want to read the INI only once and from then on keep using the $Region values. I don't want to declare a global or pass the array as ByRef into stat. Basically I want to IniRead the values while $Region is empty and then once it got its values not do it anymore. I want to keep it contained in Stat. But I don't know how to do this. Please let me know if I need to clarify this a little more.
  8. I tried both chrome examples after changing filepath and language constants. Both times I get an error. This one for ex5_chrome.au3: "RedactedPath\UIAWrappers.au3" (1726) : ==> Variable must be of type "Object".: $t = $obj.Findfirst($treeScope, $oCondition, $UIA_pUIElement) $t = $obj^ ERRORAnd this one for ex6_chrome2.au3 Example constants please change text to english or other language to identify controls Action 1 Action 2 "RedactedPath\UIAWrappers.au3" (1464) : ==> Variable must be of type "Object".: $oElementStart.FindAll($treeScope, $UIA_oTRUECondition, $pElements) $oElementStart^ ERRORCan someone see where I went wrong? I only changed following lines to this after starting chrome with --force-renderer-accessibility and using the spy on it to get the names. $strChromeExeFolder="C:\Program Files (x86)\Google\Chrome\Application\" ;~ Make this language specific Const $cToolbarByName = "name:=Google Chrome Toolbar" Const $cAddressBarByName = "name:=Address and search bar" Const $cChromeNewTabByName = "name:=New Tab"
  9. Hi Manadar, I'd like to catch the HTTP Status Responses when pushing messages. Since the WinHttp UDF always been my nemesis I have trouble to figure out how to do that. If found some hints in the help file but I can't figure out how to add this to the SimpleFormFill: "Last (superfluous) $sAdditionalData argument can be used to pass authorization credentials in form "[CRED:username,password]", magic string to ignore cerificate errors in form "[IGNORE_CERT_ERRORS]" and/or HTTP request header data to add. " I'm still unsure if this even does what I want it to do. I just want to be able to receive the 200 OK or possible error responses (500 etc). I know it has been a long time since you posted in this topic. Maybe someone else can help me out. ​
  10. You should rather try to parse the html file than doing it by mouse. With parsing the html you can avoid repeating this tedious task 3250 times and donate the multiple of software clicks to people in need. This is one of the basic sliding panels: <!-- ###############[ Start Sliding Panel ]################## --> <tr> <td colspan="7" align="center"> <div class="opener"> <table width="80%" cellspacing="0" cellpadding="0" class="listtable"> <tr> <td height="16" align="left" class="listtable_top" colspan="3"> <b>Ban Details</b> </td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Player</td> <td height="16" class="listtable_1"> Jaenas </td> <!-- ###############[ Start Admin Controls ]################## --> <td width="30%" rowspan="11" class="listtable_2 opener"> <div class="ban-edit"> <ul> <li><a href="#" onclick="" target="_self"><img src="images/demo.gif" border="0" alt="" style="vertical-align:middle" /> No Demos </a></li> </ul> </div> </td> <!-- ###############[ End Admin Controls ]##################### --> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Steam ID</td> <td height="16" class="listtable_1"> STEAM_0:0:117472517 </td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Steam Community</td> <td height="16" class="listtable_1"><a href="http://steamcommunity.com/profiles/76561198195210762" target="_blank">76561198195210762</a></td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Invoked on</td> <td height="16" class="listtable_1">09/05/2015 23:46</td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Banlength</td> <td height="16" class="listtable_1">Permanent </td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Expires on</td> <td height="16" class="listtable_1"> <i><font color="#677882">Not applicable.</font></i> </td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Reason</td> <td height="16" class="listtable_1">Ban evasion (FS)</td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Banned by Admin</td> <td height="16" class="listtable_1"> CONSOLE </td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Banned from</td> <td height="16" class="listtable_1" id="ban_server_3603"> Please Wait... </td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Total Bans</td> <td height="16" class="listtable_1">No previous bans</td> </tr> <tr align="left"> <td width="20%" height="16" class="listtable_1">Blocked (0)</td> <td height="16" class="listtable_1"> <i><font color="#677882">never</font></i> </td> </tr> </table> </div> </td> </tr> <!-- ###############[ End Sliding Panel ]################## --> It looks like alot but the goal is simple. You want to filter the Player and the Steam ID. This is just a big string that you can read and strip down to the key parts. So you want to find the fixed patters that encloses that information and then separate it from the important stuff. Take a look into the String management section in the autoit help file. If you can write a script that returns the Steam ID from following segment I will post the script that scraps all player names and Steam IDs directly from the website to a text file: <td width="20%" height="16" class="listtable_1">Steam ID</td> <td height="16" class="listtable_1"> STEAM_0:0:117472517 </td> To help you start: Save the segment above to a new .txt document (call it segment.txt), create a new autoit file next to it. Now the following code will enable you to work with the segment. Local $hFile = FileOpen(segment.txt) Local $RawString = FileRead($hFile) FileClose($hFile) ; Now you can start working with $RawString
  11. I would love if you could elaborate on your suggestion since I'm really not fond of my CMD and BATCH capabilities. I'm also not quite sure how to execute your suggestion. Should I run VBoxManage.exe via CMD and append >>C:\VBMecho to the command? And if this is the case should I use Run(@ComSpec & " /c " & $VBMdir & $VBMcmd) or rather Shellexecute CMD with $VBMdir & $VBMcmd as paremeters + enabling echo and directing it into a file? Because the version with Run seems to have the same effect of freezing autoit according to this topic https://www.autoitscript.com/forum/topic/138827-runcomspec-c-~-application-hangs/
  12. It's in that exact path and it is working too. It just stops responding randomly 1 out of 20 times. I tried ShellExecute() and no freezes. Makes the handling of VBoxManage.exe quite stupid since I can't read the stdout anymore. Maybe the stdout is the problem after all.
  13. It's always happening with those parameters: $vbmCMD = "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe controlvm DBClient poweroff" $FileDir = "C:\Program Files\Oracle\VirtualBox\" When it works the process VBoxManage.exe closes, otherwise it remains. ProcessClose($PID) after the Run command doesn't help since it never finishes executing the Run command. I just don't know how to handle VBoxManage.exe freezing when it somehow freezes autoit too. (Although autoit shouldn't care if it does) EDIT: This is the windows error report: Problem signature: Problem Event Name: AppHangB1 Application Name: AutoIt3.exe Application Version: 3.3.12.0 Application Timestamp: 538b6694 Hang Signature: 4b03 Hang Type: 1 OS Version: 6.1.7601.2.1.0.256.49 Locale ID: 1031 Additional Hang Signature 1: 4b03caab50f6acbcce282dd86e6f4f58 Additional Hang Signature 2: 7154 Additional Hang Signature 3: 71540a720fa18f0de663ec1302977db9 Additional Hang Signature 4: 4b03 Additional Hang Signature 5: 4b03caab50f6acbcce282dd86e6f4f58 Additional Hang Signature 6: 7154 Additional Hang Signature 7: 71540a720fa18f0de663ec1302977db9
  14. @Sadbunny: I already did and commented in the code. Its exactly after the run command. ; HERE EVERYTHING IS FINE Local $PID = Run($vbmCMD, $FileDir, @SW_HIDE, 0x2 + 0x4) ; EXACTLY AFTER THIS LINE THE SCRIPT HANGSSo the ConsoleWrite("Pid: " & $PID) in your example will not be displayed. It happened also with @SH_SHOW now and you don't see the CMD window. Just the process VBoxManage.exe is still running with 0% CPU usage and 108K Memory usage. How can I terminate VBoxManage.exe and rerun the command since AutoIt is not responding when VBoxManage.exe doesn't terminate? It somehow seems like it's acting almost like RunWait and when VBoxManage.exe freaks out again and doesn't shut down autoit won't proceed.
  15. I changed @SW_HIDE to @SW_SHOW and the script didn't stop yet (40 cycles). It usually breaks between 5 to 20 cycles. I do not like the CMD window popping up though. There is no information displayed in it anyway. But I want to be able to just rerun VBoxManage.exe if it fails. I'm already catching the stdout to be able to handle problems. The script not responding kinda eliminates handling anything.
  16. Since I got new hardware I'm running into a new Issue that I have trouble to work around. Randomly the script stops responding and I have to stop execution with CTRL + BREAK. If the problem occurs, it does at the Run command in following function: Func _vbmExecute($vbmCMD, $ConsoleWrite = 1, $FileDir = @ProgramFilesDir & "\Oracle\VirtualBox\", $vbmFLAG = "@SW_HIDE") If FileExists(@ProgramFilesDir & "\Oracle\VirtualBox\" & "VBoxManage.exe") Then $FileDir = @ProgramFilesDir & "\Oracle\VirtualBox\" If FileExists($FileDir & "VBoxManage.exe") = 0 Then Switch StringInStr($FileDir, "Program Files (x86)") ;x64 x86 swap Case 0 $FileDir = StringReplace($FileDir, "Files", "Files (x86)", 1) Case Else $FileDir = StringReplace($FileDir, "Files (x86)", "Files", 1) EndSwitch EndIf $vbmCMD = $FileDir &"VBoxManage.exe" & " " & $vbmCMD ; SCRIPT STOPS RESPONDING WITH THIS LINE: Local $PID = Run($vbmCMD, $FileDir, @SW_HIDE, 0x2 + 0x4) ;Catch Response Local $ResponseText, $ErrorText, $rTimer = TimerInit() While TimerDiff($rTimer) < 15000 $ResponseText &= StdoutRead($PID) $ErrorText &= StderrRead($PID) If @error Then ExitLoop WEnd If $ConsoleWrite = 1 Then ConsoleWrite($ResponseText) ConsoleWriteError($ErrorText) EndIf Return($ResponseText) #comments-start clonevm <target> --name <name> --basefolder <basefolder> --register startvm <target> controlvm <target> poweroff unregistervm <target> --delete http://www.virtualbox.org/manual/ch08.html #comments-end EndFunc ;==>_vbmExecute The last time it stopped trying to poweroff the VM. How can I prevent the script from hanging when VBoxManage.exe messes up again?
  17. Since WinMove seems only to work in absolute coordinates I wanted to convert my relative coordinates into absolute ones. The problem is that I can only think of one filthy way to complete that task and that involves MouseMove. For example: Opt("MouseCoordMode", 2) Winactivate([$WorkingWindow) MouseMove($X,$Y,0) Opt("MouseCoordMode", 1) Local $abs = MouseGetPos() Opt("MouseCoordMode", 2) WinMove($Window, $abs[0], $abs[1]) Can you help me out with a better solution? EDIT: Thank you very much. This is just perfect.
  18. Thank you for your elaborate response. I have some trouble executing the code though since shows me following errors: "C:\TEST.au3"(86,47) : error: _WinAPI_SHGetPropertyStoreForWindow() called with Const or expression on ByRef-param(s). DllStructGetPtr($tpIPropertyStore)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "C:\TEST.au3"(45,72) : REF: definition of _WinAPI_SHGetPropertyStoreForWindow(). Func _WinAPI_SHGetPropertyStoreForWindow($hWnd, $sIID, ByRef $tPointer) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\TEST.au3 - 1 error(s), 0 warning(s) And thanks to your formatting I just learned that you can connect multiple lines with underscore. EDIT: Small change made it work: ; Now create an instance of IPropertyStore interface. We must pass a void** (pointer to pointer) ; We can do it in AutoIt by using a pointer to a struct which have only 1 pointer member. Local $tpIPropertyStore = DllStructCreate($tagPointer) Local $DLLtpIPropertyStore = DllStructGetPtr($tpIPropertyStore) $ret = _WinAPI_SHGetPropertyStoreForWindow($hWnd, '{886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99}', _ $DLLtpIPropertyStore) This is exactly what I was looking for. Thank you very much for making that effort. I will have to spend some time understanding your code. Please fix the few lines in your code and I'll mark the topic as solved.
  19. Everyone of you is right. I thought of many ways solving this problem. It's just the way my code grew like this because I'm trying different approaches for practice. (To get out of my comfort zone and to actually understand the downsides to different solutions) @mpower: This is exactly how I initially wanted to solve the problem. But your idea without filesource is much closer of what im trying to do. And it would open even more paths I never came across. How to store an image in a variable etc. Guess I will finally have to take a look into GDI+. Since AutoIt basically stores the displayed images in the memory, I wanted to try retrieving it from there somehow. Like you are able to retrieve data from an edit without unneccessary writes to the harddrive. Why is wrong to assume that it should be possible with displayed images? @libreau3: Thank you for that. This is actually the quickest workaround for the question I asked. @BrewManNH: How exactly do I keep track of what my code is displaying? For now I could only keep track with mpowers method of multiple sourcefiles. By not having to keep track and just being able to "scrap the displayed image off" I would solve this satisfactorily, too. EDIT: You already gave me enough to tinker around for some days. Thank you for your help.
  20. I create multiple windows with an image. When ever a new window appears the old source .bmp is already overwritten. Since the Images are still displayed I'd like to copy the selected ones to the clipboard. But I don't seem to be able to get any data from the GUICtrlCreatePic controls. GUICtrlRead doesn't seem to have an option to read picture controls. I googled around and shuffled through the help file already. Did I miss something or do I have to workaround this?
  21. No just multiple GUIs created via Autoit. Imagine a main window with some information and some buttons. There will spawn more GUI windows with detailed info depending on what you used the specific functions on. And I don't want those additional windows to be combined in the taskbar with the main window. I want them to split as if the main windows and the secondary windows are 2 different applications. So it basically looks like this with all windows stacking together: But I would like the main window be seperated like this: (The SciTE icon represents the main window and the autoit Icon the secondary windows. Everything from the same .au3)
  22. There is a main GUI and some secondary GUIs. I want to prevent the secondary GUIs to combine with the main GUI in the taskbar. The secondary GUIs can stack with eachother in the taskbar as usual. Is this even possible or does Windows not allow it since it is a single process? If the question is unclear, tell me what I should specify.
  23. Similiar to SadBunnys log, my log also shows that MousGetPos(0) returns a value off by 1 on the the second monitor. Mouse on the left (secondary) screen with desktop as the active window: move LEFT from [1476,527] to [1475,527]. move LEFT from [1476,527] to [1475,527]. move UP from [1476,527] to [1476,526]. move UP from [1477,526] to [1477,525]. move RIGHT from [1478,525] to [1479,525]. move RIGHT from [1480,525] to [1481,525]. move DOWN from [1482,525] to [1482,526]. move DOWN from [1483,526] to [1483,527]. Mouse on the right (primary) screen with desktop as the active window: move LEFT from [2459,178] to [2458,178]. move LEFT from [2458,178] to [2457,178]. move UP from [2457,178] to [2457,177]. move UP from [2457,177] to [2457,176]. move RIGHT from [2457,176] to [2458,176]. move RIGHT from [2458,176] to [2459,176]. move DOWN from [2459,176] to [2459,177]. move DOWN from [2459,177] to [2459,178]. I'm running Windows 7 Professional N with best performance settings. AutoIt version used is v3.3.12.0 May I ask what your environment looks like jdelaney?
  24. I found a topic about this from 2006. But since I don't want to necro it and it didn't solve my problem, I'll ask here for help. I'd like to move the mousecursor by 1px with ctrl + arrowkeys. This works fine as long as the mouse is on the main monitor. When I move the mouse to the left monitor it starts to get funky. When I try to move left it wont work. When I move up it goes one up and one right. Moving right it will move 2px to the right. Here is the script: Opt("PixelCoordMode", 2) Opt("MouseCoordMode", 2) HotKeySet("^{UP}", "mmUP") HotKeySet("^{DOWN}", "mmDOWN") HotKeySet("^{LEFT}", "mmLEFT") HotKeySet("^{RIGHT}", "mmRIGHT") Func mmUP() MouseMove(MouseGetPos(0), MouseGetPos(1) - 1, 0) EndFunc ;==>mmUP Func mmDOWN() MouseMove(MouseGetPos(0), MouseGetPos(1) + 1, 0) EndFunc ;==>mmDOWN Func mmLEFT() MouseMove(MouseGetPos(0) - 1, MouseGetPos(1), 0) EndFunc ;==>mmLEFT Func mmRIGHT() MouseMove(MouseGetPos(0) + 1, MouseGetPos(1), 0) EndFunc ;==>mmRIGHT While 1 Sleep(1000) WEnd Looks like jpm didn't fix it in 2006 :<
  25. Do you want to cycle through those links or really randomize it? For $i = 1 To 8 Step 1 _IELinkClickByText($oIE, "link" & $i) Sleep(1000) Next The one above will click link1 - link8 For $i = 1 To 8 Step 1 _IELinkClickByText($oIE, "link" & Random(1, 8, 1)) Sleep(100) Next This one will click a random link between the numbers 1 and 8. And that 8x in a row.
×
×
  • Create New...