Jump to content

autoit how to write a script to click on background


cjohnjohn
 Share

Recommended Posts

I don't hope this is for cheating purposes, but i suppose not.

If you meant mouse clicks left, right, middle etc. then this should do the job for ya

While 3
Controlclick("YourWindowTitle","","","Right",1)
sleep(1000)
wend

Tyranlol

[u]Only by Attempting the Impossible You Can Earn the Remarkable[/u]
Link to comment
Share on other sites

I think NO WAY! :)

Correcting myself: YES, These is a way! ;)

I don't hope this is for cheating purposes, but i suppose not.

If you meant mouse clicks left, right, middle etc. then this should do the job for ya

While 3
Controlclick("YourWindowTitle","","","Right",1)
sleep(1000)
wend

Tyranlol

I knew ControlClick() function but I thought it would not work for background windows, but I just tried it and it works with background windows too.

So cjohnjohn you have to use ControlClick() function as Tyranlol suggested...

Edited by ALTIN
Link to comment
Share on other sites

I am playing a webpage game, it need to click on certain monster to kill them. But sometimes it is boring to do the same clicking the whole day. So i usually check some other news or other webpages while playing this game, but it is irritating to change back to the game window to click on it and back to my news every 5 seconds.

I use pixelSearch to search a certain pixel from the monster and if the monster avaiable on screen, then it will auto click on it. but it only works when the game screen is activate and is to the front screen. if i am browsing other webpage, then it can't perform the click function.

this is basic function i wanna do, this is just part of it.

$B = PixelSearch($startXY[0], $startXY[1], $endXY[0], $endXY[1], 0xed8681)

while 1

if IsArray( $B ) then

MouseClick("left",$B[0],$B[1],1,1)

SLEEP(5000)

endif

wend

I search the forum, someone say that pixelSearch doesn't work on background.

So what i need is, some functions that can search certain pixel and click on it on background window and don't irritate my current window.

Is there any function for it.

Thanks in advance.

Edited by cjohnjohn
Link to comment
Share on other sites

  • 1 year later...

i think i write all correct, but still i dont see click on window.

Do i have to write anything else exept this?

ControlClick ("Online support - Google Chrome", "" , "" , "" , 1 , 1026, 716 )
Edited by Crackeraki
Link to comment
Share on other sites

  • Moderators

Crackeraki,

Please do not necro threads - particularly those that deal with currently prohibited subjects. ;)

I would also like to point out that your first 2 posts on this forum have resulted in thread locks - please do not make it a hat-trick or you will find that your ability to continue posting may well suffer. :)

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...