Jump to content

imNew

Active Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by imNew

  1. well, mostly because in ideal conditions, ie. testing in textpad, send (key up) operations will always free my keys, don't even need the controlSend. However I encounter loads of problems when the stuff I am trying to interface with doesn't register key presses in an orthodox way and there are delays as well. That's why after trying FAQs once without any breakthru, I gave up and came on the forum. Apparently the FAQ is the best solution, then I have to try to make it work.
  2. thanks a lot for the pointer. I will look at it more serious now. I m assuming ControlSend("","","","",0) won't work right? some key, any, has to be controlsent in order for that to work.
  3. due to the nature of what I am doing, my keys will get stuck, unavoidable, I just need a reliable _clearKeys() My observation so far: send(key up) works ALL the time for normal keys, ie. asdf's same can't be said for ctrl alt and shift in a simple ctrl click: send("{ctrldown}") for $ i = 0 to 4 mouseclick("left", 11, 11) next send("{ctrlup}") in my particular instance, send("{lctrl down}"), send("{lctrldown}"), send("{ctrl up}"), send("{lctrl up}"), send("{lctrlup}") do not work or they will not free the ctrl key at the end. only send("{ctrlup}") works, but not always either. in severe cases, even a send ("ctrl") will get the ctrl key stuck (SendKeyDownDelay=30 or higher) What I am afraid is that, once the ctrl key is stuck in down position, all the subsequent send(key) will be interpreted as send(ctrl+key), EVEN the send( ctrl up) attempts. I would like a function that is lower level, something like _isPressed("12"), that can just clear all the "down" keys. my system is x64 windows 7.
  4. thank you, thank you both, with any bits or pieces of code, as long as they work. upside down 's code is really helpful, declare a pointer (I guess the pointer can only point to autoit functions take "long"s), load the dll, point the pointer to the autoit function and start using. that actually makes lots of sense now. Anything else I should be aware of for using autoit in c++? thanks in advance
  5. Hi Everybody, how is it going. The title is very general, sorry about that. I am fairly new to C++, only thing about files or libraries I can understand is "#include". however I insist on using c++, so that I can learn a ubiquitous language and still have the awesomeness of autoit with me. When I google my question, I am getting outdated advice about adding non-existent files into a C++ project. The only information I can extract out of this forum is that I have to "dynamically link" something. and I tried that, doesn't work, can't even get Sleep(1000) to work #include <Windows.h> #include "AutoIt3.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HINSTANCE hGetProcIDDLL = LoadLibrary("C:\\Users\\User\\Desktop\\C++Projects\\AutoItX3.dll"); FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),"AU3_Sleep()"); typedef int (__stdcall * pICFUNC)(char *, int); pICFUNC MyFunction; MyFunction = pICFUNC(lpfnGetProcessID); MyFunction(1000); FreeLibrary(hGetProcIDDLL); return 0; } Could someone patient enough give us new comers a step to step instruction just how to use AutoIt in c++, we only have header and dll files.
  6. Hi, I am looking for a detailed tutorial (preferably with sample codes) on how to use various common windows dll files in Autoit. More specifically, what kind of functions do those dlls provide and what inputs do they take, outputs do they return, what kind of error do they throw... and how to do all the above in autoit. Any suggestions would be greatly appreciated, Thanks in advance.
  7. How would you know the "coordinates" of your in game character without some sort of memory reading? do you do some "pattern recognition" on the mini map? Could you give us some pointers?
  8. I am a newbie to autoit, couldn't understand most of the code posted =( I am very interested in the "screen reading" bot, I wonder how can you know your location and facing by plainly reading the screen? is there some kind of an introductory level tutorial on that? Any hints or pointers would be greatly appreciated. Thanks in advance
  9. do we have any way of reading the IP package out of eve port or reading some info from memory? because simply depending everything on reading pixels on screen is extremely unreliable in many ways: 1.Extremely difficult to setup 2.extremely difficult to achieve cross compatibility 3.extremely difficult to implement smart/contingency/robust routines 4.Have to revise coordinates everytime there is a new patch. A good example, How do you control drones? (before they introduced hotkeys for it, that is)
  10. post the source or null
  11. You just want to be this disgusting gum that will stick to one's shoes that won't go away? how long do you want to troll? why would I have to post more than once? check who has to bump the last topic, do you even think about that? if I have an answer at the first place why do I have to listen to a emo clown like you? you are just this sick twisted no life trying to make others feel the same way as you do, due to your childhood or family issues, or simply the cold there just freezing your reptilian brain off.
  12. just for Holge, my symmpathies to your horrid childhood, and since you said "kids" I m assuming...
  13. allright, problem solved, thanks again, time for me to get to the crunching part.
  14. Thanks again 59FIFTY, I think I m getting very close now. but I have one thing not sure about recursion. for example, let's take look of the code you offered me: Func RunMouseMoves() For $i=0 To Ubound($aMouseXY)-1 If Not ErrorCheck Then MouseMove($aMouseXY[$i][0], $aMouseXY[$i][0]) Else $i = Ubound($aMouseXY)-1 RunMouseMoves() EndIf Next EndFunc if I call RunMouseMoves() inside of RunMouseMoves() and RunMouseMoves() finishes and exits what happens to RunMouseMoves()? will it continue to execute? because idealy i would like it just to die out; or maybe that is the place the ExitLoop you mentioned should go in? my last question, thank you so much for looking into it.
  15. what are you .... [any verb in here]ing here/today? I have to keep asking the same question because trolls like you have to ruin others' posts. if it bothers you so much then go look elsewhere.
  16. Thanks alot 59FIFTY, thanks for taking the time and read my concerns and helping out. BUt you offered something really interesting there: a function calls itself!! something reminds me of recursing. I will play around with it a bit, thanks again and problem might get complicated a lot, since those mouse movements I put there just represents my lots-of-codes with tons of mouse moves, key presses, control checkings, color checkings...
  17. right, true knowledge requires an endless pursuit, and I haven't found a solution yet. basically I m writting a automated bot to interface with a web-based database application, so it can write data to it. everything I can handle so far, but if the internet disconnects me and the application crashes, my bot can't do anything about it. thus I figured to use "Adlibenable" to catch the application crash and restart the application; but after the application is restarted, I couldn't find a way to tell the bot to stop where it were interrupted, and restart to interface with the application from the beginning again. by the way, i m not a programmer, everything I know is from matlab. Matlab sure doesn't have that feature I m looking for, but I sure hope AutoIt has some working-arounds.
  18. AdlibEnable("_error_check") ;============================= ;main script _start_application() while 1 mousemove(1, 1) mousemove(1, 2) mousemove(1, 3) mousemove(1, 4) mousemove(1, 5) mousemove(1, 6) mousemove(1, 7) mousemove(1, 8) mousemove(1, 9) mousemove(1,10) WEnd ;============================= func _error_check() if excel.exe crashed then _start_application();restart the application goto mousemove(1, 1);<<=============Can this be done in AutoIT?===================== ;if the main loop is @ mousemove(1, 4) at the moment, I need the loop to stop there, skip mousemove(1, 5) to mousemove(1, 10), ; and then go back to the beginning of the loop endif EndFunc func _start_application() run excel.exe EndFunc two things I have learnt so far that I can do: 1. use a flag in front of every line, add if-else in front of every "mousemove()", so if I have 1000lines of "mousemove()" then 1000 if-else 2. compile the while loop into a separate exe file, and call that exe from the main script I need more ideas, please help.
  19. I am hoping for some other ways other than creating a new process. and I think what I am asking is very simple, and it is pretty common if any scripts want to handle some exceptions, not sure why are ppl so frustrated about.
  20. Yeah, I think I sort of understnd how loop works, it will either run the WHOLE thing inside the loop or it does not run ANYthing at all. what if an interrupt happens right IN THE MIDDLE (or anywhere inside) of the loop and I don't want the loop to continue anymore? AdlibEnable("_error_happened") ;============================= ;main script _start_application() while 1 mousemove(1, 1) mousemove(1, 2) mousemove(1, 3) mousemove(1, 4) mousemove(1, 5) mousemove(1, 2) mousemove(1, 3) mousemove(1, 4) mousemove(1, 5) mousemove(1, 2) mousemove(1, 3) mousemove(1, 4) mousemove(1, 5) mousemove(1, 2) mousemove(1, 3) mousemove(1, 4) mousemove(1, 5) mousemove(1, 2) mousemove(1, 3) mousemove(1, 4) mousemove(1, 5) WEnd ;============================= func _error_happened() _start_application();restart the application goto mousemove(1, 1) EndFunc func _start_application() run excel.exe EndFunc so anyway to complete the above pseudo code without modifying the while loop?
  21. I do have an unothodox method to do what I want: I can make 500lines of code into a separate exe file, then I can terminate it and restart it anytime I want.
  22. thanks, but that will only break the while loop after it ran though 500 lines of code. my question is more like how to break the loop anywhere inside that 500lines of code: if the script is on line 345, I call _breakloop() then the rest of 155lines won't be executed at all.
  23. My script is used to interface with the GUI of an application, it looks like: while not $done routine1 routine2 routine3 routine4 routine5 wend and an "AdlibEnable("_msgBox")" to handle the interrupts each routine will contain codes to generate some mouse and keyboard events to work with a certain part of an application. I need a way to restart to routine1 when an interrupt occurs. so suppose the script is in the middle of routine3 and trying to click on a textbox and send a text string, the application just crashes. my _msgbox() will handle that and restart the application, then exit, thus routine3 will continue to run, which is not what I wanted, I don't need any mouseclick or send strings that remains in routine3 anymore; I need the script to go back to routine1. I am looking for something like this: func _msgBox() restart the application goto start of routine1 endfunc any help and suggestions will be much appreciated. thanks
  24. well, that do if not $gBreak then Function1() if not $gBreak then Function2() if not $gBreak then Function3() Until $gBreak = 1 is exactly what my main loop looks like but every "Function1" in there will have their own loops and error checking mechanisms that will totally get stuck if the application I am working with terminates (imagine my script is filling an application's textbox1 with "userName" then my application just crashes, after my AdLibenable restarts the application, do you want to script to "press tab" and "Send("password")" and "starts clicking on screen checking emals" or start from the beginning to find where the progress is at first?) so the only solution is to add "if not $gBreak" in front of every single line of code?
×
×
  • Create New...