NEWBIE ??? How do I run functions after certain times...

Advanced Macro Recorder/Editor.

Moderator: Pulover

Hanszi11a
Posts: 10
Joined: 13 Nov 2020, 07:16

NEWBIE ??? How do I run functions after certain times...

Post by Hanszi11a » 13 Nov 2020, 12:47

Hey there!
I just started using PMC and I have NO experience with any type of coding. This tool is REALLY nice and I'm looking forward to learning more and more!
I am creating a macro for a game in bluestacks. I want to "farm" items in the 1st macro and then have different functions run and repeat during that time.
For example:
I have a space ship set to attack any hostile that comes near me and this is looping continuously. I have functions like help alliance members and collect random gifts that I want to run every 2 - 10 minutes depending on the function. How would I structure this in the main macro for PMC?

Also, I have functions that scroll the screen left, right, up and down. How do I call these functions to run randomly? Using the scenario above; I have my space ship attack a hostile and scan for another. If it doesn't find one I have it call the specific direction function to scroll the screen to find another hostile. How can I make that call to a specific driection do a random direction in PMC?

Again, please remember that I'm SERIOUSLY new to this and so please keep it simple.
Thanks in advance for your help!!!

-Hanszilla
User avatar
Pulover
Posts: 545
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: NEWBIE ??? How do I run functions after certain times...

Post by Pulover » 13 Nov 2020, 13:45

  • Commands -> Run / File / String / Misc. -> Random
  • Commands > Set timer
You can use :arrow: Variables in the command parameters to set random values created with the Random command.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Hanszi11a
Posts: 10
Joined: 13 Nov 2020, 07:16

Re: NEWBIE ??? How do I run functions after certain times...

Post by Hanszi11a » 13 Nov 2020, 15:24

THANK YOU! The timer control works perfectly! I can't wait to incorporate it! I am still very confused on the variables though. I read through the link you posted and it made me dizzy. Would it be possible for you to give me an example of the syntax I would use or how to set up the direction functions as variables? Below is a brief sample of my macro to scan for a hostile. Right now it scans and if it doesn't find the image/pixel it goes through ALL the directions. I would like it to randomly go in one direction and then scan for a hostile.
image.png
image.png (13.7 KiB) Viewed 404 times
Hanszi11a
Posts: 10
Joined: 13 Nov 2020, 07:16

Re: NEWBIE ??? How do I run functions after certain times...

Post by Hanszi11a » 15 Nov 2020, 12:04

Any ideas?
User avatar
Pulover
Posts: 545
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: NEWBIE ??? How do I run functions after certain times...

Post by Pulover » 15 Nov 2020, 19:37

Why don't you show us what you've done and we'll help you get what you want?
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Hanszi11a
Posts: 10
Joined: 13 Nov 2020, 07:16

Re: NEWBIE ??? How do I run functions after certain times...

Post by Hanszi11a » 16 Nov 2020, 10:33

Here's the code I have so far for the ship attack portion... I have created move screen functions and other macros. So what I want to do is have lines 9-12 be random if a ship isn't found. If a ship isn't found first, it will move randomly in one direction, scan the screen for a hostile and attack if it's found. If it's not found it goes to another random direction and on an and...

Thank you SO much for the help! I really appreciate it!
image.png
image.png (76.99 KiB) Viewed 328 times
User avatar
Pulover
Posts: 545
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: NEWBIE ??? How do I run functions after certain times...

Post by Pulover » 16 Nov 2020, 10:51

Use the Random command to create the variables and put them in the coordinates enclosed in percent signs.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Hanszi11a
Posts: 10
Joined: 13 Nov 2020, 07:16

Re: NEWBIE ??? How do I run functions after certain times...

Post by Hanszi11a » 16 Nov 2020, 13:33

@pulover Can you give me an example please?
User avatar
Pulover
Posts: 545
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: NEWBIE ??? How do I run functions after certain times...

Post by Pulover » 16 Nov 2020, 13:43

The link I gave you has an example using Random and Click right off in the introduction.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
foozilla
Posts: 3
Joined: 30 Dec 2020, 10:04

Re: NEWBIE ??? How do I run functions after certain times...

Post by foozilla » 30 Dec 2020, 10:55

Hanszi11a wrote:
16 Nov 2020, 10:33
Here's the code I have so far for the ship attack portion... I have created move screen functions and other macros. So what I want to do is have lines 9-12 be random if a ship isn't found. If a ship isn't found first, it will move randomly in one direction, scan the screen for a hostile and attack if it's found. If it's not found it goes to another random direction and on an and...

Thank you SO much for the help! I really appreciate it!

image.png
What is this screenshot of? A custom gui you made? Or is it a macro viewer?

EDIT: Pulover macro creator. Pretty neat. Thanks for the image which sparked my interest.
Hanszi11a
Posts: 10
Joined: 13 Nov 2020, 07:16

Re: NEWBIE ??? How do I run functions after certain times...

Post by Hanszi11a » 06 Jan 2021, 12:03

The screen capture is from Pulover's Macro creator. It's pretty awesome, although I am still wrestling with how to make random directions. Other than my own lack of knowledge in coding it's pretty great! :)
Post Reply

Return to “Pulovers Macro Creator”