Jump to content

need help with loops


Recommended Posts

Hello I am new to autoit and need to know how to make a loop that will continue until another window opens. What i want to do make my loop send a message every 2 mins till a window opens then pause until the window closes agian and so on.

Link to comment
Share on other sites

Another window of what?

----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win

Link to comment
Share on other sites

trade? as in a game? Im willing to help and do what i can but can you please specify the exact problem/environment

----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win

Link to comment
Share on other sites

ok i am creadting a bot for mtg0 v3 evryone wants to charge me 400 bucks for a bot and i said ill do it my self, I have all the begining code done i need to create a loop that will loop my mouse to move to a chat box left click type selling then move down to send every 85 seconds. I want the loop to stop when someone opens a trade with me so i can trade with the person after the trade is done i want it to continue.

Link to comment
Share on other sites

Start with this

While 1

Sleep(85000) ; 85 sec

wend

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Link to comment
Share on other sites

played the card version of it before unluckily i dont own the actual game :D

----------------------------------90% of teens today would die if Myspace,Bebo + FaceBook had a system failure and was completely destroyed. If you are one of the 10% that would be laughing, copy and paste this to your signature.----------------------------------Code to win, 'till you die, 'till the compiler dies from your linesCode to win, take it all, just keep coding till you fallDay by day, codin' all the way, I'm not cavin' inLet another App begin, code to win

Link to comment
Share on other sites

ok need help agian here is my code

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.2.10.0

Author: myName

Script Function:

Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here;

MouseMove (36, 707) ; move to magic 3 icon;

MouseClick ("left")

MouseClick ("left")

sleep (80000)

mousemove (559, 567) ; move to luanch button;

MouseClick ("left")

sleep (65000)

mousemove (684, 391)

mouseclick ("left")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ("{BS}")

send ( "cainn823")

mousemove (683, 412)

mouseclick ("left")

send ( "********")

mousemove (676, 461)

mouseclick ("left")

sleep (120000)

mousemove (244, 760)

mouseclick ("left")

mousemove (268, 656)

sleep (3000)

mousemove (411, 659)

sleep (3000)

mousemove (516, 660)

mouseclick ("left")

$nTitle = "magic"

While 1

If Not WinExists($nTitle) Then

mousemove (1031, 487)

mouseclick ("left")

send ("sell")

mousemove (1040, 513)

mouseclick ("left") ;; Send message.

EndIf

Sleep(120000)

WEnd

after the loop do i just start to add the mouse moves for the trade screen. For example

when the trade screen opens i want it to stop the loop then move to the accept button and start the trade

do i just start codeing that on the next line below the loop?

Link to comment
Share on other sites

While 1

;Your code

If winexists(Trade Screen) then

send("help me")

Mousemove(0,0,0)

endif

wend

Something like that I would do it at the top towards you other if

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Link to comment
Share on other sites

You cant figure out the name of the window? Try using AU3info

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Link to comment
Share on other sites

ok this is what the au3info program said

title Magic Online v3.0.9.2

class WindowsForms10.window.8.app.0.33c0d9d

but is that the whole window or just the pop up becuase if i take the little icon anywhere on the application it says the same thing and my next question is, is there a way to make it watch for a window that pops up at a certin spot?

Link to comment
Share on other sites

ok this is what the au3info program said

title Magic Online v3.0.9.2

class WindowsForms10.window.8.app.0.33c0d9d

but is that the whole window or just the pop up becuase if i take the little icon anywhere on the application it says the same thing and my next question is, is there a way to make it watch for a window that pops up at a certin spot?

Link to comment
Share on other sites

Is the window a different color that pops up, If so you can do something like

If Pixelgetcolor(x,y) = that color then

code

code

code...

" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Link to comment
Share on other sites

well im going to post this image and i hope i dont get in trouble for it but you can tell me what you think and if its not allowed then im sorry this is the trade window i ham talking about tell me what you would do and how to change the code correctly and thanks for all your help i am a big noob at this but when i learn i will help others.

post-34941-1208998876_thumb.jpg

Link to comment
Share on other sites

If i use pixelgetcolor it will not stop the loop if the pixel color changes. I have used autoinfo and it only shows the ifo for the whole program and not the wind that pops up. I was thinking maybe use the handle of the window. Does anyone know of a better way to do this I included an image of the window that pops up. Thanks to all those that will and did help me.

Link to comment
Share on other sites

I really am stumped with this i dont want someone to write the code for me i just want to know what whould be a good way to start to program this. I did use

While 1

if not winexits command but i cant get the title to the window autoinfo window just shows the whole program not jst the window I was thinkning that maybe i could use the handle number for the title of the window but im not sure if that will work, If anyone knows a workaround for this let me know. I also tried the pixelget (x, y) command but when the window pops up it failes to recginze the window.

P. S. i know my spelling is bad and gramer is horrable but im at work and it wont let me install the spell check addon.

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