Post by Victor on Sept 13, 2021 21:51:01 GMT
Hello once again, i just did a quick macro to do something for my work and realized that by using the IF condition i could do a lot more with this macro. the thing is i don't know if theres a way to make a random keypress between (for example) F, V, C, A, D. So when the macro randomly presses one of these 5 keys then i copy that letter, and the IF condition will replace that letter with something else. I'll post here the macro i just made for this.
1 | 252 | 183 | 100 | Keypress Ctrl+ | c
2 | 292 | 263 | 100 | Keypress right | loop 4::150
3 | 1420 | 880 | 150 | Left Click
4 | 75 | 75 | 1000 | Left Click
5 | 244 | 205 | 150 | Keypress Ctrl+ | v
6 | 244 | 205 | 150 | Keypress enter
7 | RUN ACTION | WAIT SECONDS | %random_180-300%
8 | 75 | 75 | 150 | Left Click
9 | 245 | 880 | 150 | Left Click
10 | 241 | 261 | 1000 | Keypress enter --- Here it selects the cell in Excel
11 | 265 | 321 | 250 | Keypress %random_v-f% --- Here i tried using the %random% code for time but insted of pressing the letter itself it just types 0 or 1, so i just did 2 examples on the IF variable, but if i could make more than 0 and 1 then i'd replace those with something else
12 | 334 | 334 | 150 | Keypress Ctrl+ | a
13 | 334 | 334 | 150 | Keypress Ctrl+ | c
14 | IF | CLIPBOARD | VALUE | TEXT CONTAINS | 0 | KEYPRESS | Fast Busy --- And here's what i figured i could do to replace the values (It's also the very first time i actually use this variable)
15 | IF | CLIPBOARD | VALUE | TEXT CONTAINS | 1 | KEYPRESS | Voicemail ---
16 | 329 | 337 | 250 | Keypress tab
17 | 242 | 357 | 250 | Keypress left | loop 5::150
18 | 242 | 357 | 250 | Keypress down
1 | 252 | 183 | 100 | Keypress Ctrl+ | c
2 | 292 | 263 | 100 | Keypress right | loop 4::150
3 | 1420 | 880 | 150 | Left Click
4 | 75 | 75 | 1000 | Left Click
5 | 244 | 205 | 150 | Keypress Ctrl+ | v
6 | 244 | 205 | 150 | Keypress enter
7 | RUN ACTION | WAIT SECONDS | %random_180-300%
8 | 75 | 75 | 150 | Left Click
9 | 245 | 880 | 150 | Left Click
10 | 241 | 261 | 1000 | Keypress enter --- Here it selects the cell in Excel
11 | 265 | 321 | 250 | Keypress %random_v-f% --- Here i tried using the %random% code for time but insted of pressing the letter itself it just types 0 or 1, so i just did 2 examples on the IF variable, but if i could make more than 0 and 1 then i'd replace those with something else
12 | 334 | 334 | 150 | Keypress Ctrl+ | a
13 | 334 | 334 | 150 | Keypress Ctrl+ | c
14 | IF | CLIPBOARD | VALUE | TEXT CONTAINS | 0 | KEYPRESS | Fast Busy --- And here's what i figured i could do to replace the values (It's also the very first time i actually use this variable)
15 | IF | CLIPBOARD | VALUE | TEXT CONTAINS | 1 | KEYPRESS | Voicemail ---
16 | 329 | 337 | 250 | Keypress tab
17 | 242 | 357 | 250 | Keypress left | loop 5::150
18 | 242 | 357 | 250 | Keypress down