Civ4 Pitboss Launcher - For Pitboss players

OverloadUT

Stats Monkey
Joined
Nov 9, 2005
Messages
352
Location
Novato, CA
I've been hosting a Pitboss game that I've been playing with several friends for a few months now. Every single day I have had to launch Civ 4, go to Multiplayer, go to Direct IP, enter the server information, connect, select my leader, enter my password, and then FINALLY load the game so I can play my turn.

I looked around for a way to connect directly to a server by using command line options, but I couldn't find any.

So I made this. It's a program that automatically launches Civ 4 and clicks through the menus to get you connected to your Pitboss server. It has several features such as the ability to have multiple profiles for different Pitboss games.

It's written in the AutoIt scripting language, and the source code is included so you can be sure there's no foul play. :)

Download
Download version 2.1 here.

Notes
I have only tested this on Windows XP with an English version of Civ 4.
Please post any problems you have here.
IF you get a crash or something doesn't work properly, please modify your PitbossLauncher.ini file and change LogLevel to 3. Run the program again and then post the contents of your log here. Warning: you should edit out your server address and passwords from the log file if you do this.

Here's the full readme. Please read it, especially the troubleshooting section!
Code:
OVERVIEW
--------
This program will assist you in connecting to Pitboss servers via "Direct IP."
You enter all the details about your Pitboss game in to the GUI, and this
program will automatically launch Civilization 4, connect to the server, select
your leader, enter your password, and get in to gameplay.


FEATURES
--------
* Multiple profile support - You can define multiple profiles if you are
  playing in multiple Pitboss games.
* Option to remember game and player passwords - If you don't want your
  password stored in the PitbossLauncher.ini file, you don't have to.
* Support for 5 resolutions currently: 1024x768, 1280x960, 1280x1024, 1440x900,
  1680x1050
* Works with Warlords
* Mod support
* Supports duplicate Civ installations for being able to connect to games
  running different versions


INSTALLATION
------------
Simply extract the PitbossLauncher.zip archive to any folder on your computer.
Run PitbossLauncher.exe! When you click Go, do not move the mouse at all until
the process is finished. Be patient; it can take up to 16 seconds on the main
menu before it goes to work.


ADVANCED USAGE
--------------
If you maintain multiple installations of Civ4 so you can connect to games
running different versions, there is a feature in Pitboss Launcher to handle
this. Open up PitbossLauncher.ini and find the section for the profile that
you need to run a different exe. Change the ExeOverride variable to point to
the exe you need this profile to use. That will cause this profile to ignore
the normal Civ4 or Civ4Warlords exes, and use the one you defined.



TROUBLESHOOTING/NOTES
---------------------
* If you use a resolution that is not supported, feel free to request that
  support for it be added on the CivFanatics forums.
* There is absolutely no way to tell if Civ 4 is actually finished loading
  before this programs starts clicking the mouse. I tried to err on the side of
  caution, so it might wait a little longer than it needs to before it starts
  clicking things. Currently it waits about 10 seconds after the Civ 4 window
  is detected.
* If the script is not waiting long enough for the game to load (if this
  happens your mouse will probably be moving around in Windows instead of the
  game) you can change the "SecondsToLoad" option in the PitbossLauncher.ini
  file to something higher. The default is 10.
* Similarly, if the script is not waiting long enough for the "choose your
  leader" window to pop up (after connecting to the server) try increasing
  the "SecondsToConnect" options in the PitbossLauncher.ini file.
* If the process for some reason gets off track and the wrong buttons are being
  pressed, simply press Escape - that will abort the script.
* If you turn on the "Go on Launch" option, you can still get to the GUI by
  holding down shift when you launch the program.



CHANGELOG
---------
2.1.0.0
+Added the ability to directly launch a particular profile by adding the
 profile name as a command line parameter. The profile name must be enclosed
 in double quotes, "like so." The profile name is case sensitive.
