Jump to content

Possible to do with Autoit?


Recommended Posts

So I was messing around with Excel VBA and learning some things by watching a youtube video, and while it's infinitely more complicated/annoying then it needs to be when you compare it to Autoit but there were a few things that I really liked and am wondering if Autoit is capable of doing, and if so, how? 

1) Run a program line by line.. Now I understand that an autoit program might be super complicated and line by line you might not get anything until you're a few hundred lines in.. but especially starting out, it would be a great function to have.

2) Running a program starting halfway through, kinda self explanatory.

3) Watching variables, it's actually kinda cool to be able to monitor multiple variable for changing values/errors without having to use control write for all of them, all the time. This would be an amazing debug tool for me personally because my autoit script copies a lot of values and processes data and it would be great to be able to watch it live, as part of the IDE instead of writing every change to the console. Especially if you set it up to watch 5+ different variables at any given time, would be great for debugging. 

Edited by BatMan22
Grammar issues
Link to comment
Share on other sites

1- After each line, have a pause which gets toggled off by pressing a key, e.g. next arrow.

2- Can be done by editing the script before execution, or using goto. Can be done by making each line a function. This would require the next line to be inside this function.

That is how I would implement them, but I'm not a master. I don't know if there are better solutions.

 

HotKeySet("{RIGHT}", "continueScript")
HotKeySet("{Left}", "skipTo")

$paused = True

func step1()
   ConsoleWrite("HELLO, ")

   while($paused = True)
      Sleep(100)
   WEnd

   $paused = True

   step2()
EndFunc

func step2()
   ConsoleWrite("I ")

   while($paused = True)
      Sleep(100)
   WEnd

   $paused = True

   step3()
EndFunc

func step3()
   ConsoleWrite("AM ")

   while($paused = True)
      Sleep(100)
   WEnd

   $paused = True

   step4()
EndFunc

func step4()
   ConsoleWrite("K.")

   Exit ;script finished
EndFunc

step1()

Func skipTo()
   Call("step" & InputBox("Box", "Input the step number to skip to."))
EndFunc

Func continueScript()
   $paused = False
EndFunc

 

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