@chancity: Wait so what's still not working? Did you put in the until $CellCoord >= 5? (Ubound($cellarCoordx))
Without this, I can run the script on any random webpage with no blue and it will always succeed because it hasn't looped through the 5 iterations yet. With this in place, it should loop through all 5 combinations of 600,435, 175,305, etc etc. to 280,302 and if all 5 tries miss it will return not found.
Last edited by ElijahBailey; 06-28-2012 at 02:27 AM.
i changed some lines like someone said before, now im finding the cellar and entering it everytime, the problem is, once it gets in, my char get stuck at the desk/near the doorway.
Any idea about tweaking more numbers? 1680x1050 here.
Whats happening or atleast I think is happening is that $CellCoord = $c is being updated to something equal to or greater than 0 and causing the script to not go through all 5 iterations and returning 1 even though it really hasn't found the blue pixel. If you remove:
It will go through all 5 iterations no problem.Code:If Not @Error Then $CellCoord = $c EndIf
If I change the code to $CellCoord >= 5 it cycles through all 5 and returns a 0 causing the script to say not found. Which can be a problem :/ for actual use lol.
Last edited by chancity; 06-28-2012 at 02:32 AM.
im just being ignored.
I can't even get this to give me the right reading, just stand near the cellar and put your mouse over it..
Code:sleep(4000) $mousePos = MouseGetPos() $Pixel2 = PixelSearch($mousePos[0] - 71,$mousePos[1] - 148,$mousePos[0] + 139,$mousePos[1] + 22, 0x334FB7, 3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be) sleep(120) If Not @Error Then MsgBox("4096","Found" ,"gf" ) EndIf
Last edited by chancity; 06-28-2012 at 02:44 AM.
(this is in reference to the previous function, will check the new one you just posted :P - does it work now?)
Mmm if that's the only thing, why not just add the else? I don't know about what pixelsearch does, but if not @error is not found, then return 1 if it is found right?
If Not @Error Then
$CellCoord = $c
Else
Return 1
EndIf
So this new script, does it loot?
I'm also trying to get the bot to pick up mythic potions, but what kind of screen shot would I need?
Tried Straight GPH 21 Second Open Cellars running on vm and it got disconnected as well. 2hrs and its goin offline..anyway to auto restart it ?
Not @Error means there was no error, it found the pixel
Return Value
Success: Returns a two-element array of pixel's coordinates. (Array[0] = x, Array[1] = y).
Failure: Sets @error to 1 if color is not found.
Examples
Code:; Find a pure red pixel in the range 0,0-20,300 Local $coord = PixelSearch(0, 0, 20, 300, 0xFF0000) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf ; Find a pure red pixel or a red pixel within 10 shades variations of pure red $coord = PixelSearch(0, 0, 20, 300, 0xFF0000, 10) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf
Script was working perfectly yesterday and today, then just a little while ago I loaded the beta 27 second script instead of the Main Script and it started giving me issues with Archon, it would path fine, go into cellar, go to the Sarkoth spot use Archon but then it would just keep using Archon the entire duration, after that AutoIt seemed to stop responding properly.
Any ideas? x64 here.
@chancity:
I looked at it some more and I think it can be streamlined, ignore the $c, you only need the CellCoord in the end to reference which position you found the cellar in.
So...this logic I understand, it will loop through the 5 xy positions and check for the pixel, if the pixel exists (pixel2 = 1) then it returns 1, and cellcoord is already set to the correct coordinate. If not exists, then...return 0.
Now, regarding whether or not the blue pixel actually exists at the position you specified, that I don't know
Also, does PixelSearch actually return 1 if it finds something?
---
Code:Func FindCellar() ;$CellCoord = 0 if not defined globally Do MouseMove(Round($cellarCoordx[$CellCoord] * $x_ratio), Round($cellarCoordy[$CellCoord] * $y_ratio), 1) ;moves cursor over to the cellar $mousePos = MouseGetPos() sleep(120) $Pixel2 = PixelSearch($mousePos[0] - 71,$mousePos[1] - 148,$mousePos[0] + 139,$mousePos[1] + 22, 0x334FB7, 3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be) ;If $Pixel2 = 1 Then (this should be equivalent to not @error? if not, can just use not @error) If Not @Error Then Return 1 EndIf $CellCoord += 1 Until $CellCoord >= Ubound($cellarCoordx) Return 0 EndFunc
ok, after trying to make it work on 1680x1050 for 8 hours, i give up. I'm going to wait a oficial port to 1680x1050 or someone who have the skills to do the port. See ya.