+OmniCitadel Posted December 25, 2005 Share Posted December 25, 2005 Ok so let me tell you what i want to do and you can tell me if it is possible or not. I want to develope a macro which runs certain filters and then exports them to my sd card reader and my sync folder for pocket pc with certain names. It seems like it should be fairly easy but i dont know the limitiations of this program. If it is possible can some one please point me in the right direction to learn how to program macros for gsak. If it is not possible can come one please point me in the right direction to learn how to program macros for gask. Quote Link to comment
+ClydeE Posted December 25, 2005 Share Posted December 25, 2005 Ok so let me tell you what i want to do and you can tell me if it is possible or not. I want to develope a macro which runs certain filters and then exports them to my sd card reader and my sync folder for pocket pc with certain names. It seems like it should be fairly easy but i dont know the limitiations of this program. If it is possible can some one please point me in the right direction to learn how to program macros for gsak. If it is not possible can come one please point me in the right direction to learn how to program macros for gask. Yes, you can do this via the macro language. To check out some existing working macros see http://gsak.net/Macros.php For a complete overview of the macro language please see "Automating GSAK" in the help file or online here http://gsak.net/help/hs21000.htm Quote Link to comment
+OmniCitadel Posted December 25, 2005 Author Share Posted December 25, 2005 awesome that helps ... i got it working but i would like to know how to set the export Number to 200 caches per file any ideas? Quote Link to comment
+ClydeE Posted December 25, 2005 Share Posted December 25, 2005 awesome that helps ... i got it working but i would like to know how to set the export Number to 200 caches per file any ideas? The EXPORT command for all types supports the "From" and "To" tokens: Example: Export Type=GPS Settings="My settings" From=1 To=200 Quote Link to comment
+OmniCitadel Posted December 25, 2005 Author Share Posted December 25, 2005 (edited) ok now stupid question but how do i ensure that it is the closest 200 caches to the center point? Edited December 25, 2005 by OmniCitadel Quote Link to comment
+Pasha Posted December 25, 2005 Share Posted December 25, 2005 CENTRE Location="Home" sets your center point and sorts records by distance from that point. You of course would need to have a named location - see the Tools Menu/Options/Locations. I have Home, N 47 30.967, W 122 36.474 as one of my saved locations, and can then center on my home location prior to exporting to the GPS or whatever. Quote Link to comment
+Photom Posted December 25, 2005 Share Posted December 25, 2005 (edited) awesome that helps ... i got it working but i would like to know how to set the export Number to 200 caches per file any ideas? Here's what I do to get the approximate number of caches in each file: run a GSAK filter with the "Distance less than or equal to" the number of miles that gives me the correct number of caches. Then I save that filter. I also save a companion SETTINGS file to create Magellan SD files and also gpx files for download to my ppc.) Finally - you need to add each location's coordinates to the location file. Then I run my macro - exactly like you described - for each city or sub-city between Sacramento and Fresno (about 200 miles total.) The macro looks like this: (Note the numbers after the cities is the number of miles needed to approximate 200 finds that a.) are active, and b.) I haven't found.) FILTER Name="Merced_44" EXPORT Type=MAGSD Settings="Explorist gs Merced_44" EXPORT Type=GPX Settings="gpx Merced_44" # FILTER Name="Modesto_30" EXPORT Type=MAGSD Settings="Explorist gs Modesto_30" EXPORT Type=GPX Settings="gpx Modesto_30" # FILTER Name="Turlock_38" EXPORT Type=MAGSD Settings="Explorist gs Turlock_38" EXPORT Type=GPX Settings="gpx Turlock_38" # FILTER Name="Sacramento_8" EXPORT Type=MAGSD Settings="Explorist gs Sacramento_8" EXPORT Type=GPX Settings="gpx Sacramento_8" # and on and on for each area....... Edited December 25, 2005 by Photom Quote Link to comment
+OmniCitadel Posted December 25, 2005 Author Share Posted December 25, 2005 (edited) Is there a way to create a string like [a,b,c,d,e] as displayed in this javascript snipplet: function calc_premium() { var pprices = [12, 23, 33, 41, 48]; var pcounter = -1; var bill_hbo_checked= window.document.frmBot.elements["bill_hbo"].checked; var bill_show_checked= window.document.frmBot.elements["bill_show"].checked; var bill_starz_checked= window.document.frmBot.elements["bill_starz"].checked; var bill_cine_checked= window.document.frmBot.elements["bill_cine"].checked; var bill_sports_checked= window.document.frmBot.elements["bill_sports"].checked; if (bill_hbo_checked == true) { pcounter++; } if (bill_show_checked == true) { pcounter++; } if (bill_starz_checked == true) { pcounter++; } if (bill_cine_checked == true) { pcounter++; } if (bill_sports_checked == true) { pcounter++; } if (pcounter >= 0) { return pprices[pcounter]; } else { return 0; } } I am trying to cut down this script in gsak: IF $Count = 1 $Loc = $a ENDIF IF $Count = 2 $Loc = $b ENDIF IF $Count = 3 $Loc = $c ENDIF IF $Count = 4 $Loc = $d ENDIF IF $Count = 5 $Loc = $e ENDIF so that i can say: $Loc=["a","b","c","d","e"] so that: $Loc[1] = "a" $Loc[3] = "c" Edited December 25, 2005 by OmniCitadel Quote Link to comment
+Pasha Posted December 25, 2005 Share Posted December 25, 2005 There's currently no support for arrays and array operations in the GSAK macro language. However, you can probably do what you want with the SUBSTR function: $locs = "abcde" $num = 3 $loc = SUBSTR($locs, $num, 1) should set $loc to "c". The EXTRACT function would also allow you to do something like that - see the GSAK help page on internal functions. I may have dropped some quotes or something in the above code so it may not work if you cut and paste it. It's 2:40am Christmas morning and I should really be in bed. Hope that helps - happy holidays. Quote Link to comment
+ClydeE Posted December 25, 2005 Share Posted December 25, 2005 There is currently no native support for arrays in the GSAK macro language. However, you can have "seudo" arrays by using a string variable with the extract function. For example: $containers = "Micro~Small~Regular~Large" Now you "extract" any item for this string via: $temp = Extract($containers,"~",3) $temp now equals "Regular" Quote Link to comment
+OmniCitadel Posted December 25, 2005 Author Share Posted December 25, 2005 Well guys that definately helped. This macro is amazing and thus i will be distributing it once i am done cleaning it up and reformatting it into a legable thing.... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.