anyone got the image search working? All the coords i changed are correct also the image i made works. I tested the image with a quick image search script i found on forums but no clue how to edit AutoIT code
script im using.
works like a charm for 1920x1080 but as i said cant get imagesearch working to delete the green items.Code:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ImageSearch.au3> Global $Paused Global $Exit HotKeySet("{NUMPAD0}", "TogglePause") HotKeySet("{NUMPAD1}", "end") Local $result,$x,$y,$i,$fire $i = 1 $fire =1 WinActivate("Neverwinter") sleep (1000) while 1 MouseClick("left",725,570) Sleep(500) Send("{BACKSPACE 20}") sleep(200) Send("accoumt") sleep(200) Send("{TAB}") sleep(200) Send("password") sleep(200) Send("{ENTER}") Sleep(3000) MouseClick("left",1724,965) Sleep(8000) Send("f") sleep(4000) Send("f") Sleep(1500) Send("i") Sleep(3000) if $i = 8 then for $r=550 to 700 step 45 for $c=1270 to 1550 step 45 $found = 0 sleep(500) MouseMove($c,$r) sleep(500) $result = _ImageSearchArea("unidentified.png",1,681,237,1165,648,$x,$y,150) if $result=1 Then FOUND() ContinueLoop endif $result = _ImageSearchArea("rank2.png",1,681,237,1165,648,$x,$y,150) if $result=1 Then FOUND() ContinueLoop endif Next Next $i = 1 Else $i=$i + 1 endif Send("i") Sleep(500) Send("{ESC}") Sleep(500) MouseClick("left",967,571) Sleep(500) MouseClick("left",1051,595) Sleep(500) MouseClick("left",1033,603) Sleep(2000) wend func found() MouseClickDrag("left",$c,$r,369,336,1) sleep(500) $result = _ImageSearch("delete.bmp",1,$x,$y,100) ; Discard button if $result=1 Then mouseclick("left",$x,$y) endif EndFunc Func end() MsgBox(4096, "Exit", "exit", 1) exit EndFunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd WinActivate("Neverwinter") sleep (2000) EndFunc
You guys need to download the imagesearch.dll and put it in the same folder as the scripts and images.
Downloads and details here ... ImageSearch Usage Explanation - Example Scripts - AutoIt Forums
If it hovers over the icon, it will popup a tooltip of the item ... like "unidentfied item ...."
My script, if you copied it, only searches a small area of the screen (for performance), which is that tooltip area. So you need to make a jpg of the items you want to delete using text in that tooltip.
Also make a picture for the discard button.
Last edited by Arrakis; 05-16-2013 at 04:40 AM.
So if i get this right it mouseovers your inventory checking the tooltips. Then i just gotta make a screenie of the "Unidentified" text.
Yep ... or only a small part of it as long as it's unique.
call me an idiot but i cant for the love of me seem to figure out the coords, as to wich goes where >.> any chance you can push me in the right direction based on my screenshot? im using 1920x1080 resolution.
http://imageshack.us/a/img835/2127/derot.png
already given ya +rep
Can't make it easier then thisCode:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ImageSearch.au3> Global $Paused Global $Exit HotKeySet("{NUMPAD0}", "TogglePause") HotKeySet("{NUMPAD1}", "end") Local $result,$x,$y,$i $i = 1 WinActivate("Neverwinter") sleep (1000) while 1 MouseClick("left",432,618) Sleep(500) Send("{BACKSPACE 20}") sleep(200) Send("USERNAME") sleep(200) Send("{TAB}") sleep(200) Send("PASSWORD") sleep(200) Send("{ENTER}") Sleep(3000) MouseClick("left",1435,1078) ;; Enter World Sleep(7000) ;; load into world Send("f") ;; open chest sleep(4000) Send("f") ;; take all Sleep(1500) Send("i") ;; open inventory Sleep(1500) if $i = 8 then ;; every 8th run do an inventory cleanup for $r=550 to 700 step 45 ;; Rows in inventory $r = Y coordinate of 1st row until Y coordinate of last row. Step depends on number of pixels between 2 inventory slots. for $c=1270 to 1550 step 45 ;; Columns in inventory $c = X coordinate of 1st column until X coordinate of last column. $found = 0 sleep(500) MouseMove($c,$r) ;; hover mouse over icon to trigger tooltip sleep(500) $result = _ImageSearchArea("unidentified.png",1,920,500,1230,610,$x,$y,150) if $result=1 Then FOUND() ContinueLoop endif $result = _ImageSearchArea("rank2.png",1,920,500,1230,610,$x,$y,150) if $result=1 Then FOUND() ContinueLoop endif Next Next $i = 1 Else $i=$i + 1 endif Send("i") Sleep(500) Send("{f 2}") ;; sometimes timing goes weird and it opens inventory before looting chest ... this will make sure chest is still looted before logging off Sleep(1000) Send("{ESC}") ; logout menu Sleep(500) MouseClick("left",804,620) ; logout Sleep(500) MouseClick("left",821,643) ; exit Sleep(500) MouseClick("left",869,654) ; sure Sleep(2000) wend func found() MouseClickDrag("left",$c,$r,700,500,1) ; pull item from inventory into nothingness to trigger deletion sleep(500) $result = _ImageSearch("delete.bmp",1,$x,$y,100) if $result=1 Then mouseclick("left",$x,$y) endif EndFunc Func end() MsgBox(4096, "Exit", "exit", 1) exit EndFunc Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) WEnd WinActivate("Neverwinter") sleep (2000) EndFunc![]()
o jeez thank you lol ive been fiddling with this for hours, im hopeless when code doesnt come with notes to tell me what the mouse is doing when it goes where it goes lol. much appreciated!
i was so lost trying to figure out why the hell i would = 8 lol. thought that had something to do with why i couldnt figure out which coords were to place the mouse at the inv slots i wanted to check.
I have everything in the folder and changed all the cords and everything works great except the imagesearch for deleting items. I downloaded the two files and put them in the same folder but i get this error:
"Line 44(File ImageSearch.au3)
if $result[0]="0" then return 0
if $result^ ERROR
Error: Subscript with non-Array variable"
Any1 can share the quest on mindflayer?
Hello guys,
This scripts only login and then open my inventory. There is no movement code in your script. Is it only for open chest without movement at start location to chest room?
What each parameter do?Code:_ImageSearchArea("rank2.png",1,920,500,1230,610,$x,$y,150)
whats the 1 do?
920,500 and 1230, 610 are the area I wanna search?
x and y saves the coords, that I kind figure out.
150?
EDIT - Nevermind, already found it.
Last edited by botelho; 05-16-2013 at 05:06 PM.