Sign in to follow this  
Followers 0
Halldor

Need Advice

7 posts in this topic

#1 ·  Posted (edited)

Alright i'm new to AutoIT, but so far i'm having a lot of fun with a project.

The goal with my script, is to have pixelgetcolor on a loop, looking for changes at 2 different cords, if the color matches, i want it to do X until the color changes then i want it to do Y.

I managed to do this fine with just IF/Else, i ran into problems when i added my second part of coding, that introduced the second pixelgetcolor loop,

Now i was not exactly sure how to use IF/Else for this, seeing as i have more then 2 statements, and IF/Else seems to my limited knowledge to allow for 2 (or 3 with if elseif, else)

Here is the majority of the code, the reason for all the sleep, is i have been looping both the If/Else statements in a While(9999999999) loop, and it seems to be really laggy, the sleep helped,

Any suggestions as to how to do this more effectively ?

ToolTip("info", 0, 0)
Sleep(250)

Sleep(3000)
ToolTip("")
Sleep(250)
$b = "121455"
$var = "16711680"
Sleep(250)
Sleep(250)
Local $px = PixelGetColor(473, 358)
Sleep(250)

If $px == $var Then
Sleep(250)
Sleep(250)
$x MouseClick("left")
Sleep(700)


Else
Sleep(250)
Send("{h down}")
Sleep(250)
Sleep("1000")
ToolTip("You have no valid target, You Inbred")
EndIf


Sleep(250)
$c = PixelGetColor(432, 22)
Sleep(250)

Sleep(250)
If $c == $b Then
Sleep(250)
Send("{h down}")
Sleep("1000")
Send("{h up}")

Else
Sleep(250)
ToolTip("a message")
Sleep(250)
ToolTip("")
EndIf
Edited by Halldor

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Welcome.

Let me start with a question: have you read our Forum rules?

Jos

I shamefully admit to not having read them, but not from a lack of trying. Can you point me in their general direction ?

And regarding the script, i would just like the best way to loop this all, and some general advice if there is a better way to write it, not asking anyone to write this for me, only looking for a "xxx might be a better way to accomplish this)

Edited by Halldor

Share this post


Link to post
Share on other sites

Right bottom of the screen has the link to the Forum rules ;)

Found it, too bad you guys don't allow any scripting for games, even if the game allows it, should i delete the post ?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I'm not the boss, but you should leave the posts alone.

That way all the information is still here and everybody's part continues to make sense without edit.

Do whatever you want with your scripts, just don't discuss game automation here.

I think the idea is game automation discussion takes away from the utility of this forum.

Moderation becomes more necessarily and too many immature people start debating.

The rules are the rules, take your shoes off at the door.

Best of luck.

Edited by Xandy

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

Found it, too bad you guys don't allow any scripting for games, even if the game allows it, should i delete the post ?

Agree and we tried it .... the remains can still be found in the archives ... :(

Just leave your posts.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  
Followers 0