title: 'Using Perl Scripts with Mac' #
Using Perl Scripts with Mac #
Author: Red Orion
Please note that installing perl and running scripts in the beginning can be a frustrating process. Many times the simplest of typos or errors can make the entire thing not work. Literally 1 character being off or a space being in the wrong place. If for any reason during the install process you run into problems, remember.. There are other people to help you. If at anytime it just gets too frustrating, please feel free to contact me or anyone else within the expanse for help. If you are unfamiliar with DOS, Perl, Scripting, Programming and just cannot learn to start scripting, please check with someone in your alliance as they may be able to run scripts for you.
In Terminal, type the following and enter your administrator password if needed
perl -MCPAN -e shell
install Mac::Carbon
install Bundle::LWP
install Bundle::CPAN
install DateTime
install Test::Warn
install DateTime::Format::ICal
install JSON
install JSON::RPC
install JSON::RPC::LWP
install Imager
install Text::CSV
install Class::XSAccessor
install ORLite
install IO::Interactive
install DBI
install Crypt::SSLeay
install MIME::Lite
install AnyEvent
install Number::Format
install Exception::Class
perl -MCPAN -e shell
install Mac::Carbon
install Bundle::LWP
install Bundle::CPAN
install DateTime
install Test:Warn
install DateTime::Format::ICal
install JSON
install JSON::RPC
install JSON::RPC::LWP
install Imager
install Text::CSV
install Class::XSAccessor
install ORLite
install IO::Interactive
install DBI
install Crypt::SSleay
install MIME::Lite
install AnyEvent
install Number::Format
install Exception::Class
install Mac::Carbon
install Bundle::LWP
install Bundle::CPAN
install DateTime
install Test::Warn
install DateTime::Format::ICal
install JSON
install JSON::RPC
install JSON::RPC::LWP
install Imager
install Text::CSV
install Class::XSAccessor
install ORLite
install IO::Interactive
install DBI
install Crypt::SSLeay
install MIME::Lite
install AnyEvent
install Number::Format
install Exception::Class
install Text::CSV_XS
install Browser::Open
Get yourself an API key
The website for requesting an API key can be found here
Keep track of these API keys. The public key is what you will use for scripts/applications that log into your account. The private key will be for tracking your usage and things of that nature.
Acquire the GLC libraries
Download the zip from the link here.
Extract the zip archive to a folder of your choice
users/username/Applications/LE (is a good choice)
Using Finder, browse to users/username/Applications/LE
Rename the folder you extrated into here to "GLC"
You should now have a users/username/Applications/LE/GLC folder
Browse to LE\GLC\examples
Copy myaccount.yml into LE\GLC
Rename LE\GLC\myaccount.yml to lacuna.yml
Modify the configuration file
Your config file should looke like this:
---
server_url: 'https://us1.lacunaexpanse.com'
api_key: API Key Provided by link above
empire_name: Your Empire Name
empire_password: Your Empire Password
session_persistent: 1
The api_key to be used is the public key you got from step 3
empire_name is the exact same thing as the name you use to log in
empire_password most of the time will be your sitter password, however sometimes it will need to be your normal password.
session_persistent means that if you run a script and it logs you in, it will use that logged in session if possible before doing another log in to prevent awaste of RPCs from logging in constantly.
Copy the configuration file into the bin and data folders. This simplifies running scripts without being required to keep the --config paths up to date.
Download the Star Map CSV file.
Download the stars.csv file for your server
This file is a comma separated value file that contains the X|Y coordinates of every star in the "Lacunaverse"
Currently, there is only one server in addition to the public test server.
You can download the US1 CSV file from here
http://us1.lacunaexpanse.com.s3.amazonaws.com/stars.csv
You can download the PT CSV file from here
http://pt.lacunaexpanse.com.s3.amazonaws.com/stars.csv
Copy the stars.csv file to LE\GLC\
Set up the Stars database
Open a command prompt and navigate to LE\GLC\examples
Type the following pressing enter after every line:
star_db_util.pl --config ../lacuna.yml --db ../stars.db --no-fetch --create-db
populate_db.pl --db ../stars.db --csv ../stars.csv
this script should be located in LE\GLC\Examples if you got your GLC libraries and stuff from the link above.
Watch the fun . . .
Start running scripts
At this point, everything should be up and running and you should be able to try running a script or two. Assuming you have everything set up right, you should be able to fire up any script you like.
Open a command prompt and navigate to LE\GLC\examples