+Added a button in the GUI to create a shortcut for you that will directly
 launch the profile selected.
+Added a "ExeOverride" variable for each profile that can be used to make a
 certain profile use an exe that is different from the rest of the profiles.
 This is for people who maintain multiple installations of Civ4 so that they
 can connect to servers running different versions.
 
2.0.0.0
+Added Warlords support in the form of a "mod" - in the mod dropdown, you will
 notice that there are several mods that say "(Warlords)" in front of them.
 Those are all Warlords mods. To run Warlords without a mod, choose the
 "(Warlords) None" option.
+Made it so that it does not try to click through the movies if a mod is
 loaded, since the intro movies do not play when a mod is loaded. This speeds
 up the process by several seconds.
+Made a tweak that allows the legal screen to be clicked through. This speeds
 up the whole process by a couple seconds.

1.9.1.0
+Added support for resolution 1680x1050. Thanks portuga!

1.9.0.2
+Added mod support! You can now select a mod for each profile.
+Added an extra click after you connect that will clear the "Modified Assets
 Warning" - clicking on that spot when the window doesn't appear does not cause
 any harm, so there was no reason not to add this, for the people who are using
 modified assets.

1.6.1.0
+Added the ability to hold down shift when launching the program to prevent the
 "Auto Go" feature.
=REALLY Fixed the bug that caused "Auto Go on Launch" to crash the script.

1.6.0.0
=Fixed a bug that caused "Auto Go on Launch" to crash the script.
=Updated the AutoIt engine to 3.1.1.125 BETA so I could use some of the nifty
 new tray icon features. The tray icon will now only appear when you actually
 start the process, and it will no longer have the "pause" option.
=A few other minor improvements related to the update.

1.5.1.0
+Added the profile selection stuff to the main interface and got rid of the
 Profiles button. It's now faster and easier to switch profiles.
+Added detection code for the window that pops up if you have fullscreen set to
 "ask" - it will now wait for you to manually select what you want instead of
 complaining about the resolution.
+Added detection code for the "Please insert CD" window so the script will exit
 if it finds that window.
=Moved all the strings to global variables to make localization easy. You know,
 just in case.

1.2.0.0
+Added the "SecondsToConnect" option to the PitbossLauncher.ini file and also
 increased the default value from 5 seconds to 8 seconds.

1.1.0.0
+Added support for 1440x900
+Added the "SecondsToLoad" option to the PitbossLauncher.ini file

1.0.0.4
=Initial Release

Here's a screenshot of the UI:
 
I just uploaded a new version, 1.2, based on some problems reported in the thread in the Multiplayer forums.
 
This is great. One problem though, I tried selecting the "Go on Launch" option and I get this error:

If $iniAutoLogin = 1 AND Then
If ^ ERROR
Error: Error in expression

It looks like a mistake in the PitbossLauncher.au3 at line 339 (I think you just need to remove the word 'AND'). I tried changin the au3 file myself but it made no difference, so I assume it's compiled directly into the .exe and the .au3 file is only for reference?

It works perfectly without the Go On Launch option though - Thanks! :)

One other thought though, since you specify your civ by a number, will it work if someone is already logged into the server? Since the number of available civs is reduced if someone is already logged in?
 
dribnairb said:
This is great. One problem though, I tried selecting the "Go on Launch" option and I get this error:

You're exactly right about where the problem is. I fixed this in the next version (not released yet) that I will release soon. I'm using the latest beta version of AutoIt now because it has some really fun things I can do. :)

Also, yes, the .au3 file is compiled directly in to the .exe, and the au3 is there in case you want to download AutoIt yourself to play around with the code.

dribnairb said:
One other thought though, since you specify your civ by a number, will it work if someone is already logged into the server? Since the number of available civs is reduced if someone is already logged in?

My friends and I JUST encountered this last night! I didn't know that screen moves around when people are logged in. Unfortunately, I don't think there's any way to fix this. :(
 
