Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/13/2016 in all areas

  1. This forum (Au3 Technical) is inhabited by luminaries whose posts frequently demonstrate understanding far beyond my capabilities. For that reason, and at Jon's suggestion, I am reaching out to tap into your wisdom for a project that I have been working on a for a while. I was looking for a way to give back to AutoIt. As a self-taught programmer I have learned an incredible amount from this forum and the help file. It has been very rewarding. Over the course of my personal experiences I have wished, at times, that even though the materials and support are truly incredible - that someone could explain some of the more basic concepts. At the same time, I saw the creation of code.org and I started to think that AutoIt would be a perfect learning tool for people starting out (because of the simplicity, the incredible help file, and the best forum I have ever seen). All of that led to the creation of this text: https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/. It is the first draft of a basic introduction to programming using AutoIt. Nobody has reviewed it. Accordingly, I seek the collective constructive feedback of anyone willing to offer opinion as to content, spot any errors, and make any suggestions to improve it. My goal was always to donate it to the AutoIt forum when it was done. I think it could be a good addition to fill the gap for neophytes who may crave to see how everything fits together. The last thought I will leave you with - similar to the first - is that I am not the world's greatest coder (this may be a case of those who can do and those who can't teach). That said, I am hoping that the issues you will undoubtedly spot are not huge or threatening to the overall effort and that you appreciate the fact that this took some time to pull together. I look forward to hearing your thoughts.
    1 point
  2. JohnOne

    Legal AutoIt

    It is not a registered trademark.
    1 point
  3. @Leo1906 I use something like this in one of my larger scripts for pop out messages, to ensure they keep pace with the main GUI. May translate to what you are trying to accomplish: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $hGUI_Child $hGUI_Main = GUICreate("Test", 300, 300) _Create_Child($hGUI_Main) GUIRegisterMsg($WM_MOVE, "_Position_Child") GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") GUISetState(@SW_SHOW, $hGUI_Main) $btnGo = GUICtrlCreateButton("Show Child", 220, 250, 70, 40) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $btnGo _SH_Child($hGUI_Main, "Secondary Pop Up That Follows Main", 10000) EndSwitch WEnd Func _Create_Child($hGUI_Main) Local $lnCount = 100 $hGUI_Child = GUICreate("Follower", 400, $lnCount, -1, -1, BitOR($WS_POPUP, $WS_BORDER), 0, $hGUI_Main) GUISetBkColor(0xCCFFCC) GUISetFont(11, 400, Default, "Arial") Global $text = GUICtrlCreateLabel("", 10, 10, 380, ($lnCount * 20) - 20) _Position_Child($hGUI_Main, 0, 0, 0) GUISetState(@SW_HIDE, $hGUI_Child) EndFunc ;==>_Create_Child Func _Position_Child($hGUI_Main, $iMsg, $wParam, $lParam) Local $aGUI_Main_Pos = WinGetPos($hGUI_Main) WinMove($hGUI_Child, "", $aGUI_Main_Pos[0] + $aGUI_Main_Pos[2], $aGUI_Main_Pos[1]) EndFunc ;==>_Position_Child Func _SH_Child($hGUI_Main, $sText, $sLength) GUISetState(@SW_SHOW, $hGUI_Child) GUICtrlSetData($text, $sText) WinActivate($hGUI_Main) Sleep($sLength) GUISetState(@SW_HIDE, $hGUI_Child) GUICtrlSetData($text, "") EndFunc ;==>_SH_Child Func _WM_NOTIFY($nWnd, $iMsg = "", $wParam = "", $lParam = "") Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) If BitAND(DllStructGetData($tStruct, 3), 0xFFFFFFFF) = $NM_CLICK Then ; Code $hCurrListView = DllStructGetData($tStruct, 1) ; ListView handle EndIf EndFunc ;==>_WM_NOTIFY
    1 point
  4. 32 bit processes cannot read 64 bit, but 64 bit can read both.
    1 point
  5. This is a public forum--you don't get to dictate how people post/reply.True. But just like in the real world, when someone is interfeering in a conversation while not providing anything of value, those people can be reprimanded. Which is what I did. I would've made the same comment as BrewMan. Why ? It does not help in regard to the question in the slightest, and is, in effect, only made to make oneself "feel good" by bashing someone else. Nothing more, nothing less. And pardon me, do you have any idea why I still have that OS running ? Nope, you simply do not care. And that, my friend, is dumb arrogance. I hope your Win98 machine ins't connected to the internet. Actually, it has been connected to it for all that time, and I've been visiting all sorts of sites (in search of this-or-that info). And without any noticable problem. Mainly due to the usage of the only actually working AV product, ones wetware (which also blocked installing of Flash and other random software. Keeping JS turned off helps too. :-) ). Much luck with your rammed-down-the-throat, riddled with spyware -- or "Telemetry" as its called by MS -- and its mandatory udates which can just rip out functionality -- see webcams -- Win10 though. You are now merely a user of the OS -- going along for the ride -- , while I'm still the owner of mine. :-) Regardless, glad you solved your issue. I said I found the cause of the problem, I never said I solved it (which it isn't). The possible work-arounds are all ugly as f*ck. Especially when you need to mind that other (parts of the) script(s) might not use such work-arounds (copy-pasted from other sources, or simply by mistake). It also excludes a NULL value being used in a dictionary object, as it can generate that itself, and it effectivily negates the usefullness of the "exists" method.
    1 point
  6. Are you compiling 32 bit? Perhaps notepad is 64 bit.
    1 point
  7. Yep, 64bit works here. I think there's one thing that would be a great improvement, which is the ability to have the equivalent to a wildcard. For example: an image with transparency areas that would serve as wildcard, so that the surroundings of the image could change, but it would find it anyway, because parts of it would remain the same, know what i mean? Something similar could be done with pixel search, by checking if X pixels to the right of Y, there is a determinate pixel. etc
    1 point
  8. ? #include <WinAPI.au3> ;~ #RequireAdmin try to un-comment if not work for you Local $iPID = Run("notepad.exe") ;~ Local $iPID = ProcessWait("notepad.exe") Local $hFile = _WinAPI_CreateFile(@ScriptDir & "\Test.dmp", 1) ; Creates a new file. If a file exists, it is overwritten _DumpFile($iPID, $hFile) _WinAPI_CloseHandle($hFile) ProcessClose($iPID) Func _DumpFile($iPID, $hFile, $dDumpType = 0) Local $hProcess = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", 0x0450, "bool", 0, "dword", $iPID) If @error Then Return SetError(@error, @extended, 0) $aResult = DllCall("dbghelp.dll", "bool", "MiniDumpWriteDump", "handle", $hProcess[0], "dword", $iPID, "handle", $hFile, "dword", $dDumpType, "dword", "", "dword", "", "dword", "") DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hProcess[0]) If $aResult[0] = 0 Then Return SetError(@error, @extended, False) Return $aResult[0] EndFunc
    1 point
  9. What i mean is, divide the screen in 4 parts, for example, and loop through them, may be 4 or 8 or whatever. Obviously you'd have to change the starting coordinates, one way to do that is @DesktopWidth/2 @DesktopHeight/2 or whatever you need for the areas.
    1 point
  10. You're going in the right direction I think by how you are considering usage of your $marker variabl. The main thing you need to do is use the Returned Data in $marker from the _ImageSearch function to change the starting points for the next search on every loop after every previous result. Only on the first search do you want the search to begin at 0,0 which are your $yy and $$xx variables. You want to update those variables after every previous result. You're gonna get in twouble here if that's game automation related, tss tss tss Don't have the time right now to write or test any actual script for you but I hope the idea is clearer now
    1 point
  11. I have made my own solution for image searching. I would like to share here. Im from spain (if someone of you can notice a bad grammar, etc): My idea is to make an aproximation to the problem, its not perfect but its usefull if you take 1 or 2 tips while using my system: a] You should try to detect images with the upper left corner in a pixel that not has the same color in the background or in big areas (this is for speed reasons). b] Sometimes, in order to set a] tip properly, a trick is to detect an image, lets name it "AUX", that "AUX" verify a] tip, and then, when you get the coordinates of that image with my image detection system, the only thing you need is to apply an offset to that point, exactly the offset to transform that point into the right one, this is, the coordinates of original "TARGET" image. Obviusly this is only valid when the relatives positions between AUX and TARGET are fixed and both of them exists always togheter in the screen. Anyway, the advantages of my system are the following: - You dont need any DLL file or library. - You dont need to deal with extrange problems or bugs mentioned here around the imageSearch posted in this thread. - Your dont need to put a copy of the image file you are trying to detect, neather distribute this file with the script .au3 file. - It doesnt matter the size/resolution of the image, because my algorithm is O(1) efficient in this aspect, i mean, the image size not affect to the speed detection. Even with this advantages... as i said, its not at all a perfect system, because it has the limitation mentioned above, in a] point. I should say that i have make my efforts in every part of the algorithm, i mean, even if you dont take a] point seriously, the system should be as fast as is possible. All i use from AutoIt library is PixelGetColor and PixelSearch (as you can imagine, specially this one). If someone of you are interested in this idea, i can attach here the files, so you can freely dowload, and i will put here also some examples of using this idea, all you wiil need to use the system are these 3 things: -1 Your script file with the image file you want to detect (you will be able to delete the image when all is set up) -2 My image_search.au3 to import in your script (so you can use my func image_search(), that returns the center point of the image). -3 A little Java app that i provide also and i have made specially to make it easy the use of the system. The idea behind this Java app is simple: it takes any image file and generates an .au3 script with only one function, named "func get_<image_name>_<widthxheight>_sign()". This new function, makes a simple signature from the image, a kind of "footprint". This signature has always the same size, thats why the image size doesnt matter. And that signature is what my search in the screen. Then, the scan itself is "optimized" by using PixelSearch in a certain way (not the best way, but i have tried). Anyway, i will put the codes and samples here if there are people with the desire. Cheers. PD: Or maybe i could make a youtube video and share here as a little tutorial or something, but i cant garantee this.
    1 point
  12. I don't have any questions... because I don't understand your code. I just adviced you to post the code for others to help you . Although there is a bug (or is it intended behavior?) I noticed... The simulation does not look like 3D , but some clever image morphing or something . My brain hurts!
    1 point
×
×
  • Create New...