Endless Sky

Endless Sky

tsingi May 15, 2021 @ 1:39pm
Disguised Bandits, who are they?
I'm killing bandits, some of them are disguised. I have a list of bounties as long as your arm and it's a pain keeping track of the provocateurs.

So I wrote a shell script. It's not rigorously tested and you probably won't get it to work on Windows, might work on a Mac. I use Linux...

#!/bin/sh save_dir='/home/tsingi/.var/app/io.github.endless_sky.endless_sky/data/endless-sky/saves' save_file=$save_dir/`ls -t $save_dir | head -1` grep -A 1 'Disguised bandit' "$save_file" | grep description | cut -d ' ' -f 7- | sed -e 's/ is.*//'
~
< >
Showing 1-7 of 7 comments
jafdy May 15, 2021 @ 2:07pm 
I just watch for "merchant" ships that are hanging around. Nice grep though.
tsingi May 15, 2021 @ 2:21pm 
I like bash scripts, it's amazing what you can do with them.
Here's what I get...
the Long Ben the Screaming Chamber the Nightface the Omen of Destruction the Black Freighter the Barrel the Usha's Ravager the Churning Conquest the Galley of Plunder the Spearmonster the Jolly Roger
jafdy May 16, 2021 @ 1:19am 
You're still just selecting merchants and looking for piratey names.
Last edited by jafdy; May 16, 2021 @ 2:18pm
tsingi May 16, 2021 @ 7:40am 
grep -A 1 'Disguised bandit'
The line following that line in the save file contains the name of a pirate pretending to be a merchant. -A 1 selects the matching line and the following line.
grep description
throw away the 'Disguised bandit' lines, don't want those, just the lines with their names. They match the description field.
cut -d ' ' -f 7- | sed -e 's/ is.*//'
Strips the name out by taking all space delimited fields after 7, don't know how many words are in the name so strip off the end using sed to replace it with nothing.

It does have a bug in it in that it doesn't get all of them. I'll play with it when I feel the urge.
Last edited by tsingi; May 16, 2021 @ 10:25am
tsingi May 18, 2021 @ 7:43am 
Doesn't seem to be much interest, but I've fleshed it out to get the missing bad guys. I was just searching for bandits, disguised ships can be bandits, pirates or warlords depending on how nasty they are, so this works better...

#!/bin/sh #EDIT THIS to point to your save file directory... save_dir='/home/tsingi/.var/app/io.github.endless_sky.endless_sky/data/endless-sky/saves' save_file=`ls -t $save_dir | head -1` save_path=$save_dir/$save_file echo echo using save file: "$save_file" echo listthem() { grep -A 1 "Disguised $badguy" "$save_path" | grep description | cut -d ' ' -f 7- | sed -e 's/ is.*//' | sed -e "s/^/$badguy /" | sort } for badguy in bandit pirate warlord do listthem done echo

output example...

using save file: Harry Mudd.txt bandit the Fractured Hope bandit the Francois l'Olonnais bandit the Hangman's Noose pirate the Evil Glory pirate the Lady Killigrew pirate the Prosperous warlord the Angry Angels
Last edited by tsingi; May 18, 2021 @ 9:43am
tuk0z May 23, 2021 @ 12:59pm 
FOSS geek fighting bandits the smart way... Nice :-)
tsingi May 23, 2021 @ 7:26pm 
Originally posted by tuk0z:
FOSS geek fighting bandits the smart way... Nice :-)
I resemble that.
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: May 15, 2021 @ 1:39pm
Posts: 7