Jump to content

Do PixelSearch Until, Then


Recommended Posts

Hey folks, my brains fried. i've been stuck at this line of code for a couple hours now. I've done Google searches, forum searches, etc.. I'm making no progress and I feel like I've tried every variation of the code possible. It's a simple program to open D3 so I can Log in.

$default_resolutionX = 1920

$default_resolutionY = 1080

$x_ratio = @Desktopwidth / $default_resolutionX

$y_ratio = @Desktopheight / $default_resolutionY

Run ("C:Program Files (x86)Diablo IIIDiablo III Launcher.exe")

Do

$Pixel2 = PixelSearch(0,0,(1113 * $x_ratio),(616 * $y_ratio),0xF6F8FC,3)

Until @error Then

If not @error Then

MouseClick("left", Round(1113 * $x_ratio),Round(616 * $y_ratio))

Endif

Do

$Pixel3 = PixelSearch(0,0,(1113 * $x_ratio),(616 * $y_ratio),0xF6F8FC,3)

Until @error Then

Do

$Pixel4 = PixelSearch(0,0,(959 * $x_ratio),(356 * $y_ratio),0xEF571D,3)

Until @error Then

Etc..

I realize this is grossly incorrect, but I re-did the coding that would make sense to me. Hopefully you can see my way of thinking and help explain how I'm getting everything wrong here. Having a hard time figuring out how to continue off of "Until @error" because it seems to just stop when it becomes true, instead of wanting to use the "Then" request. It basically needs to search for the launch button with the distinct red color at those coords, when it appears, clicks it, then starts searching for the next pixel, clicks a certain point on the screen, etc...

Thanks folks. Once I grasp this, should be smooth sailing. This is my first Autoit program, coming from DOS batch files.

Edited by mrwizardd
Link to comment
Share on other sites

  • Moderators

mrwizardd,

Welcome to the AutoIt forum. :)

Unfortunately you appear to have missed the Forum Rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. :naughty:

See you soon with a legitimate question I hope. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...