Jump to content

hawky358

Active Members
  • Posts

    86
  • Joined

  • Last visited

Everything posted by hawky358

  1. Ok if I understand correctly. First file: When you are in Scite you press F5 then you have a file D:\wpkg\Copy.exe which is a certain size. Second File: You compile your .au3 and then run it you get D:\wpkg\Copy.exe which is a different size. The reason for this is that when you hit F5 in Scite, it just compiles and runs the file, but when you select compile you are using UPX compression which makes the file smaller. If you turn off UPX the file will be the exact size as when you use F5 in Scite
  2. Look at the help for these functions GUICreate() GUICtrlCreateButton() Since you are a "noob" it would be best to read the help file. The example script in the GUICtrlCreateButton() section in the help already has a two button menu, just work off that. I don't think anyone will help you with this since there should be hundreds of examples on the forums already as well.
  3. Can you perform any network based action via Autoit? Try doing a ping() ... Maybe firewall is blocking it? I know the inet.... functions are dependant on Internet Explorer (Not sure about _Inet..., haven't checked yet). Does your Internet Explorer work properly?
  4. Hey There's something else you can do as well, which will require minimal editing (If you want to keep the excel method for some reason). Just change the string into a pointer Global $handleBrowser = ClipGet() $handleBrowser = Ptr($handleBrowser) or just Global $handleBrowser = Ptr(ClipGet())
  5. Hey If anyone is interested there's a autoit function which returns this: DllCall('kernel32.dll', 'int', 'GetTickCount') _Date_Time_GetTickCount()
  6. That should work fine. The only thing that would prevent the removal is an open file within the path. Since it deletes when your script ends, check if your script doesn't have an open filehandle when you're trying to delete the folder.
  7. This is your problem Global $handleBrowser = ClipGet() ... ... WinActivate($handleBrowser) When you copy the handle from the clipboard the type is "String". What happens then when you use WinActivate() is that it looks for a window with the title 0x......... Do this and you'll see what I mean ConsoleWrite(VarGetType($handleBrowser)) What you need it to be is a pointer So the best way to do it is to store the handle in a variable from the start instead of pasting it then copying it (Seems like a roundabout method) You'll see here the vartype is a ptr (Pointer) Opt("WinTitleMatchMode", 2) $hndl = WinGetHandle("Internet") ConsoleWrite(VarGetType($hndl)) WinActivate($hndl) If you must use the copy method (strings) then use the method suggested by jfcby (Winlist then match the handles to the strings) Edit:Note: I added consolewrites, if you don't use Scite the change them to messageboxes.
  8. Cool. This is probably more robust as well. The net stats shows the time when the net service started, so if for some reason it's restarted or doesn't run it will show incorrectly. Thanks GEOSoft / SmOke_N
  9. THere's a sticky on the main page of this forum ...
  10. Yea, I guess this is my bad, I like using consolewrite for debugging. Like GEOSoft said just make it msgbox(0,"Time?",$boottime)
  11. Oh I didn't see you changed the code there. It's supposed to be Exitloop. (You don't want to quit you just want out of the while loop) The @error is supposed to be set, it reads everything once it reaches the end it sets @error. (since the net program closes after giving the output)
  12. It should set @error, just check your consolebox if the boottime shows there. Edit: Consolebox [Not consolebox() ]
  13. Hey GEOSoft Can you try net stats workstation ? Apparently it's a Vista issue (srv), but I'm not running Vista anywhere.
  14. Hmm interesting. I've never seen it returning an incorrect date. What system was that on? (OS & SP)?
  15. Hey One method would be to have an ini/txt file (or even a registry entry) which logs what the boot time was when the script was last run. ex. When you run the script, you check at what time the current Windows session started (Uptime), if this session is the same as the session in the log file/registry/whatever then it is not the first run. Here's how you can get the time at which your PC booted into Windows. (Maybe there's a UDF or function in Autoit (Anyone know of it??) #include <Constants.au3> $out = Run("net stats srv","",@SW_hide,$STDOUT_CHILD) local $output While 1 $output &= StdoutRead($out) If @error Then ExitLoop Wend $start = StringInStr($output,"Statistics since") $end = StringInStr($output,@CR,-1,1,$start) $boottime = StringMid($output,$start,$end-$start) $boottime = StringReplace($boottime,"Statistics since ","") ConsoleWrite($boottime) ;Write this boottime into ini/txt I just made it a consolewrite so you can see what the output is ...
  16. Yes, you can very easily do all those. I suggest you read more on the functions/topics (in the help file) I post with the numbers. 2- Run()/ winwaitactive() 1- fileopen() / fileread() / filereadline() 3- see (1) / send() / controlsend() 4- see (1) / filewriteline() / _sql... functions (for db) 5- see (1) / (3) Your question is a very common occurance in these forums as well I have no doubt if you search (even just the last few days) you'll find a workable solution to everything you want to do.
  17. Like I said, you use run() with $STDIN_CHILD, $STDOUT_CHILD Here you go, just take note that I used enter as the send hotkey here and hotkeys are global even when the window is not focused, you may want to use another way but I just used it for the example. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <Constants.au3> HotKeySet("{ENTER}","sendtocmd") GUICreate("Promt GUI DEMO") $in = GUICtrlCreateInput("",10,300,300) $out = GUICtrlCreateEdit("",10,10,350,250, $ES_READONLY+$WS_VSCROLL) GUICtrlSetBkColor(-1,0x000000) GUICtrlSetColor(-1,0xffffff) GUISetState() $cmd = Run("cmd","",@SW_HIDE, $STDIN_CHILD+$STDOUT_CHILD ) local $disp,$dispold while 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE Then ProcessClose("cmd.exe") Exit EndIf sleep(10) $disp &= StdoutRead($cmd) if $disp <> $dispold Then ;prevent refresh flash $dispold = $disp GUICtrlSetData($out,$disp,1) If @error Then ExitLoop EndIf WEnd func sendtocmd() StdinWrite($cmd, GUICtrlRead($in) & @CRLF) GUICtrlSetData($in,"") EndFunc
  18. Look at the help for Run, specifically look at the options: $STDIN_CHILD, $STDOUT_CHILD and similar. They allow you to capture streams from the run. I may write some sample code a little later if someone else hasn't yet, but this should get you on the right track.
  19. Hey Your original code was pretty close Try this. Note I used a left click, just check if the left click selects it then change it to right click. Opt("Wintitlematchmode",2) ControlClick("Administrator","","[CLASS:SysTreeView32; INSTANCE:1]","left",1,76,56) If the right click doesn't bring up the context menu the you can either do the task with only left click (i.e. using the edit or file menu etc) or you can try this to simulate Shift+F10 after left click (I know you said it doesn't accept keystrokes, but just try and see) Opt("Wintitlematchmode",2) ControlClick("Administrator","","[CLASS:SysTreeView32; INSTANCE:1]","left",1,76,56) ControlSend("Administrator","","[CLASS:SysTreeView32; INSTANCE:1]","+{F10}") Edit: Next time just make the image a jpg instead of bmp please (150k vs 3mb)
  20. Since $outHeaderSum and $outCheckSum are pointers (outputs) you need to define them as such for Autoit to use them. $outHeaderSum = DLLStructCreate("dword") ;Here you create a structure for a pointer to write into $outCheckSum = DLLStructCreate("dword") Dim $input = '' & @ScriptDir & "\1.xls" & '' ;Dim $input = @ScriptDir & "\1.exe" ;Dim $input = "1.exe" _MapFileAndCheckSum($input) MsgBox( 0, "HeaderSum:", $outHeaderSum) MsgBox( 0, "CheckSum:", $outCheckSum) Func _MapFileAndCheckSum($input) Local $aResult $aResult = DllCall("imagehlp.dll", "long" , "MapFileAndCheckSum" , "str" ,$input , "ptr" ,DllStructGetPtr($outHeaderSum), "ptr" ,DllStructGetPtr($outCheckSum)) ; NOTE THAT THE TYPES CHANGED TO ptr If @error Then Return SetError(@error, 0, 0) MsgBox( 0, "$aResult[0] returned:", $aResult[0]) $outHeaderSum = DllStructGetData($outHeaderSum, 1) ;<Here you read out of your structure again $outCheckSum = DllStructGetData($outCheckSum,1) Return $aResult EndFunc Check out the help for DLLStructCreate, DllStructGetPtr and DllStructGetData. I didn't check the .dll functions so I'm not sure what the checksum returns, maybe it needs to be processed further. Edit: Oh I forgot to mention that you need to take out the starting and trailing " from the file path
  21. Maybe post the rest of the code, since both those Macros will work in all drives.
  22. What's the return from Controlclick()? You can try to remove the "database" portion. Can you post/link a screenshot with the AutoitWindowinfo locked on the tree? The relative coordinates should remain the same if the window doesn't resize to a size that the tree can't be seen properly (YOu could Maximize before you begin, but that's another story. First get the click to work.) Just btw, you can use MouseClick("Right",290,245), it moves the mouse before it clicks.
  23. The _Filewritetoline() function already has this built in Here's the syntax: _FileWriteToLine($sFile, $iLine, $sText[, $fOverWrite = 0]) change _FileWriteToLine($myfile, $i+1,"dog", 1) to _FileWriteToLine($myfile, $i+1,"dog", 0) or _FileWriteToLine($myfile, $i+1,"dog")
  24. I assume you mean the folder in which the script is? Use @scriptdir
  25. What Melba meant by '"4 cases" is this Switch @GUI_CtrlId Case $quickloadsGUI[0] $savedname = "save1" Case $quickloadsGUI[1] $savedname = "save2" Case $loadlistGUI $savedname = GUICtrlRead($savedattackzonelistGUI) Select Case _GUICtrlListBox_GetCurSel($savedattackzonelistGUI) = -1 MsgBox(0x10, "Error", "No save selected") Return EndSelect Case Else $savedname = "defaults" So instead of calling the loadsaved() function at the start of the script you just add these lines, which will result in $savedname = "defaults", since you didn't click anything? So why not just define $savedname = "defaults" ?
×
×
  • Create New...