Sign in to follow this  
Followers 0
joshb

Help with AutoIt Function

12 posts in this topic

Hello,

I am new to AutoIt but I do understand it enough to do what I need to as far as my program which is really simple and noobie.

The problem I am having is I want to run the program that sends commands to another program while both are running in the background. So I may be able to web surf or maybe play another game. Is this possible? Here is a simple example my code:

Sleep(10000)
For $count = 1 To 200000
Next
For $count = 1 To 200000
    
  Send("1")
   Sleep(1000)
   Send("q")
   Sleep(1000)
   Send("l")
   Sleep(500)
   MouseClick("left")
   Sleep(20000)
   Send("2")
   Sleep(2000)
   Send("l")
   MouseClick("left")
   Sleep(20000)
   Send("3")
   Sleep(2000)
   Send("l")
   MouseClick("left")
   Sleep(20000)
   Send("4")
   Sleep(2000)
   Send("l")
   MouseClick("left")
   Sleep(20000)
   Send("5")
   Sleep(2000)
   Send("l")
   MouseClick("left")
   Sleep(20000)
   Send("q")
   Sleep(1000)
   Send("5")
   Sleep(1000)  

   Next

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

ooops, lol yeah...

Edited by DarkDragon

Share this post


Link to post
Share on other sites

Ty for your response. Do I have to direct the AutoIt program to the program I want to use it or will ControlSend(),ControlClick() be enough...

Share this post


Link to post
Share on other sites

Line 6

ControlSend("1")

^ERROR

Error:Incorrect number of parameters in function call.

is the message I'm getting.Here is my code revised...

Sleep(10000)
For $count = 1 To 200000
Next
For $count = 1 To 200000
    
  ControlSend("1")
   Sleep(1000)
   ControlSend("q")
   Sleep(1000)
   ControlSend("l")
   Sleep(500)
   ControlClick("left")
   Sleep(20000)
   ControlSend("2")
   Sleep(2000)
   ControlSend("l")
   ControlClick("left")
    Sleep(20000)
   ControlSend("3")
   Sleep(2000)
   ControlSend("l")
   ControlClick("left")
    Sleep(20000)
   ControlSend("4")
   Sleep(2000)
   ControlSend("l")
   ControlClick("left")
    Sleep(20000)
   ControlSend("5")
   Sleep(2000)
   ControlSend("l")
   ControlClick("left")
   Sleep(20000)
   ControlSend("q")
   Sleep(1000)
   ControlSend("5")
   Sleep(1000)  

   Next

Share this post


Link to post
Share on other sites

ty for the links somdcomputerguy one more thing do i have to input all ie can i just say ControlSend ( "Darkfall Online" [,flag])for that window? im not writing text just simulating keystrokes. I don't know how to find the controlID, or do I need all " " filled? ControlSend ( "title", "text", controlID, "string" [, flag] )

Share this post


Link to post
Share on other sites

should it look something like this?

Sleep(10000)
For $count = 1 To 200000
Next
For $count = 1 To 200000
    
  ControlSend("Darkfall Online", "", "", "1")
   Sleep(1000)
   ControlSend("Darkfall Online", "", "", "q")
   Sleep(1000)
   ControlSend("Darkfall Online", "", "", "l")
   Sleep(500)
   ControlClick("Darkfall Online", "", "", "left")
   Sleep(20000)
   ControlSend("Darkfall Online", "", "", "2")
   Sleep(2000)
   ControlSend("Darkfall Online", "", "", "l")
   ControlClick("Darkfall Online", "", "", "left")
    Sleep(20000)
   ControlSend("Darkfall Online", "", "", "3")
   Sleep(2000)
   ControlSend("Darkfall Online", "", "", "l")
   ControlClick("Darkfall Online", "", "", "left")
    Sleep(20000)
   ControlSend("Darkfall Online", "", "", "4")
   Sleep(2000)
   ControlSend("Darkfall Online", "", "", "l")
   ControlClick("Darkfall Online", "", "", "left")
    Sleep(20000)
   ControlSend("Darkfall Online", "", "", "5")
   Sleep(2000)
   ControlSend("Darkfall Online", "", "", "l")
   ControlClick("Darkfall Online", "", "", "left")
   Sleep(20000)
   ControlSend("Darkfall Online", "", "", "q")
   Sleep(1000)
   ControlSend("Darkfall Online", "", "", "5")
   Sleep(1000)  

   Next

Share this post


Link to post
Share on other sites

Ok I've made some progress! The code works but it doesn't register as a keystroke in game like i want it to. When i run it, it looks like nothing is happening until i click on the chat window in the game then i see it running. ie it inputs the letters and numbers.

Share this post


Link to post
Share on other sites

Yopu might want to review this passage you agreed to before you get yourself banned from the game.

12. Active Game and Account Monitoring. You agree that Aventurine may use whatever procedures or protocols it may deem necessary to monitor your computer and activity in the Game and the World. This may include, but is not limited to, monitoring your personal computer to determine the validity of your installation you account and the Game and to assure that you are not using any third party software that might violate this EULA and the TOS. You agree that Aventurine or its authorized agents may monitor, by any means, your computer’s CPU, operating system, video card, sound card and memory information in order to analyze and optimize your Game experience, improve and maintain the Game and the World or to provide customer service.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Mass Spammer! thanks but I know this. Macroing in game is not against AV policy as long as you are at your computer. I just want to be able to check my fantasy BB scores while im running this program without having to break/pause the program.

Share this post


Link to post
Share on other sites

Read notice on top of 'General Help and Support' (or in my sig.)

Its not to b discused if its classified as MMO and your trying to automate it


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0