SupraNatural Posted August 18, 2005 Share Posted August 18, 2005 When using the PixelSearch function how do you get the left, top, right, bottom, coordinates out of Top Left, Bottom Left, Top Right, Bottom Right, since they each come out with an X,Y not just 1 number. If im not explaining this right please ask. Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
phillip123adams Posted August 18, 2005 Share Posted August 18, 2005 When using the PixelSearch function how do you get the left, top, right, bottom, coordinates out of Top Left, Bottom Left, Top Right, Bottom Right, since they each come out with an X,Y not just 1 number. If im not explaining this right please ask.<{POST_SNAPBACK}>What do you mean? Where are the corner coordinates coming from? Here's an example where they come from the mouse in the form of a 2 element array. Run it a couple of times and move the mouse to a new positon at each prompt.MsgBox(4096, "Get Mouse Position", "About to get the mouse position. Please wait", 3) $a1 = MouseGetPos() MsgBox(4096, "Get Mouse Position", "About to get next mouse position. Move it a little and wait", 3) $a2 = MouseGetPos() MsgBox(4096, "Example", "First Mouse Positon X = " & $a1[0] &@lf& "First Mouse Positon Y = " & $a1[1] &@lf& "2nd Mouse Positon X = " & $a2[0] &@lf& "2nd Mouse Positon Y = " & $a2[1]) Exit Phillip Link to comment Share on other sites More sharing options...
SupraNatural Posted August 19, 2005 Author Share Posted August 19, 2005 (edited) Alright i did the diagonal heres what i got HotKeySet("{F1}", "CreateAndEnterPortal");F1 While 1 Sleep(100) WEnd Func CreateAndEnterPortal() PixelSearch (508, 414, 224, 89, 0x212021) If Not @error Then MouseMove($coord[0], $coord[1]) MouseClick("left") EndIf EndFunc 508,414 is the top left corner and 224,89 is the bottom right. Maybe its just the color im looking for, I'll try some different ones. I want it to move the mouse to the found color and click on it. Edited August 19, 2005 by SupraNatural Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
phillip123adams Posted August 19, 2005 Share Posted August 19, 2005 (edited) Alright i did the diagonal heres what i gotHotKeySet("{F1}", "CreateAndEnterPortal");F1 While 1 Sleep(100) WEnd Func CreateAndEnterPortal() PixelSearch (508, 414, 224, 89, 0x212021) If Not @error Then MouseMove($coord[0], $coord[1]) MouseClick("left") EndIf EndFunc508,414 is the top left corner and 224,89 is the bottom right. Maybe its just the color im looking for, I'll try some different ones. I want it to move the mouse to the found color and click on it.<{POST_SNAPBACK}>You did not assign the coordinate returned by PixelSearch to the $Coord variable. And the parameter order is Left, Top, Right, Bottom (where Left < Right, and Top < Bottom). If the color is found, the mouse should move to that location.$coord = PixelSearch(224, 89, 508, 414, 0x212021)Edited to correct the parameter order. Edited August 19, 2005 by phillip123adams Phillip Link to comment Share on other sites More sharing options...
SupraNatural Posted August 19, 2005 Author Share Posted August 19, 2005 Well that doesn't seem to work, what i dont get is why it doesn't click on the pixel if it finds it, all it does is move the mouse to a different spot and click there. Here is what i've got. HotKeySet("{F1}", "CreateAndEnterPortal") ;F1 While 1 Sleep(100);Idle around WEnd Func CreateAndEnterPortal() Send("{F8}");Opens portal skill MouseClick("right");Casts portal skill $coord = PixelSearch(224, 89, 508, 414, 0x212021);Search for portal If Not @error Then MouseMove($coord[0], $coord[1]);Move to portal MouseClick("left");Click on portal EndIf EndFunc Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
LxP Posted August 19, 2005 Share Posted August 19, 2005 Nothing obviously wrong with that code, but why not combine the two mouse actions? --; click on portal mouseClick("left", $coord[0], $coord[1])That might make things slightly better. If not, take note of the pixel colour underneath where the mouse is moved -- is it identical to the pixels at your desired location?Off-topic: When using a loop to idle around you'll always use less CPU with larger Sleep() values. Personally I always use the largest value that I can:while (1) sleep(0x7fffffff) wEnd Link to comment Share on other sites More sharing options...
phillip123adams Posted August 19, 2005 Share Posted August 19, 2005 Well that doesn't seem to work, what i dont get is why it doesn't click on the pixel if it finds it, all it does is move the mouse to a different spot and click there. Here is what i've got.<{POST_SNAPBACK}>I added two message boxes for testing purposes. Which one appears? I would also implement LxP's suggestions.Func CreateAndEnterPortal() Send("{F8}");Opens portal skill MouseClick("right");Casts portal skill $coord = PixelSearch(224, 89, 508, 414, 0x212021);Search for portal If Not @error Then MouseMove($coord[0], $coord[1]);Move to portal MouseClick("left");Click on portal MsgBox(4096, "Debug 1", "The color was found and the mouse should have left clicked on it.") Else MsgBox(4096, "Debug 2", "The color was not found?") EndIf EndFunc Phillip Link to comment Share on other sites More sharing options...
SupraNatural Posted August 20, 2005 Author Share Posted August 20, 2005 Ok well it says the color was found and it should have been left clicked on, but it doesn't left click on it. It clicks like WAY to far left of it, here is what it should do: 1. Select portal using F8 2. Create portal using Right Click 3. Scan for portal using pixel search 4. Use the pixel search coords to click on portal That's all it needs to do but it never clicks on it. Here is the code once again; HotKeySet("{F1}", "CreateAndEnterPortal") ;F1 While 1 Sleep(100) WEnd Func CreateAndEnterPortal() Send("{F8}");Opens portal skill MouseClick("right");Casts portal skill $coord = PixelSearch(224, 89, 508, 414, 0x212021);Search for portal If Not @error Then MouseClick( "left", $coord[0], $coord[1] );Click on portal MsgBox(4096, "Debug 1", "The color was found and the mouse should have left clicked on it.") Else MsgBox(4096, "Debug 2", "The color was not found?") EndIf EndFunc Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 20, 2005 Moderators Share Posted August 20, 2005 At the top of your Script include these two things: Opt("MouseCoordMode", 0) ; if Window Coords / , 2 if Client Coords Opt("PixelCoordMode", 0) ; Same as above Good Luck Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SupraNatural Posted August 22, 2005 Author Share Posted August 22, 2005 Well that didn't work. Does it matter that the resolution is 800X600? I'm going to try it using the client coords. Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 22, 2005 Moderators Share Posted August 22, 2005 Well your using Debug... did you at least get the Debug Error ... The color is not found? If so... try putting it in a while loop till it is found: Opt("MouseCoordMode", 0); if Window Coords / , 2 if Client Coords Opt("PixelCoordMode", 0); Same as above HotKeySet("{F1}", "CreateAndEnterPortal");F1 While 1 Sleep(100) WEnd Func CreateAndEnterPortal() While 1 Sleep(100) Send("{F8}");Opens portal skill MouseClick("right");Casts portal skill $coord = PixelSearch(224, 89, 508, 414, 0x212021);Search for portal If Not @error Then MouseClick( "left", $coord[0], $coord[1] );Click on portal MsgBox(4096, "Debug 1", "The color was found and the mouse should have left clicked on it.") ExitLoop EndIf Wend EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SupraNatural Posted August 22, 2005 Author Share Posted August 22, 2005 Ok well it says the color was found and it should have been left clicked on, but it doesn't left click on it. It clicks like WAY to far left of it. Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 22, 2005 Moderators Share Posted August 22, 2005 (edited) Opt("MouseCoordMode", 0); if Window Coords / , 2 if Client Coords Opt("PixelCoordMode", 0); Same as above Global $Game = "YOUR GAME TITLE HERE" HotKeySet("{F1}", "CreateAndEnterPortal");F1 While 1 Sleep(100) WEnd Func CreateAndEnterPortal() While WinExists($Game) Sleep(100) If Not WinActive($Game) Then WinActivate($Game) Sleep(500) EndIf Send("{F8}");Opens portal skill MouseClick("right");Casts portal skill $coord = PixelSearch(224, 89, 508, 414, 0x212021);Search for portal If Not @error Then MouseClick( "left", $coord[0], $coord[1], 1, 1 );Click on portal Sleep(1000) MsgBox(4096, "Debug 1", "The color was found and the mouse should have left clicked on it.") MsgBox(0, "Pixel Coords", "Found at x: " & $coord[0] & " y: " & $coord[1]) ExitLoop EndIf Wend EndFunc Edited August 22, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
w0uter Posted August 22, 2005 Share Posted August 22, 2005 <{POST_SNAPBACK}> maby the same color is found there ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
SupraNatural Posted August 22, 2005 Author Share Posted August 22, 2005 No the color im looking for is bright blue, its the only color like it in the game diablo. Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 23, 2005 Moderators Share Posted August 23, 2005 And what of the option I gave you? If you've done it as I've put it, it will return the results you desire. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SupraNatural Posted August 23, 2005 Author Share Posted August 23, 2005 LoL this is confusing me.. Ok so far it returns with the msgbox saying color found and should of clicked but it does NoT click on the color. Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
SupraNatural Posted August 23, 2005 Author Share Posted August 23, 2005 (edited) Ok it is done!! This will open a portal and take you into town, I will be implenting this into many other scripts, thanks all for helping. HotKeySet("{HOME}", "CreateAndEnterPortal");F1 While 1 Sleep(100) WEnd Func CreateAndEnterPortal() While 1 Sleep(100) Send("{F8}");Opens portal skill MouseClick("right");Casts portal skill $coord = PixelSearch(224, 89, 508, 414, 0xFFFFFF, 4);Search for portal If Not @error Then MouseClick( "left", $coord[0], $coord[1] );Click on portal ExitLoop EndIf Wend EndFunc ;224, 68 = Top Left ;508, 414 = Bottom Right Edited August 23, 2005 by SupraNatural Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
dutch-force Posted August 23, 2005 Share Posted August 23, 2005 cool lookin nice shame i dun play D2 nymore Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now