New Program - GSAK (Geocaching Swiss Army Knife)

Discussion about software such as GSAK, OziExplorer etc, as well as all things hardware, GPSrs, laptops, PDAs, paperless caching, cables etc
User avatar
Facitman
1400 or more caches found
1400 or more caches found
Posts: 463
Joined: 18 June 04 3:58 pm
Location: Melbourne
Contact:

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by Facitman » 29 August 09 10:39 am

Sorry Fuddley, thought you had some macro experience :)

In the subroutine GatherLogs change the section of code below to include the additional lines in red

$_sql = "UPDATE Placedlogs Set lOwnerid = 'G' || lOwnerid where substr(lParent,1,2)='GC'"
$status = Sqlite("sql",$_sql)
$_sql = "UPDATE Placedlogs Set lOwnerid = 'T' || lOwnerid where substr(lParent,1,2)='TC' OR substr(lParent,1,2)='LC'"
$status = Sqlite("sql",$_sql)
$_sql = "UPDATE Placelogs Set lOwnerid = 'A' || Replace(OwnerName,';',',') where substr(lparent,1,2) = 'GA'"
$status = Sqlite("sql",$_sql)
$_sql = "ALTER TABLE Placedlogs ADD Loglength integer"
$status = Sqlite("sql",$_sql)
$_sql = "update PlacedLogs SET LogLength = Length(trim(lText)) - Length(REPLACE(trim(lText), ' ', '')) + 1"
$status = Sqlite("sql",$_sql)

No guarantee but worth a shot.

User avatar
Fuddley
1950 or more caches found
1950 or more caches found
Posts: 360
Joined: 17 February 08 6:22 am
Location: Hastings NZ GPSr: Garmin Oregon 300 GPSr: Tom Tom XL one GPSr: Garmin Etrex Vista
Contact:

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by Fuddley » 29 August 09 12:06 pm

Facitman wrote:Sorry Fuddley, thought you had some macro experience :)

In the subroutine GatherLogs change the section of code below to include the additional lines in red

$_sql = "UPDATE Placedlogs Set lOwnerid = 'G' || lOwnerid where substr(lParent,1,2)='GC'"
$status = Sqlite("sql",$_sql)
$_sql = "UPDATE Placedlogs Set lOwnerid = 'T' || lOwnerid where substr(lParent,1,2)='TC' OR substr(lParent,1,2)='LC'"
$status = Sqlite("sql",$_sql)
$_sql = "UPDATE Placelogs Set lOwnerid = 'A' || Replace(OwnerName,';',',') where substr(lparent,1,2) = 'GA'"
$status = Sqlite("sql",$_sql)
$_sql = "ALTER TABLE Placedlogs ADD Loglength integer"
$status = Sqlite("sql",$_sql)
$_sql = "update PlacedLogs SET LogLength = Length(trim(lText)) - Length(REPLACE(trim(lText), ' ', '')) + 1"
$status = Sqlite("sql",$_sql)

No guarantee but worth a shot.
I have tried as you said above, but get an error
"Error=>SQLite no such Column: OwnerName

User avatar
Facitman
1400 or more caches found
1400 or more caches found
Posts: 463
Joined: 18 June 04 3:58 pm
Location: Melbourne
Contact:

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by Facitman » 29 August 09 7:14 pm

Hmmm good try, fail.

Have been mucking around with this macro in the last week, so I'll have a more detailed look. Sorry about the bum steer.

Peter

User avatar
Chwiliwr
10000 or more caches found
10000 or more caches found
Posts: 900
Joined: 10 April 05 10:39 pm
Location: Leeming Western Australia

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by Chwiliwr » 29 August 09 8:26 pm

Facitman wrote:Sorry Fuddley, thought you had some macro experience :)

In the subroutine GatherLogs change the section of code below to include the additional lines in red

$_sql = "UPDATE Placedlogs Set lOwnerid = 'G' || lOwnerid where substr(lParent,1,2)='GC'"
$status = Sqlite("sql",$_sql)
$_sql = "UPDATE Placedlogs Set lOwnerid = 'T' || lOwnerid where substr(lParent,1,2)='TC' OR substr(lParent,1,2)='LC'"
$status = Sqlite("sql",$_sql)
$_sql = "UPDATE Placelogs Set lOwnerid = 'A' || Replace(OwnerName,';',',') where substr(lparent,1,2) = 'GA'"
$status = Sqlite("sql",$_sql)
$_sql = "ALTER TABLE Placedlogs ADD Loglength integer"
$status = Sqlite("sql",$_sql)
$_sql = "update PlacedLogs SET LogLength = Length(trim(lText)) - Length(REPLACE(trim(lText), ' ', '')) + 1"
$status = Sqlite("sql",$_sql)

No guarantee but worth a shot.
Although I have GSAK I have never played with the macro stuff but looking at the above code and the response that Fuddley got I would have to ask why the the "Replace(OwnerName,';',',')" was added into the line instead of following the format of the previous two lines. I couldn't find where OwnerName would come from in this particular subroutine.

User avatar
Facitman
1400 or more caches found
1400 or more caches found
Posts: 463
Joined: 18 June 04 3:58 pm
Location: Melbourne
Contact:

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by Facitman » 30 August 09 11:25 pm

