Leaderboard
Popular Content
Showing content with the highest reputation on 07/30/2013 in all areas
-
marcoroc, When you compile the file, are you calling it "Notepad.exe" by any chance? M233 points
-
Write out a reproducer that you think does not work. 99 times out of ten, you will see the problem, and learn something. EDIT: and post it I meant.1 point
-
UEZ, Certainly you know that stuff is being rendered to the display, and the graphics card is responsible for rendering that data? Since the graphics card is a separate processor with separate memory from the CPU, it will always have an effect on any benchmark which utilizes graphics. And AutoIt is nothing special with how it handles graphics - all those GUICtrlxxx calls get translated into a series of user32 and gdi32 Windows API calls. Much of the data may first be sent to an offscreen DIB or other buffer, but ultimately that data must be transferred to the screen, and for that to happen Windows has multiple layers of abstraction that it uses to ultimately render that data to the graphics card (the graphics driver is the last level of abstraction, really). When something is finally rendered to the graphics card, the system must pump memory from the motherboard across the bus to the graphics card's memory, and the graphics card can then render that data to the screen. There's exceptions for 3D primitives and preloaded textures and whatnot, but you are drawing a new image each frame, which must be transferred each time. Anyway.. what this all boils down to is that, in order to do any focused benchmarks on the CPU, you need to always always remove graphics display from the equation. This is nothing new; its been done this way for decades. If you want to test graphics speed, that's another story. In AutoIt's case, we must focus on CPU benchmarking first and foremost to find out if the interpreter's speed has changed. Speed of individual graphics functions is another story; however I doubt much has changed in quite some time (Jon can correct me here). Still, the results will always be skewed for those functions based on the graphics card and drivers being used. Okay, with that out of the way, I've retested with your script and realized I hadn't completely taken away all the graphics rendering. This time I also got rid of GUICtrlCreateGraphic() which I had missed the first time. The results are now: AutoIt v3.3.8.1: ~232 fps AutoIt v3.3.9.13: ~214 fps With graphics put back into the equation, it is around 65fps for both versions. Hopefully that gives you an idea of what the problem is with incorporating graphics into a benchmark. Also - running tests inside a VM is never a good idea, as the O/S is inside the VM running on top of another O/S with drivers which are used to translate calls into the host O/S.. its a huge extra level of abstraction really that should normally result in slower performance than running that O/S in its own native environment.1 point
-
Jon, In re: Accessing AutoIt3Wrapper-added icons. With help from wraithdu I have developed a valid access strategy for AutoIt3Wrapper-added icons which does not depend on the index number - and hence the number of native icons is no longer a problem. In fact you gave me the clue when you suggested using the icon name - on examination it appeared that AutoIt3Wrapper could indeed set this value but this was not documented anywhere. This additional parameter will be fully explained in the Help file for next release - along with an example script to show how to use it to access the icons. M231 point
-
How I can get a full filename when I have some chars from its name
DW1 reacted to DatMCEyeBall for a topic
Use Melbas' >RecFileListToArray UDF if you're not sure where the file is. Something like: $aArray = _RecFileListToArray("f:\folder1\folder2\", "StartingOfTheFileName*", 1, 1, 1, 2)1 point -
@ScriptDir returns trailing slash
BinaryBrother reacted to guinness for a topic
So is this... ConsoleWrite(FileExists("C:\\\Users\\\\\\guinness\\\Desktop\\\\\\\\\\\\\\\\\\\\\\\\\\Exampel.txt") & @CRLF) ; Returns 1. ConsoleWrite(FileExists("C:\\\Users\\\\\\guinness\\\Desktop\\\\\\\\\\\\\\\\\\\\\\\\\\ExampleNotExists.txt") & @CRLF) ; Returns 0.1 point -
@ScriptDir returns trailing slash
BinaryBrother reacted to BrewManNH for a topic
BTW, this is completely valid as far as Windows is concerned, "C:Temp"1 point -
Well I'm no expert so there may in fact be a simple way to do it. I was about to test your script by creating an array to hold the control id's returned from GUICtrlCreateTreeViewItem and see how it correlates to a straight index value (1-155). Will post the findings. edit: The Controls IDs are consecutive, but they start at 5 instead of 0 (or 1). #include <GUIConstantsEx.au3> #include <GuiTreeView.au3> #include <WindowsConstants.au3> #include <array.au3> local $gui010 = guicreate('TreeView Test') local $aSZE = wingetclientsize($gui010) local $TV010 = guictrlcreatetreeview(0,0,$aSZE[0],$aSZE[1]-40) local $btn010 = guictrlcreatebutton('Generate Treeview Debug Data To Console',20,$aSZE[1]-30,$aSZE[0]-40) local $x,$y ; just for handle holders to create child elements local $total_entries = 0 Local $arrIDs[155][2] $IDindx = 1 _GUICtrlTreeView_BeginUpdate($TV010) ;For $1 = 1 To Random(1, 10, 1) For $1 = 1 To 5 $arrIDs[$IDindx-1][0] = $IDindx $x = GUICtrlCreateTreeViewItem(StringFormat("[%02d] Level 1", $1),$TV010) $arrIDs[$IDindx-1][1] = $x $IDindx += 1 $total_entries += 1 ;For $2 = 1 To Random(1, 10, 1) For $2 = 1 To 5 $arrIDs[$IDindx-1][0] = $IDindx $y = GUICtrlCreateTreeViewItem(StringFormat("[%02d] Level 2", $2),$x) $arrIDs[$IDindx-1][1] = $y $IDindx += 1 $total_entries += 1 ;for $3 = 1 to random(1, 10,1) for $3 = 1 to 5 $arrIDs[$IDindx-1][0] = $IDindx $arrIDs[$IDindx-1][1] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] Level 3", $3),$y) $IDindx += 1 $total_entries += 1 next Next Next _GUICtrlTreeView_EndUpdate($TV010) ConsoleWrite('Generated = ' & $total_entries & ' entries' & @LF) guisetstate() while 1 switch guigetmsg() case $gui_event_close Exit case $btn010 _out() _ArrayDisplay($arrIDs) EndSwitch WEnd func _out() local $str ConsoleWrite('GETCOUNT = ' & _GUICtrlTreeView_GetCount($TV010) & @LF) for $1 = 0 to _GUICtrlTreeView_GetCount($TV010) $str &= stringformat( 'Text = %-15s Child Switch = %-5s CTLID = %03i Parent CTLID = %03i Parent Handle = %-8s Sibling Count = %03i Child Count = %03i', _ _GUICtrlTreeView_GetText($TV010, $1), _ _GUICtrlTreeView_GetChildren($TV010,$1), _ _GUICtrlTreeView_GetItemParam($tv010,$1), _ _GUICtrlTreeView_GetParentParam($TV010,$1), _ _GUICtrlTreeView_GetParentHandle($TV010,$1), _ _GUICtrlTreeView_GetSiblingCount($TV010,$1), _ _GUICtrlTreeView_GetChildCount($TV010,$1) ) & @lf next ConsoleWrite($str & @LF) endfunc1 point
-
Noob script brings to high CPU usage and large increasing in processes number.
0xdefea7 reacted to Tripredacus for a topic
No one's perfect! I did something silly like that once (well probably more than once but no picture evidence)1 point -
@ScriptDir returns trailing slash
BinaryBrother reacted to wraithdu for a topic
Kind of a PITA, but you could wrap the macro. Also, this is the same behavior of other dynamic directory macros like @WorkingDir. ConsoleWrite(@ScriptDir & " | " & _ScriptDir() & @CRLF) ConsoleWrite(@WorkingDir & " | " & _WorkingDir() & @CRLF) FileChangeDir("C:\") ConsoleWrite(@WorkingDir & " | " & _WorkingDir() & @CRLF) Func _ScriptDir() Return StringRegExpReplace(@ScriptDir, "\\+$", "") EndFunc Func _WorkingDir() Return StringRegExpReplace(@WorkingDir, "\\+$", "") EndFunc1 point -
@ScriptDir returns trailing slash
BinaryBrother reacted to JLogan3o13 for a topic
I believe it only does it at the root of C:. I have tried it when the script is saved elsewhere, and it doesn't return the trailing slash. Maybe that is why you haven't noticed it Edit: Too slow1 point -
@ScriptDir returns trailing slash
BinaryBrother reacted to wraithdu for a topic
It only happens in root directories, and really, scripts shouldn't run from there, especially with UAC. It's one of those sneaky gotchas.1 point -
YogiBear, Those posts were uncalled for - please would you be so kind as to delete them and apologise. trancexx, Thank you for posting some links to help those of us with less knowledge of the more arcane stuff - sharing is what the forum is all about. ` And please do not waste your time looking for anything being added to the "User Moderation" section just yet. M23 Edit: YogiBear, Thanks.1 point
-
how i add SkinCrafter Autoit ??
AdemSezgin reacted to water for a topic
If you search the forum you will notice that there is even a Scincrafter UDF available.1 point -
Have a look at the >Taskplaner/Taskscheduler COM UDF. It works with systems Vista and higher. Also, look at the SCHTASKS command. Adam1 point
-
Retrieve data from IMDB
coffeeturtle reacted to bird42 for a topic
Don't worry it's just for personal use;) My basic knowledge let me write this script: Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) HotKeySet("{esc}","ExitScript") $1 = TrayCreateItem("Go!",-1,-1,1) TrayItemSetOnEvent(-1,"_go") TrayCreateItem("") $a = TrayCreateItem("About") TrayItemSetOnEvent(-1,"_about") TrayCreateItem("") $e = TrayCreateItem("Exit (Esc)") TrayItemSetOnEvent(-1,"ExitScript") TraySetToolTip("IMDB lookup") Global $result[7] While True ; Forever Sleep(100) WEnd Func _about() TrayTip(" IMDB lookup","Script Function: Retrieve a movie's infos from IMDB",10) EndFunc Func exitscript() Exit EndFunc Func _go() For $i=0 to 6 $result[$i]='not found' Next Local $title = InputBox('IMDB lookup','Please enter movie title') Local $dummy If @error Then MsgBox(0,'ERROR','Invalid parameters') SetError(0) Return 0 EndIf StringReplace($title,' ','+') TrayTip('Working...',$title,30) Local $response = _INetGetSource('http://mymovieapi.com/?title='&$title&'&type=json&plot=none&episode=0&limit=1&yg=0&mt=none&lang=en-US&offset=&aka=simple&release=simple&business=0&tech=0') $dummy=_StringBetween($response, '"title": "','", "filming_locations":') If Not @error then $result[0]=$dummy[0] Else SetError(0) EndIf $dummy=_StringBetween($response, '"year":',', "country":') If Not @error then $result[1]=$dummy[0] Else SetError(0) EndIf $dummy=_StringBetween($response, '[{"runtime": ["',' min"],') If Not @error then $result[2]=$dummy[0] Else SetError(0) EndIf $dummy=_StringBetween($response, '"genres": [','], "rated"') If Not @error then $result[3]=$dummy[0] Else SetError(0) EndIf $dummy=_StringBetween($response, '"writers":','], "imdb_id"') If Not @error then $result[4]=$dummy[0] Else SetError(0) EndIf $dummy=_StringBetween($response, '"directors": ["', '], "rating_count":') If Not @error then $result[5]=$dummy[0] Else SetError(0) EndIf $dummy=_StringBetween($response, '"actors": [','], "also_known_as":') If Not @error then $result[6]=$dummy[0] Else SetError(0) EndIf _ArrayDisplay($result) EndFunc I believe there is a better way to extract the data from the json string, but the json udf i found seemed a bit too complicated for me. Any suggestions?1 point