
Creative
Active Members-
Posts
80 -
Joined
-
Last visited
Everything posted by Creative
-
I was about to make a particular program in AutoIt and as I was designing it, I came to find that it was so suited to object orientation that I came to think about how I might emulate those practices through AutoIt. Remembering how it's been said a million times that OOP is "never" going to be in AutoIt, I realized I would have to take my own approach which would work with AutoIt. So I designed a library which makes AutoIt have pseudo-object-orientation. Before you anti-OOP people realize, I'll just say, yes pseudo object oriented programming's acronym is POOP, but that doesn't change quality of my work. It will all be written as a (*.au3) library. It includes lots of key OOP stuff including variable and method access privileges (public and private for now), single parent inheritance and object orientation (instantiation of unique objects based off of classes with unique properties and capabilities). So, I have a pretty full idea and written design for the backend and am about to get into the development of that. But that's not what I am interested in talking about here. What I am here to discuss is the front end. Below is sample front end code, i.e. what a scripter/programmer using the Psuedo Object Orientation Library (POOL) would have to write. It creates an object, idles, and then exits. Nothing important, but it demonstrates some OOP concepts (I was too lazy to show inheritance). So could you guys give me some feedback on the good and bad about using a command set as shown below? Here is a commentless version: CreateClass("frame") AddMethod("close", "public") AddMethod("OnButtonclick") AddVar("title") AddVar("width") AddVar("height") AddVar("top") AddVar("left") SetParent("") Func frame() set("top", "-1") set("left", "-1") dim $unit = 100 set("this width", 4*$unit) set("height", 3*$unit) set("title", get("width")&"x"&get("height")&" window") GUICreate(get("title"), get("width"), get("height"), get("left"), get("top")) GUISetState(@sw_show) EndFunc Func frameclose() GUIDelete() EndFunc Func frameOnButtonclick() EndFunc $frame_object = addObject("frame") Sleep(1000) obj("close()", $frame_object) And a commented version //Create a class CreateClass("frame") //Give it methods, unspecified priviledge means private, defaults to last created class AddMethod("close", "public") AddMethod("OnButtonclick") //Give it some variables. Defaults private variable in most recently created class. Can be array. AddVar("title") AddVar("width") AddVar("height") AddVar("top") AddVar("left") //Set no parent. By default there is no parent...just figured I should show this method SetParent("") //Methods for the class Func frame() // A method of the same name as the class always defines the constructor. If // the user does not define the method, POOL will simply set all instance variables to 0. If the // user does define the method the user's version will be called instead. set("top", "-1")//Set's the object variables set("left", "-1") // This is traditional AutoIt still, regular variables inside methods are local and behave as they should, OOP or not dim $unit = 100 set("this width", 4*$unit)//since in frame, 'this' is implied object specification is optional. Acceptable representations are "this width", "this_width" and "this.width" set("height", 3*$unit)//As stated, defaults object to "this" if unspecified //reads width (400) and height (300) to set the title to "400x300 window" set("title", (get("width") & "x" & get("height") & " window")) GUICreate(get("title"), get("width"), get("height"), get("left"), get("top")) GUISetState(@sw_show) EndFunc Func frameclose() //The method naming requires that the method starts with the class's name. //Function frameclose() is called as: // obj("[frameObject] close()"), obj("[OBJECT] [METHOD]()") // OR // obj("close()", [frameobject]), obj("[METHOD]()", "[object]") GUIDelete() EndFunc Func frameOnButtonclick() EndFunc //Done with class //Instantiate and do stuff...this program does nothing useful, just shows the OOP commands //Make the OBJ $frame_object = addObject("frame") //Chill Sleep(1000) //Call close() in object obj("close()", $frame_object)
-
It's pretty straightforward, but the real issue comes in with identifying the location of the file because the built in processes of AutoIt only show the filename of the processes, not the file location. Some thoughts: - You could use the _FileListToArray UDF to create a list of all exe's on the E drive and then check the process name against that closing it if it matches - You could do the opposite of the above and index all allowed exe's and then any processes not in the allowed list are blocked - I'm not sure about the OS you are currently on but it may have the option that you can set which forbids execution in a certain directory and you can set that
-
Another Voice Recognition Topic
Creative replied to Creative's topic in AutoIt General Help and Support
The site says that the software runs in Windows 2000 and XP this would mean that it uses SAPI 5.1 (XP/2000/ME) rather than SAPI 5.3 (included in VISTA and 7). Much of the reason that I was inspired to start including this into my software is the incredible improvement from SAPI 5.1 to SAPI 5.3, from speech in XP to speech in Vista and 7, so I would prefer to stay away from that. The other issue comes from the idea that I don't want to have to load programs in order to carry out commands. It is slow and inefficient to load a executable for each command (especially considering that I believe AutoIt's compiling is still essentially smashing a script and an interpreter together and therefore would have large overhead). And without the API it has the same issues as the above. However even with the API...it claims to use SAPI which stands for Speech Application Programming Interface. So both of the solutions posed are strange in that they themselves use speech recognition APIs. So the real question is why use an API for another API...an interface for programming an interface for programming speech recognition. It would seem more logical to use SAPI rather than an interface for an interface for speech. Unless anybody has any knowledge or experience in this I may just have to wait until 7 is publicly released at which point I'd imagine there would be more resources to read through. -
Another Voice Recognition Topic
Creative replied to Creative's topic in AutoIt General Help and Support
Well I guess that is a fallback, but I am really interested in using this as an interface layer for my applications which I program already so I am looking for a bit more power and some stronger integration. Also, since SAPI 5.3 commands are standard on Windows Vista and Windows 7 it would be much easier to deal rather than adding other stuff. In regard to personal shortcuts, vocola could be a decent solution there. -
I recently transitioned to Windows 7 as my primary operating system and I absolutely love the voice recognition features. I have used speech recognition in XP with a number of different programs and have never come across anything which worked so well. However, being a developer I naturally am looking to extend the voice recognition to be able to do some more complex and advance things. Upon investigating I found it very difficult to find out how to properly implement some some of the speech recognition solution. I've been through MSDN documentation, posts throughout this forum and all around the google. In all honesty, the best I could do was make slight modifications to code that I copied, so it really isn't worth pasting my code in. I did implement the speech synthesis portion, so my knowledge of com implementation isn't totally lacking. So if anybody could provide any input into how to setup SAPI on Windows 7 (or Vista since they are probably using the same SAPI engine) to listen for a set of words or phrases I would appreciate it greatly. I'm not event exactly sure which objects/functions are relevant or how they work.
-
I learned AutoIt almost entirely through the help file. If all languages had a help file like AutoIt, it'd be a piece of cake learning even machine code. When I didn't know if something would work or that the language would accept it, I just tried and experimented to see what happened. Way after I considered myself to be a good AutoIt scripter, I joined the forums. I learned most from the forum neither from responding, nor asking, but from simply reading other people's problems and learning from them. That, and I started AutoIt after javascript, HTML, PHP, ASP, PERL, C/C++, etc. so it was nice and simple by comparison.
-
Finding a Picture on a screen
Creative replied to D4rk^S0ul's topic in AutoIt General Help and Support
Due to the fact that the PixelSearch function searches for a color in an area, you could go through searching for a pixel of the same color as the picture's top corner...then everytime that you find that color, you check to see if the pixel next to it is the same as the next pixel in the picture. Due to time constraints, perhaps you might only check alternating pixels or if the picture is big enough, even every five pixels or something. Rather than searching for the whole picture, you could really pick any pixel of the picture and search for it, and then check if the neighboring pixels match. -
hi q comando puedo usar para quitar la barra de tareas
Creative replied to ismael's topic in AutoIt General Help and Support
La barra de tareas es un parte de "Explorer.exe". Si terminas "Explorer.exe", la barra desaparecerá. Dime si tengas problemas. ( Y, lo siento para mi español...es mejor que nada, ¿sí? ) EDIT: También, hay un opción en la sistema operativa. Haz un clic derecho a la barra, selecta "características" (o un palabra similar...yo no sé la palabra que Microsoft Windows usa en su versión española), y escoges la opción para ocultar la barra de tareas automáticamente -
Maybe some starting rules to argue about: Entry For any new entries, an entry test created by the team is given. It is meant to limit the team to skilled members, although it is not meant to be very difficult for anybody who has a good grasp on the concepts of AutoIt. Due to the fact that the ability to find information and learn is at least as important as the knowledge one already has, applicants may use any resource necessary to complete the test. Coding consistancy - upon the creation of the group, a universal system of coding practices and naming styles will be reached. Members who fail to act in a friendly, professional manner will be removed from the group upon a vote by others. How the team works There will be regular planning sessions (weekly? monthly?) overseen by the team leader. At each planning session, the remaining tasks necessary to complete the program will be discussed, necessary details (variable naming, function param formats, etc) will be decided, and the tasks will be divided among the members. At the following meeting, progress (and lack of progress) are discussed and addressed. The project will be designed to be heavily function-based. Generally, at each planning session, the task given to each member will be in the form of a function. The team leader's primarily task is to coordinate and combine the code of the other members and to write the main source file which will call for these files. Regardless of position in the group, all members will participate actively in the coding of the program (with the exception of artists, if we have any). Consistant failure to complete code will result in suspension or expulsion from the group. Whenever possible, member specialization will be considered. Although, members should be prepared to write code of all styles, members will be designated a field of specialization in which they are to focus their practice and learning. Tasks of this category will be prioritized to a specialized member. Obviously in the case of a misc task, etc. members may still, at times, be called upon to write other types of code. Example fields may be: audio, graphics/video/GUI, files and registry, etc...obviously depending on our project. Team Leader As previously mentioned, the team leader's primarily task is to coordinate and combine the code of the other members and to write the main source file which will call for these files. The team leader is also responsible for ensuring proper communication (calling meetings when necessary, choosing communications method for meetings), calling the kick-out vote for bad members, and directing public relations (such as a website, forum posts regarding idea, calls for additional members, etc.). The team leader could be chosen a number of ways. The easiest is to make me the team leader. But I doubt that'd appeal to you. We could have a one-time vote for team leader. We could have a vote held monthly or every few months. We could take turns, every month or two the next member becomes team leader. We could (if the team lasts long enough) go on a per-project basis. We could go by seniority. In any case three things are true: 1) a defined leader at any given time is essential to keeping the group together 2) changing the leadership too much means that by the time one leader gets aquainted with everything and has the ability to be effective, they will be gone, and thus weak leadership and poor direction 3) inexperienced or poorly chosen leaders could also cause a downfall.
-
Sure, although as I said, I'd like to know what I'll be developing before I develop it. Either that or establish the rules and guidelines of how the group works beforehand. If anybody does anything you just PM me, I would likely join. As for what I could offer to a team: I am of intermediate skill level. That is, I'm very comfortable with basically all of AutoIt's internal functions. I've made a handful of stuff with it so far. AutoIt is not my first, or only, language. The biggest hole in my knowledge is that I've never worked with the COM or DLL stuff in autoIt, although, I'm sure that lack of knowledge won't last. (Side note: If we do make a game I've taught classes in game development so I have some knowledge in that, but in all honesty, I think that autoIt would not be best suited to a game.)
-
Do you have any simple examples of how to do this? I have really experimented at all with creating my own file types....It's very specific to the type of data that you want to store. The first step is just typing something different after the ". ". Then you'd probably go to 'folder options > filetypes > new' and link the filetype to your program. But then, the most important part, what is actually inside the file...that is different for every situation...I mean, it's just a matter of looking at your data and figuring how to:create a positional or symbol based code in order to abbreviate common data types and valueswrite data in an order that lets you access important bits easilyfind the best way to write it so that when it is read, it can be easily seperated and sortedcreate a data structure which can maintain the hiearchy or relations between the dataetcBut, as I said...I can't really say much that is useful...it is obviously very specific to the data that you are trying to represent.
-
I believe that the windows registry is overused. It should be used when the information should stay even afer the program uninstalls. For example, I think it was back when I had Norton's Anti-Virus, I uninstalled for some reason and some settings and registration info were kept in the registry so that, when I installed a month later, I didn't have to choose every option again. This was best for the registry because, after uninstalling the program, all of its files should be gone and were. Also, I think that it is good for system information and other information that is unique to that particular computer (or using HKEY CURRENT USER the err...current user.) because files can be copied...and will be... However, in 9 out of 10 cases, it's best to use files. I use ini sometimes, but frequently I invent file-types which work best for the program. There are a number of ways to keep a user from messing up a file. My favorite is already mentioned...decrypt on load file, encrypt on write. A user who can get around that, would have an equally easy time getting around something similar in the registry. The registry keeps distance between the non-technical users and the data...but not putting your files in My Documents, etc. could easily do the same thing. However, recently in most of my software, I've been leaning toward the total opposite, I've been working to create open file specifications because I would be more than happy to see others write software which supports my file format. As for a reminders program, I made one too...a scheduler/reminder program. In early versions it had a sophisticated security and encryption system, but then I realized that it was total overkill. You don't have to be worried if the user can edit their data in notepad if they want to...well, unless you are being reminded of illegal acts.
-
Q: Can I imbed a font into an exe?
Creative replied to Eru's topic in AutoIt General Help and Support
In web development, there have been many talks about a feature which allows a person to embed a font into the webpage, however, the primary arguement which has kept this from happening is that you may be are violating copyright law by distributing it free for free. Be careful. If you got it with MSOffice that may mean that you are violating copyright law by distributing it free with your program due to the fact that you actually had to buy it... As for the actual implementation of HOW to do it...listen to SmOke_N, he's a smart chap. -
Probably use the fileInstall command to embed the program...and then only run it if it passes a check for registry entry which is only put on that computer. I've never used fileInstall before, but in my subconcious I believe it would work for that.
-
How to prevent a PC going into hybernate
Creative replied to Noob's topic in AutoIt General Help and Support
I'd imagine that it would. It reminds me of one time when I wrote a breakout clone and in order to keep it from getting stuck in a pattern (essentially ending playabilty of the level), I at one point figured whenever I detected a repeated path I'd just add one to the bearing of the ball...oh boy...big mistake...it reminds me how much a little tiny offset in the movement of anything can impact things. -
How to prevent a PC going into hybernate
Creative replied to Noob's topic in AutoIt General Help and Support
Like, right after you change the registry you put a shortcut to a program which fixes the registry auto-startup, then, on the exit of your program, you delete this shortcut. So that, if you fail to get to that end, it'll always fix the registry on restart and in the probable case that nothing goes wrong, the shortcut is taken out at the end and the registry is simply returned to normal at the end. I wasn't talking about that. Sorry should have been more clear. I was talking about the mousemove script by nfwu. -
The easiest way is: $testFile = FileOpen("test.ini", 2) $string = FileRead($testFile, FileGetSize("test.ini"));read the file FileClose($testFile) $string = StringReplace($string, "=", " = ");replace "=" with " = " $testFile = FileOpen("test.ini", 2) FileWrite($testFile, $string);overwrite to file FileClose($testFile) That will work, assuming that there are no "=" within the actual values. Otherwise I'd read the file line by line and use StringinStr to find the first "=" in the line and then to pop in the spaces there.
-
How to prevent a PC going into hybernate
Creative replied to Noob's topic in AutoIt General Help and Support
Proper coding can fix this. Well, I know that works on XP, it wouldn't take much to check it for winME or something. Personally I think that the registry is good because it's not some peculiar roundabout way, as the others are. -
How to prevent a PC going into hybernate
Creative replied to Noob's topic in AutoIt General Help and Support
I did a registry scan before and after I changed the "hibernate" setting and I found that the only thing that changed was: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power\Heuristics whose value changed as shown: 05 00 00 00 00 01 01 00 ... 05 00 00 00 00 01 00 00 ... So, I'd recommend either reading up on what the data of that key actually means or experimenting changing it around. In case you'd like to investigate, I used Registry Monitor a great free tool. Grab it here. -
How to prevent a PC going into hybernate
Creative replied to Noob's topic in AutoIt General Help and Support
Well, you could probably find the hybernation options in the registry...I feel that would be the most professional way and would prevent you from having to consantly run wakeup code. I'm not quite sure where it is...some possible locations are the contents of: HKEY_CURRENT_USER\Control Panel\Desktop HKEY_CURRENT_USER\Control Panel\PowerCfg HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Power They all look pretty interesting. -
I'm rather new to this forum, but at a previous development forum of mine, after years of great discussions, we began having a problem with an increasing abundance of posts of that nature which you've mentioned here. All of the original members discussed and tried many things from the excessively welcome to the brutally outspoken and everthing in between. However, the thing worked in the end was properly sorting the forum. We added a Beginners board where those kinds of posts went, so that, by a few months later, I no longer saw a single post that I didn't want to read. The people who wanted to help beginners, went there and helped. The people who wanted to have advanced conversations stayed out. I personally think that the organization is terrible here. General Help and Support should definately not be a single category. The trick to having good forum interactions, is to put the right people with the right people...i.e. catagories!
-
Music Player Playlist Builder Help
Creative replied to Abaddon's topic in AutoIt General Help and Support
HotKeySet(). Consequntly, you need to put the actions into function so that you can call them from HotKeySet() ??? -
I'm not sure, but I don't think that you can do it directly. You can use conditionals to do it though. $codeToRun = 'RegWrite("key")' Select Case StringInStr($codeToRun, "RegWrite") $codeToRun = StringTrimRight(StringTrimLeft($codeToRun, 9), 1);isolate arguements for function Local $givenArguements = StringSplit($codeToRun, ",");split each arguement Select Case $givenArguements[0] == 4 RegWrite($givenArguements[1], $givenArguements[2], $givenArguements[3], $givenArguements[4]) Case $givenArguements[0] == 3 RegWrite($givenArguements[1], $givenArguements[2], $givenArguements[3]) Case $givenArguements[0] == 2 RegWrite($givenArguements[1], $givenArguements[2]) Case $givenArguements[0] == 1 RegWrite($givenArguements[1]) Case Else MsgBox(0, "Error", "Invalid number of arguements for RegWrite");EDIT...missing arguements EndSelect EndSelect The only issue is that this way, you'd have to write one out for every individual command that you'd like to be able to read.
-
Music Player Playlist Builder Help
Creative replied to Abaddon's topic in AutoIt General Help and Support
Put this at the beginning of the file to tell the program to start at track 1: Global $currentTrack = 1oÝ÷ Ù8^Ú ¢Ú-éÞÆÛ(¨º;¬¶×¥Ø^¦º ©¢·vØ^ìm)Þ¢¶®¶sbb33c¶7W'&VçEG&6²Òb33c¶7W'&VçEG&6²²oÝ÷ ج¶Ø^±©¶(m§$Ê·õÛÉ«¢+ØÀÌØíÕÉɹÑQɬôÀÌØíÕÉɹÑQɬ´ÄoÝ÷ Ù8^Ú)¬¢·*.ë-ç¶ÞiÖ®¶se6÷VæEÆfÆU&VDÆæRgV÷CµtDUdU%õDUôdÄUô2gV÷C²Âb33c¶7W'&VçEG&6²·Æ2FR6öæröâFBÆæ -
Yeah, I avoid it myself. Running two programs can be wasteful or messy. Personally, as I said at the beginning of the post, I'd probably do what MsCreatoR said, but I was just providing another option because each option has situations it would work well in, and situations that it would work poorly at.