Sign in to follow this  
Followers 0
Ghost1981

Any way to use an input box to multiply the script

7 posts in this topic

I'm a noob, so sorry I'm not sure exactly how to put this.

What I want to do is have an input box at the start of the script that lets the user basically set how many times to repeat the input gathering section of a script to basically do the same set of mouse click operations only in different locations on the screen. Basically what I'm looking for is for them to be able to say ok, I've got this many to do, input the information/clicks for each one, and then the script remember those separate sets of inputs and be able to run the rest of the operation using each set of inputs..

So something like..

User inputs 3

program gathers 1st set of input information

program gathers 2nd set

program gathers 3rd set

Program runs 1st set of info through later section of script

program runs 2nd set of into through the same later section

same for the 3rd

Any help would be appreciated.. I'm looking for a way to do this withuot having to essentially just make a seperate script for each number of times I want it to run.

And again I apologize for being a noob

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$Times = InputBox("Times', "How many times do you want this to run?")

For $X = 1 To Times
 ;Gather info script
 _UseInfo($GatheredItem1, $GatheredItem2, $GatheredItemN)
Next

Func _UseInfo($1, $2, $n)
 ;What do do with info you gathered
EndFunc

Would this be close to what you want to do?

Edited by darkjohn20

Share this post


Link to post
Share on other sites

Well basically what I'm using it for is for the facebook app farmville (involes ALOT of clicking).. The imfo portion of the script gathers the location of chickens within a group and moves them into a chicken coop, also has a section to take them back out and put them right back where they started from. So what I'm trying to do is set it up so that if someone wants to move say a 2nd set of chickens (in a different location) to a 2nd coop (also in another location) that that be possible without me having to double the already lengthy script that it is.

Share this post


Link to post
Share on other sites

I personally don't play Farmville, but I imagine PixelSearch might help, even though it would probably be unreliable for this task.

You could move the mouse over the chicken and press a hotkey to get the current mouse x and y pos. Then store it and refer to it when clicking later on (in an auto-click or whatever)

There isn't really any extremely easy way to do this. I am not sure of the easiest way, so I cannot be of much help.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The script works for a single coop, though as I said it's quite long.. Here, I'll post it So, I've already got the info gathering portion and the main script portion done.. Just if I could have it do more than one group of chickens to more than one coop would be great

^0::
;Ctrl 5 to Pause
;Ctrl 0 to start
;ctrl X to stop
;

sleep 1000

gosub Info
gosub Main

Info:
msgbox, Instructions: Press Ctrl+5 to Pause Ctrl+X to stop(reload) the script, Ctrl+1 to skip to Load proccess and Ctrl+2 to skip to Unload Process. It is recommended that you create and use a macro to move your screen to where you will be working in case of a forced refresh.
sleep 1000
msgbox, Click on the 1st (of the 19) Chickens to be loaded
KeyWait, LButton, D
mousegetpos, c1X,  c1Y
c1mX:=c1X+45
c1mY:=c1Y+10
sleep 100
click, %c1mX%, %c1mY%
msgbox, Move the Chicken to the chicken coop, Then click the remaining 18 chickens, you will know it's correct when the program moves it to the coop
sleep 100
KeyWait, Lbutton, D
mousegetpos, ccX, ccY
ccmX:=ccX+45
ccmY:=ccY+10
cchX:=ccX+1
cchY:=ccY+1
sleep 100]
KeyWait, LButton, D
mousegetpos, c2X,  C2Y
c2mX:=c2X+45
c2mY:=c2Y+10
sleep 100
click, %c2mX%,  %c2mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c3X,  C3Y
c3mX:=c3X+45
c3mY:=c3Y+10
sleep 100
click, %c3mX%,  %c3mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c4X,  C4Y
c4mX:=c4X+45
c4mY:=c4Y+10
sleep 100
click, %c4mX%,  %c4mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c5X,  C5Y
c5mX:=c5X+45
c5mY:=c5Y+10
sleep 100
click, %c5mX%,  %c5mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c6X,  C6Y
c6mX:=c6X+45
c6mY:=c6Y+10
sleep 100
click, %c6mX%,  %c6mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c7X,  C7Y
c7mX:=c7X+45
c7mY:=c7Y+10
sleep 100
click, %c7mX%,  %c7mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c8X,  C8Y
c8mX:=c8X+45
c8mY:=c8Y+10
sleep 100
click, %c8mX%,  %c8mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c9X,  C9Y
c9mX:=c9X+45
c9mY:=c9Y+10
sleep 100
click, %c9mX%,  %c9mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c10X,  C10Y
c10mX:=c10X+45
c10mY:=c10Y+10
sleep 100
click, %c10mX%,  %c10mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c11X,  C11Y
c11mX:=c11X+45
c11mY:=c11Y+10
sleep 100
click, %c11mX%,  %c11mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c12X,  C12Y
c12mX:=c12X+45
c12mY:=c12Y+10
sleep 100
click, %c12mX%,  %c12mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c13X,  C13Y
c13mX:=c13X+45
c13mY:=c13Y+10
sleep 100
click, %c13mX%,  %c13mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c14X,  C14Y
c14mX:=c14X+45
c14mY:=c14Y+10
sleep 100
click, %c14mX%,  %c14mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c15X,  C15Y
c15mX:=c15X+45
c15mY:=c15Y+10
sleep 100
click, %c15mX%,  %c15mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c16X,  C16Y
c16mX:=c16X+45
c16mY:=c16Y+10
sleep 100
click, %c16mX%,  %c16mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c17X,  C17Y
c17mX:=c17X+45
c17mY:=c17Y+10
sleep 100
click, %c17mX%,  %c17mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
KeyWait, LButton, D
mousegetpos, c18X,  C18Y
c18mX:=c18X+45
c18mY:=c18Y+10
sleep 100
click, %c18mX%,  %c18mY%
sleep 100
click, %ccX%, %ccy%
sleep 100
Keywait, Lbutton, D
mousegetpos, c19X,  C19Y
c19mX:=c19X+45
c19mY:=c19Y+10
sleep 100
click, %c19mX%,  %c19mY%
sleep 100
click, %ccX%, %ccY%
sleep 2000
click, %cchX%, %cchY%
sleep 900
Click, %ccmX%, %ccmY%
sleep 500
msgbox, After you've dealt with the egg or Sorry message, press} to continue, Do this at this stage every time.
Keywait, }, D
sleep 100
click, %ccX%, %ccY%
sleep 200
click, %ccmX%, %ccmY%
sleep 1200
msgbox, Click the remove button for the color of chickens you are using and wait
Keywait, Lbutton, D
Keywait, Lbutton, D
mousegetpos, remX, remY
sleep 900
click, %c19X%, %C19Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c18X%, %c18Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c17X%, %c17Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c16X%, %c16Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c15X%, %c15Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c14X%, %c14Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c13X%, %c13Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c12X%, %c12Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c11X%, %c11Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c10X%, %c10Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c9X%, %c9Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c8X%, %c8Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c7X%, %c7Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c6X%, %c6Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c5X%, %c5Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c4X%, %c4Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c3X%, %c3Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c2X%, %c2Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 1200
click, %c1X%, %c1Y%
sleep 400
msgbox, Unload your last chicken, put a new "reset" chicken in your coop and press { to continue
return

Main:
Keywait,   {, D
^1::
sleep 100
click, %c1X%, %c1Y%
sleep 100
click, %c1mX%, %c1mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c2X%, %c2Y%
sleep 100
click, %c2mX%, %c2mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c3X%, %c3Y%
sleep 100
click, %c3mX%, %c3mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c4X%, %c4Y%
sleep 100
click, %c4mX%, %c4mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c5X%, %c5Y%
sleep 100
click, %c5mX%, %c5mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c6X%, %c6Y%
sleep 100
click, %c6mX%, %c6mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c7X%, %c7Y%
sleep 100
click, %c7mX%, %c7mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c8X%, %c8Y%
sleep 100
click, %c8mX%, %c8mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c9X%, %c9Y%
sleep 100
click, %c9mX%, %c9mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c10X%, %c10Y%
sleep 100
click, %c10mX%, %c10mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c11X%, %c11Y%
sleep 100
click, %c11mX%, %c11mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c12X%, %c12Y%
sleep 100
click, %c12mX%, %c12mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c13X%, %c13Y%
sleep 100
click, %c13mX%, %c13mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c14X%, %c14Y%
sleep 100
click, %c14mX%, %c14mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c15X%, %c15Y%
sleep 100
click, %c15mX%, %c15mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c16X%, %c16Y%
sleep 100
click, %c16mX%, %c16mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c17X%, %c17Y%
sleep 100
click, %c17mX%, %c17mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c18X%, %c18Y%
sleep 100
click, %c18mX%, %c18mY%
sleep 200
click, %ccX%, %ccY%
sleep 100
click, %c19X%, %c19Y%
sleep 100
click, %c19mX%, %c19mY%
sleep 200
click, %ccX%, %ccY%
sleep 1200
click, %cchX%, %cchY%
sleep 150
click, %ccmX%, %ccmy%
KeyWait, }, D
^2::
click, %ccX%, %ccY%
sleep 100,
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c19X%, %C19Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c18X%, %c18Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c17X%, %c17Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c16X%, %c16Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c15X%, %c15Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c14X%, %c14Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c13X%, %c13Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c12X%, %c12Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c11X%, %c11Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c10X%, %c10Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c9X%, %c9Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c8X%, %c8Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c7X%, %c7Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c6X%, %c6Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c5X%, %c5Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c4X%, %c4Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c3X%, %c3Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200[
click, %remX%, %remY%
sleep 900
click, %c2X%, %c2Y%
sleep 100
click, %ccX%, %ccY%
sleep 100
click, %ccmX%, %ccmY%
sleep 1200
click, %remX%, %remY%
sleep 900
click, %c1X%, %c1Y%
gosub Main

^X::reload

^5::Pause
Edited by Ghost1981

Share this post


Link to post
Share on other sites

Topic Closed - OP was confused on AHK/AuotIt similarities.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0