xZZTx Posted August 14, 2008 Share Posted August 14, 2008 (edited) ok i have goten board with autoit's speed so i thought if i just had my autoit commands run right to C++ then it would fix the lack of speedbut i have no idea on how todo this...so far i used thisbut now im stuck on.. how do i add an include.. would i have to convert the scrips?!*EDIT*Well this is BS...This WorksAU3_Sleep(1000); AU3_Run("notepad.exe", "", 1); AU3_WinWaitActive("Untitled -", "", 0); AU3_Send("Hello{!}", 0);But This Does NotAU3_Func TogglePause(); $Paused = NOT $Paused; AU3_While $Paused; AU3_sleep(100); AU3_ToolTip('Bot is "Paused"'); AU3_WEnd; AU3_ToolTip(""); AU3_EndFunc;WTH! Edited August 14, 2008 by xZZTx Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times.. Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 14, 2008 Share Posted August 14, 2008 What the heck is AU3_While? And AU3_Func? If you are serious in trying to do this, you need to learn C++ first. Then you need to learn that the AutoIt dll is not a full 1 to 1 copy of AutoIt. Link to comment Share on other sites More sharing options...
xZZTx Posted August 14, 2008 Author Share Posted August 14, 2008 Ya Learning C++ 1st would be a smart move... and i kinda have something working it just can't do variables like $Test any format i need to follow for that?! Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times.. Link to comment Share on other sites More sharing options...
weaponx Posted August 14, 2008 Share Posted August 14, 2008 I think you took this line too literally:Basically all commands start as AU3_This doesn't mean you can add AU3_ to any AutoIt function and make it work in AutoItX. Link to comment Share on other sites More sharing options...
cppman Posted August 14, 2008 Share Posted August 14, 2008 (edited) Ya Learning C++ 1st would be a smart move... and i kinda have something working it just can't do variables like $Test any format i need to follow for that?!Variables in C++ don't begin with a '$'. int x = 100; float y = 250.245f; double z = 12.0005; char str[] = "hello world"; You need to learn (and I mean actually learn) C++ first. Personally, I find using AutoItX in C++ pointless anyways. AutoItX is written in C++ - so every function you are calling is just calling another function in C++. Why not just do it in C++ the first time around? Edited August 14, 2008 by cppman Miva OS Project Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 14, 2008 Share Posted August 14, 2008 They can begin with a dollar sign. They just aren't declared by assignment. You can declare int $i; if you wanted. Link to comment Share on other sites More sharing options...
cppman Posted August 14, 2008 Share Posted August 14, 2008 (edited) They can begin with a dollar sign. They just aren't declared by assignment. You can declare int $i; if you wanted.I hate C++... (not really) Edited August 14, 2008 by cppman Miva OS Project Link to comment Share on other sites More sharing options...
NELyon Posted August 14, 2008 Share Posted August 14, 2008 (edited) They can begin with a dollar sign. They just aren't declared by assignment. You can declare int $i; if you wanted. #include <iostream> using namespace std; int main() { char * $Text = "This is a test"; cout<<$Text; getchar(); } Hmm, That's cool. Learn something new every day. Edited August 14, 2008 by KentonBomb Link to comment Share on other sites More sharing options...
weaponx Posted August 15, 2008 Share Posted August 15, 2008 They can begin with a dollar sign. They just aren't declared by assignment. You can declare int $i; if you wanted. I prefer dollar signs in front of my identifiers. I think this option is compiler specific though. Link to comment Share on other sites More sharing options...
Valik Posted August 15, 2008 Share Posted August 15, 2008 weaponx is correct. Most compilers support it, but it's a non-standard feature, as I recall.cppman, to answer your question: Because AutoIt does a lot behind the scenes. Do you use STL, ATL, MFC, WTL, TR1, boost or some other library? Those are all written in C++ so your argument for not using AutoItX applies to them as well. But I'm sure you use something to make your life easier. Link to comment Share on other sites More sharing options...
cppman Posted August 15, 2008 Share Posted August 15, 2008 (edited) cppman, to answer your question: Because AutoIt does a lot behind the scenes. Do you use STL, ATL, MFC, WTL, TR1, boost or some other library? Those are all written in C++ so your argument for not using AutoItX applies to them as well. But I'm sure you use something to make your life easier.I just meant because most of the functions AutoItX implements are just a couple of lines using the Windows API (as far as I've seen, in the AutoIt source). I don't especially like the STL, but I do use it every once in a while. However, I completely hate, and refuse to use ATL/MFC/WTL and boost. (Never used TR1. I don't even know what it is.)But, I understand what you're saying. Personally, I just don't think it is worth having an external DLL for such simple functions. Edited August 15, 2008 by cppman Miva OS Project Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 15, 2008 Moderators Share Posted August 15, 2008 (edited) I just meant because most of the functions AutoItX implements are just a couple of lines using the Windows API (as far as I've seen, in the AutoIt source). I don't especially like the STL, but I do use it every once in a while. However, I completely hate, and refuse to use ATL/MFC/WTL and boost. (Never used TR1. I don't even know what it is.)But, I understand what you're saying. Personally, I just don't think it is worth having an external DLL for such simple functions.So saving time in actually having to code all those functions (regardless of the few lines) isn't reason enough for you? I admit, I've written my own functions based off of autoits interpretation of use, but ... not everyone is as masochistic I'm sure.Edit:Oh... and Send() is just a "few" lines in C++? ... Man, the one I wrote was like 1K lines ... I suck . Edited August 15, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
cppman Posted August 15, 2008 Share Posted August 15, 2008 (edited) So saving time in actually having to code all those functions (regardless of the few lines) isn't reason enough for you? I admit, I've written my own functions based off of autoits interpretation of use, but ... not everyone is as masochistic I'm sure. Edit: Oh... and Send() is just a "few" lines in C++? ... Man, the one I wrote was like 1K lines ... I suck .Unless you type 3 words per minute, it isn't a problem (at least not for me). Especially when you now have the code right there to edit and modify to you're likings. If it is a problem, you could even just use the code from the AutoIt public source code. Without taking into account parsing and character case, a simple send function.... void Send(const char *text) { const char *src = text; while (*src != '\0') { UINT vk = VkKeyScanA(*src); keybd_event(vk, MapVirtualKeyA(vk, 0), 0, 0); Sleep(10); src++; } } Edited August 15, 2008 by cppman Miva OS Project Link to comment Share on other sites More sharing options...
Valik Posted August 15, 2008 Share Posted August 15, 2008 Unless you type 3 words per minute, it isn't a problem (at least not for me).Yes because it's the writing of code that takes the most time. <insert eye rolling emoticon here> Especially when you now have the code right there to edit and modify to you're likings. If it is a problem, you could even just use the code from the AutoIt public source code. Without taking into account parsing and character case, a simple send function.... void Send(const char *text) { const char *src = text; while (*src != '\0') { UINT vk = VkKeyScanA(*src); keybd_event(vk, MapVirtualKeyA(vk, 0), 0, 0); Sleep(10); src++; } }So without doing everything that makes the Send() function useful? Right. That's really an apples to apples comparison right there. If you choose not to use libraries that's fine but please don't advocate the non-use of them, especially in threads where it's clear the OP doesn't know much if anything about C++. In most cases it makes far more sense to use well-tested libraries, even if they are "just a couple lines", than it does to write everything from scratch. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 15, 2008 Moderators Share Posted August 15, 2008 Unless you type 3 words per minute, it isn't a problem (at least not for me). Especially when you now have the code right there to edit and modify to you're likings. If it is a problem, you could even just use the code from the AutoIt public source code. Without taking into account parsing and character case, a simple send function.... void Send(const char *text) { const char *src = text; while (*src != '\0') { UINT vk = VkKeyScanA(*src); keybd_event(vk, MapVirtualKeyA(vk, 0), 0, 0); Sleep(10); src++; } }That's nothing like autoit's send(). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
cppman Posted August 15, 2008 Share Posted August 15, 2008 (edited) If you choose not to use libraries that's fine but please don't advocate the non-use of them, especially in threads where it's clear the OP doesn't know much if anything about C++. In most cases it makes far more sense to use well-tested libraries, even if they are "just a couple lines", than it does to write everything from scratch.All right.edit:Yes because it's the writing of code that takes the most time. <insert eye rolling emoticon here>If the person is going to use C++, then research comes with it. Obviously, if the original poster is trying to use real AutoIt code in C++, then the original poster shouldn't even be using AutoItX in C++ (let alone C++ itself). Just my opinion... Edited August 15, 2008 by cppman Miva OS Project Link to comment Share on other sites More sharing options...
xZZTx Posted August 16, 2008 Author Share Posted August 16, 2008 (edited) I don't think i could really sit down and learn C++ i just have to play with it till i get it right like i did with autoit but right now i have learn a little bit like how to use variables...and i used $ because its what is used in autoit i tryed this code and it kinda worked.. { while(1) { int X = AU3_MouseGetPosX(); int Y = AU3_MouseGetPosY(); AU3_ToolTip(X & Y,"1000","300"); } return 0; } then i got 1>.\main.cpp(20) : error C2664: 'AU3_ToolTip' : cannot convert parameter 1 from 'int' to 'const char *' any fix? Also.. Can i even use int X = AU3_MouseGetPosX(); ?! Edited August 16, 2008 by xZZTx Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times.. Link to comment Share on other sites More sharing options...
Valik Posted August 16, 2008 Share Posted August 16, 2008 If you can't be arsed to actually take appropriate action to learn C++, give up now. It's not a language you can just fumble your way through without taking the initiative to learn it. Link to comment Share on other sites More sharing options...
xZZTx Posted August 16, 2008 Author Share Posted August 16, 2008 That Helped... And We Will See In Due Time My Friend.. I Will Rule You C++! Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times.. Link to comment Share on other sites More sharing options...
Valik Posted August 17, 2008 Share Posted August 17, 2008 That Helped...And We Will See In Due Time My Friend..I Will Rule You C++!And people call me arrogant. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now