
Zacharot
Active Members-
Posts
48 -
Joined
-
Last visited
Everything posted by Zacharot
-
here's my take: to store the Q&A properly, all you'd need is to convert the CR and LF into something else, then make a file with alternating pairs of questions, answers, example: Lightest atom? Hydrogen Which moderator tolerates idiocy the least? Valik see? then you load it into an array with _FileToArray(), or whatever it is, and access the question's by accessing the odd's (count is kept in 0, so first is at 1) and the answer is the next in the array simple enough? StringReplace($line,@CR,"|CR|") works well for me.
-
How to Unobfuscated file au3 obfuscated ?
Zacharot replied to renanzin22's topic in AutoIt General Help and Support
Shift+Delete He couldn't bear the sight of so much clean code, so now he codes in obfuscated code. -
You won with 28 moves! dont take that for skill, I got lucky on that one
-
Look in the help at StdOutRead, that should help ya
-
Guictrlcreatebutton returns a handle to the button, think of it as a reference number you can then move that number around like any other number, but you cant use it like a button, you need to pass that number to functions that do the work, like $text = guictrlgettext($1) $msg = GuiGetMsg() gets another handle, but this time to an event on a control, it returns ( I think ) the handle to the control, so you can do the comparisons. $msg[0] is when you have multiple windows, with controls on each, it allows you to pick your window (1,2,3,etc) then get the msg for that window. P.S. you need to understand functions, such as GuiCtrlCreateButton(), which RETURN data when you set them to a variable, you cant assign the action that the function does to the variable, just it's return value. example! it's fake, dont try it, it's just for explanation. $count = NumberOfProcsInASingleProcessorSystem() $count will equal 1
-
is this your entire code? I cant very well fix (or help fix) if you are only posting snippets of it. ERROR: ToChaos(): undefined function. and in fact, it's not defined.
-
once the first loop goes false, because $checksum is no longer valid, the code kicks out of the first loop and moves on to the second loop, that's all there is to it
-
erp
-
Hex means hexadecimal, or base 16, whereas decimal is base 10 when you count in decimal, it's 00,01,02,03,04,05,06,07,08,09.. repeat as 10,11,12, etc, but in hex it's.. 00,01,02,03,04,05,06,07,08,09,0A,0B,0C,0D,0E,0F, repeat as.. 10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F get it? 10 in hex, is 16 in decimal 20 in hex, is 32 in decimal FF in hex is 255 in decimal computers use the 0 as a number (fancy that) so it's actually counted in the first set as creating 16, such as 1-9 make base 10, because you need the 0 so 00 (or 0) through 255 is 256, so FF*FF*FF = FFFFFF, or 0xFFFFFF, or #FFFFFF (html) so in fact, FF*FF*FF (10*10*10 = 1000, same thing) equals 16777216
-
BATCH script... help me plz
Zacharot replied to HackerZer0's topic in AutoIt General Help and Support
mine is off on every computer I have, so I couldnt Actually test that, just crossing my fingers on that one. -
BATCH script... help me plz
Zacharot replied to HackerZer0's topic in AutoIt General Help and Support
$compname = InputBox("Comp Name?", "What is the computer name?") While 1 $message = InputBox("Message?","What is the message?") If $message = "" Then Exit Run('"' & @ComSpec & '" /c Net Send '&$compname&' "'&$message&'"', '', @SW_HIDE) WEnd -
$strComputer = InputBox("Computer name", "Enter the computer's name") $strProcessKill = InputBox("Prosess Name", "Enter the process you wish to stop") $strProcessKill="'"&$strProcessKill&"'" <----- NEEDED THIS BIT $objWMIService = Objget("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & $strComputer & "\root\cimv2") $colProcess = $objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = " & $strProcessKill ) For $objProcess in $colProcess $objProcess.Terminate() Next
-
I like WMI #include <Array.au3> Local $objWMIService, $objProcess, $colProcess, $strComputer, $strProcessKill Local $procs $strComputer = ".";replace with remote computer $objLoc = ObjCreate("wbemscripting.swbemlocator") $objLoc.Security_.privileges.addasstring("sedebugprivilege", true) $objWMIService = Objget("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & $strComputer & "\root\cimv2") $colProcess = $objWMIService.ExecQuery _ ("Select * from Win32_Process" ) For $objProcess in $colProcess ConsoleWrite($objProcess.CommandLine&@LF) Next Get process list and COMMAND LINE of all running processes on remote compy I only know of 1 program that will get you the command line arguments, ProcExp by sysinternals.
-
I think you are confusing a point. windows does intercept it at the lowest level, but it does also pass it. you just cant STOP it, you cant hook into the message queue lower than windows and intercept it before windows does. and it works for me on xp, look behind the taskmgr that pops up
-
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
Start in Autoit, start with that very script, and when you understand it, extend it, recode it, retool it, modify it, hack it. If you've ever programmed a cisco router, it's much the same, it's a script that goes from line to line, executing as it goes. I dont know if cisco has loops, but it's all just logic. follow the logic from line to line, Read it, as if it were english, and you will hopefully get it. I'm 24 -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
It outputs error messages into Scite, and error words into the xls if it cant find the printer, make a 3-4 item list, and make one address invalid to see what I mean. If you post me the code and the debug output in scite, I can tell you why you get the stuff. You could say we're all his friends, though I've never said one word to him. If you want to donate, feel free, maybe it'll get you and me on Jon and Valik's good side. -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
I would appreciate it if you could post back your final code, and the xls it outputs, maybe I can get an idea of why mine doesnt work for you, and get a better understanding of why yours DOES work for you. -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
I'm glad it works! I just wish I knew why that works for you, since it makes no sense to me, but hooray for you! and for me too! are you running the very newest autoit? I hadnt contemplated that you might not be. -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
I was indeed adding error messages #include <Array.au3> #include <File.au3> #include <INet.au3> #include <ExcelCOM_UDF.au3> ;a zenlike method of getting a list of printer levels Local $filePrinterList = "C:\PrinterList.txt" Local $fileXLS= "C:\Printers.xls" ; Local $FindFirstClass = "class=hpConsumableBlockHeaderText>" Local $FindFirstPercent = "Cartridge " ; Local $Printers Local $oExcel $oExcel = _ExcelBookOpen($fileXLS,0) If Not IsObj($oExcel) Or @error Then ConsoleWrite("Couldnt Call Excel"&@LF) Exit EndIf Local $firstRow = 3, $firstColumn = 4 $Printers = _ExcelReadArray($oExcel, $firstRow, $firstColumn-1, 256, 1, 1) If Not IsArray($Printers) Or @error Then ConsoleWrite("Couldnt get Printers List from Excel"&@LF) Exit EndIf $Printers[0]=0 $Printers[0]=_ExcelReadCell($oExcel,$firstRow-1,$firstColumn-1) If $Printers[0] = 0 Then ConsoleWrite("Couldnt get Printer Count, use: =COUNTA(C3:C1024) In C2 To get Count"&@LF) Exit EndIf For $p = 1 to $Printers[0] Local $Slot[7][3] Local $aLines $source = _INetGetSource($Printers[$p]) If $source = "" Or $source = " " Or @error Then _ExcelWriteCell($oExcel, "Error", $firstRow+$p-1, $firstColumn) ContinueLoop EndIf $aLines = StringSplit($source,@CRLF,1) If $aLines[0] <= 1 Then _ExcelWriteCell($oExcel, "Error", $firstRow+$p-1, $firstColumn) ContinueLoop EndIf $num = 0 For $i = 1 to $aLines[0] $sline = $aLines[$i] If StringInStr($sline, $FindFirstClass) Then ConsoleWrite("----------"&@LF) ConsoleWrite("Class Line:: "&$sline&" :: on line "&$i&" with var: "&$FindFirstClass&@LF) ConsoleWrite("Cartr Line:: "&$aLines[$i+1]&" :: on line "&$i+1&" with var: "&$FindFirstPercent&@LF) $SlotT = StringTrimLeft($sline,StringLen($FindFirstClass)) ConsoleWrite("Cartridge Type/Color is: "&$SlotT&@LF) $Percent = StringTrimLeft($aLines[$i+1],StringLen($FindFirstPercent)) $PercentPos = StringInStr($Percent,"%") $Percent = StringLeft($Percent,$PercentPos - 1) ConsoleWrite("Cartridge Percentage is: "&$Percent&@LF) $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] If Not _ExcelWriteCell($oExcel, $Slot[$i][2], $firstRow+$p-1, $firstColumn+$i-1) Or @error Then ConsoleWrite("Couldnt Write Data"&@LF) EndIf Next $Slot[0][0] = 0 Next If Not _ExcelBookSave($oExcel) Or @error Then ConsoleWrite("Couldnt Save"&@LF) EndIf _ExcelBookClose($oExcel) lots of error checking mostly, but lots of debug statuses for you. -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
my pleasure, I enjoy coding, even if I'll never use it myself -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
yes, use the newest, I'll halt my meddling long enough for you to try it If need be, I could code in some debug messages and just have you paste them back in here, but after you try this! -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
The computer world moves fast eh? I just made a new version that skips the text file and instead reads it out of your xls #include <Array.au3> #include <File.au3> #include <INet.au3> #include <ExcelCOM_UDF.au3> ;a zenlike method of getting a list of printer levels Local $fileXLS= "C:\Printers.xls" ; Local $FindFirstClass = "class=hpConsumableBlockHeaderText>" Local $FindFirstPercent = "Cartridge " ; Local $Printers Local $oExcel = _ExcelBookOpen($fileXLS,0) Local $firstRow = 3, $firstColumn = 4 $Printers = _ExcelReadArray($oExcel, $firstRow, $firstColumn-1, 256, 1, 1) $Printers[0]=_ExcelReadCell($oExcel,$firstRow-1,$firstColumn-1) For $p = 1 to $Printers[0] Local $Slot[7][3] Local $aLines $source = _INetGetSource($Printers[$p]) If @error Then ContinueLoop $aLines = StringSplit($source,@CRLF,1) $num = 0 ;ConsoleWrite($source&@LF) 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] _ExcelWriteCell($oExcel, $Slot[$i][2], $firstRow+$p-1, $firstColumn+$i-1) ConsoleWrite($Slot[$i][1]&":") ConsoleWrite($Slot[$i][2]&@LF) Next $Slot[0][0] = 0 Next _ExcelBookSave($oExcel) _ExcelBookClose($oExcel) Column C, the address column, needs to be something like this Row1: Address Row2: =COUNTA(C3:C1024) Row3: http://192.168.1.101/index.html Row4: http://192.168.1.102/index.html etc.... very zen. -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
I made more mods, mostly for clarity: #include <Array.au3> #include <File.au3> #include <INet.au3> #include <ExcelCOM_UDF.au3> ;a zenlike method of getting a list of printer levels Local $filePrinterList = "C:\PrinterList.txt" Local $fileXLS= "C:\Printers.xls" ; Local $FindFirstClass = "class=hpConsumableBlockHeaderText>" Local $FindFirstPercent = "Cartridge " ; Local $Printers Local $oExcel = _ExcelBookOpen($fileXLS,0) If Not _FileReadToArray($filePrinterList,$Printers) Then Exit For $p = 1 to $Printers[0] Local $firstRow = 4, $firstColumn = 4 Local $Slot[7][3] Local $aLines $source = _INetGetSource($Printers[$p]) If @error Then ContinueLoop $aLines = StringSplit($source,@CRLF,1) $num = 0 ;ConsoleWrite($source&@LF) 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] _ExcelWriteCell($oExcel, $Slot[$i][2], $firstRow+$p-1, $firstColumn+$i-1) ConsoleWrite($Slot[$i][1]&":") ConsoleWrite($Slot[$i][2]&@LF) Next $Slot[0][0] = 0 Next _ExcelBookSave($oExcel) _ExcelBookClose($oExcel) Make a file somewhere called whatever you want, and in it, put a list of printer URL's, as such: http://192.168.1.101/index.html http://192.168.1.102/index.html http://192.168.1.103/index.html http://192.168.1.104/index.html http://192.168.1.105/index.html make sure to leave no blanks at the top. the script will read this in to make it's array of printers. to rearrange the order in the xls, rearrange them in this list I think it makes it easier, dont you? I sped up the execution by not repeating the open and close also. -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
This line $Percent = StringTrimLeft($aLines[$i+1],StringLen($FindFirstPercent)) and precisely this bit StringLen($FindFirstPercent) cut off the , if you change the find string to just Cartridge, it wont cut off enough! -
Automating Printer Toner Levels
Zacharot replied to Moscar's topic in AutoIt General Help and Support
This code: #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³UÒÒ³BÂgV÷C¶GG¢òó"ãcããöæà¹¡Ñµ°ÅÕ½Ðì°ÅÕ½Ðí¡ÑÑÀè¼¼ÄäÈ¸ÄØà¸Ä¸ÄÀĽ¥¹à¹¡Ñµ°ÅÕ½Ðì°ÅÕ½Ðí¡ÑÑÀè¼¼Ääȸ68.1.101/index.html","http://192.168.1.101/index.html"] For ÌÍÜHHÈ ÌÍÔ[ÖÌBSØØ[ ÌÍÙÝÝÈH ÌÍÙÝÛÛ[âÒ@ Æö6Âb33cµ6Æ÷E³uÕ³5Ð Æö6Âb33c¶ÆæW0 b33c´fæDf'7D6Æ72ÒgÕ½Ðí±ÍÌõ¡Á ½¹ÍÕµ± ±½!ÉQáÐÐìÅÕ½Ðì($ÀÌØí¥¹¥ÉÍÑAɹÐôquot;Cartridge " $source = _INetGetSource(�ÍÔ[ÖÉÌÍÜJBRYÜ[ÛÛ[YSÛÜIÌÍØS[ÈHÝ[ÔÜBb33c·6÷W&6RÄ5$Äbà b33c¶çVÒÒ 6öç6öÆUw&FRb33c·6÷W&6Rf×´Äb%½ÈÀÌØí¤ôÄѼÀÌØí1¥¹ÍlÁt($$ÀÌØíͱ¥¹ôÀÌØí1¥¹ÍlÀÌØí¥t($If StringInStr($sline, $FindFirstClass) Then ConsoleWrite(ÚI[ÐBBBIÌÍÔÛÝHÝ[Õ[SY ÌÍÜÛ[KÝ[Ó[ ÌÍÑ[Df'7D6Æ72 b33cµW&6VçBÒ7G&æuG&ÔÆVgBb33c¶ÆæW5²b33c¶³ÒÅ7G&¹1¸ ÀÌØí¥¹¥ÉÍÑAɹФ¤($$$ÀÌØíAɹÑA½ÌôMÑÉ¥¹%¹MÑÈ ÀÌØíAÉnt,"%") $Percent = StringLeft($Percent,$PercentÜÈHJBBBIÌÍÔÛÝÌVÌHH ÌÍÔÛÝÌVÌH ÈBBBIÌÍÔÛÝÉÌÍÔÛݳճÕÕ³ÓÒb33cµ6Æ÷E@ b33cµ6Æ÷E²b33cµ6Æ÷E³Õ³ÕÕ³%ÓÒb33cµW&6Vç@ $ÀÌØí¤¬ôÄ($%¹%(%9áÐ($(%1½°ÀÌØí½á°ô}á± ½½=Á¸ ÅÕ½Ðíè92;Printers.xls",0) For $i = 1 to $Slot[0][0] _ExcelWriteÙ[ ÌÍÛÑ^Ù[ ÌÍÔÛÝÉÌÍÚWVÌK ÌÍÙÝÝÊÉÌÍÜLK ÌÍÙ'7D6öÇVÖâ²b33c¶Ó 6öç6öÆUw&FRb33cµ6Æ÷E²b33c¶Õ³ÒfײgV÷C³¢gV÷ì¤($% ½¹Í½±]É¥Ñ ÀÌØíM±½ÑlÀÌØí¥ulÉtµÀí1¤(%9áÐ(%}á± ½½MÙ À6;oExcel) _ExcelBookClose($oExcel) $Slot[0][0] = 0 Next Yields the attached file I am running Office 2k3, though that shouldnt make the slightest difference. Try my code exactly as it is, changing only the url's and the spreadsheet path, and post the xls if it's still messed up.