UGP2
August 23, 2011, 1:03pm
1
Hello,
What is the problem with my script:
:global lastTime;
:global currentBuf [ :toarray [ /log print where buffer=VPN ] ] ;
:global currentLineCount [ :len $currentBuf ] ;
:global currentTime [ :totime [/log get [ :pick $currentBuf ($currentLineCount -1) ] time ] ];
:global message "";
:if ( $lastTime = "" ) do={
:set lastTime $currentTime ;
:set message [/log get [ :pick $currentBuf ($currentLineCount-1) ] message];
/tool fetch url="http://www.shirazpardaz.ir/bank/olog.php?msg=$message" mode=http keep-result=no
} else={
:if ( $lastTime < $currentTime ) do={
:set lastTime $currentTime ;
:set message [/log get [ :pick $currentBuf ($currentLineCount-1) ] message];
/tool fetch url="http://www.shirazpardaz.ir/bank/olog.php?msg=$message" mode=http keep-result=no
}
}
fewi
August 26, 2011, 4:26pm
2
It parses and there’s no syntax errors. So instead of having everyone stare at it and guess, why don’t you give some details? What is the script supposed to do? How are you testing? What are you expecting to see during the test, and what are you seeing instead?
‘/log find’ not ‘/log print’, remember a '' with all ‘?’ in strings.
:global lastTime;
:local currentBuf [/log find buffer=VPN];
:if ([:len $currentBuf] != 0) do={
:local currentLineCount [:len $currentBuf];
:local lastItem [:pick $currentBuf ($currentLineCount - 1)];
:local currentTime [:totime [/log get $lastItem time]];
:if ([:len $lastTime] = 0 || $lastTime < $currentTime) do={
:set lastTime $currentTime;
:local message [/log get $lastItem message];
/tool fetch url="http://www.shirazpardaz.ir/bank/olog.php\?msg=$message" mode=http keep-result=no;
}
}