OverloadUT said:
My friends and I JUST encountered this last night! I didn't know that screen moves around when people are logged in. Unfortunately, I don't think there's any way to fix this. :(

You could try your password on every civ from #N to #1. It would be nice if you could detect a successful password, but I don't know if AutoIt can do that.
 
New version uploaded: 1.6.1.0

A couple small changes to the way the systray icon works, and more importantly a bug fix that makes it not crash when you select the "Go on Launch" option.

Oh, and you can now hold down shift when launching the program to prevent it from automatically "Going on Launch".
 
Is there anyway to adapt this so it can launch games that are played using mods. I'm assuming its a command line setting (i'm a builder hence the only programming I know is PERT or Gant :) )
 
Okay!

New version released!
Mod support added

This new version has two new features:
Mod support! You can select a mod for each profile and it will automatically load it.
I added a click for the "Modified Assets" warning that can appear after you connect to the server. This should be useful for people who use modified assets.
 
Brilliant!

That was quick. Had you been working on it before I posted?

It works fine. Loaded up both pitboss games just fine. The only issue I have is the interface is a little messy - here's a screenshot (the writings chopped off).
 

Attachments

  • untitled.JPG
    untitled.JPG
    25 KB · Views: 274
Well, I had wanted to implement mod support for a while, but I've been so tied up with my other project that I never got around to it. When you posted here it reminded me to do it. The biggest issue I was having was detecting the mod list, but I finally found a way to do it and the rest was a snap. ;)

As for your spacing problem It's happening because you have Windows set up to use extra large fonts. If anything it's a bug in AutoIt itself. I'll report it on their forums and see what they say, but I will most likely not be able to fix it without making it look way too spaced out on normal systems.
 
OverloadUT said:
As for your spacing problem It's happening because you have Windows set up to use extra large fonts. If anything it's a bug in AutoIt itself. I'll report it on their forums and see what they say, but I will most likely not be able to fix it without making it look way too spaced out on normal systems.

Well you learn something new every day :D
 
I just released a new version that adds support for resolution 1680x1050. Thank you portuga for providing me with the coordinates!

There are no other changes in this version except a couple code cleanups that don't matter to you. :D
 
Something I noticed last weekend that I haven't seen mentioned above.

I used to find it annoying that everytine you logged into a new pitboss game, the game would restart.

After playing a pitboss turn, exit to main menu and then alt tab to the launcher. Hit go on your next game and it takes you straight back into civ without any fuss and loads up the game :)
 
Yep, I use that myself sometimes.

It's an unintended feature. If you launch Civilization4.exe when the game is already running, it just restores it. :)
 
Hello,

Could you provide support for 1280x800 (widescreen laptop) please?

Ben
 
The_Oakster said:
Hello,

Could you provide support for 1280x800 (widescreen laptop) please?

Ben

Sure! But since I can't select that resolution, I need some screenshots taken in full screen mode from you:

The main menu
The main menu after you click "Multiplayer"
The window that pops up after you click "Direct IP Game"
The "Game assets differ from server" warning - don't worry if you can't get this one.
The "Leader Select" window that pops up after you connect to a direct IP game.
And finally, the password window that pops up after you select what leader you want to play.

Once I get those I can add support. :)
 
Hi OverloadUT,

Is there anyway you could get this to load up Warlord games, I'm guessing something along the way you select a mod you can also select a game type?
 
mickeyj said:
Hi OverloadUT,

Is there anyway you could get this to load up Warlord games, I'm guessing something along the way you select a mod you can also select a game type?

Yes, I do plan on implementing Warlords support. You'll probably just select it as a "mod" - Civstats has been taking up a lot of my time recently, but when I find some extra time I'll work on this. :)
 
New version!
Warlords support!

This is a long overdue update.

Warlords is now fully supported and some tweaks have been made that speed up the process.

Enjoy!
 
Top Bottom