-
Active Member
Necrobot Logs
Is there a way to change the fact they make a new file every hour?
If not does anyone have a pokemon/pokestop check that can check multiple logs at once and make them into one number??
----
im currently running a check which has to check many logs as seperate number and then i add them up, plus i keep having to add a file location every 1hour as it makes a new log... it works i guess but its not practical...
-
Active Member
-
Contributor
Hey, can you share your current source, for what you have working so far?
Because I'm trying the same and got as far as counting everything automatically from every single log file. No need to worry about adding new path, even when new file gets created. Looks like this:

I'm just not sure, how to add the numbers together.
-
Active Member
Well thats one step ahead of me, i have to manually add mine on, how did you get it to do it automatically?
-
Member
Here you go. With automatic 24h archiving. (It will break at the end of each month cause only looking for previous day logs)
@echo off
if not exist "old_logs" md old_logs
:move_old_files
cls
echo Checking for old logs
set times10loop=0
rem Make sure that current hour,day,month,year are correct for your timezone/settings by running
rem echo hr=%time:~0,2%
rem echo day=%date:~4,2%
rem echo month=%date:~7,2%
rem echo year=%date:~10,4%
set hr=%time:~0,2%
set /a day=%date:~4,2%-1
set month=%date:~7,2%
set year=%date:~10,4%
FOR /L %%G IN (0,1,%hr%) DO call :move_old_files_loop %%G
timeout /t 3 1>nul
goto :loop
:move_old_files_loop
IF %1 LSS 10 (
set hrr=0%1
) ELSE (
set hrr=%1
)
if exist NecroBot-%year%-%month%-%day%-%hrr%.txt move /y NecroBot-%year%-%month%-%day%-%hrr%.txt old_logs
goto :eof
:loop
set /a times10loop+=1
set pokestops=0
for /f "tokens=3" %%f in ('find /n /c "] Name:" NecroBot-*.txt') do set /a pokestops+=%%f
set pokemons=0
for /f "tokens=3" %%f in ('find /n /c "(CatchSuccess" NecroBot-*.txt') do set /a pokemons+=%%f
cls
echo %date:~7,2%/%date:~4,2% %time:~0,2%:%time:~3,2%:%time:~6,2%
echo Looted Pokestops: %pokestops%
echo Captured Pokemons: %pokemons%
echo Press key to refresh
timeout /t 60 1>nul
if %times10loop% GTR 9 goto :move_old_files
goto :loop
Last edited by velissarios; 08-22-2016 at 05:49 PM.
Reason: small fix in code
-
Post Thanks / Like - 1 Thanks
Ripper3 (1 members gave Thanks to velissarios for this useful post)
-
Contributor
Originally Posted by
velissarios
Here you go. With automatic 24h archiving.
This is working. Thank you very much 

