Jump to content



Photo

Web Based Printer Log


  • Please log in to reply
No replies to this topic

#1 mikeytown2

mikeytown2

    Polymath

  • Active Members
  • PipPipPipPip
  • 210 posts

Posted 21 May 2005 - 11:35 PM

This makes a log file of the log file... the file stored on the printer only holds 22 entries, so this makes one big log file of all the entries on your c drive.
If you want to test it out here is a live address of a dell laser printer i found on google
http://146.6.127.19/ews/job/log.htm

This script is tested only on a 3000, the link is for a 5100
AutoIt         
;#NoTrayIcon #include <file.au3> $temp = 0 Do     InetGet("http://192.168.2.3/ews/job/log.htm", "C:\templog.html")     $file = FileOpen("C:\templog.html", 0)     $lineNum = 72     $prtlog = FileOpen("C:\printlog.html", 0)     If $prtlog = -1 Then         FileClose($prtlog)         $prtlog = FileOpen("C:\printlog.html", 1)         $bar = 0         While 1             $line = FileReadLine($file)             $bar = $bar + 1             If $bar < 47 Then ContinueLoop             FileWriteLine($prtlog, $line)             If $bar > 71 Then                 FileClose($prtlog)                 FileOpen("C:\printlog.html", 0)                 ExitLoop             EndIf         WEnd         MsgBox(0, "Dell3000", "Print Log Located At C:\printlog.html", 60)     EndIf     $lines = 0     $count = -1     While 1         $line = FileReadLine($prtlog)         $lines = $lines + 1         If @error = -1 Then ExitLoop     WEnd     $lines = $lines - 1     $prtline = FileReadLine($prtlog, $lines)     $prtread = StringSplit($prtline, "<tr><td>", 1)     $prtnum = StringSplit($prtread[2], "</td><td>", 1)     Do         $line = FileReadLine($file, $lineNum)         $read = StringSplit($line, "<tr><td>", 1)         $num = StringSplit($read[2], "</td><td>", 1)                 $lineNum = $lineNum - 1         $count = $count + 1         If $count = 20 Then             ExitLoop         EndIf     Until $num[1] = $prtnum[1]     FileClose($prtlog)     $lineNum = 73 - $count     If $count > 0 Then         $prtlog = FileOpen("C:\printlog.html", 1)         MsgBox(0, "Dell3000", "New Print Completed", 60)         Do             $line = FileReadLine($file, $lineNum)             FileWriteLine($prtlog, $line)             $lineNum = $lineNum + 1         Until $lineNum = 73         FileClose($prtlog)     EndIf     FileClose($file)     FileDelete("C:\templog.html")     Sleep(90000) Until $temp = 1

I commented out the no tray to post, but I run this at startup so I don't want to see it. it runs 24/7 on my computer.

Tell me what you think.
-Mike

Edited by mikeytown2, 12 December 2007 - 12:04 PM.









0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users