Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VERY easy question (Wait, Then Repeat)
#1
Hello everyone! Im writing a VERY simple macro in which I would like it too do the following

Code:
Copy      Help
rig+ 634 222 w1
rig- 635 241 w1
lef+ 618 294 w1
lef- 625 283 w1
rig+ 682 225 w1
rig- 681 245 w1
lef+ 659 299 w1
lef- 650 297 w1
rig+ 349 280 w1
rig- 351 291 w1
lef+ 333 353 w1
lef- 335 350 w1
rig+ 416 266 w1
rig- 415 266 w1
lef+ 410 336 w1
lef- 409 337 w1

I would like it too wait 5 seconds after it does that, then restart again.



(If possible is it easy too add a hotkey too stop it?)
#2
Code:
Copy      Help
spe 100
rep
,rig+ 634 222 w1
,rig- 635 241 w1
,lef+ 618 294 w1
,lef- 625 283 w1
,rig+ 682 225 w1
,rig- 681 245 w1
,lef+ 659 299 w1
,lef- 650 297 w1
,rig+ 349 280 w1
,rig- 351 291 w1
,lef+ 333 353 w1
,lef- 335 350 w1
,rig+ 416 266 w1
,rig- 415 266 w1
,lef+ 410 336 w1
,lef- 409 337 w1
,5

If it's a macro then the Pause/Break key in the top right corner of your keyboards should stop it. If not read this:

Code:
Copy      Help
If key is pressed
Syntax
ifk[-] keycode [toggled]
(tab)    statement
(tab)    ...
[else
(tab)    statement
(tab)    ... ]
...



Can be single line:

ifk[-](keycode [toggled]) statement ...
[else statement ...]



Parts
keycode - QM key code. Also can be virtual-key code enclosed in parentheses. Also can test mouse buttons. Virtual-key codes for mouse buttons: 1 left, 2 right, 4 middle.

toggled - if nonzero, check whether key is toggled.

statements - any statements.

Options: - not.



Remarks
Similar to if. If the specified key is pressed, execute statements after ifk and skip statements after else (if any). Otherwise, skip statements after ifk and execute statements after else.



Not all keys and key combinations give correct result. For example, on some operating systems you cannot test the Pause key.



See also: GetMod.



Examples
ifk(F2) bee  if key F2 pressed, beep
ifk(K 1) key K  if key CapsLock toggled, press CapsLock
ifk((1)) bee  if left mouse button pressed, beep

Repeatedly execute some code; stop when key F12 is pressed:
rep
    ...
    ifk(F12) break
Taking on Quick Macros one day at a time
#3
rep( )
rig+ 634 222 w1
rig- 635 241 w1
lef+ 618 294 w1
lef- 625 283 w1
rig+ 682 225 w1
rig- 681 245 w1
lef+ 659 299 w1
lef- 650 297 w1
rig+ 349 280 w1
rig- 351 291 w1
lef+ 333 353 w1
lef- 335 350 w1
rig+ 416 266 w1
rig- 415 266 w1
lef+ 410 336 w1
lef- 409 337 w1
wait 5
#4
Thank you both very much!

I really appreciate the community here, =)
#5
Your welcome.
Taking on Quick Macros one day at a time


Forum Jump:


Users browsing this thread: 1 Guest(s)