Edit:
Counter works.
Archiving doesn't actually do anything for me. It keeps all .txt files, even though it does create the Old_logs folder
Error message "Invalid number" upon start: (goes away after a few sec)
Last edited by Ripper3; 08-22-2016 at 07:20 AM.
-
Member
Not sure why this happening for you, could be the cmd version, timezone settings, etc.
Remove/rem all "cls" commands and "@echo off" and see if there is any error. Echo some variables along the way.
also Make sure that current hour,day,month,year are correct by running
echo hr=%time:~0,2%
echo day=%date:~4,2%
echo month=%date:~7,2%
echo year=%date:~10,4%
if not change the first number to the correct value. %date:~4,2% means get the 2 chars after the 4th from the start (substring)
Or you can do the archiving manually and just run this for counting only
@echo off
:loop
set pokestops=0
for /f "tokens=3" %%f in ('find /n /c "] Name:" NecroBot-*.txt') do set /a pokestops+=%%f
set pokemons=0
for /f "tokens=3" %%f in ('find /n /c "(CatchSuccess" NecroBot-*.txt') do set /a pokemons+=%%f
cls
echo Looted Pokestops: %pokestops%
echo Captured Pokemons: %pokemons%
timeout /t 60
goto :loop
Last edited by velissarios; 08-22-2016 at 05:48 PM.
Reason: small fix in code
-
Member
Necrobot logs analyzer pokemon counter
another account banned 
while I waited for the new one to raise its lvl, here is a much more good looking/better working counter that I wrote
It is a vb script HTA application, so make sure you save it as name.hta
Might add some css styles later to make it more colorful 
Code:
<head>
<title>NecroBot Logs - 24h Statistics</title>
<HTA:APPLICATION ID="oHTA" ApplicationName="NecroBot_Logs_24h" SINGLEINSTANCE="yes">
</head>
<style>
p {text-align:center}
</style>
<script language="VBScript">
window.resizeTo 510, 280
Dim path
Sub Window_OnLoad
SetPath
ProcessLogs
iTimerID = window.setInterval("ProcessLogs", 30000) 'Program refresh rate in ms
End Sub
Sub SetPath 'Getting the absolute path so we can work with relative files later.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
strHtmlLocnVal = document.location.href
strThisHTA = Replace(Right(strHtmlLocnVal, Len(strHtmlLocnVal) - 8), "/", "\")
strThisHTA = UnEscape(strThisHTA)
Set objThisFile = objFSO.GetFile(strThisHTA)
objParentDir = objThisFile.ParentFolder
Set objFolder = objFSO.GetFolder(objParentDir)
path = objFolder.ShortPath
WshShell.CurrentDirectory = path
End Sub
Sub ProcessLogs
Set fso = CreateObject("Scripting.FileSystemObject")
currentDate=now
pokemons=0
pokestops=0
snipes=0
earnedexp=0
la.innerText=""
logdate.innerText=currentDate
for h=23 to 0 step -1 'get all logs from up to 23 hours ago
oldDate = DateAdd("h",-h,currentDate)
filename="NecroBot-" & Year(oldDate) & "-" & Right(String(2,"0")&Month(oldDate),2) & "-" & Right(String(2,"0")&Day(oldDate),2) & "-" & Right(String(2,"0")&Hour(oldDate),2) & ".txt"
If (fso.FileExists(fso.BuildPath(path, filename))) Then
Set MyFile = fso.OpenTextFile(filename, 1)
If NOT MyFile.AtEndOfStream Then
la.innerHtml=la.innerHtml & "<li>" & filename
content = MyFile.ReadAll
set re = new regexp
'pokemons captured
re.pattern = "CatchSuccess.+\| (\d+) EXP"
re.Global = True
set list = re.Execute(content)
count=0
cexp=0
For Each match In list
count=count+1
cexp=cexp+match.SubMatches(0)
Next
pokemons=pokemons+count
earnedexp=earnedexp+cexp
la.innerHtml=la.innerHtml & count & " Pokemons (" & cexp & " EXP) | "
'pokestops looted
re.pattern = "] Name:.*XP: (\d*),"
re.Global = True
set list = re.Execute(content)
count=0
cexp=0
For Each match In list
count=count+1
cexp=cexp+match.SubMatches(0)
Next
pokestops=pokestops+count
earnedexp=earnedexp+cexp
la.innerHtml=la.innerHtml & count & " Pokestops (" & cexp & " EXP) | "
'per log snipping attemps
re.pattern = "Sniping"
re.Global = True
set list = re.Execute(content)
la.innerHtml=la.innerHtml & list.count & " Snipes </li>"
'last 10 mins attemps
If (h<2) Then
re.pattern = "(\d\d):(\d\d):(\d\d).*Sniping"
re.Global = True
set list = re.Execute(content)
For Each match In list
loghour=match.SubMatches(0)
logminute=match.SubMatches(1)
logsecond=match.SubMatches(2)
toDate = cDate(Year(currentDate) & "/" & Month(currentDate) & "/" & Day(currentDate)& " " & loghour & ":" & logminute & ":" & logsecond)
if(DateDiff("n",toDate,currentDate))<10 Then
snipes = snipes+1
End If
Next
End If
End If
MyFile.Close
End If
next
pstops.innerText=pokestops
pmons.innerText=pokemons
snip.innerText=snipes
texp.innerText=earnedexp
End Sub
</script>
<body>
<p id="logdate"></p>
<p>Looted Pokestops: <span id="pstops"></span></p>
<p>Captured Pokemons: <span id="pmons"></span></p>
<p>Earned EXP: <span id="texp"></span></p>
<p>Snipes (last 10mins): <span id="snip"></span></p>
<br>
<hr>
Logs
<ul id="la"></ul>
</body>
screenshot: screenshot.jpg
file: counter.zip
Last edited by velissarios; 08-23-2016 at 03:42 PM.
-
Post Thanks / Like - 1 Thanks
Ripper3 (1 members gave Thanks to velissarios for this useful post)