Jump to content

Decker87

Active Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by Decker87

  1. Yes, but I have a $200 keyboard that I can't replace for another couple weeks. Do you have any idea on how to fix the problem of AutoIt Send() failing?
  2. I'm in a very strange situation. The "Q" button on my keyboard has stopped working. Unfortunately one of my favorite games, League of Legends, uses this key extensively while providing no reliable way to remap the keys. So I figured, 'no big deal', I'll just configure a script to send Q when I press a different key (in my case A). Here's the thing: The function executes just fine, but the game doesn't pick up the keystroke. It's as if the keystroke was never sent. Why might this be and is there a way to fix it? Note: I am not trying to automate any aspect of the game, so I believe this is not in violation of the rules (which I have read).
  3. I love using the PixelChecksum function, I find it very useful. However, sometimes I find that I have a bitmap file saved, and I want to run a pixelchecksum on that file. For example, say we are doing a comparison of two screenshots. Is there any such function out there? Can PixelChecksum be extended to do this?
  4. The #include directive is much, much more basic than you think it is. The compiler literally copies and pastes that other file right smack in place of the #include directive. It then runs the whole thing as if it was one script (because at that point, it is). If you want to pick and choose what it "looks at" in the #include-ed files, I suggest further splitting up your #include files into parts that get executed, and parts that are just definitions and declarations, so that you can comment and uncomment those #includes separately. This is a generally good practice, anyway.
  5. Hi. I'm trying to write a background script that scrolls through another window's control, one pixel at a time, and captures a really tall image of it. Is there such a way to scroll "one pixel at a time"? All I can really think of right now is sending a pageup/pagedown key, or sending the up/down keys. Any better ideas?
  6. No problem. Generally, I can find all the info I need in the documentation - but there is no UDF documentation for the XML DOM Wrapper yet, just brief descriptions in the file itself. Examples are about 1000% more helpful than anything else. When I'm done with my project I will try to remember to post it.
  7. You'd think this would be simple, but it isn't. <node1> <node2 name="adam"/> </node1> All I want to do, is use the XML DOM wrapper to get the atomic value "adam". How in the world is this done? I've tried: _XMLGetAttrib("node1/node2", "name") _XMLGetField("node1/node2/name") _XMLGetValue("node1/node2/name") None of these return valid input. If I use: Dim $sNames[1] Dim $sVals[1] _XMLGetAllAttrib("node1/node2", $sNames, $sVals) _ArrayDisplay($sNames) _ArrayDisplay($sVals) $sNames and $sVals are properly filled, and I could do a search in $sNames for "name", get the index and match it up with the value in $sVals under the same index. But we all know this isn't the right way to do it. How is it done? EDIT: GOT IT. Apparently I need a foreslash before the first node like _XMLGetAttrib("/node1/node2", "name"). This isn't required in some of the other functions.
  8. I have an XML document similar in form to this: <directory name="1.0"> <file name="ahv.exe"/> <file name="help.html"/> <file name="help.jpg"/> <directory name="Resources"> <directory name="en"> <file name="crossProductLinkError.html"/> <file name="HelpViewerStrings.dat"/> <file name="linkError.html"/> </directory> </directory> </directory> Is there some syntax I am unaware of for selecting attributes from the N'th child node of specified type (type meaning file or directory in this example)? Clearly, a simple XPath like "directory/directory/directory/file" is not appropriate here. EDIT: How embarassing! I figured out all I had to do was use [n] to specify the n'th child node in the XPath, like "directory[1]/directory[1]/directory[1]/file[1]" BUUUUT...I do have another problem. I can't seem to use the XML DOM functions right to get, for example, the name of the first directory. What should I use in _XMLGetAttrib?
  9. Hmm, that is a nice function, but it doesn't solve the problem. I am trying to find a way of dealing with arrays of arbitrary dimensions - what you wrote there only works for two or three dimensions. If I were to pass to those functions a 27-dimension array, I'd still get an error. This is the fundamental problem I am trying to solve.
  10. Hi. I am trying to write some UDFs (for myself and the community) that deal with arrays of arbitrary dimensions. This is often quite difficult because it means I can't use syntax such as $arr[2][2] if the array passed has three dimensions. This is where I am looking for a secondary was to reference an array, similar to C++. As many of you know, in C++ an array is simply a pointer to a memory location, and it's dimensions are simply offsets within that memory location dedicated to the array. For example, say I have an array that is defined like so: Dim $arr[4][3] Now, say I want to reference the last element in this array: $arr[3][2] What I'm looking for is a more primitive way of referencing this element, something like $arr + 12. Obviously this isn't the correct syntax, but I am trying to convey the idea. It would make it _much_ easier to write functions that deal with many-dimensional arrays easier.
  11. I wish it were that easy. Yes, I used _iTunes_Start() in my code beforehand. However, I did manage to do what I wanted. Turns out .AddFile is the method I wanted. So, I added this to iTunes.au3: Func _iTunes_Library_AddFile($path) $Library_Playlist.AddFile($path) EndFunc Which works great. Now the question is - how can I retrieve this newly added track as an object? For instance, say I want to add the song "Changes" by "2pac" and automatically change the artist to "Tupac". I understand how to set the artist of a song that is already playing by using CurrentTrack().
  12. I am using the iTunes UDF. I need to add files to my iTunes library. However, when I use the function _iTunes_Library_AddTrack("C:\test\primus.mp3") it spits out an error message on line 114 of iTunes.au3: C:\Program Files\AutoIt3\Include\itunes.au3 (114) : ==> The requested action with this object has failed.: $Library_Playlist.AddTrack($path) $Library_Playlist.AddTrack($path)^ ERROR ->11:39:31 AutoIT3.exe ended.rc:1 So how can I add a file to my iTunes library?
  13. Hi. I am trying to write a function to report a computer name by way of it's IP Address. This can be done in windows at the command prompt using the command NBTSTAT -A <IP Address>. I don't understand how to use standard output to get the output of that command into some AutoIT variables. Can someone show me how to read this command's output?
  14. Func _DirFileInfo($sBaseDir, ByRef $aMain) ;$aMain[File Number][0 = File Path, 1 = File Size] Dim $temp6[3] $temp6[0]=0 $temp6[1]=1 $temp6[2]=2 $temp6 = DirGetSize($sBaseDir, 1) $iCount = $temp6[1] + $temp6[2] Local $hSearch = FileFindFirstFile($sBaseDir & "\*") Local $sFilePath, $iUBound = UBound($aMain, 1) For $i = 1 To $iCount $sFilePath = FileFindNextFile($hSearch) If StringInStr(FileGetAttrib($sBaseDir & "\" & $sFilePath), "D") == 0 Then; It's a file! ReDim $aMain[$iUBound+1][2] $aMain[$iUBound][0] = $sFilePath $aMain[$iUBound][1] = FileGetSize($sFilePath) Else;It's a folder! _DirFileInfo($sFilePath, $aMain) EndIf Next EndFunc Local $array[1][1] _DirFileInfo("C:\Install Files", $array) _ArrayDisplay($array) Why in the world am I getting a "subscript used with non-array variable" error here? Why is it that _ArrayDisplay can display temp6 as an array, but AutoIT does not recognize it as an array? I am thoroughly confused. Shouldn't DirGetSize return an array?
  15. Hi. I am looking for a function to quickly compute basic checksums on a per-file basis to check for data integrity. Does one exist? If yes, where can I find it? If no, where can I find some resources to write it?
  16. Perhaps you are and do, but not everyone is and does. Thanks for the short answer.
  17. I am wondering if AutoIT has any plans for the ability to create classes like C++. A class is essentially a set of functions and data that does all its own calculations and manipulations internally.
  18. I'm not sure what you mean about my imagination. I'm just looking for help with AutoIT. I have been able to set the font and that tip was quite helpful, but what I'm really looking for is a way to make the standard checkboxes, radio buttons etc. bigger. As in, the actual square checkbox that the user would actually click.
  19. So, with 29 views and zero replies, I guess I will assume AutoIT can't do this (rather simple) task.
  20. Is there a way to place a big checkbox in my GUI? With bigger font and a bigger actual checkbox?
  21. Well, I feel like I just climbed a wall of dicks. I didn't even realize AutoIT had a set of functions for handling INIs! I've been doing it wrong for weeks! On another note, I do have one question that might actually be legitimate. Is there a way to store more dynamic information in an INI file? That is, say I want the INI to hold a list of strings: string1, string2, string3 etc. Is there such a way for an INI file to contain an arbitrary number of "keys"?
  22. I have been using files to store settings for quite some time now. For example, having the compiled "My Program.exe" read from the file "My Settings.ini". In these files I would often have some format like: Setting1: 20 Setting2: 45 Et cetera. I would then have some function to sequentially read each line, then interpret the text. This method works but it is horrendous for editing the data with autoIT. That is, writing a program to specify these values in a user-friendly way has for me up to this point also been sequential. I am tired of sequentially accessing external data. Has anyone out there made a set of functions to handle external data in a dynamic way? I don't really need a database, I just want to read/write 50 or so lines from a text file.
  23. Excuse me, I didn't explain it quite right. The function I wrote returns the full path of EVERY file in the directory, and all the subdirectories (it spans the entire tree). It also optionally accepts an array of directories not to be looked into, and a list of files not to be listed. This is for my own purposes, although it would be interesting to see if anyone else would like to make use of such a function. So, how exactly do I ask the AutoIT developers to improve the StringReplace function to include a right-to-left functionality? PS: I tried some of the UDFs in your signature and loved them! Especially the process lister!
  24. Yes. I actually do have that as part of my code for Ben, which is why I created Jerry to envelope him - so that the end user doesn't see or know about the flag parameter.
  25. Have you tried adding a messagebox to make sure it is looping? Have you tried using SendKeepActive?
×
×
  • Create New...