File: help_me.sh

package info (click to toggle)
unknown-horizons 2019.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 347,832 kB
  • sloc: python: 46,804; xml: 3,137; sql: 1,189; sh: 736; makefile: 40; perl: 35
file content (18 lines) | stat: -rwxr-xr-x 540 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# little help with savegames

F=$1

q="sqlite3 -noheader $F"

$q "SELECT rowid FROM settlement" | while read settlement_id; do
	$q "DELETE FROM storage WHERE object = $settlement_id"
	for res in 2 3 4 5 6 7 8 10 18 21 22 23 25 26 29 31 32 35 36 38 40 41 43 44 46 47 54 55 56 58 60; do
		$q "INSERT INTO storage (object, resource, amount) VALUES($settlement_id, $res, 1000)"
	done
	# gold for player with id 1
	$q "INSERT INTO storage (object, resource, amount) VALUES(1, 1, 50000)"
done

$q "UPDATE player set settler_level = 3"