How do I store a value and add a number to it?

Recommended Posts

computergroove 31

computergroove 31

I am making a program that will auto fill a form. I am confused on a couple of things. I need it to go something like this:

$variable1 = 1000
While 1
Call ("start")
WEnd
Func start()
MouseClick ("left"); I want this to click on a x,y coordinate - not sure of the code but I do have the coordinates
Send ("variable1")
Send ("{TAB}")
Send ("variable1")
Send ("{ENTER}")
variable1 = variable1 + 1; I am guessing that this is also coded wrong but I want the 1000 to become 1001
Sleep (3000)
Send ("{BACKSPACE}")
Sleep (3000)
call("start")
EndFunc

I have most of this down. I was not able to understand the variable tutorial. Any help is appreciated. Thanks

Share this post

Link to post

Share on other sites

martin 66

martin 66

I am making a program that will auto fill a form. I am confused on a couple of things. I need it to go something like this:

$variable1 = 1000
While 1
Call ("start")
WEnd
Func start()
MouseClick ("left"); I want this to click on a x,y coordinate - not sure of the code but I do have the coordinates
Send ("variable1")
Send ("{TAB}")
Send ("variable1")
Send ("{ENTER}")
variable1 = variable1 + 1; I am guessing that this is also coded wrong but I want the 1000 to become 1001
Sleep (3000)
Send ("{BACKSPACE}")
Sleep (3000)
call("start")
EndFunc

Welcome to the AutoIt forums!

Perhaps this will do it.

$variable1 = 1000
While 1
Start();using Call is not needed
WEnd
Func start()
Local $xpos = 345, $ypos = 776;put your coordinates here
MouseClick ("left",$xpos, $ypos); I want this to click on a x,y coordinate - not sure of the code but I do have the coordinates
Send ($variable1);use the variable name itself
Send ("{TAB}")
Send ($variable1)
Send ("{ENTER}")
$variable1 = $variable1 + 1; I am guessing that this is also coded wrong but I want the 1000 to become 1001
Sleep (3000)
Send ("{BACKSPACE}")
Sleep (3000)
; call("start");don't call the function again or you will get a problem
EndFunc