Jump to content
Sign in to follow this  
JoanG

script bugged?

Recommended Posts

JoanG

Hi ,

I got a script im working on and I cant seem to get it to work the way I want it too A little help or a "point the right direction" would be nice 

here is the script 

HotKeySet("{Esc}", "ExitScript") ; terminates the script

$color = 0xFC16D4 ; can be anything

While 1
    $pixelSearch = PixelSearch(0, 0, 1365, 767, $color, 10)

    If IsArray($pixelSearch) Then
        MouseClick("primary", $pixelSearch[0], $pixelSearch[1], 1, 10)
        Sleep(100)
    Else
        MouseClick("secondary")
        Sleep(200)
    EndIf

WEnd

Func ExitScript()
    Exit
EndFunc   ;==>ExitScript

I cant get this to work right,its supposed to click primary when pixel in visible and click secondary whenever its not available but it just randomly does the timing.. 

 

Share this post


Link to post
Share on other sites
water

Welcome to AutoIt and the forum!

Can you please tell us which program you try to automate? Often there are easier and more reliable ways to do what you want to do.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Blue_Drache

Um ... Someone made a graphics extraction program in Autoit a little while ago. 

Is that what you're looking for?


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites
JoanG

I cant open that link for some reason says 

Sorry, we couldn't find that!

 

weird.

Share this post


Link to post
Share on other sites
Melba23

JoanG,

That post is in the "Chat" section - and you need 5 posts to access it. So reply to this post and you are nearly there! ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
JoanG

oh hmmm well would it be considered spam if I double post here? haha

hope I find it there but if it isn't I hope someone can help me out :)

Share this post


Link to post
Share on other sites
Melba23

JoanG,

 

would it be considered spam if I double post here?

Well, I would certainly not say anything if by any chance you were to do such a thing... :whistle:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
JoanG

oh okay well I found out the reason I cant get script to work right is that the pixel search isnt that accurate I saw Color 0x00FF96FF was not found in the logs hmmm

need to get around that one I guess hahaha

Share this post


Link to post
Share on other sites
Blue_Drache

oh okay well I found out the reason I cant get script to work right is that the pixel search isnt that accurate I saw Color 0x00FF96FF was not found in the logs hmmm

need to get around that one I guess hahaha

 

99.99999999999999999999999999999999999999999999999999999999999999999999% of the time, it's user error.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites
JoanG
Blue_Drache I know.....

 

I'll get it to work somehow I guess.....

Share this post


Link to post
Share on other sites
Blue_Drache

Take a look at pixelsearch again.  See the first optional parameter?  Try toying with the shade variation and see if it helps.  You may be having issues with image artifacts, especially if you're using .JPG


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites
JoanG

I still cant open that link.... :P and wonder if anyone has ideas to help me out ^_^

Share this post


Link to post
Share on other sites
Melba23

JoanG,

Can you access the "Chat" section at all? If not, then perhaps Jon has increased the necessary post count - try posting 3 times in quick succession here to get you up to 10. I will not moan, promise. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
JoanG

ok then hehe hope that post is the one ive been looking for ^_^

Share this post


Link to post
Share on other sites
JoanG

I can make this so it only activates when graphics gale is open right? so when I alt tab it stops hehe

Share this post


Link to post
Share on other sites
JoanG

hmmmm I need more research I guess hehe :( hope to get this done soon haha I miss my sprites 

Share this post


Link to post
Share on other sites
JoanG
Blue_Drache

 

well thanks for pointing out that cool program but doesnt really fit for what I wanna do..

basic run down of the script im making is

I sprite the whole thing from scratch then I want to use this program to pinpoint the pixels I want so I can just change it automatically and if its done right click so ill know its done hehe basically its a color changer and shade fixer,now I was thinking it would be nice if it would only work if I got the tab/window open so when I alt+tab it stops..I know bout the magic want feature but its to complicated and takes to much time to adjust so this would make things much faster :)

well back to good ol drawing board... :P

Share this post


Link to post
Share on other sites
Blue_Drache

GIMP has a wonderful scripting language that will do exactly what you're asking.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites
JoanG

err I dun like gimp :P not good for spriting hehe prefer graphics gale 

oh well guess im stuck on this for awhile...

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×