Jump to content
Sign in to follow this  
Madness2008

Image scripting

Recommended Posts

Madness2008

I am making a script which automates several functions on a website. I can make it all automate by using mouseclick simply enough, and in the past I have background scripted other websites similar, however on this website one of the buttons is an image src and not an input type="button", therefore it does not have a name attribute that I am aware of.

I would like to know if there is anyway to click the image without having to use the mouse, so I can fully background automate this script and do other things while it is running.

I can provide some source code if anyone thinks they may be able to help me solve this one and needs to see the source to possibly solve this.

Many Thanks

Madness2008

Share this post


Link to post
Share on other sites
monoceres

_IEImgClick would do the trick

Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Madness2008

can't find anything in the help file about _IEImgClick :)

MY current code for this particular image is :-

Func ClickNewfight()

Local $oframe = _IEFrameGetObjByName($oie, "toiminta")

local $Button = _IEGetObjByid($oframe, "nefb")

local $X = _IEPropertyGet($Button, "screenx")

local $Y = _IEPropertyGet($Button, "screeny")

local $Width = _IEPropertyGet($Button, "width")

local $Height = _IEPropertyGet($Button, "height")

local $widthA = $X

local $WidthB = ($X + $Width - 5)

local $heighta = $Y

local $heightb = ($Y + $Height-5)

local $WidthRange = Random($WidthA, $WidthB, 1)

local $HeightRange = Random($HeightA, $HeightB, 1)

If $WidthRange + $HeightRange = 0 Then Return 0

MouseClick("left", $WidthRange, $HeightRange, 1, 0)

sleep(2000)

EndFunc

That randomises it to click on a random pixel in range. How would I use _IEImgClick. I cannot find anything in help file to show me an example of it's use.

Share this post


Link to post
Share on other sites
Madness2008

Ok I've found some documentation on the _IEImgClick. I have tried using the src partial and full and it doesn't work so I assume I am doing something wrong.

_IEImgClick ($oIE, "/images/newf.jpg")

Is that incorrectly written or is it just not gonna work for other reasons?

Thanks

Madness 2008

Share this post


Link to post
Share on other sites
Madness2008

<input type='image' name='newfightbutton' onclick='setTimeout(\"this.disabled=true;\",10);return true;' src='images/newf.jpg' style='cursor: default;'>

That's the source for the image I am attempting to click background. Forgot to add it earlier :)

Share this post


Link to post
Share on other sites
Madness2008

ok spoke to a friend who knows au3 well and he said the IEImgClick will not work. He also said he has no idea how to make it work. Any new ideas welcome I would love to solve this problem :)

Share this post


Link to post
Share on other sites
monoceres

Can you post a link to the website, it's easier if you can examine it for yourself :)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Madness2008

Ok that idea failed :) Has anyone got any fresh ideas for this one?

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  

×