Need Help To Make some simple Macro Scrpt >.<

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
am3s22
Newbie
Posts: 4
Joined: Tue May 22, 2007 11:28 am
Location: Philippines

Need Help To Make some simple Macro Scrpt >.<

Post by am3s22 » Thu May 24, 2007 2:34 pm

i just want to make this simple program that :

1. will ask for time for a key to be pressed

2. and then ask again for a time for a key to be pressed

3. and then again and again ^_^ just like that

just press,not to hold a key ...

ty in advanced.

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

Not sure I follow

Post by Aaron » Thu May 24, 2007 4:43 pm

Are you wanting a popup window to ask you for a time?

OR

Are you wanting a script that presses a key waits for a given amount of time then presses the net key?
Aaron

am3s22
Newbie
Posts: 4
Joined: Tue May 22, 2007 11:28 am
Location: Philippines

Post by am3s22 » Tue May 29, 2007 7:21 pm

yup a pop up window will ask the time for a key to be pressed..

then it will loop back from the start ...

thanks in advanced ..

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

heres what you need to do

Post by Aaron » Wed May 30, 2007 4:21 pm

Get the system time

If>time=TimeToPushKey

Bla Bla Bla

Endif




Use the dialog Builder, to call your input prompt.


Hope this helps
Aaron

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Wed May 30, 2007 10:20 pm

Here is a simple way to do it without a fancy dialog.

Code: Select all

Label>Start
// Get current system time to display in input dialog as an example
GetTime>TimeToDisplay

// Disable input file browse
Let>INPUT_BROWSE=0

// Open input dialog
Input>InputTime,Enter the time (HH:MM:SS AM/PM) when to press the T key.,%TimeToDisplay%

// Exit script if close or cancel button clicked
if>InputTime=,Exit

Label>WaitLoop
  Wait>0.1

  // Get current system time
  GetTime>CurrentTime

  // Compare current system with input time
  // If current system time equals the time entered press the T key
  IF>CurrentTime=%InputTime%,Press_T
Goto>WaitLoop

label>Press_T
  // Notepad window will open to illustrate that the T key was pressed/sent.
  Run Program>Notepad
  WaitWindowOpen>Notepad*
  SetFocus>Notepad*

  // Pressing T key
  Send Character/Text>T

  // Start over
Goto>Start

Label>Exit
I hope this was helpful,

Rain

am3s22
Newbie
Posts: 4
Joined: Tue May 22, 2007 11:28 am
Location: Philippines

Post by am3s22 » Sun Jun 03, 2007 5:12 pm

thanks for your help rain :D

can u help me again with this one.. :(

its has the similarity with the 1st one

a pop up window will ask again the time, but not in the format of HH/MM/SS , it will just ask a time by a format of seconds only..for a key to be simulteanously be pressed..then when the time(seconds) inputed
become 0, the 2nd pop up window with the same question will appear..

but can u help me do that it will loop to the part of the program that the key is being pressed simultaenously not to the part the pop up window,
sorry for my bad english..i cant explain it well grr .. its just after the 2nd key is done to be pressed, it will loop again to the 1st key that is assign to be pressed then the second key again... but skipping the part of the pop up window...

thank you hope you get my explanation..

hope u could help me the same way rain did..^_^
a complete program.. not just a part of it.. tnx tnx :D

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Tue Jun 05, 2007 2:16 pm

Here you go.

Code: Select all

Label>Start

// Disable input file browse
Let>INPUT_BROWSE=0

// Open input dialog
Input>InputTime,Enter the time in seconds when to press the T key.,10

// Exit script if close or cancel button clicked
if>InputTime=,Exit

// Set counter
let>Sec_Counter=0

Label>WaitLoop
  Wait>1

  // Add 1 to Sec_Counter ever second
  Add>Sec_Counter,1

  // If Sec_Counter equals the number seconds entered press the T key
  IF>Sec_Counter=%InputTime%,Press_T
Goto>WaitLoop

label>Press_T
  // Notepad window will open to illustrate that the T key was pressed/sent.
  Run Program>Notepad
  WaitWindowOpen>Notepad*
  SetFocus>Notepad*

  // Pressing T key
  Send Character/Text>T

  // Start over
Goto>Start

Label>Exit
Rain

am3s22
Newbie
Posts: 4
Joined: Tue May 22, 2007 11:28 am
Location: Philippines

Post by am3s22 » Wed Jun 06, 2007 10:28 am

thanks again Rain :D

anyway how can i declare if i want the T to be pressed once
then it will shift to another character.. then it will loop again to the Press_T.

i got this problem when pressing the T, its like ur holding it...

how can i delay the time of pressing the T char. tnx ^^

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Wed Jun 06, 2007 2:22 pm

You can send more than one character with Send Character/Text
Example:
Send Character/Text>ABCDEFG

SK_DELAY will slow down the speed at which each character in the string is sent. Search for Send Character/Text in the help file and look for SK_DELAY


Rain

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts