Jump to content

browsers make the same?


Recommended Posts

hi

does anyone know a way to duplicate the clicks on a browser window? it should fill the 2nd browser with exact the clicks i do in first window....is there a chance? like cloning or something?

thx in advance!

Link to comment
Share on other sites

hi

does anyone know a way to duplicate the clicks on a browser window? it should fill the 2nd browser with exact the clicks i do in first window....is there a chance? like cloning or something?

thx in advance!

Please do not double post.

This is the same topic that you started here:

http://www.autoitscript.com/forum/index.ph...=0&p=684928

The solution to this gaming problem of yours is the same as was given in the other thread.

WinMove to setup the two browsers to the exact same size windows

While 1

IsPressed to detect when you as a human clicks your mouse

MouseGetPos to determine where you as a human clicked

ControlClick to click in your cloned browser window

Sleep(9)

WEnd

(You may have to use the x,y parm on ControlClick)

If ControlClick does not work, then MouseClick with a speed of 0 to the cloned window and then MouseMove back to your original window with a speed of 0.

Post some of your own code next time to show some effort. :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

i did it that way...works...not really well, but better than nothing:)

anything to make better?

#include <Misc.au3>

$dll = DllOpen("user32.dll")

WinWait("GreenBrowser - [www.seafight.com]","")

If Not WinActive("GreenBrowser - [www.seafight.com]","") Then WinActivate("GreenBrowser - [www.seafight.com]","")

WinWaitActive("GreenBrowser - [www.seafight.com]","")

While 1

Sleep ( 250 )

If _IsPressed("01", $dll) Then

$pos = MouseGetPos()

;MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])

Sleep(50)

Send("{F3}")

Sleep(50)

Mouseclick("left",$pos[0],$pos[1],1,1)

Sleep(50)

Send("{F2}")

ExitLoop

EndIf

WEnd

DllClose($dll)

Link to comment
Share on other sites

ok, but why 9 and not 10?

Easier to type - the left parenthesis is also the number 9 on this laptop :-)

Read this:

http://www.autoitscript.com/forum/index.ph...ost&p=32762

Partial quote:

Also, when the Sleep() command is used the timer is only checked every 10ms anyway.

If you read that entire thread, you will have more info on on the Sleep and timer functions that you ever wanted to know.

That thread might also put you to sleep. :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

it does not work :)

it always runs different coordinates...anything is wrong :party:

this is the last i tried:

#include <Misc.au3>

Global $paused = FALSE

$dll = DllOpen("user32.dll")

WinWait("GreenBrowser - [www.seafight.com]","")

If Not WinActive("GreenBrowser - [www.seafight.com]","") Then WinActivate("GreenBrowser - [www.seafight.com]","")

WinWaitActive("GreenBrowser - [www.seafight.com]","")

While 1

Sleep (9)

If _IsPressed("01", $dll) Then

$pos = MouseGetPos()

;MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1])

Sleep(9)

Send("{F3}")

Sleep(9)

Mouseclick("left",$pos[0],$pos[1],1,1)

Sleep(9)

Send("{F2}")

;ExitLoop

EndIf

WEnd

DllClose($dll)

Func TogglePause()

$paused = Not $paused

While $paused

WEnd

EndFunc

anyone knows another(better) way?

Link to comment
Share on other sites

Look at Opt(MouseCoordMode...

Also, I do not see any code that sets up the two browser windows to be the same size.

And how are you switching between the windows?

the size is the same because Greenbrowser just makes 2 tabs....i switch by sending F2 / F3! should be same size --- as i see its the same! :)

Link to comment
Share on other sites

the size is the same because Greenbrowser just makes 2 tabs....i switch by sending F2 / F3! should be same size --- as i see its the same! :)

Create two windows - not two tabs.

Use WinSetTitle to name each GreenBrowser window something different.

Use WinMove to make sure that they are the same size.

Put one browser window exactly behind the other one.

Your challenge will be how to code the steps below:

[it might be harder for you than just playing the game manually :-]

While 1

When you click in window #1

- the script changes windows to window #2

- then clicks in the same place

[Do not have the script switch back to window #1]

Your next manual click will be in window #2

- the script changes windows to window #1

- then clicks in the same place

WEnd

At the top of your script, put:

Opt(WinWaitDelay, 1)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
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
 Share

  • Recently Browsing   0 members

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