Moscar Posted June 20, 2007 Posted June 20, 2007 Hello I really need some help, I was up till 2am last night browsing through post to try to find clues how to make something I did even sweeter. One definte thing is a bunch of you are truely amazing. I am a MCSE and have been a network admin, but never seen the side of programming. Anyways, we lost our toner management support, so we have to manually check, then order. Since all of my printers are HP and networked, you can enter its ip address in IE and see the toner levels. I then created an Excel spreadsheeet which has the printer name, ip address link and cells for its toner levels. I even created email hyperlinks per printer toner level cell so that when near 6% all I have to do it click it and a pre filled out email is ready to be sent to our new toner vendor. I want to automate this better. Can anyone tell me ** per my attached pic to help ** is it possible to have AutoIT 1. Open IE to a http: address - done 2. Scan the source info from the web page and find the percentage for example Black 3. Take that percentage and input it into my spreadsheet in the appropriate cell If someone could help me just figure out just one printer, just one color cell, that would be an most appreciated start. Thanks Moscar
james3mg Posted June 20, 2007 Posted June 20, 2007 (edited) It looks like from the .bmp you posted that the percentage is already written in text, so you don't have to calculate it at all...just read it!(it's written in the line you show that looks like: class=hpConsumableBlockHeaderText>Black | Cartridge $nbsp;83%</SPAN>)Use INetGet() and FileRead(), then search for the following string using StringInStr() class=hpConsumableBlockHeaderText>Black | Cartridge $nbsp;. Once your script returns the position, take the next three characters (in this case, "83%") and there you go! For error checking when it's below 10%, you can StringReplace your three-character string, substituting "<" for "", since that's the character that follows the %. Presumably you can now repeat the process for each color and printer. Edited June 20, 2007 by james3mg "There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
JSunn Posted June 21, 2007 Posted June 21, 2007 Theoretically you could have it send the request to the vendor automatically too, once the toner levels reached a certain state. Obviously much testing would be required - dont want 500 cases of toner on your doorstep by surprise. But I think it would be easy to do. Like you could code it in a morning.-J
Moscar Posted June 21, 2007 Author Posted June 21, 2007 Theoretically you could have it send the request to the vendor automatically too, once the toner levels reached a certain state. Obviously much testing would be required - dont want 500 cases of toner on your doorstep by surprise. But I think it would be easy to do. Like you could code it in a morning.-JI could not code it !I have absolutly no experience coding, I have been trying for hours just to repeat some sample code and make it just get the xx% from the source of my toner page.The Example is from the AutoIT tutorial lessons................. Before I put in this script went out to www.auitscript.com and found "LZ" Before "comp". When the script runs it does find 77. I put in place of the web address my locally saved web page, and the variables. I JUST HAVE NO CLUE.; demonstration to find chracters that change between to standard points; or just find a string#include <IE.au3>#Region --- IE-Builder generated code Start ---$oIE = _IECreate ();------------- User input --------------_IENavigate ($oIE, "G:\tep05007.htm") ; web address$Find = "Black | Cartridge $nbsp;" ; my info shows after this line... or just find this line$Before = "</SPAN>)" ; my info shows before this line... or set as ""; ------------ End User input -------------Sleep(1000)$body = _IEBodyReadHTML ($oIE)$sloc = @TempDir & "\stest.txt"FileDelete($sloc)FileWrite($sloc, $body)$sfile = FileOpen($sloc, 0)$num = 0While 2 $num = $num + 1 $sline = FileReadLine($sfile, $num) If @error Then MsgBox(262208, "Fail", "The string was NOT found ") FileClose($sfile) Exit EndIf If StringInStr($sline, $Find) Then MsgBox(64, "Success", "The string " & $Find & " was found " & @CRLF & " on line # " & $num, 5) If $Before = "" Then ExitLoop $Found = stringbetween($sline, $Find, $Before) MsgBox(64, "Found", "The string is " & $Found & " ", 5) ExitLoop EndIfWEndFunc stringbetween($str, $start, $end) $pos = StringInStr($str, $start) If Not @error Then $str = StringTrimLeft($str, $pos + StringLen($start) - 1) $pos = StringInStr($str, $end) If Not @error Then $str = StringTrimRight($str, StringLen($str) - $pos + 1) Return $str EndIf EndIfEndFunc ;==>stringbetween#EndRegion --- IE-Builder generated code End --
Moscar Posted June 21, 2007 Author Posted June 21, 2007 I could not code it !I have absolutly no experience coding, I have been trying for hours just to repeat some sample code and make it just get the xx% from the source of my toner page.The Example is from the AutoIT tutorial lessons................. Before I put in this script went out to www.auitscript.com and found "LZ" Before "comp". When the script runs it does find 77. I put in place of the web address my locally saved web page, and the variables. I JUST HAVE NO CLUE.; demonstration to find chracters that change between to standard points; or just find a string#include <IE.au3>#Region --- IE-Builder generated code Start ---$oIE = _IECreate ();------------- User input --------------_IENavigate ($oIE, "G:\tep05007.htm") ; web address$Find = "Black | Cartridge $nbsp;" ; my info shows after this line... or just find this line$Before = "</SPAN>)" ; my info shows before this line... or set as ""; ------------ End User input -------------Sleep(1000)$body = _IEBodyReadHTML ($oIE)$sloc = @TempDir & "\stest.txt"FileDelete($sloc)FileWrite($sloc, $body)$sfile = FileOpen($sloc, 0)$num = 0While 2 $num = $num + 1 $sline = FileReadLine($sfile, $num) If @error Then MsgBox(262208, "Fail", "The string was NOT found ") FileClose($sfile) Exit EndIf If StringInStr($sline, $Find) Then MsgBox(64, "Success", "The string " & $Find & " was found " & @CRLF & " on line # " & $num, 5) If $Before = "" Then ExitLoop $Found = stringbetween($sline, $Find, $Before) MsgBox(64, "Found", "The string is " & $Found & " ", 5) ExitLoop EndIfWEndFunc stringbetween($str, $start, $end) $pos = StringInStr($str, $start) If Not @error Then $str = StringTrimLeft($str, $pos + StringLen($start) - 1) $pos = StringInStr($str, $end) If Not @error Then $str = StringTrimRight($str, StringLen($str) - $pos + 1) Return $str EndIf EndIfEndFunc ;==>stringbetween#EndRegion --- IE-Builder generated code End --I can get the page to open, but can not get the BLACK % and then input that % into a specified excel cell. Any help would be appreicated
Zacharot Posted June 21, 2007 Posted June 21, 2007 (edited) change search string to Cartridge in fact, if you post your tmp file, I think we could whip up something. I dont know the excel part, but we could refine a lot of this. Edited June 21, 2007 by Zacharot
Moscar Posted June 21, 2007 Author Posted June 21, 2007 O That would be so great. I could then maybe catch on enough to replicate the commands to search all 30 printers. I just want to have a script goto a 10.100.100.x address, search and find the % for Black, then paste that xx% into a designated cell in Excel. Then repeate the same thing for % for Cyan, % for Magenta, and % for Yellow. Any help getting there I wanted to add the htm file and the source.txt as an attachment, but I can't remove my 1st one. Here is the source <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- saved from url=(0047)http://10.100.13.11/hp/device/this.LCDispatcher --> <?xml version="1.0" encoding="UTF-8"?><HTML lang=en xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>HP Color LaserJet 4700 Printers</TITLE> <META http-equiv=Content-Type content="text/html; charset=utf-8"> <script type=text/javascript>divClickEnabled=true;</SCRIPT> <STYLE type=text/css media=all>A { COLOR: #3366cc; TEXT-DECORATION: underline } A.hpButtonNavigationLink { COLOR: #000000; TEXT-DECORATION: none } A.hpButtonNavigationLink:visited { COLOR: #000000; TEXT-DECORATION: none } A.hpSelectedTabLabel { FONT-WEIGHT: bold; FONT-SIZE: 14px; Z-INDEX: 1; MARGIN-LEFT: 10px; COLOR: #000000; MARGIN-RIGHT: 10px; FONT-FAMILY: helvetica, arial; TEXT-DECORATION: none } A.hpSelectedTabLabel:visited { FONT-WEIGHT: bold; FONT-SIZE: 14px; Z-INDEX: 1; MARGIN-LEFT: 10px; COLOR: #000000; MARGIN-RIGHT: 10px; FONT-FAMILY: helvetica, arial; TEXT-DECORATION: none } A.hpUnselectedTabLabel { FONT-SIZE: 14px; Z-INDEX: 1; MARGIN-LEFT: 10px; COLOR: #000000; MARGIN-RIGHT: 10px; FONT-FAMILY: helvetica, arial; TEXT-DECORATION: none } A.hpUnselectedTabLabel:visited { FONT-SIZE: 14px; Z-INDEX: 1; MARGIN-LEFT: 10px; COLOR: #000000; MARGIN-RIGHT: 10px; FONT-FAMILY: helvetica, arial; TEXT-DECORATION: none } A:visited { COLOR: #3366cc } BODY { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 5px 5px 0px; COLOR: #000000; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffffff } DIV.hpButtonNavigation { BORDER-RIGHT: #ffcc66 1px solid; BORDER-LEFT: #ffcc66 1px solid; PADDING-TOP: 3px; BACKGROUND-COLOR: #ffcc66 } DIV.hpButtonSpacer { FONT-SIZE: 1px; HEIGHT: 10px } DIV.hpConsumableBlock { BORDER-RIGHT: 2px ridge; BORDER-TOP: 2px ridge; BORDER-LEFT: 2px ridge; WIDTH: 97%; BORDER-BOTTOM: 2px ridge; BACKGROUND-COLOR: #cdcecd } DIV.hpContentArea { MARGIN-TOP: 13px; FONT-SIZE: 11px; WIDTH: 100%; COLOR: #000000; FONT-FAMILY: helvetica, arial } DIV.hpConsumableBlockData { PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px } UNKNOWN { BORDER-RIGHT: 2px; BORDER-TOP: 2px ridge; FONT-SIZE: 9px; BORDER-LEFT: 2px; BORDER-BOTTOM: 2px; BACKGROUND-COLOR: #ffffff } UNKNOWN { FONT-SIZE: 9px } DIV.hpConsumableBlockDataNoPct { PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffffff } DIV.hpFormBottom { BORDER-TOP: #3366cc 2px ridge; MARGIN-TOP: 20px } DIV.hpGasGaugeBlock { MARGIN: 10px 10px 10px 0px; WIDTH: 100% } DIV.hpGasGaugeBorder { BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid } DIV.hpNavigationButtonselected { BORDER-TOP: 1px inset; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 12px; MARGIN-BOTTOM: 3px; PADDING-BOTTOM: 1px; MARGIN-LEFT: 7px; BORDER-LEFT: 1px inset; CURSOR: pointer; PADDING-TOP: 1px; BORDER-BOTTOM: 1px inset; FONT-FAMILY: helvetica, arial; BACKGROUND-COLOR: #ffffff } DIV.hpNavigationButtonUnselected { BORDER-TOP: #ffffff 1px solid; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 12px; MARGIN-BOTTOM: 3px; PADDING-BOTTOM: 1px; MARGIN-LEFT: 7px; BORDER-LEFT: #ffffff 1px solid; CURSOR: pointer; PADDING-TOP: 1px; BORDER-BOTTOM: #7b7d7b 1px solid; FONT-FAMILY: helvetica, arial } DIV.hpOtherLinksBanner { PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: helvetica, arial; BACKGROUND-COLOR: #cccccc } DIV.hpOtherLinksContent { PADDING-LEFT: 5px; FONT-SIZE: 11px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: helvetica, arial } DIV.hpOtherLinksNavigation { BORDER-RIGHT: #3366cc 2px solid; BORDER-TOP: #3366cc 2px solid; BORDER-LEFT: #3366cc 2px solid; BORDER-BOTTOM: #3366cc 2px solid } DIV.hpPageText { MARGIN-TOP: 0.4em; FONT-SIZE: 12px; MARGIN-BOTTOM: 0.4em; FONT-FAMILY: helvetica, arial; BACKGROUND-COLOR: #ffffff } SPAN.hpPageText { MARGIN-TOP: 0.4em; FONT-SIZE: 12px; MARGIN-BOTTOM: 0.4em; FONT-FAMILY: helvetica, arial; BACKGROUND-COLOR: #ffffff } DIV.hpPageTitle { FONT-WEIGHT: bold; FONT-SIZE: 18pt; MARGIN-BOTTOM: 5px; COLOR: #3366cc; BORDER-BOTTOM: #3366cc 2px ridge; FONT-FAMILY: helvetica, arial } DIV.hpSection { MARGIN-TOP: 14px; PADDING-LEFT: 5px; FONT-SIZE: 12px; MARGIN-BOTTOM: 10px; PADDING-BOTTOM: 2px; COLOR: #ffffff; PADDING-TOP: 3px; FONT-FAMILY: helvetica, arial; BACKGROUND-COLOR: #3366cc } DIV.hpTabExtender { BORDER-RIGHT: #ffcc66 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: #ffcc66 1px solid; BORDER-BOTTOM: #ffcc66 1px solid; POSITION: relative; TOP: -1px; HEIGHT: 10px; BACKGROUND-COLOR: #ffcc66 } DIV.hpSelectedTab { BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; Z-INDEX: 1; FLOAT: left; BACKGROUND-IMAGE: url(images/tabTopWhite.png); BORDER-LEFT: black 1px solid; CURSOR: pointer; MARGIN-RIGHT: 4px; BORDER-BOTTOM: #ffcc66 1px solid; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: helvetica, arial; POSITION: relative; BACKGROUND-COLOR: #ffcc66 } DIV.hpUnselectedTab { BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; FLOAT: left; BACKGROUND-IMAGE: url(images/tabTopWhite.png); BORDER-LEFT: black 1px solid; CURSOR: pointer; MARGIN-RIGHT: 4px; BORDER-BOTTOM: black 1px solid; BACKGROUND-REPEAT: repeat-x; FONT-FAMILY: helvetica, arial; POSITION: relative; BACKGROUND-COLOR: #cccccc } FORM { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px } IMG { BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none } IMG.hpPageImage { BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none } IMG.hpConsumableBlockImage { WIDTH: 24px; HEIGHT: 24px } IMG.hpLogo { BORDER-RIGHT: medium none; BORDER-TOP: medium none; VERTICAL-ALIGN: bottom; BORDER-LEFT: medium none; WIDTH: 160px; BORDER-BOTTOM: medium none; HEIGHT: 52px } IMG.tabLeftNotch { LEFT: -1px; VERTICAL-ALIGN: top; POSITION: relative; TOP: -1px } IMG.tabRightNotch { LEFT: 1px; VERTICAL-ALIGN: top; POSITION: relative; TOP: -1px } INPUT { FONT-SIZE: 12px; FONT-FAMILY: helvetica, arial } INPUT.hpTextInput { FONT-SIZE: 12px; WIDTH: 225px; FONT-FAMILY: helvetica arial } SELECT.hpPageList { FONT-SIZE: 12px; WIDTH: 225px; FONT-FAMILY: helvetica, arial } SELECT.hpPageCombo { FONT-SIZE: 12px; WIDTH: 225px; FONT-FAMILY: helvetica, arial } SPAN.hpConsumableBlockHeaderText { FONT-SIZE: 10px; FONT-FAMILY: helvetica, arial } SPAN.hpBannerTextBig { PADDING-LEFT: 3px; FONT-SIZE: 22px; COLOR: #ffffff; FONT-FAMILY: helvetica, arial } SPAN.hpBannerTextSmall { PADDING-LEFT: 3px; FONT-SIZE: 12px; COLOR: #ffffff; FONT-FAMILY: helvetica, arial } SPAN.hpPageTextButtonReference { FONT-WEIGHT: bold } TABLE { BORDER-RIGHT: medium none; PADDING-RIGHT: 0px; BORDER-TOP: medium none; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: medium none; PADDING-TOP: 0px; BORDER-BOTTOM: medium none } TABLE.hpConsumableBlockHeader { WIDTH: 100% } TABLE.hpLayoutTable { Z-INDEX: 1; WIDTH: 100%; HEIGHT: 52px } TABLE.hpTable { BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 100%; BORDER-BOTTOM: medium none } TD { BORDER-RIGHT: medium none; PADDING-RIGHT: 0px; BORDER-TOP: medium none; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; VERTICAL-ALIGN: top; BORDER-LEFT: medium none; PADDING-TOP: 0px; BORDER-BOTTOM: medium none } TD.hpBanner { PADDING-TOP: 5px; BACKGROUND-COLOR: #3366cc } TD.hpConsumableBlockGasGauge { BORDER-RIGHT: 2px ridge; BORDER-TOP: 2px ridge; VERTICAL-ALIGN: middle; BORDER-LEFT: 2px ridge; BORDER-BOTTOM: 2px ridge } TD.hpConsumableBlockGasGaugeImage { WIDTH: 30px; HEIGHT: 16px; TEXT-ALIGN: center } TD.hpConsumableBlockHeaderImage { WIDTH: 31px; HEIGHT: 26px; TEXT-ALIGN: center } TD.hpConsumableBlockHeaderPctRemaining { WIDTH: 31px; HEIGHT: 26px } TD.hpContentMargin { WIDTH: 20px } TD.hpLogo { WIDTH: 160px; TEXT-ALIGN: center } TD.hpTabExtender { BACKGROUND-COLOR: #ffcc66 } TEXTAREA { FONT-SIZE: 12px; FONT-FAMILY: helvetica, arial } TH.hpTableHeader { BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; TEXT-ALIGN: left } TR { BORDER-RIGHT: medium none; PADDING-RIGHT: 0px; BORDER-TOP: medium none; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: medium none; PADDING-TOP: 0px; BORDER-BOTTOM: medium none } </STYLE> <META content="MSHTML 6.00.2900.3086" name=GENERATOR></HEAD> <BODY> <DIV> <TABLE class=hpLayoutTable cellSpacing=0 cellPadding=0> <TBODY> <TR> <TD colSpan=4> <TABLE style="WIDTH: 100%" cellSpacing=0 cellPadding=0 summary=""> <TBODY> <TR> <TD class=hpLogo><A title="Jump to main content. Please activate this if you would like to skip the navigation and jump directly to the main content." href="http://10.100.13.11/hp/device/this.LCDispatcher#skipnavigation"></A><A title="Go to HP corporate web site: external link" onclick="target = new Date().valueOf().toString(); if (window.open) window.open('http://www.hp.com',target,'resizable=yes,scrollbars=yes,menubar=yes,location=yes,toolbar=yes,status=yes'); return false;" href="http://www.hp.com/"><IMG class=hpLogo alt="Go to HP corporate web site: external link" src="TEP05007_files/hp_invent_logo.gif"> </A></TD> <TD class=hpBanner><SPAN class=hpBannerTextSmall>HP Color LaserJet 4700 / 10.100.13.11<BR></SPAN> <TABLE class=hpTable> <TBODY> <TR> <TD><SPAN class=hpBannerTextBig>HP Color LaserJet 4700 Printers</SPAN> </TD> <TD style="PADDING-RIGHT: 5px; TEXT-ALIGN: right"> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD style="FONT-SIZE: 10px; HEIGHT: 12px" colSpan=4> </TD></TR> <TR> <TD colSpan=4> <DIV style="PADDING-LEFT: 4px"> <DIV class=hpSelectedTab onclick="if(divClickEnabled) location.replace('this.LCDispatcher?nav=hp.DeviceStatus')"><IMG class=tabLeftNotch alt="" src="TEP05007_files/selectedTabNotchLeft.png"><IMG style="LEFT: -10px; VERTICAL-ALIGN: bottom; POSITION: relative; TOP: 1px" alt="" src="TEP05007_files/selectedTabTransitionLeft.png"><A class=hpSelectedTabLabel onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.DeviceStatus">Information</A><IMG style="LEFT: 10px; VERTICAL-ALIGN: bottom; POSITION: relative; TOP: 1px" alt="" src="TEP05007_files/selectedTabTransitionRight.png"><IMG class=tabRightNotch alt="" src="TEP05007_files/selectedTabNotchRight.png"></DIV> <DIV class=hpUnselectedTab onclick="if(divClickEnabled) location.replace('this.LCDispatcher?nav=hp.ConfigDevice')"><IMG class=tabLeftNotch alt="" src="TEP05007_files/unselectedTabNotchLeft.png"><A class=hpUnselectedTabLabel onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.ConfigDevice">Settings</A><IMG class=tabRightNotch alt="" src="TEP05007_files/unselectedTabNotchRight.png"></DIV> <DIV class=hpUnselectedTab onclick="if(divClickEnabled) location.replace('/hp/jetdirect')"><IMG class=tabLeftNotch alt="" src="TEP05007_files/unselectedTabNotchLeft.png"><A class=hpUnselectedTabLabel onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/jetdirect">Networking</A><IMG class=tabRightNotch alt="" src="TEP05007_files/unselectedTabNotchRight.png"></DIV></DIV></TD></TR> <TR> <TD class=hpTabExtender colSpan=4> <DIV class=hpTabExtender></DIV></TD></TR> <TR> <TD style="WIDTH: 160px"> <DIV class=hpButtonNavigation> <DIV class=hpButtonSpacer></DIV> <DIV class=hpNavigationButtonselected onclick="if(divClickEnabled) location.href='this.LCDispatcher?nav=hp.DeviceStatus'"><A class=hpButtonNavigationLink onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.DeviceStatus">Device Status</A> </DIV> <DIV class=hpNavigationButtonUnselected onclick="if(divClickEnabled) location.href='this.LCDispatcher?nav=hp.Config'"><A class=hpButtonNavigationLink onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.Config">Configuration Page</A> </DIV> <DIV class=hpNavigationButtonUnselected onclick="if(divClickEnabled) location.href='this.LCDispatcher?nav=hp.Supplies'"><A class=hpButtonNavigationLink onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.Supplies">Supplies Status</A> </DIV> <DIV class=hpNavigationButtonUnselected onclick="if(divClickEnabled) location.href='this.LCDispatcher?nav=hp.EventLog'"><A class=hpButtonNavigationLink onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.EventLog">Event Log</A> </DIV> <DIV class=hpNavigationButtonUnselected onclick="if(divClickEnabled) location.href='this.LCDispatcher?nav=hp.Usage'"><A class=hpButtonNavigationLink onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.Usage">Usage Page</A> </DIV> <DIV class=hpNavigationButtonUnselected onclick="if(divClickEnabled) location.href='this.LCDispatcher?nav=hp.Diagnostics'"><A class=hpButtonNavigationLink onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.Diagnostics">Diagnostics Page</A> </DIV> <DIV class=hpNavigationButtonUnselected onclick="if(divClickEnabled) location.href='this.LCDispatcher?nav=hp.DeviceInfo'"><A class=hpButtonNavigationLink onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.DeviceInfo">Device Information</A> </DIV> <DIV class=hpNavigationButtonUnselected onclick="if(divClickEnabled) location.href='this.LCDispatcher?nav=hp.ControlPanel'"><A class=hpButtonNavigationLink onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.ControlPanel">Control Panel</A> </DIV> <DIV class=hpNavigationButtonUnselected onclick="if(divClickEnabled) location.href='this.LCDispatcher?nav=hp.Print'"><A class=hpButtonNavigationLink onmouseover=divClickEnabled=false; onmouseout=divClickEnabled=true; href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.Print">Print</A> </DIV> <DIV style="TEXT-ALIGN: right"><IMG style="LEFT: 1px; VERTICAL-ALIGN: bottom; POSITION: relative" alt="" src="TEP05007_files/curveTransition2.png"></DIV></DIV> <DIV style="HEIGHT: 15px"></DIV> <DIV class=hpOtherLinksNavigation> <DIV class=hpOtherLinksBanner>Other Links</DIV> <DIV class=hpOtherLinksContent> <DIV style="PADDING-BOTTOM: 2px"><A id=lnkOtherLink0 onclick="target = new Date().valueOf().toString(); if (window.open) window.open('this.LCDispatcher?nav=hp.InstantSupport',target,'resizable=yes,scrollbars=yes,menubar=yes,location=yes,toolbar=yes,status=yes'); return false;" href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.InstantSupport">hp instant support</A> </DIV> <DIV style="PADDING-BOTTOM: 2px"><A id=lnkOtherLink1 onclick="target = new Date().valueOf().toString(); if (window.open) window.open('this.LCDispatcher?nav=hp.OrderSupplies',target,'resizable=yes,scrollbars=yes,menubar=yes,location=yes,toolbar=yes,status=yes'); return false;" href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.OrderSupplies">Order Supplies</A> </DIV> <DIV style="PADDING-BOTTOM: 2px"><A id=lnkOtherLink2 onclick="target = new Date().valueOf().toString(); if (window.open) window.open('http://productfinder.support.hp.com/tps/Hub?h_product=Q7492A&h_lang=en&h_cc=us&h_tool=prodhomes',target,'resizable=yes,scrollbars=yes,menubar=yes,location=yes,toolbar=yes,status=yes'); return false;" href="http://productfinder.support.hp.com/tps/Hub?h_product=Q7492A&h_lang=en&h_cc=us&h_tool=prodhomes">Product Support</A> </DIV></DIV></DIV></TD> <TD class=hpContentMargin><IMG style="VERTICAL-ALIGN: top" alt="" src="TEP05007_files/curveTransition1.png"></TD> <TD style="WIDTH: auto"> <DIV class=hpContentArea><A name=skipnavigation></A> <DIV> <DIV class=hpPageTitle id=Page1>Device Status </DIV> <FORM id=deviceStatusPage action=this.LCDispatcher?nav=hp.DeviceStatus method=post> <DIV> <DIV id=Section1 style="FONT-SIZE: 1px; HEIGHT: 5px"></DIV> <DIV id=Text1 style="FONT-SIZE: 14px; PADDING-BOTTOM: 0.7em; PADDING-TOP: 0.7em">ORDER MAGENTA CARTRIDGE LESS THAN 1400 PAGES </DIV> <script type=text/javascript> <!-- function displayHelpWindow() { w=window.open("", "ControlPanelHelp", "height=500,width=450,location=no,scrollbars,resizable,dependent"); w.document.open(); w.document.write('<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "htp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" ><head><title> </title></head><body>'); w.document.write('<table style="border: none; width: 100%" cellspacing="0" cellpadding="15" summary="This table displays the steps to resolve the device problem: first column is the text; second column contains an animated graphic corresponding to the resolution text">'); w.document.write('<tr><th id="t1" style="width:60%;">Problem Resolution Text</th><th id="t2" style="width:40%;"> </th></tr>'); w.document.write('<tr><td headers="t1" style="width:60%;">'); w.document.write('Order HP part: MAGENTA CARTRIDGE: HP Q5953A'); w.document.write('</td><td headers="t2" style="text-align: center;">'); w.document.write(' '); w.document.write('</td></tr>'); w.document.write('<tr><td headers="t1" style="width:60%;">'); w.document.write('Pages remaining for this supply has reached the low threshold. Estimated pages remaining is based on historical page coverage of this supply.'); w.document.write('</td><td headers="t2" style="text-align: center;">'); w.document.write(' '); w.document.write('</td></tr>'); w.document.write('<tr><td headers="t1" style="width:60%;">'); w.document.write('Printing will continue until a supply needs to be replaced.'); w.document.write('</td><td headers="t2" style="text-align: center;">'); w.document.write(' '); w.document.write('</td></tr>'); w.document.write('</table></body></html>'); w.document.close(); } --> </SCRIPT> <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none" summary=""> <TBODY> <TR> <TD style="VERTICAL-ALIGN: middle; WIDTH: auto"><SPAN class=hpPageText id=Text2>Help</SPAN></TD> <TD style="VERTICAL-ALIGN: middle; TEXT-ALIGN: left"><A class=hpPageLink href="java script:displayHelpWindow();"><IMG class=hpPageImage title="On-line help: opens a new window" alt="On-line help: opens a new window" src="TEP05007_files/question.gif"></A></TD></TR></TBODY></TABLE> <TABLE style="MARGIN-TOP: 0.7em; WIDTH: auto"> <TBODY> <TR> <TD style="VERTICAL-ALIGN: middle"><INPUT title=Pause/Resume type=image alt=* src="TEP05007_files/go_button2green.gif" name=btnGo> </TD> <TD style="VERTICAL-ALIGN: middle; WHITE-SPACE: nowrap"> <DIV id=Text3 style="PADDING-LEFT: 3px; FONT-SIZE: 12px; VERTICAL-ALIGN: middle; MARGIN-RIGHT: 15px">Pause/Resume </DIV></TD> <TD style="VERTICAL-ALIGN: middle"><INPUT title=Continue type=image alt=* src="TEP05007_files/go_button2greencheck.gif" name=btnContinue> </TD> <TD style="VERTICAL-ALIGN: middle; WHITE-SPACE: nowrap"> <DIV id=Text4 style="PADDING-LEFT: 3px; FONT-SIZE: 12px; VERTICAL-ALIGN: middle; MARGIN-RIGHT: 15px">Continue </DIV></TD></TR></TBODY></TABLE></DIV> <DIV> <DIV class=hpSection id=Section2>Supplies </DIV><SPAN id=Text5 style="FONT-WEIGHT: bold">Toners: (% remaining)</SPAN> <TABLE class=hpTable> <TBODY> <TR> <TD style="VERTICAL-ALIGN: bottom"> <DIV class=hpGasGaugeBlock><SPAN class=hpConsumableBlockHeaderText>Black Cartridge 83%</SPAN> <DIV class=hpGasGaugeBorder> <DIV style="MARGIN: 0px; WIDTH: 83%; HEIGHT: 21px; BACKGROUND-COLOR: #000000"> <DIV style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 80%"> </DIV></DIV></DIV></DIV></TD> <TD style="VERTICAL-ALIGN: bottom"> <DIV class=hpGasGaugeBlock><SPAN class=hpConsumableBlockHeaderText>Cyan Cartridge 54%</SPAN> <DIV class=hpGasGaugeBorder> <DIV style="MARGIN: 0px; WIDTH: 54%; HEIGHT: 21px; BACKGROUND-COLOR: #00ffff"> <DIV style="BORDER-RIGHT: #00ffff 1px solid; BORDER-TOP: #00ffff 1px solid; BORDER-LEFT: #00ffff 1px solid; BORDER-BOTTOM: #00ffff 1px solid; HEIGHT: 80%"> </DIV></DIV></DIV></DIV></TD> <TD style="VERTICAL-ALIGN: bottom"> <DIV class=hpGasGaugeBlock><SPAN class=hpConsumableBlockHeaderText>Magenta Cartridge 6%</SPAN> <DIV class=hpGasGaugeBorder> <DIV style="MARGIN: 0px; WIDTH: 6%; HEIGHT: 21px; BACKGROUND-COLOR: #ff00ff"> <DIV style="BORDER-RIGHT: #ff00ff 1px solid; BORDER-TOP: #ff00ff 1px solid; BORDER-LEFT: #ff00ff 1px solid; BORDER-BOTTOM: #ff00ff 1px solid; HEIGHT: 80%"> </DIV></DIV></DIV></DIV></TD> <TD style="VERTICAL-ALIGN: bottom"> <DIV class=hpGasGaugeBlock><SPAN class=hpConsumableBlockHeaderText>Yellow Cartridge 89%</SPAN> <DIV class=hpGasGaugeBorder> <DIV style="MARGIN: 0px; WIDTH: 89%; HEIGHT: 21px; BACKGROUND-COLOR: #ffff00"> <DIV style="BORDER-RIGHT: #ffff00 1px solid; BORDER-TOP: #ffff00 1px solid; BORDER-LEFT: #ffff00 1px solid; BORDER-BOTTOM: #ffff00 1px solid; HEIGHT: 80%"> </DIV></DIV></DIV></DIV></TD></TR> <TR> <TD style="VERTICAL-ALIGN: bottom"> <DIV class=hpGasGaugeBlock><SPAN class=hpConsumableBlockHeaderText>Image Transfer Kit 65%</SPAN> <DIV class=hpGasGaugeBorder> <DIV style="MARGIN: 0px; WIDTH: 65%; HEIGHT: 21px; BACKGROUND-COLOR: #000000"> <DIV style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 80%"> </DIV></DIV></DIV></DIV></TD> <TD style="VERTICAL-ALIGN: bottom"> <DIV class=hpGasGaugeBlock><SPAN class=hpConsumableBlockHeaderText>Image Fuser Kit 72%</SPAN> <DIV class=hpGasGaugeBorder> <DIV style="MARGIN: 0px; WIDTH: 72%; HEIGHT: 21px; BACKGROUND-COLOR: #000000"> <DIV style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid; HEIGHT: 80%"> </DIV></DIV></DIV></DIV></TD></TR></TBODY></TABLE> <DIV id=Text6 style="PADDING-TOP: 5px; TEXT-ALIGN: center"> <A class=hpPageLink href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.Supplies"><SPAN id=Text7>Supplies Details</SPAN></A> </DIV></DIV> <DIV> <DIV class=hpSection id=Section3>Media </DIV> <TABLE class=hpTable summary="This table displays the status of input trays and output bins"> <TBODY> <TR> <TH class=hpTableHeader id=InOut style="WIDTH: 20%"><SPAN class=hpPageText id=Text8>Input/Output</SPAN></TH> <TH class=hpTableHeader id=Status style="WIDTH: 20%"><SPAN class=hpPageText id=Text9>Status</SPAN></TH> <TH class=hpTableHeader id=Capacity style="WIDTH: 20%"><SPAN class=hpPageText id=Text10>Capacity</SPAN></TH> <TH class=hpTableHeader id=Size style="WIDTH: 20%"><SPAN class=hpPageText id=Text11>Size</SPAN></TH> <TH class=hpTableHeader id=Type style="WIDTH: 20%"><SPAN class=hpPageText id=Text12>Type</SPAN></TH></TR> <TR> <TD headers=InOut><SPAN class=hpPageText id=Text13>Tray 1</SPAN></TD> <TD headers=Status><IMG class=hpPageImage title="" alt="" src="TEP05007_files/binEMPTY.gif"><SPAN class=hpPageText id=Text14> Empty</SPAN></TD> <TD headers=Capacity><SPAN class=hpPageText id=Text15>100 Sheets</SPAN></TD> <TD headers=Size><SPAN class=hpPageText id=Text16>ANY SIZE</SPAN></TD> <TD headers=Type><SPAN class=hpPageText id=Text17>ANY TYPE</SPAN></TD></TR> <TR> <TD headers=InOut><SPAN class=hpPageText id=Text18>Tray 2</SPAN></TD> <TD headers=Status><IMG class=hpPageImage title="" alt="" src="TEP05007_files/binOK.gif"><SPAN class=hpPageText id=Text19> OK</SPAN></TD> <TD headers=Capacity><SPAN class=hpPageText id=Text20>500 Sheets</SPAN></TD> <TD headers=Size><SPAN class=hpPageText id=Text21>LETTER</SPAN></TD> <TD headers=Type><SPAN class=hpPageText id=Text22>PLAIN</SPAN></TD></TR> <TR> <TD headers=InOut><SPAN class=hpPageText id=Text23>STANDARD TOP BIN</SPAN></TD> <TD headers=Status><IMG class=hpPageImage title="" alt="" src="TEP05007_files/binOK.gif"><SPAN class=hpPageText id=Text24> OK</SPAN></TD> <TD headers=Size><SPAN class=hpPageText id=Text25>N/A</SPAN></TD> <TD headers=Type><SPAN class=hpPageText id=Text26>N/A</SPAN></TD></TR></TBODY></TABLE> <DIV id=Text27 style="PADDING-TOP: 5px; TEXT-ALIGN: center"> <A class=hpPageLink href="http://10.100.13.11/hp/device/this.LCDispatcher?nav=hp.ConfigDevice"><SPAN id=Text28>Change Settings</SPAN></A> </DIV></DIV> <DIV> <DIV class=hpSection id=Section4>Capabilities </DIV><SELECT style="WIDTH: auto" size=7 name=SOne> <OPTION value=x>Printer Serial Number: JPGLB04398</OPTION> <OPTION value=x>Firmware Datecode: 20050805 46.028.0</OPTION> <OPTION value=x>CARD SLOT Storage: 2 MB Capacity</OPTION> <OPTION value=x>RAM DISK Storage: 49 MB Capacity</OPTION> <OPTION value=x>DIMM Slot 1: Empty</OPTION> <OPTION value=x>DIMM Slot 2: 128 MB DDR</OPTION> <OPTION value="">Card Slot 1: 32 MB F/W FLASH: 2 MB</OPTION> <OPTION value="">Card Slot 2: Empty</OPTION> <OPTION value="">Card Slot 3: Empty</OPTION> <OPTION value=x>Embedded Jetdirect : YES</OPTION></SELECT> </DIV></FORM><BR> <DIV style="WIDTH: 580px"></DIV></DIV><!--end hpContentArea--></DIV></TD> <TD class=hpContentMargin> </TD></TR> <TR> <TD class=hpLogo> </TD> <TD class=hpContentMargin> </TD> <TD> </TD> <TD class=hpContentMargin> </TD></TR></TBODY></TABLE></DIV></BODY></HTML>
Moscar Posted June 21, 2007 Author Posted June 21, 2007 give me a minuteZacharotI could get you the actual file - tep05007.htm
Zacharot Posted June 21, 2007 Posted June 21, 2007 When I use IE to pull the file, it's butchering it, I recognize what it's doing, but it needs to be coded to work around it, so I need a little longer I shouldnt need the original file, as I'm opening it with IE anyway.
Moscar Posted June 21, 2007 Author Posted June 21, 2007 When I use IE to pull the file, it's butchering it, I recognize what it's doing, but it needs to be coded to work around it, so I need a little longer I shouldnt need the original file, as I'm opening it with IE anyway.I really have to credit some of you guys, take all the time you need. You could do in minutes what I can't do in days !I am going to keep going through the tutorials, I would like to learn.Thanks
Zacharot Posted June 21, 2007 Posted June 21, 2007 #include <IE.au3> #include <String.au3> Global $Slot[7][3] Local $aFile $oIE = _IECreate() _IENavigate($oIE, @ScriptDir&"\Cartridge.txt") ; web address $FindFirstClass = "class=hpConsumableBlockHeaderText>" $FindFirstPercent = "Cartridge&nbsp;&nbsp;" Sleep(1000) $body = _IEDocReadHTML($oIE) $aLines = StringSplit($body,@CRLF,1) $num = 0 For $i = 1 to $aLines[0] $sline = $aLines[$i] If StringInStr($sline, $FindFirstClass) Then ConsoleWrite($i&@LF) $SlotT = StringTrimLeft($sline,StringLen($FindFirstClass)) $Percent = StringTrimLeft($aLines[$i+1],StringLen($FindFirstPercent)) $PercentPos = StringInStr($Percent,"%") $Percent = StringLeft($Percent,$PercentPos - 1) $Slot[0][0] = $Slot[0][0] + 1 $Slot[$Slot[0][0]][1]= $SlotT $Slot[$Slot[0][0]][2]= $Percent $i+=1 EndIf Next For $i = 1 to $Slot[0][0] ConsoleWrite($Slot[$i][1]&":") ConsoleWrite($Slot[$i][2]&@LF) Next
Zacharot Posted June 21, 2007 Posted June 21, 2007 revised, no more IE window, we're getting there! #include <Array.au3> #include <File.au3> #include <INet.au3> Global $Slot[7][3] Local $aLines $FindFirstClass = "class=hpConsumableBlockHeaderText>" $FindFirstPercent = "Cartridge " $source = _INetGetSource("http://localhost/index.html") $aLines = StringSplit($source,@CRLF,1) $num = 0 For $i = 1 to $aLines[0] $sline = $aLines[$i] If StringInStr($sline, $FindFirstClass) Then ConsoleWrite($i&@LF) $SlotT = StringTrimLeft($sline,StringLen($FindFirstClass)) $Percent = StringTrimLeft($aLines[$i+1],StringLen($FindFirstPercent)) $PercentPos = StringInStr($Percent,"%") $Percent = StringLeft($Percent,$PercentPos - 1) $Slot[0][0] = $Slot[0][0] + 1 $Slot[$Slot[0][0]][1]= $SlotT $Slot[$Slot[0][0]][2]= $Percent $i+=1 EndIf Next For $i = 1 to $Slot[0][0] ConsoleWrite($Slot[$i][1]&":") ConsoleWrite($Slot[$i][2]&@LF) Next
Zacharot Posted June 21, 2007 Posted June 21, 2007 (edited) you'll need excelcom from herehttp://www.autoitscript.com/forum/index.ph...mp;hl=Excel+UDFthen the script should go something like this.. I say something, because I dont have excel installed, if you cant make this work, I'll dig it up, but not tonight, it'll have to slide till tomorrow. you can put the au3 (UDF) in the same Dir as your script and it'll work#include <Array.au3> #include <File.au3> #include <INet.au3> #include <ExcelCOM_UDF.au3> Global $Slot[7][3] Local $aLines $FindFirstClass = "class=hpConsumableBlockHeaderText>" $FindFirstPercent = "Cartridge " $source = _INetGetSource("http://localhost/index.html") $aLines = StringSplit($source,@CRLF,1) $num = 0 For $i = 1 to $aLines[0] $sline = $aLines[$i] If StringInStr($sline, $FindFirstClass) Then ConsoleWrite($i&@LF) $SlotT = StringTrimLeft($sline,StringLen($FindFirstClass)) $Percent = StringTrimLeft($aLines[$i+1],StringLen($FindFirstPercent)) $PercentPos = StringInStr($Percent,"%") $Percent = StringLeft($Percent,$PercentPos - 1) $Slot[0][0] = $Slot[0][0] + 1 $Slot[$Slot[0][0]][1]= $SlotT $Slot[$Slot[0][0]][2]= $Percent $i+=1 EndIf Next Local $oExcel = _ExcelBookOpen("Path to .xls",0) For $i = 1 to $Slot[0][0] _ExcelWriteCell($oExcel, $Slot[$i][2], 3, 3+$i) ConsoleWrite($Slot[$i][1]&":") ConsoleWrite($Slot[$i][2]&@LF) Next _ExcelBookSave($oExcel) _ExcelBookClose($oExcel) Edited June 21, 2007 by Zacharot
Moscar Posted June 21, 2007 Author Posted June 21, 2007 Really sweet work, I have the ExcelCOM.auf in the same dir as your script. Not working just yet, but I will keep trying. Thanks for the effort, I might need some more of your excellence. Talk tomorrow. Moscar
Zacharot Posted June 21, 2007 Posted June 21, 2007 try this out expandcollapse popup#include <Array.au3> #include <File.au3> #include <INet.au3> #include <ExcelCOM_UDF.au3> ;a zenlike method of getting a list of printer levels Local $Printers[4] = [3,"http://192.168.1.101/File.html","http://192.168.1.102/File.html","http://192.168.1.103/File.html"] For $p = 1 to $Printers[0] Local $firstRow = 4, $firstColumn = 4 Local $Slot[7][3] Local $aLines $FindFirstClass = "class=hpConsumableBlockHeaderText>" $FindFirstPercent = "Cartridge " $source = _INetGetSource($Printers[$p]) $aLines = StringSplit($source,@CRLF,1) $num = 0 For $i = 1 to $aLines[0] $sline = $aLines[$i] If StringInStr($sline, $FindFirstClass) Then ConsoleWrite($i&@LF) $SlotT = StringTrimLeft($sline,StringLen($FindFirstClass)) $Percent = StringTrimLeft($aLines[$i+1],StringLen($FindFirstPercent)) $PercentPos = StringInStr($Percent,"%") $Percent = StringLeft($Percent,$PercentPos - 1) $Slot[0][0] = $Slot[0][0] + 1 $Slot[$Slot[0][0]][1]= $SlotT $Slot[$Slot[0][0]][2]= $Percent $i+=1 EndIf Next $Slot[0][0] = 0 Local $oExcel = _ExcelBookOpen("Path to .xls",0) For $i = 1 to $Slot[0][0] _ExcelWriteCell($oExcel, $Slot[$i][2], $firstRow+$p-1, $firstColumn+$i-1) ConsoleWrite($Slot[$i][1]&":") ConsoleWrite($Slot[$i][2]&@LF) Next _ExcelBookSave($oExcel) _ExcelBookClose($oExcel) Next
Moscar Posted June 21, 2007 Author Posted June 21, 2007 I'm not sure about this line Local $Printers[4] = [3,"http://192.168.1.101/File.html","http://192.168.1.102/File.html","http://192.168.1.103/File.html"] Since I'm not at work, not on my network, all I have is a htm file. I saved it at work and emailed it just to look into this. Looks to me I have to try this at work and modify the ips with my actual printer ips. I am in Heat Administration class until Friday, I can try this out Monday. Man I wish I could take pleasure in what you did tonight, zenlike is right .......whammy ! Thanks Zacharot
Zacharot Posted June 21, 2007 Posted June 21, 2007 (edited) http://www.ritlabs.com/en/products/tinyweb/great little server, it requires an index.html, so just name your file index.html! you can change that line toLocal $Printers[2] = [1,"http://localhost/index.html"]using tiny, you should get results!dont forget thishttp://people.freenet.de/ralph.becker/tinybox/tinybox is a gui, since tinyweb is command line, tinybox really helps Edited June 21, 2007 by Zacharot
Zacharot Posted June 21, 2007 Posted June 21, 2007 this code works for me: #include <Array.au3> #include <File.au3> #include <INet.au3ÝÂÚ[ÛYH Ñ^Ù[ÓÓWÕQ]LÉÝÂØH[ZÙHY]ÙÙÙ][ÈHÝb&çFW"ÆWfVÇ0¤Æö6Âb33cµ&çFW'5³%ÒÒ³ÂgV÷C¶GG¢òó"ãcããöæà¹¡Ñµ°ÅÕ½Ðít)½ÈÀÌØíÀôÄѼÀÌØíAÉ¥¹ÑÉÍlÁt(%1½°ÀÌØí¥ÉÍÑI½Üô4, $firstColumn = 4 Local $Slot[7][3] Local $aLines $Ñ[ÝÛÜÈH ][ÝØÛÜÏZÛÛÝ[XXPØÚÒXY^ ÝÉ][ÝÈIÌÍfæDf'7EW&6VçBÒgV÷C´6'G&FvRf×¶æ'7²f×¶æ'7²gV÷C° b33c·6÷W&6R}%9ÑÑM½ÕÉ ÀÌØíAÉ¥¹ÑÉÍlÀÌØíÁt¤(%%ÉɽÈQ¡¸ ½¹Ñ¥¹Õ1½½À($ÀÌ;aLines = StringSplit($source,@CRLF,1) $num = 0 ConsoleWrite(&#ÍÜÛÝÙI[ÐBQÜ ÌÍÚHHHÈ ÌÍØS[ÖÌBBIÌÍÜÛ[HH Ìc¶ÆæW5²b33c¶Ð b7G&ætå7G"b33c·6ÆæRÂb33c´fæDf'7D6Æ72FVà $% ½¹Í½±]É¥Ñ ÀÌØí¤µÀí1¤($$$ÀÌØíM±½ÑPôMÑÉ¥¹QÉ¥µ1Ð ÀÌØíͱ¥¹StringLen($FindFirstClass)) $Percent = StringTrimLeft($aL[ÖÉÌÍÚJÌWKÝ[Ó[ ÌÍÑ[ÝÙ[ JBBBIÌÍÔÙ[ÜÈHÝætå7G"b33cµW&6VçBÂgV÷C²RgV÷C² b33cµW&6VçBÒ7G&ætÆVgBb33cµÉ¹Ð°ÀÌØíAɹÑA½Ì´Ä¤($$$ÀÌØíM±½ÑlÁulÁtôÀÌØíM±½ÑlÁulÁt¬Ä($$$036;Slot[$Slot[0][0]][1]= $SlotT $Slot[$Slot[0][0]][OH ÌÍÔÙ[BBIÌÍÚJÏLBBQ[YS^BSØØ[ ÌÍÛÑ^Ù[HÑ^Ù[&öö´÷VâgV÷C´3¢b3#µ&çFW'2çÇ2gV÷C²Ã f÷"b33c¶ÒFòb33cµ6Æ÷EÁulÁt($%}á±]É¥Ñ ±° ÀÌØí½á°°ÀÌØíM±½ÑlÀÌØí¥ulÉt°ÀÌØí¥ÉÍÑI½+$p-1, $firstColumn+$i-1) ConsoleWrite($Slot[$i]ÌWI[É][ÝÎ][ÝÊBBPÛÛÛÛUÜ]J ÌÍÔÛÝÉÌÍÚWVÌI[ÐBS^ôW6VÄ&ööµ6fRb33c¶ôW6V ôW6VÄ&öö´6Æ÷6Rb33c¶ôW6V b33cµ6Æ÷E³lÁtôÀ)9áÐ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now