Jump to content

Really Just Another Sad Newbie Begging For Code. Lol


Recommended Posts

Hi There.. Long Time Lurker.. Extremely Seldom Poster

What I'm Currently Trying To Do, Is Force Mouse Movements Untill A Specific Keypress Is Registered.. And At That Point, Pause The Entire Script Untill That Keypress Is Registered Again..

My Current Level Of Coding Is Nil, I'm Parting Out The Doc's As I Can And Using The Window Recording Function.. But All I've Mustered Up So Far Is Simple Mouse Movement And Interaction

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

MouseMove(804,510)

MouseClick("left", 804,510, 1)

Sleep(250)

MouseMove(812,541)

MouseClick("left", 812,541, 1)

Sleep(1000)

If Anyone Has The Time To Slap Together A "press p to start automation, and p again to pause it" Script, You Would Make My Life. =D

Link to comment
Share on other sites

Hi There.. Long Time Lurker.. Extremely Seldom Poster

What I'm Currently Trying To Do, Is Force Mouse Movements Untill A Specific Keypress Is Registered.. And At That Point, Pause The Entire Script Untill That Keypress Is Registered Again..

My Current Level Of Coding Is Nil, I'm Parting Out The Doc's As I Can And Using The Window Recording Function.. But All I've Mustered Up So Far Is Simple Mouse Movement And Interaction

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

MouseMove(804,510)

MouseClick("left", 804,510, 1)

Sleep(250)

MouseMove(812,541)

MouseClick("left", 812,541, 1)

Sleep(1000)

If Anyone Has The Time To Slap Together A "press p to start automation, and p again to pause it" Script, You Would Make My Life. =D

the helpfile entry for hotkeyset has a pause demo script you should be able to implement.

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d

;;;; Body of program would go here;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc

***edit*** put my start code tag where it should have been.

Edited by cameronsdad
Link to comment
Share on other sites

I wrote this up to keep some computers awake while running some upgrades on them...hope it helps.

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

;;;; Body of program would go here;;;;
While 1
    MouseMove(Random(1, @DesktopWidth), Random(1,@DesktopHeight))
    Sleep(1000)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Most of that was pulled directly from the helpfile. Check out HotKeySet to see what you can change that "{PAUSE}" key to. Or just leave it that way if that is the key you are looking for.

Dont forget to give credit if you are going to use my script.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

JS, I Might Not Use Your Script Directly, But I Think I Might "steal" That First Quote In Your Signature :(

Who Said That, BTW? Any Idea?

hehe... I dont care... most of my code was copied and pasted out of the helpfile :) I appreciate your honesty in asking for code directly and not whining about it.

The first quote in my sig... well the first sentance is the actual quote... I added the second sentance myself about a year ago.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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...