--- title: 'Sample Script Examples, part 2' --- # Sample Script Examples, part 2 updated:11/23/13 In this section, we’ll take a look at various examples for upgrading, sending [ships](/wiki/ships/), and building SS [plans](/wiki/plans/). As mentioned in my original [Sample Script Examples](/wiki/sample-script-examples/) post, I make no claims as to whether the methods I use are the best or not. Upgrade\_all is a Perl file that allows us to upgrade virtually any structure in the game. It has many options available (see [Sample Script Commands](/wiki/sample-script-commands/) in the Wiki). Its usage can be a bit tricky though. I’ve found it easier to use when upgrading the same [buildings](/wiki/buildings/), even on several planets. However, when trying to upgrade multiple planets that have different [buildings](/wiki/buildings/) to upgrade, I’ve found it difficult to use. As it set’s a queue for upgrades, it causes subsequent instructions in a script to wait. So for example: upgrade\_all.pl --planet “One”--planet "Two" upgrade\_all.pl --planet “Three” --match “[Algae Pond](/wiki/algae-pond/)” The first line of these instructions would upgrade [buildings](/wiki/buildings/) on planets One & Two, and then on line two only [Algae Pond](/wiki/algae-pond/)s on planet Three would be upgraded. But as upgrade\_all.pl sets a build queue (up to 8 hours), if building takes less than 8 hours on either planet in the first line than the second line will have to wait for the timer on the queue to finish before it can be executed. While one could run multiple scripts to get around this issue, there is a simple way to disable the timer queue. Using a text editor (like Notepad) open upgrade\_all.pl. Near the beginning of the file, find the instruction: wait => 8 \* 60 \* 60, Change this line to read: wait => 0 \* 60 \* 60, By changing the eight to a zero, we have essentially disabled the queue function. Why we do this will become clearer in a moment. Using our modified upgrade\_all.pl file, let’s see an example: @echo off cd c:\\le\\glc\\examples :start FOR /F "tokens=\*" %%A IN ('DATE/T') DO FOR %%B IN (%%A) DO SET Today=%%B FOR /F %%A IN ('TIME/T') DO SET Now=%%A upgrade\_all.pl --planet "One" --planet "Two" --match "[Shipyard](/wiki/shipyard/)" --space upgrade\_all.pl --planet "Four" --match “[Shield Against Weapons](/wiki/shield-against-weapons/)” upgrade\_all.pl --planet "Two" --planet “Three” --skip “[Algae Pond](/wiki/algae-pond/)” --skip “[Apple Orchard](/wiki/apple-orchard/)” echo Resuming in 1 hr from now: %Today% %Now% perl -e "sleep 3600" goto start Here’s a file that loops back on itself, similar to examples from my first [Sample Script Examples](/wiki/sample-script-examples/) post. In this example, we’re upgrading different [buildings](/wiki/buildings/) on multiple planets (lines 6-8), sleeping for 60 minutes (line 10), and then returning to the beginning to upgrade again. By using the Perl sleep function, we’re deciding how long the program sleeps or pauses before looping back around. That’s why we disabled the queue function in upgrade\_all.pl I’ve also added some MS-DOS instructions; line 4 sets the date (Today) and line 5 the time (Now) as variables that are used in line 9, which would display as such: Resuming in 1 hr from now: 10/31/13 10:32 By displaying when the sleep cycle begins, we can tell when the timer will run out. We could also modify the upgrade\_all.pl timer, if desired. If you changed the timer queue to 1, for example: wait => 1 \* 60 \* 60, This would max the queue timer at one hour. Here are some examples we can use to send [ships](/wiki/ships/) to other planets. So for example, if you wanted to send 100 [fighter](/wiki/fighter/)s to defend another of your planets or [space station](/wiki/space-station/)s: @echo off cd c:\\le\\glc\\examples send\_[ships](/wiki/ships/).pl --from " One" --type [fighter](/wiki/fighter/) --max 100 --planet "My SS" send\_[ships](/wiki/ships/).pl --from " Two" --type [fighter](/wiki/fighter/) --max 100 --planet "My SS" send\_[ships](/wiki/ships/).pl --from "Four" --type [fighter](/wiki/fighter/) --max 100 --planet "My SS" We can only send [fighter](/wiki/fighter/)s to defend another body, not [sweeper](/wiki/sweeper/)s. And to recall them: @echo off cd c:\\le\\glc\\examples recall\_[ships](/wiki/ships/).pl --planet "One" --orbiting "My SS" --all recall\_[ships](/wiki/ships/).pl --planet "Two" --orbiting "My SS" --all recall\_[ships](/wiki/ships/).pl --planet "Three" --orbiting "My SS" –all And to send 50 [Fissure](/wiki/fissure/) Sealers to seal a [fissure](/wiki/fissure/) on an uninhabited planet: @echo off cd c:\\le\\glc\\examples send\_[ships](/wiki/ships/).pl --from "Four" --type [fissure](/wiki/fissure/)\_sealer --planet "Oock 8" --max 50 Now let’s look at some scripts for building SS [plans](/wiki/plans/). This script goes through a series of loops to build nine lvl 5 [warehouse](/wiki/warehouse/) [plans](/wiki/plans/), six lvl 6 [warehouse](/wiki/warehouse/) [plans](/wiki/plans/) and twelve lvl 7 [warehouse](/wiki/warehouse/) [plans](/wiki/plans/). It can be modified to build any type or number of SS [plans](/wiki/plans/). NOTE: build times are dependent on several factors and your build times will be different. [The Lacuna Expanse](/wiki/the-lacuna-expanse/) [iPhone client](/wiki/iphone-client/) specifies the build times beforehand, making it easy to insert the proper sleep times. This script incorporates concepts covered previously, so it’s pretty self explanatory. REM statements are included for documentation. @echo off cd c:\\le\\glc\\examples set /a count=0 :LOOP1 REM In the first line, count=number of build cycles. Edit this number accordingly. REM When the variable “count” equals this value the program will skip to the next loop. IF %count%==3 goto N2 set /a count+=1 ss\_lab.pl --planet "One" --level 5 --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet "Three" --level 5 --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet "Four" --level 5 --type [warehouse](/wiki/warehouse/) REM The number of times the build cycle has gone around is displayed in the next line. echo Building level 5 [plans](/wiki/plans/). Cycle %count%. Sleeping 3:51mins... perl -e "sleep 13860" goto LOOP1 :N2 REM The count is reset to 0 for a new build loop. set /a count=0 :LOOP2 IF %count%==2 goto N3 set /a count+=1 ss\_lab.pl --planet "One" --level 6 --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet " Three" --level 6 --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet " Four" --level 6 --type [warehouse](/wiki/warehouse/) echo Building level 6 [plans](/wiki/plans/). Cycle %count%. Sleeping 6:43mins... perl -e "sleep 24180" goto LOOP2 :N3 set /a count=0 :LOOP3 IF %count%==4 goto END set /a count+=1 ss\_lab.pl --planet "One" --level 7 --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet "Three" --level 7 --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet "Four" --level 7 --type [warehouse](/wiki/warehouse/) echo Building level 7 [plans](/wiki/plans/). Cycle %count%. Sleeping 11:45mins... perl -e "sleep 42300" goto LOOP3 :END The above example could be modified in several ways. Still, it does require a fair bit of editing. Let’s look at another example that’s a little more sophisticated. @echo off cd c:\\le\\glc\\examples set /a count=0 REM N=plan level set /a N=5 :LOOP1 IF %count%==3 goto N2 set /a count+=1 ss\_lab.pl --planet "One" --level %N% --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet "Three" --level %N% --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet "Four" --level %N% --type [warehouse](/wiki/warehouse/) REM The number of times the build cycle has gone around is displayed in the next line. echo Building level 5 [plans](/wiki/plans/). Cycle %count%. Sleeping 3:51mins... perl -e "sleep 13860" goto LOOP1 :N2 REM The count is reset to 0 for a new build loop. set /a count=0 set /a N=6 :LOOP2 IF %count%==2 goto N3 set /a count+=1 ss\_lab.pl --planet "One" --level %N% --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet " Three" --level %N% --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet " Four" --level %N% --type [warehouse](/wiki/warehouse/) echo Building level 6 [plans](/wiki/plans/). Cycle %count%. Sleeping 6:43mins... perl -e "sleep 24180" goto LOOP2 :N3 set /a count=0 :LOOP3 IF %count%==4 goto END set /a count+=1 set /a N=7 ss\_lab.pl --planet "One" --level %N% --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet "Three" --level %N% --type [warehouse](/wiki/warehouse/) ss\_lab.pl --planet "Four" --level %N% --type [warehouse](/wiki/warehouse/) echo Building level 7 [plans](/wiki/plans/). Cycle %count%. Sleeping 11:45mins... perl -e "sleep 42300" goto LOOP3 :END See how we’ve used a variable to indicate the level number of the SS [plans](/wiki/plans/) to be built. The variable N will be equal to the desired level for every line in a particular loop. Instead of editing the level number on several lines, we only need to edit it in one spot per loop. Let’s look at another example of what we can do with variables: @echo off cd c:\\le\\glc\\examples REM N=plan level set /a N=3 REM name= plan name REM Valid plan names: art opera ibs command policestation [parliament](/wiki/parliament/) food set name=art ss\_lab.pl --planet "One" --level %N% --type %name% ss\_lab.pl --planet "Three" --level %N% --type %name% ss\_lab.pl --planet "Four" --level %N% --type %name% ss\_lab.pl --planet "Five" --level %N% --type %name% ss\_lab.pl --planet "Six" --level %N% --type %name% echo Building SS %name% [plans](/wiki/plans/) level %N% :END In the above simple example, we’re building SS [plans](/wiki/plans/) on several planets. It is necessary to set the plan name and level only once, using the variables N and name. In this example, we’re building 5 [Art Museum](/wiki/art-museum/) [plans](/wiki/plans/) of level 3. As we’re only building one set of [plans](/wiki/plans/), we not interested in performing any loops, so don’t need to sleep. We could modify the above script to perform several loops, by incorporating loops as illustrated in the previous example. However, we’d still need to edit the Perl sleep command to the correct amount of time depending on the level plan we wished to build. Here is an example of a fully automated SS [plans](/wiki/plans/) menu. It will accept input for the plan type and level desired, and confirms that is what you wish to build before proceeding. SS levels 1-10 are the only options. Copy and paste this example into a file and call it SS menu.bat. Simply modify the planet names in the build menu to match the names of your planets with SS labs. REM statements are included for documentation. @echo off cd c:\\le\\glc\\examples REM :start - the main menu subroutine, where plan type is selected REM cls - clears the screen REM echo. - skips a space :start cls echo. echo SELECT [SPACE STATION](/wiki/space-station/) PLAN echo --------------------------------- echo. echo 1 - Build [Art Museum](/wiki/art-museum/) [Plans](/wiki/plans/) echo 2 - Build [Culinary Institute](/wiki/culinary-institute/) [Plans](/wiki/plans/) echo 3 - Build [Interstellar Broadcast System](/wiki/interstellar-broadcast-system/) [Plans](/wiki/plans/) echo 4 - Build [Opera House](/wiki/opera-house/) [Plans](/wiki/plans/) echo 5 - Build [Parliament](/wiki/parliament/) [Plans](/wiki/plans/) echo 6 - Build [Police Station](/wiki/police-station/) [Plans](/wiki/plans/) echo 7 - Build [Station Command Center](/wiki/station-command-center/) [Plans](/wiki/plans/) echo 8 - Build [Warehouse](/wiki/warehouse/) [Plans](/wiki/plans/) echo 9 - Exit echo. REM The next line displays valid options and accepts an input. set /p opt1=Enter option 1 2 3 4 5 6 7 8 or 9: REM input is set as a variable "opt1" REM IF statement checks the value of "opt1" if "%opt1%"=="1" set var=art& goto level if "%opt1%"=="2" set var=food& goto level if "%opt1%"=="3" set var=ibs& goto level if "%opt1%"=="4" set var=opera& goto level if "%opt1%"=="5" set var=[parliament](/wiki/parliament/)& goto level if "%opt1%"=="6" set var=policestation& goto level if "%opt1%"=="7" set var=command& goto level if "%opt1%"=="8" set var=[warehouse](/wiki/warehouse/)& goto level if "%opt1%"=="9" goto exit goto start REM Depending on the value of "opt1", each option sets a variable "var" to the appropriate SS plan name. REM The ampersand allows a second instruction to be executed after setting "var", in this case, branching to the level menu. REM Entering a 9 will cause the program to terminate. REM goto start - branches back to the main menu if an invalid entry is encountered. REM :level - the level menu subroutine, where plan level is selected :level cls echo. REM echo %var% plan selected - displays selected SS plan name, eg: art plan selected echo %var% plan selected echo. echo SELECT [SPACE STATION](/wiki/space-station/) LEVEL echo ---------------------------------- echo Enter a value between 1 and 10: echo 0 - Return to Main Menu echo. REM The next line accepts an input. Similar to the option found in the main menu, but doesn't display any options . set /p opt2=Enter option: REM input is set as a variable "opt2" REM IF statement checks the value of "opt2" if "%opt2%"=="1" set /a lvl=1& goto confirm if "%opt2%"=="2" set /a lvl=2& goto confirm if "%opt2%"=="3" set /a lvl=3& goto confirm if "%opt2%"=="4" set /a lvl=4& goto confirm if "%opt2%"=="5" set /a lvl=5& goto confirm if "%opt2%"=="6" set /a lvl=6& goto confirm if "%opt2%"=="7" set /a lvl=7& goto confirm if "%opt2%"=="8" set /a lvl=8& goto confirm if "%opt2%"=="9" set /a lvl=9& goto confirm if "%opt2%"=="10" set /a lvl=10& goto confirm if "%opt2%"=="0" goto start goto level REM Depending on the value of "opt2", each option sets a variable "lvl" to the appropriate SS plan level. REM The ampersand allows a second instruction to be executed after setting "lvl", in this case, REM branching to the confirm menu. REM Entering a 0 will branch back to main menu. REM goto level - branches back to the level menu if invalid entry is encountered. REM :confirm - the confirm menu subroutine, where confirmation of menu options occurs. REM Not a necessary function, can be skipped. In the level menu, replace each: goto confirm with: goto build to bypass. Delete cancel menu subroutine. :confirm echo. REM echo Ready to build SS %var% [plans](/wiki/plans/) level %lvl% - displays selected SS plan name and level, REM eg: Ready to build SS art [plans](/wiki/plans/) level 3 echo Ready to build SS %var% [plans](/wiki/plans/) level %lvl% echo. REM The next line displays valid options and accepts an input. set /p confirmDeploy=Confirm deployment of code \[y/n\] ?: REM /I option ignores upper and lower case, so Y,y,N,n are all valid options. REM Depending on the value of "confirmDeploy", branches to build menu or cancel menu. REM If invalid option is encounted, "Invalid response" displayed and returns to confirm menu. if /I "%confirmDeploy%"=="y" goto build if /I "%confirmDeploy%"=="n" goto cancel echo. echo Invalid response goto confirm REM :build - build menu subroutine. Where Perl instruction build SS [plans](/wiki/plans/). REM In this example, every planet that has a SS lab (that can build up to level 10 SS [plans](/wiki/plans/)) has been included. Branches to end menu where program terminates. :build echo. echo Building SS %var% [plans](/wiki/plans/) level %lvl% ss\_lab.pl --planet "One" --level %lvl% --type %var% ss\_lab.pl --planet "Three" --level %lvl% --type %var% ss\_lab.pl --planet "Four" --level %lvl% --type %var% ss\_lab.pl --planet "Five" --level %lvl% --type %var% ss\_lab.pl --planet "Six" --level %lvl% --type %var% goto end REM :cancel - cancel menu subroutine. Build aborted. Perl sleep command utilized so message can be displayed for a moment before returning to main menu. :cancel echo. echo Build cancelled, returning to Main Menu... perl -e "sleep 2" goto start REM :end - end menu subroutine. Program terminates after this point. :end In my first [Sample Script Examples](/wiki/sample-script-examples/) post, I offered an example of a batch file that could build several ship types on a single colony. Here's an updated version of that script which offers the user the options of colony, ship types and number of [ships](/wiki/ships/) to build. The script is written to compensate for the possibility that not every colony can build every ship type. It also checks for the maximum number of queues available to compensate for varying number of [shipyard](/wiki/shipyard/)s/[shipyard](/wiki/shipyard/) leveles per colony. To keep it from getting too complex, I've excluded most of the optional arguments in build\_[ships](/wiki/ships/).pl except for --noreserve. The script builds upon previous examples and uses variables extensively to cut down on repetative typing. It can be modified to accomodate any number of colonies and ship types. Here is Ship\_Building\_Menu.bat: @echo off cd c:\\le\\glc\\examples :mainmenu cls echo. echo Select a Ship Building Colony echo ----------------------------- echo. echo 1 - Planet 1 echo 2 - Planet 2 echo 3 - Planet 3 echo 0 - Exit echo. REM max=maximum number of [ships](/wiki/ships/) in your build queue for the [shipyard](/wiki/shipyard/)s on a colony. This is a user defined entry. set /p place=Enter option 1 2 3 or 0: if "%place%"=="1" set planet=Planet 1& set /a max=120& goto ship1 if "%place%"=="2" set planet=Planet 2& set /a max=100& goto ship2 if "%place%"=="3" set planet=Planet 3& set /a max=80& goto ship3 if "%place%"=="0" goto exit goto mainmenu REM sets max # of [ships](/wiki/ships/) that can be queued for a colony & branches to subroutine ship1, ship2 or ship3 depending on colony selected. :ship1 cls set /a option=0 echo. echo Select Option for %planet% echo ------------------------------ echo. echo 1 - Build [Fighter](/wiki/fighter/)s echo 2 - Build [Snark](/wiki/snark/) 3's echo 3 - Build [Sweeper](/wiki/sweeper/)s echo 4 - Build [Excavator](/wiki/excavator/)s echo 5 - Build [Gas Giant Settlement Ship](/wiki/gas-giant-settlement-ship/)s echo 6 - Build Mega [Scow](/wiki/scow/)s echo 7 - Build Huge [Hulk](/wiki/hulk/)s echo 8 - Build [Smuggler Ship](/wiki/smuggler-ship/)s echo 9 - Build [Spy Pod](/wiki/spy-pod/)s echo 10 - Build [Space Station Hull](/wiki/space-station-hull/) echo 11 - Build [Spaceport Seeker](/wiki/spaceport-seeker/)s echo 12 - Build [Security Ministry Seeker](/wiki/security-ministry-seeker/)s echo 13 - Build [Observatory Seeker](/wiki/observatory-seeker/)s echo 14 - Build [Fissure](/wiki/fissure/) Sealers echo. echo Press Enter to return to Main Menu echo. REM get ship names from build\_[ships](/wiki/ships/).pl set /p option=Enter option: if "%option%"=="0" goto mainmenu if "%option%"=="1" set type=[fighter](/wiki/fighter/)& goto quantity if "%option%"=="2" set type=[snark](/wiki/snark/)3& goto quantity if "%option%"=="3" set type=[sweeper](/wiki/sweeper/)& goto quantity if "%option%"=="4" set type=[excavator](/wiki/excavator/)& goto quantity if "%option%"=="5" set type=gas\_giant\_settlement\_ship& goto quantity if "%option%"=="6" set type=[scow](/wiki/scow/)\_mega& goto quantity if "%option%"=="7" set type=[hulk](/wiki/hulk/)\_huge& goto quantity if "%option%"=="8" set type=smuggler\_ship& goto quantity if "%option%"=="9" set type=spy\_pod& goto quantity if "%option%"=="10" set type=space\_station& goto quantity if "%option%"=="11" set type=spaceport\_seeker& goto quantity if "%option%"=="12" set type=security\_ministry\_seeker& goto quantity if "%option%"=="13" set type=[observatory](/wiki/observatory/)\_seeker& goto quantity if "%option%"=="14" set type=[fissure](/wiki/fissure/)\_sealer& goto quantity goto ship1 :ship2 cls set /a option=0 echo. echo Select Option for %planet% echo ------------------------------ echo. echo 1 - Build [Fighter](/wiki/fighter/)s echo 2 - Build [Snark](/wiki/snark/) 3's echo 3 - Build [Sweeper](/wiki/sweeper/)s echo 4 - Build [Excavator](/wiki/excavator/)s echo 5 - Build Mega [Scow](/wiki/scow/)s echo 6 - Build Huge [Hulk](/wiki/hulk/)s echo 7 - Build [Smuggler Ship](/wiki/smuggler-ship/)s echo 8 - Build [Spy Pod](/wiki/spy-pod/)s echo 9 - Build [Spaceport Seeker](/wiki/spaceport-seeker/)s echo 10 - Build [Security Ministry Seeker](/wiki/security-ministry-seeker/)s echo 11 - Build [Observatory Seeker](/wiki/observatory-seeker/)s echo 12 - Build [Fissure](/wiki/fissure/) Sealers echo. echo Press Enter to return to Main Menu echo. set /p option=Enter option: if "%option%"=="0" goto mainmenu if "%option%"=="1" set type=[fighter](/wiki/fighter/)& goto quantity if "%option%"=="2" set type=[snark](/wiki/snark/)3& goto quantity if "%option%"=="3" set type=[sweeper](/wiki/sweeper/)& goto quantity if "%option%"=="4" set type=[excavator](/wiki/excavator/)& goto quantity if "%option%"=="5" set type=[scow](/wiki/scow/)\_mega& goto quantity if "%option%"=="6" set type=[hulk](/wiki/hulk/)\_huge& goto quantity if "%option%"=="7" set type=smuggler\_ship& goto quantity if "%option%"=="8" set type=spy\_pod& goto quantity if "%option%"=="9" set type=spaceport\_seeker& goto quantity if "%option%"=="10" set type=security\_ministry\_seeker& goto quantity if "%option%"=="11" set type=[observatory](/wiki/observatory/)\_seeker& goto quantity if "%option%"=="12" set type=[fissure](/wiki/fissure/)\_sealer& goto quantity goto ship2 :ship3 cls set /a option=0 echo. echo Select Option for %planet% echo ------------------------- echo. echo 1 - Build [Fighter](/wiki/fighter/)s echo 2 - Build [Snark](/wiki/snark/) 3's echo 3 - Build [Sweeper](/wiki/sweeper/)s echo 4 - Build [Excavator](/wiki/excavator/)s echo 5 - Build Mega [Scow](/wiki/scow/)s echo 6 - Build Huge [Hulk](/wiki/hulk/)s echo 7 - Build [Smuggler Ship](/wiki/smuggler-ship/)s echo 8 - Build [Spaceport Seeker](/wiki/spaceport-seeker/)s echo 9 - Build [Security Ministry Seeker](/wiki/security-ministry-seeker/)s echo 10 - Build [Observatory Seeker](/wiki/observatory-seeker/)s echo 11 - Build [Fissure](/wiki/fissure/) Sealers echo. echo Press Enter to return to Main Menu echo. set /p option=Enter option: if "%option%"=="0" goto mainmenu if "%option%"=="1" set type=[fighter](/wiki/fighter/)& goto quantity if "%option%"=="2" set type=[snark](/wiki/snark/)3& goto quantity if "%option%"=="3" set type=[sweeper](/wiki/sweeper/)& goto quantity if "%option%"=="4" set type=[excavator](/wiki/excavator/)& goto quantity if "%option%"=="5" set type=[scow](/wiki/scow/)\_mega& goto quantity if "%option%"=="6" set type=[hulk](/wiki/hulk/)\_huge& goto quantity if "%option%"=="7" set type=smuggler\_ship& goto quantity if "%option%"=="8" set type=spaceport\_seeker& goto quantity if "%option%"=="9" set type=security\_ministry\_seeker& goto quantity if "%option%"=="10" set type=[observatory](/wiki/observatory/)\_seeker& goto quantity if "%option%"=="11" set type=[fissure](/wiki/fissure/)\_sealer& goto quantity goto ship3 :quantity cls set /a number=0 echo. echo You selected building %type%s on %planet%. echo. echo Select Number of [Ships](/wiki/ships/) to Build ECHO ------------------------------- ECHO Enter a value between 1 and %max% echo. echo Press Enter to return to Main Menu echo. REM max=maximum number of [ships](/wiki/ships/) in your build queue for the [shipyard](/wiki/shipyard/)s on a colony. User defined in main menu subroutine. REM EQU - equal NEQ - not equal LSS - less than LEQ - less than or equal GTR - greater than GEQ - greater than or equal set /p number=Enter number of [ships](/wiki/ships/) to build: IF %number% EQU 0 goto mainmenu IF %number% LSS 0 echo Invalid Input & perl -e "sleep 1" & goto quantity IF %number% GTR %max% echo Invalid Input & perl -e "sleep 1" & goto quantity goto confirm :confirm echo. echo Ready to build %number% %type%s on %planet% echo. set /p confirmbuild=Confirm deployment of code \[y/n\] ?: if /I "%confirmbuild%"=="y" goto build if /I "%confirmbuild%"=="n" goto cancel echo. echo Invalid response goto confirm :cancel echo. echo Build cancelled, returning to Main Menu... perl -e "sleep 1" goto mainmenu :build build\_[ships](/wiki/ships/).pl --yards [shipyard](/wiki/shipyard/).js --type %type% --number %number% --noreserve --planet "%planet%" echo Returing to Main Menu perl -e "sleep 3" goto mainmenu :exit That’s all for now. Again, I hope these examples have given you some ideas as to what you can do to make tasks easier and automated in the game. Happy scripting! Frobozz