#******************************************* # MacVersion = 3.31 # MacDescription = OBG Bingo Horizontal with Log db # MacAuthor = Peter McLure # MacFileName = OBG Bingo331.gsk # MacUrl = #*******************************************\ ################## Cacher Name ################################################## $CacherName="Peter and Gloria" ################## True to Exclude; False to Include ################################################## $ExcludeLocationless=False # Set debugging on or off #DEBUG Status=On #timer status=on $RequiredVersion = "7.5.0.188" VERCHECK Version=7.5.0.188 (Note: This GSAK version is needed for the new 'sqlite' log database) $msg1="Cacher Name is "+ $CacherName + $_NewLine If $ExcludeLocationless $msg1=$msg1+"Locationless Caches are EXCLUDED" else $msg1=$msg1+"ALL Caches are INCLUDED" endif $msg1=$msg1+$_NewLine + "These variables can be changed on line 10 && 12 of the macro." MSGOK msg=$Msg1 $out = "" + $_NewLine $out = $out + "" + $_NewLine $out = $out + "" + $_NewLine $out = $out + "" $out = $out + "" + $_NewLine $out = $out + "" $out = $out + "" $out = $out + "" $out = $out + "" + $_NewLine $totalfinds = 0 $totaldnfs = 0 SET $Count = 1 WHILE $Count <= 32 Array($count,0) = "13" $Count = $Count + 1 ENDWHILE Array(30,2) = "--" Array(31,2) = "--" Array(31,4) = "--" Array(31,6) = "--" Array(31,9) = "--" Array(31,11) = "--" $Sort = $_SortBy $temp = GetEnvV("temp") #test for missing log entry # Just use current database ########################## #Database Name="Default" Goto Position=top While not ($_eoL) $logentry=0 if $d_FoundCount >0 and ($ExcludeLocationless=False or ($ExcludeLocationless=True and $d_CacheType<>"L")) table active=logs scope=parent Goto Position=top while not($_eol) if ($d_lType="Attended" or $d_lType="Found it" or $d_lType="Webcam Photo Taken") and $d_lBy =$CacherName $logentry=1 $MyDate = datetostring($d_lDate) $MyDay=val(substr($MyDate,7,2)) $MyMonth=val(substr($MyDate,5,2)) Array($MyDay,$MyMonth)=str(val(Array($MyDay,$MyMonth))+1,3,0) endif Goto Position=Next EndWhile Table active=caches endif ################################################################################################################# ######### when there is no log entry (yet), data is stll captured based on main database $d_FoundByMeDate ####### ################################################################################################################# if $logentry=0 and $D_Found $MyDate = datetostring($d_FoundByMeDate) $MyDay=val(substr($MyDate,7,2)) $MyMonth=val(substr($MyDate,5,2)) Array($MyDay,$MyMonth)=str(val(Array($MyDay,$MyMonth))+1,3,0) endif Goto Position=Next EndWhile #now print######################################################## Set $countMonth = 1 While $CountMonth<=12 SET $CountDay = 1 $StrMon = "Jan." if $CountMonth = 2 $StrMon = "Feb." endif if $CountMonth = 3 $StrMon = "Mar." endif if $CountMonth = 4 $StrMon = "Apr." endif if $CountMonth = 5 $StrMon = "May" endif if $CountMonth = 6 $StrMon = "June" endif if $CountMonth = 7 $StrMon = "July" endif if $CountMonth = 8 $StrMon = "Aug." endif if $CountMonth = 9 $StrMon = "Sep." endif if $CountMonth = 10 $StrMon = "Oct." endif if $CountMonth = 11 $StrMon = "Nov." endif if $CountMonth = 12 $StrMon = "Dec." endif $out = $out + "" $alldays=0 WHILE $CountDay <= 31 $mynumber=Array($countday,$countmonth) if val($mynumber)=0 if $mynumber="--" $out = $out + "" else $out = $out + "" endif else $out = $out + "" $alldays=$alldays+1 endif $countday = $countday + 1 ENDWHILE ## Print Total Found ##################################### if $alldays=31 or ($countmonth=2 and $alldays=29) or ($alldays=30 and ($countmonth=4 or $countmonth=6 or $countmonth=9 or $countmonth=11)) $out = $out + "" else $out = $out + "" endif ## Print Total ToDo ######################################### if $alldays=31 or ($countmonth=2 and $alldays=29) or ($alldays=30 and ($countmonth=4 or $countmonth=6 or $countmonth=9 or $countmonth=11)) $out = $out + "" else $feb=0 if $countmonth=2 $feb=2 endif $days30=0 if ($countmonth=4 or $countmonth=6 or $countmonth=9 or $countmonth=11) $days30=1 endif $todo = 31-$alldays-$feb-$days30 $out = $out + "" endif $countmonth = $countmonth +1 endwhile ############################ print column totals ################################## $out = $out + "" Set $totaldays = 0 SET $CountDay = 1 WHILE $CountDay <= 31 Set $countMonth = 1 #$alldays=0 $allmonths=0 While $CountMonth<=12 if val(Array($countday,$countmonth))<>0 #$alldays = $alldays+1 $allmonths=$allmonths+1 $totaldays = $totaldays +1 endif $countmonth = $countmonth +1 endwhile if $allmonths=12 or ($countday=30 and $allmonths=11) or ($countday=31 and $allmonths=07) $out = $out + "" else $out = $out + "" endif $Countday = $Countday + 1 endwhile ############################ print total ################################## $out = $out + "" ############################ print todo balance ################################## $totalleft=366-$totaldays $out = $out + "" $out = $out + "" + $_NewLine CancelFilter $SortData = Extract($Sort, "=",1) $Sequence = Extract($Sort, "=",2) SORT By=$SortData Sequence=$Sequence Goto Position=Top $out = $out + "
OBG Bingo - Days with Cache Finds for $CacherName
Month123456789101112131415 16 17 18 19202122232425 26 27 28 2930 31FoundTo Do
$StrMon$mynumber $mynumber $mynumber ALL$alldays"+"--" +" $todo
FoundAll$allmonths$totaldays$totalleft
" $FileName = $_Install + "\html" + "\obg bingo.htm" $Error = PutFile($FileName,$out) OpenFile file="$FileName" #timer status=off