Well after a false start (I really should test code before posting it, c@w don't let me near gca code)

So if you're interested....
change the subroutine GatherLogs by adding the lines in red

$_sql = "UPDATE Placedlogs Set lOwnerid = 'T' || lOwnerid where substr(lParent,1,2)='TC' OR substr(lParent,1,2)='LC'"
$status = Sqlite("sql",$_sql)
$_sql = "UPDATE Placedlogs Set lOwnerid = 'A' || Replace(lBy,';',',') where substr(lparent,1,2) = 'GA'"
$status = Sqlite("sql",$_sql)
$_sql = "ALTER TABLE Placedlogs ADD Loglength integer"
$status = Sqlite("sql",$_sql)

Why you ask? Well geocaching.com includes OwnerID in each log. This is the unique number assigned to every geocaching.com user (stays the same even if you change your name), geocaching.com.au doesn't have this number or any equivilent so you need to give each log a OwnerID that represents the finder, in this case you can use the text name which in in the By field.
This will work but has a drawback, there is no linkage between a user on geocaching.com.au and their presence on geocaching.com so the statistics aint quiet right as each person will appear twice in "Finders of My Caches" section once for finds on geocaching.com caches and once for geocaching.com.au

Tested on a couple of data samples, successfully but I'd still call it beta code! :D

Peter

User avatar
caughtatwork
Posts: 17017
Joined: 17 May 04 12:11 pm
Location: Melbourne
Contact:

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by caughtatwork » 31 August 09 9:49 am

Facitman wrote:Why you ask? Well geocaching.com includes OwnerID in each log. This is the unique number assigned to every geocaching.com user (stays the same even if you change your name), geocaching.com.au doesn't have this number or any equivilent so you need to give each log a OwnerID that represents the finder, in this case you can use the text name which in in the By field.
Of course have an OwnerID. If you've logged a GCA cache, you have an account at GCA. If you have an account at GCA, then you have a userid. There is a challenge in that GCA OwnerID is NOT guaranteed to be unique vs. GC or TC or OC userids. I will have a look tonight at the GPX file generator and see whether including the GCA OwnerID will break anything.

traineediplomat
4000 or more? I'm officially obsessed.
4000 or more? I'm officially obsessed.
Posts: 614
Joined: 21 April 03 4:32 pm
Location: The World...man...

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by traineediplomat » 20 September 09 11:35 pm

hi all. My error is that i get an invalid index when i'm loading gsak. Of course this error is due to me transferring gsak to a new machine. I obviously didn't copy a file or two. The error seems to occur when it gets to the caches placed by me index.

ian-and-penny
10000 or more caches found
10000 or more caches found
Posts: 1067
Joined: 13 October 03 11:45 am
Location: Travelling Australia using a Garmin Montana 650T

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by ian-and-penny » 21 September 09 3:33 pm

traineediplomat wrote:hi all. My error is that i get an invalid index when i'm loading gsak. Of course this error is due to me transferring gsak to a new machine. I obviously didn't copy a file or two. The error seems to occur when it gets to the caches placed by me index.
Better to ask on the GSAK Forum

phillipsart
Posts: 50
Joined: 01 March 09 3:50 pm
Location: Bundaberg

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by phillipsart » 27 October 09 11:35 pm

I don't know if this has been bought up before or not, I couldn't find anything on it, But. is there some way of including your TB's and Geocoins into GSAK. So that when you create a Statistic for your profile page on Geocaching.com it would also show your Tb's and Coins?

Echo
1800 or more caches found
1800 or more caches found
Posts: 281
Joined: 02 December 07 8:29 am
Location: Cranbourne East, Victoria

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by Echo » 08 November 09 4:28 pm

Here's a question for the GSAK macro savvy types.
I recently learnt how to automatically fill in details like "%count" and %time" to the user notes via the FieldNotesImportandLog macro before logging them into the CG site. Is there one of those "%things" for adding in the owner's name too?
Can you tell I'm not really a macro writer? :-"

ian-and-penny
10000 or more caches found
10000 or more caches found
Posts: 1067
Joined: 13 October 03 11:45 am
Location: Travelling Australia using a Garmin Montana 650T

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by ian-and-penny » 08 November 09 4:39 pm

%ownername

Look up "Special Tags" in the help file.

Echo
1800 or more caches found
1800 or more caches found
Posts: 281
Joined: 02 December 07 8:29 am
Location: Cranbourne East, Victoria

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by Echo » 08 November 09 4:51 pm

ian-and-penny wrote:%ownername

Look up "Special Tags" in the help file.

\:D/ Thanks Ian and Penny, that is where I got the other "Special Tags" from but that wasn't one of the ones listed.

User avatar
setsujoku
3500 or more caches found
3500 or more caches found
Posts: 1422
Joined: 28 December 04 5:46 pm
Twitter: BGNWP
Location: Athelstone, SA
Contact:

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by setsujoku » 08 November 09 5:13 pm

Just checked my help file and %ownername is there in the Special Tags section.

In any case the other place you can look up all of the special tags (or any other info) is on the GSAK web site, but that is really just a copy of the help file (or vice versa). Special Tags here

Echo
1800 or more caches found
1800 or more caches found
Posts: 281
Joined: 02 December 07 8:29 am
Location: Cranbourne East, Victoria

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by Echo » 08 November 09 5:28 pm

I might be looking at a different help file, the one I was using is the tab that comes up when I run the FieldNotesLogAndImport macro or I could be running an older version of GSAK (7.6.1.27).
Either way it doesn't matter because I think my question has been answered.
But thanks for your fast help Ian and Penny and your special tags link setsujoku. :D

FishFinder
Posts: 4
Joined: 16 March 09 9:58 pm
Location: Macdonald Park

Re: New Program - GSAK (Geocaching Swiss Army Knife)

Post by FishFinder » 22 December 09 10:18 am

Just started Using GSAK, having a few problems, when loading file from GC, columns such as My Finds, My Hides, Cache type, Logs and Last found dont fill in, also dates such as last found date and placed date are the date uploaded not the correct date. Is there an easy solution?

Post Reply