Tuesday, July 28, 2009

Does anyone know how to make a c++ program that thinks you are clicking every 10 seconds?

I need to know how to make a program that thinks i a clicking every ten seconds. It can be in C++, C, Ruby, Java or Blitz Basic 3d. Please let me know as soon as possible.

Does anyone know how to make a c++ program that thinks you are clicking every 10 seconds?
The most effective way would be to use a on break loop in c++ then create another loop inside this with an if statement or simular as a counter. use the counter for timing and execute a simple line command to return the /n key or what ever key you requireafter the timer has run down.This will run until the break key is pressed.





You can find all this online under basic C++


should only be around 20-30 lines of code
Reply:what toolkit are you using. C++ is only a language not the API.
Reply:You can do this type of thing with a ruby script and the rubyforge win32 api. See link below.





Here's a sample ruby script that looks for certain dialogs in certain windows and clicks them.





The following code is in the initializer of the test class and starts up the clicker process





require 'win32/process'





@pid = Process.create(


:app_name =%26gt; 'ruby clicker.rb',


:creation_flags =%26gt; Process::DETACHED_PROCESS


).process_id








at_exit{ Process.kill(9,@pid) }





and the clicker.rb looks like the following





require 'win32ole'





begin


autoit = WIN32OLE.new('AutoItX3.Control')





loop do


autoit.ControlClick("Microsoft Internet Explorer",'', 'OK')


autoit.ControlClick("Security Information",'', '%26amp;Yes')


autoit.ControlClick("Security Alert",'', '%26amp;Yes')


sleep(5)


end





rescue Exception =%26gt; e


puts e


end
Reply:Clicking what and where? Just clicking the mouse anywhere or in a particular spot.





Anyway, depending on the language and framework you are using, you could set a timer and 1) generate a click event like the OS sends to your app if your language allows that, or 2) just manually call the onClick() event for some component in your application





you need to be more specific probably.


No comments:

Post a Comment