New Program - GSAK (Geocaching Swiss Army Knife)
- Facitman
- 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)
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.
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.
- Fuddley
- 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)
I have tried as you said above, but get an errorFacitman 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.
"Error=>SQLite no such Column: OwnerName
- Facitman
- 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)
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
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
- Chwiliwr
- 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)
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.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.
- Facitman
- 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)
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!
Peter
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!
Peter
- caughtatwork
- Posts: 17017
- Joined: 17 May 04 12:11 pm
- Location: Melbourne
- Contact:
Re: New Program - GSAK (Geocaching Swiss Army Knife)
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.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.
-
- 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)
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.
-
- 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)
Better to ask on the GSAK Forumtraineediplomat 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.
-
- Posts: 50
- Joined: 01 March 09 3:50 pm
- Location: Bundaberg
Re: New Program - GSAK (Geocaching Swiss Army Knife)
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?
-
- 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)
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?
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?
-
- 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)
%ownername
Look up "Special Tags" in the help file.
Look up "Special Tags" in the help file.
-
- 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)
ian-and-penny wrote:%ownername
Look up "Special Tags" in the help file.
Thanks Ian and Penny, that is where I got the other "Special Tags" from but that wasn't one of the ones listed.
- setsujoku
- 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)
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
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
-
- 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)
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.
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.
-
- Posts: 4
- Joined: 16 March 09 9:58 pm
- Location: Macdonald Park
Re: New Program - GSAK (Geocaching Swiss Army Knife)
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?