Jump to content

Issues with send command in firefox


Recommended Posts

Hi everyone. I am an AutoIt newbie and just a general coding noob. I am trying to code something in Autoit to help me automate some tasks online a simple mouseclick and keyboard command type of program. Currently with what I have coded, it seems that it has issues when it reaches the send("{SPACE}") command. Sometimes it will press Space once, but most of the time it totally just doesn't register the two send commands and goes through the rest of the program. Any help would be appreciated. Thanks!

Global $Paused
HotKeySet("=","togglepause")  ;script started by pressing =
HotKeySet("x", "terminate") ;script stopped by pressing x

While 1
    Sleep(500)
   ToolTip("Not Running Hit '=' to start/pause 'x' to force end!", 0, 0)
WEnd

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
      ToolTip("Running!", 0, 0)
        
   MouseClick("left",1063,546,1)
   Sleep(6000)
   Send("{SPACE}")
   Sleep(4000)
   Send("{SPACE}")
   Sleep(10000)
   MouseClick("left", 773,718,1)
   Sleep(5000)
   MouseClick("left", 1022,603,1)
   Sleep(2000)
      
    
   WEnd
      
      
   EndFunc
   
   Func Terminate()
    Exit 0
EndFunc
Link to comment
Share on other sites

Try putting BlockInput in there, don't forget to call it again to allow input.  That's only if there is a possibility of a user or another program moving the mouse or pressing keys.  IF there is not that possibility then I don't know.  It worked for me.  Also, the While $paused means that it will run when it is paused.  While Not $paused might offer more expected behavior.  It works either way though.

Edited by jaberwocky6669
Link to comment
Share on other sites

Thanks for the quick reply Jaberwocky. I tried adding BlockInput and changed it to Not $paused and I am still getting the same results. First time I ran the program, it would just hit space once. I stopped the program and then restarted it, and it didn't hit space at all. Lol this is driving me crazy, because it seems like i did everything correctly but for some reason its not working for me.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...