Jump to content

Need help with my script!


Recommended Posts

Here is part of my script....

MouseMove(233, 43)

MouseClick("left")

Sleep(1000)

If PixelGetColor(160, 173) = 0x45494A Then

MouseMove(160,173)

MouseClick("left")

MouseMove(577,377)

MouseClick("left")

MouseMove(569, 411)

MouseClick("left")

MouseMove(663, 377)

MouseClick("left")

MouseMove(660, 480)

MouseClick("left")

MouseMove(665, 400)

MouseClick("left")

Elseif Not PixelGetColor(160, 173) = 0x45494A Then

If PixelGetColor(200, 160) = 0x45494A Then

MouseMove(200,160)

MouseClick("left")

MouseMove(577,377)

MouseClick("left")

MouseMove(569, 411)

MouseClick("left")

MouseMove(663, 377)

MouseClick("left")

MouseMove(660, 480)

MouseClick("left")

MouseMove(665, 400)

MouseClick("left")

Elseif Not PixelGetColor(200, 160) = 0x45494A Then

MouseMove(177, 145)

MouseClick("left")

MouseMove(577,377)

MouseClick("left")

MouseMove(569, 411)

MouseClick("left")

MouseMove(663, 377)

MouseClick("left")

MouseMove(660, 480)

MouseClick("left")

MouseMove(665, 400)

MouseClick("left")

EndIf

First, I am having problems with the PixelGetColor part, because it won't do the mouse move afterwards. Second, I'm not sure if the "If" "ElseIf" is right. Third, for the "MouseClick" function, can you put in the coordinates for the click, instead of having so many MouseMoves? I tried to do it, but it kept giving me "ERROR." Fourth, how do I make my code into the box part on this forum? Thats all, PLEASE HELP!

Signature Created By: Eli at http://customsignatures.net/index.php
Link to comment
Share on other sites

  • Developers

First, I am having problems with the PixelGetColor part, because it won't do the mouse move afterwards. Second, I'm not sure if the "If" "ElseIf" is right. Third, for the "MouseClick" function, can you put in the coordinates for the click, instead of having so many MouseMoves? I tried to do it, but it kept giving me "ERROR." Fourth, how do I make my code into the box part on this forum? Thats all, PLEASE HELP!

1. Check the result of the PixelGetColor() so you know what it is returning to determine what is wrong.

2. The first elseIf is wrong for sure because you are using the Not wrongly, but what about you tell us what you want first.

3. Yes... Checked the helpfile for that before asking?

4. Select all code iIn the forum editor and click on one of the last Icons that says "Wrap in code tags" when you hover over it.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

1. Check the result of the PixelGetColor() so you know what it is returning to determine what is wrong.

2. The first elseIf is wrong for sure because you are using the Not wrongly, but what about you tell us what you want first.

3. Yes... Checked the helpfile for that before asking?

4. Select all code iIn the forum editor and click on one of the last Icons that says "Wrap in code tags" when you hover over it.

What I am trying to do is change my district in a game... http://ninja-ferret.deviantart.com/art/GW-124583302 look at the top left of the picture. I want to hit the More Options button, but sometimes it will be up higher due to less districts. So I want to see if its there with PixelGetColor and if not, go up one and see if its there, if not go up one... etc.

I'm not even sure if PixelGetColor is the right thing I should be using :D

Signature Created By: Eli at http://customsignatures.net/index.php
Link to comment
Share on other sites

I'm not even sure if PixelGetColor is the right thing I should be using :D

Try with PixelSearch and MouseClick

$coord = PixelSearch( 0, 0, 20, 300, "0x45494A" )
If Not @error Then
    MouseClick("left", $coord[0],$coord[1], 0)
Else
    MsgBox(0,"","i dont see it")
EndIf

(or look at examples on commands in help file)

for command PixelGetColor in the help file look closely at line

MsgBox(0,"The hex color is", Hex($var, 6))

in its example

hope this helps

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

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