
DNnlee
Active Members-
Posts
52 -
Joined
-
Last visited
DNnlee's Achievements

Wayfarer (2/7)
0
Reputation
-
I've wrote a autoit script that does what i wanted to do. modified it to controlsend sending keys "2" or "w" or "{Enter}" seems fine without the ID or class. sending "Left" or "Right" doesn't seem to be working. i removed/edited out a lot of the more complicated part of the script so you dont have to waste time reading everything. basically even this wont get ControlSend "left" to work. i thought of sending {ASC} keys, but couldn't find the code for "left" or "right" arrow keys also thought of sending "NumPadRight" key... but i guess the newer version of AU3 removed that function?? script doesn't recognize it as a key i need advice/ alternative methods on how to send right/left key to a window that's not active, other than what i have already tried. HotKeySet("{ESC}", "bye") $title= "irrelevant " while 1 sleep(1000) ControlSend($title,"","","2") sleep(1000) ControlSend($title,"","", "{Right}") sleep(1000) ControlSend($title,"","","w") sleep(1000) ControlSend($title,"","","{Enter}") sleep(1000) ControlSend($title,"","", "{Left}") WEnd Func bye() Exit EndFunc
-
i wanted to run something every 500 milisecond, and something else every 30 seconds something like: AdlibEnable("Status",760) AdlibEnable("DC",30000) but it seems like "DC" overtakes "STATUS" .. any good way to make them both run, and at differnt intervals?
-
[solved] How do I assign GUI labels while running script
DNnlee replied to DNnlee's topic in AutoIt General Help and Support
only one way, from the bot to the GUI, as the GUI's only function is to display whatever is going on all that's needed is for the GUI to read the $A $B $Status variables within the BOT Script, every 10-30 seconds or so thx will look into it -
[solved] How do I assign GUI labels while running script
DNnlee replied to DNnlee's topic in AutoIt General Help and Support
so if i split them into 2 separate scripts, does the variable of one script carry on to the the other script? i'm thinking of GUI script and BOT script so can the GUI read what is the value of $A from the BOT script? -
i have a script that runs as a bot, and i wanted to keep track of what's happening on the GUI. so i want to run the function called Labels() to display what's happening while the Bot keeps going. it runs something like this: GUICreate("MY GUI", 365, 600, 656, 0); creates a box GUISetState(@SW_SHOW) A = 0 Do B = 0 do C = 0 while C < 10 Sleep(1000) mouseClick ( 20,20) C = C + 1 wend SomeFunction() $B = B + 1 until B = 10 $A = A+1 until A = 10 Func Labels() $Label_A= GUICtrlCreateLabel("A: " & $A, 25, 20) $Label_B= GUICtrlCreateLabel("B: " & $B, 25, 100) $Label_C= GUICtrlCreateLabel("C: " & $C, 25, 120) $Label_Status = GUICtrlCreateLabel("Status: " & $Status, 25, 140) EndFunc anyone know of a good way to make a GUI display variable values, while the script does something else like running a bot? edit: well my program is obviously more complex than that, but the main thing is that i wanted the labels function to run often, without sticking Labels() into every part of my program. I wanted this because i wanted to track what the program is doing at the exact moment, such as $Status.
-
the images i wanted to match are relatively small, so i wanted to get best quality so the script can be able to match it program i used => here bmp? gif? jpeg? any file type that photoshop can save in is fine with me
-
Can i Speed up imagesearch & lower cpu usage
DNnlee replied to DNnlee's topic in AutoIt General Help and Support
well i added the SLeep(30) because i was scared i would damage the cpu if i don't let it rest a bit. i'm not sure whether the Imagesearch already takes a break per image search or not, so i added it just in case. but i will try to use _ImageSearchArea() to skip the overhead. -
Hi, I am using a function from ImageSearch in a previous post I've received help to create an ImageSearch script, and it is able to do what i want it to. the goal of the script is to scan for a an image, and assign a value like 10 to $value however it takes 15+/- 5 seconds to match an image from a choice of 120 images, and my CPU runs up to 90%+ i am running this script via VMware, and my laptop's specs are T9300 @ 2.49ghz / 4gb ram so the host cpu is @ 45% and the Virtual CPU is @ 90%+, btw it "is" dangerous to have a constant high CPU usage right? Need advice on how to Improve / Speed up / Lower cpu use / or scan multiple image at once instead of one by one. #include <ImageSearch.au3> $ImageLocation = IniReadSection(@ScriptDir & '\Image.ini', 'Images') $x1=0 $y1=0 For $s = 1 to $ImageLocation[0][0] $result = _ImageSearch($ImageLocation[$s][0],1,$x1,$y1,101) Sleep(30) if $result = 1 Then $value = $ImageLocation[$s][1] ExitLoop Elseif $result = 0 Then $value2 = 0 EndIf Next INI FILE [Images] One.bmp = 10 Two.bmp = 10 Three.bmp = 10 Four.bmp = 10
-
it works very nicely now, but then when i look at the CPU usage, it pops up to 90+% when it does the ImageSearch function, i was scared it'll damage the CPU so i added a Sleep(30) and now it takes about 15+ seconds for the script to go through all 100 images and find a match. anyone know if 90+ cpu usage is normal when it does imagesearch? and any way to make it search any faster without hurting the CPU i'm using T9300 @ 2.5 ghz, loading this script on a VMware. tyvm
-
ahh nevermind, it's a small trivial thing to not be able to comment on the ini file, i'll live iwth it thank you all for all the help ! XD
-
i have only 9 values , and i have a set amount of possible images, and i have screenshoted all 120+ of them... lol i've just thought of this, wondering if it'll work dim $imagelocation[200][2] $ImageLocation[0][0] = "One.bmp" $ImageLocation[0][1] = 10 $ImageLocation[1][0] = "Two.bmp" $ImageLocation[1][1] = 10 $ImageLocation[2][0] = "Three.bmp" $ImageLocation[2][1] = 10 $ImageLocation[3][0] = "Four.bmp" $ImageLocation[4][1] = 10 for $s = 0 to 200 $result = _ImageSearch($ImageLocation[$s][0],1,$x1,$y1,101) if $result = 1 Then $value = $ImageLocation[$s][1] ExitLoop EndIf Next
-
I have a large amount of BMP images, and i use the "IMAGESEARCH" library recommended to me the other day. i want to scan an area for the image i want, and there are multiple image that i want, but they appear one at a time. if image is found, i want to assign a value to $VALUE, and i have to assign 9 different values to about 120 images. below is an example of what i want to do, any recommendation on how to "shrink" or compact the script so it's not so long and more efficient. $result = _ImageSearch("ONE.bmp",1,$x1,$y1,0) if $result=1 Then $Value = 10 EndIf $result = _ImageSearch("Two.bmp",1,$x1,$y1,0) if $result=1 Then $Value = 20 EndIf $result = _ImageSearch("THREE.bmp",1,$x1,$y1,0) if $result=1 Then $Value = 30 EndIf $result = _ImageSearch("FOUR.bmp",1,$x1,$y1,0) if $result=1 Then $Value = 40 EndIf something like scanning the area for all of the images at once instead of doing it 120 times would be helpful too, only one desired image would appear at a time.
-
the desired images will always look the same, but might appear at different locations of the screen, and MIGHT be TRANSPARENT and have another undesired image UNDER it to trick my script... so this imagesearch should be able to find it still right? if so thanks XD
-
Hi, I'm trying to make my program recognize an image that is part of a bigger image. the bigger image will be dynamic, and the part of the image that i want to match, might not be there all the time. example: i have a picture that's 10 x 10 pixel, and i wanna scan it 2x2 pieces at a time, until one of the 2x2 scans matched up with the pixel count or image i want. goal: to make my mouse click on the image IF the desired image is found. $IQ = pixelchecksum(28,192,39,195);;;;;;; scans a Certain area If $IQ = 2975549012 then ;;;;;;;;;; desired image pixel count $Modifier = 5 ElseIf $IQ = 4109728171 Then;;;;;;;;;; desired image pixel count $Modifier = 4 Else $Modifier = 0 EndIf If $Modifier >= 4 Then Sleep(200) mouseclick("Left", 80,195);;;;;;;;;clicks on image EndIf my script here so far, only scans 11 by 3, and its the same 11x3 everytime.. the actual whole bigger picture that could be scanned, is something like 30x5. any idea how to make the script scan different parts of the picture until it finds the desired image? thanks
-
i have this long code which is almost similar, and want to click just want to simply if so i don't have a long list of $slot[][], if you notice every 4 is almost the same $S = 5 ;;;;;;; <= this is the variable i will change Dim $Slot[8][2] $Slot[1][0] = "50" $Slot[1][1] = "10" $Slot[2][0] = "150" $Slot[2][1] = "10" $Slot[3][0] = "50" $Slot[3][1] = "25" $Slot[4][0] = "150" $Slot[4][1] = "25" $Slot[5][0] = "50" $Slot[5][1] = "40" $Slot[6][0] = "150" $Slot[6][1] = "40" $Slot[7][0] = "50" $Slot[7][1] = "55" $Slot[8][0] = "150" $Slot[8][1] = "55" $Slot[9][0] = "50" $Slot[9][1] = "70" $Slot[10][0] = "150" $Slot[10][1] = "70" $Slot[11][0] = "50" $Slot[11][1] = "85" $Slot[12][0] = "150" $Slot[12][1] = "85" ControlClick ( "mozilla", "", "MozillaWindowClass8" , "left", 2 , $Slot[$S][0],$Slot[$S][1]);;;;;;;<= the click