Jump to content
AC Tool Forums
Sign in to follow this  
ArcherRojas

Need some help on this script

Recommended Posts

Okay lemme check the code and I will return with news , also I've got another question, do we have a more complete help section of the commands of ac tool? so I can read in detail what means every command? I think that the one that comes with the app is not complete. @Ego

Edited by ArcherRojas

Share this post


Link to post
Share on other sites

@ArcherRojas

The reason that your code with the Keys, or sKeys, command is not working. Is because when AC Tool presses a key, it does so for .002 seconds. For some games this is too quick for the game to know that they key was pressed. In order for you to get the script, or any script, to function properly for your game. You need to add the KeyRate command as Ego has already suggested to you, and as I was going to suggest when I read your response. For some games you may also to need to use the MouseClickDelay command to allow the game to recognized that the mouse button was pressed.

When you use the KeyRate, or the MouseClickDelay, you want to use it before any other command in your script to set the default values. And then you use them again when you come to a point when you may need to change the value because it is still too fast at that point in the game. But, when you do, you have to always reset the value for KeyRate and MouseClickDelay to what you set as the default value.

So your full script should look like that following:

// This command adjusts how quickly, or slowly, AC Tool
// presses a key. The lower the number the quicker the
// key is pressed. The higher the number the slower the
// key is pressed.
//
// Adjust the number up to slow down the
// pressing of the keys until your game recognizes
// that the key has been pressed.
//
// NOTE: No matter what game you are playing.
// KeyRate show not be higher than 50, and
// even then that is way to slow.
KeyRate 10

// Set the game window as the active window
SetActiveWindow Granado Espada Andromida

// wait for 2 seconds to allow time for the
// game window to become the active window
// NOTE: change the amount of delay, up or down,
// to allow just enough time to allow the game
// window to be the active window.
Delay 2 sec


while 1 = 1
	// Call the Builder_Summoner_1 procedure
	call Builder_Summoner_1
	// Call the Builder_Summoner_2 procedure
	call Builder_Summoner_2
	// Call the Buff procedure
	call Buff
end

Procedure Builder_Summoner_1 //builder/summoner 1
	// Press the w key. I don't know what
    // pressing the w key does.
	keys w
	// Wait 1 second, i don't know why
	delay 1 sec
	// Press the Left Mouse button
	leftclick
	// Wait 3 seconds
	delay 3 sec
	// Press the e key. I don't know what
    // pressing the e key does.
	keys e
	// Wait 1 second, i don't know why
	delay 1 sec
	// Press the Left Mouse Button
	leftclick
	// Wait 3 seconds
	delay 3 sec
	// Press the r key. I don't know what
    // pressing the r key does.
	keys r
	// Wait 1 second, i don't know why
	delay 1 sec
	// Press the Left Mouse Button.
	leftclick
	// Wait 3 seconds
	delay 3 sec
	// Press the q key. I don't know what
    // pressing the q key does.
	keys q
end

Procedure Builder_Summoner_2 // builder/summoner 2
	// Press the x key. I don't know what
    // pressing the x key does.
	keys x
	// Wait 1 second, i don't know why
	delay 1 sec
	// Press the Left Mouse Button.
	leftclick
	// Wait 3 seconds
	delay 3 sec
	// Press the c key. I don't know what
    // pressing the c key does.
	keys c
	// Wait 1 second, i don't know why
	delay 1 sec
	// Press the Left Mouse Button.
	leftclick
	// Wait 3 seconds
	delay 3 sec
	// Press the v key. I don't know what
    // pressing the v key does.
	keys v
	// Wait 1 second, i don't know why
	delay 1 sec
	// Press the Left Mouse Button.
	leftclick
	// Wait 3 seconds
	delay 3 sec
	// Press the z key. I don't know what
    // pressing the z key does.
	keys z
end

procedure Buff //buff
	// Press the i key. I don't know what
    // pressing the i key does.
	keys i
	// Wait 5 min.
	delay 5 min
end

As you can see this is using the last full script that you posted. And that I had made the following changes:

  1. I changed the procedure names to something that tells you what the procedure does.
  2. I also added comments to tell you what each command is supposed to do.
    Each comment, or block of comments, is for the command directly below them.
  3. I also moved the procedures to be below the main part of the script code.
    This makes it so that all of the main code is together and it also makes it easier for anyone to read the code.
  4. I added the KeyRate command
  5. And I added a Delay command right after the SetActiveWindow command. As Ego had already suggested to you.

 

Share this post


Link to post
Share on other sites

As for your needing to run the code in what you call procedure 3 every 5 minutes or so. I know of 5 different ways in how to implement this. Only one of which is what @Ego suggested. But, I had asked you specifically what is this script is supposed to do. And you never answer that question. So, I can not suggest what ways to code that part of the script. And even though @Ego had suggested that combining two of the procedures together is a good suggestion. It may not be the right way of writing your script. And we can not truly any suggestions without knowing what your script is supposed to do.

Share this post


Link to post
Share on other sites
20 minutes ago, The WABBIT said:

As for your needing to run the code in what you call procedure 3 every 5 minutes or so. I know of 5 different ways in how to implement this. Only one of which is what @Ego suggested. But, I had asked you specifically what is this script is supposed to do. And you never answer that question. So, I can not suggest what ways to code that part of the script. And even though @Ego had suggested that combining two of the procedures together is a good suggestion. It may not be the right way of writing your script. And we can not truly any suggestions without knowing what your script is supposed to do.

Okay so I will test the code that you kindly added and update when I test it I kind of understand what the keyrate does, also what this code does is to cast the differen skills of the 3 characters as you can see on the screenshot there are 3 characters each with a series of skills what I do for the procedures for builder/summoner 1 and 2 is to cast the skill but it need to click a part of the map for the summon to work that why first it presses the key and the leftclick , thats for the first 2 procedures wich I have already condensed in just one procedure, as for the third procedure is a skill buff that needs to be casted every 5 minutes wich is the part that I havent figured out yet.

 

Update: I have added a video on how does the builder/summoner skill works

Captura.PNG

Edited by ArcherRojas

Share this post


Link to post
Share on other sites
18 hours ago, ArcherRojas said:

Okay lemme check the code and I will return with news , also I've got another question, do we have a more complete help section of the commands of ac tool? so I can read in detail what means every command? I think that the one that comes with the app is not complete. @Ego

As for your question about the help file. If you are using AC Tool v5.4.0. Then yes the Help file does not have all of the commands. As AC Tool was updated/fixed and had commands added. The Help file was never updated since the initial v5.0.0 release of AC Tool. As

If you are using AC Tool v5.5.1. Then with the exception of a few commands. The help file has all of the commands and how to use them. Including those that I have added, fixed, or found to be already in AC Tool.

Now as for the few commands that are not in the Help file. I had found these commands in AC Tool as I was creating Divide. And making sure that Divide had all of the same commands available in it. Those few commands, and their use, can be found here in the forums. As I have made posts about those commands. Individually and in response to other posts about some other problem the user was having.

 

Share this post


Link to post
Share on other sites
4 minutes ago, The WABBIT said:

As for your question about the help file. If you are using AC Tool v5.4.0. Then yes the Help file does not have all of the commands. As AC Tool was updated/fixed and had commands added. The Help file was never updated since the initial v5.0.0 release of AC Tool. As

If you are using AC Tool v5.5.1. Then with the exception of a few commands. The help file has all of the commands and how to use them. Including those that I have added, fixed, or found to be already in AC Tool.

Now as for the few commands that are not in the Help file. I had found these commands in AC Tool as I was creating Divide. And making sure that Divide had all of the same commands available in it. Those few commands, and their use, can be found here in the forums. As I have made posts about those commands. Individually and in response to other posts about some other problem the user was having.

 

Okay thanks a lot I will look into it, also I will post an update of the macro working with the code you sent, thanks a lot.

 

PS. sorry for the audio

Share this post


Link to post
Share on other sites

Here is an example of how KeyRate works, you need Notepad with a new document for this to work:

// Adjust the keyrate up and down to see the
// effects it has on AC Tool pressing keys.
KeyRate 10

SetActiveWindow Untitled - Notepad
Delay 2 sec

// The {return} in the keys command is a special key. It causes AC Tool to press the Return key.
Keys This is a test of the KeyRate on using the Keys command.{return}
Keys See how fast, or slow, this lines of text is being typed into Notepad.{return}

 

Share this post


Link to post
Share on other sites
1 minute ago, The WABBIT said:

Here is an example of how KeyRate works, you need Notepad with a new document for this to work:


// Adjust the keyrate up and down to see the
// effects it has on AC Tool pressing keys.
KeyRate 10

SetActiveWindow Untitled - Notepad
Delay 2 sec

// The {return} in the keys command is a special key. It causes AC Tool to press the Return key.
Keys This is a test of the KeyRate on using the Keys command.{return}
Keys See how fast, or slow, this lines of text is being typed into Notepad.{return}

 

The keyrate does work pretty good the way the code is now I think I do understand how does it work, also looking into the forums about the commands, now I've got a question I recall you saith something about using the delay until command I read something about it but still not sure how does it work? could you explain me please

Share this post


Link to post
Share on other sites

Okay, from the help file:

DelayUntil
  
  
Description
Delays until a certain contidition is met.  Similar in function to a While ... End loop. 
 
  
Parameters
Conditional expression
  
  
Examples
DelayUntil {ElapsedMSec} > 10000

 

Basically what this command does. Is that you set a condition, like you would for a If statement or a While statement, and then when the script reaches the DelayUntil command. It will stop and wait until the condition that you have set is met. During this time, AC Tool is no doing anything, except waiting for the condition that you have set to become true.

The example in the help file has a DelayUntil {ElapsedMSec}  > 10000. What this does it is causes AC Tool to wait for 10000 milliseconds (10 seconds) then continue executing the script.

 

Share this post


Link to post
Share on other sites
2 minutes ago, The WABBIT said:

Okay, from the help file:


DelayUntil
  
  
Description
Delays until a certain contidition is met.  Similar in function to a While ... End loop. 
 
  
Parameters
Conditional expression
  
  
Examples
DelayUntil {ElapsedMSec} > 10000

 

Basically what this command does. Is that you set a condition, like you would for a If statement or a While statement, and then when the script reaches the DelayUntil command. It will stop and wait until the condition that you have set is met. During this time, AC Tool is no doing anything, except waiting for the condition that you have set to become true.

The example in the help file has a DelayUntil {ElapsedMSec}  > 10000. What this does it is causes AC Tool to wait for 10000 milliseconds (10 seconds) then continue executing the script.

 

Hmm okay but if I use the delay until command it will stop after using the buff procedure until the 5 minute delay condition is met 🤔

Share this post


Link to post
Share on other sites

For what you are trying to do. Using the DelayUntil will not do what you want. You would use the DelayUntil <Condition> to cause AC Tool to stop doing anything and wait until the <Condition> is true. Then AC Tool will continue to executing the script from that point on.

Using the buff procedure as the condition would not work. As it does not work with procedures as the condition.

 

Depending on how much work you want to put into the script to make it really good. You need to use either a Every Procedure, a When procedure, or the code that @Ego had posted before. You can find the information on both Every procedure and the When procedure in the Help file under Procedure ... End.  At this time I am not going to how the Every Procedure and the When Procedure works. That information, with examples, is in the Help file so I suggest that you read it.

Since you are so new to AC Tool and what it can do, and for ease of use. I would suggest that for now that you should use the Every Procedure.

To show how to add the Every Procedure to your script. I have added only the code that has changed from the last version of the script that I had posted.

While 1 = 1
      // Call the Builder_Summoner_1 procedure
      call Builder_Summoner_1
      // Call the Builder_Summoner_2 procedure
      call Builder_Summoner_2

      // Check to see if the Buff Every Procedure
      // needs to be executed. If the Buff
      // Every Procedure needs to be executed.
      // Then it is automatically executed
      // at this time.
      ProcessMessages
end

and

// This procedure is automatically executed
// every 5 min.
procedure Buff Every 5 min
      // Activate the Buff skill
      keys i
end

 

Share this post


Link to post
Share on other sites
34 minutes ago, The WABBIT said:

For what you are trying to do. Using the DelayUntil will not do what you want. You would use the DelayUntil <Condition> to cause AC Tool to stop doing anything and wait until the <Condition> is true. Then AC Tool will continue to executing the script from that point on.

Using the buff procedure as the condition would not work. As it does not work with procedures as the condition.

 

Depending on how much work you want to put into the script to make it really good. You need to use either a Every Procedure, a When procedure, or the code that @Ego had posted before. You can find the information on both Every procedure and the When procedure in the Help file under Procedure ... End.  At this time I am not going to how the Every Procedure and the When Procedure works. That information, with examples, is in the Help file so I suggest that you read it.

Since you are so new to AC Tool and what it can do, and for ease of use. I would suggest that for now that you should use the Every Procedure.

To show how to add the Every Procedure to your script. I have added only the code that has changed from the last version of the script that I had posted.


While 1 = 1
      // Call the Builder_Summoner_1 procedure
      call Builder_Summoner_1
      // Call the Builder_Summoner_2 procedure
      call Builder_Summoner_2

      // Check to see if the Buff Every Procedure
      // needs to be executed. If the Buff
      // Every Procedure needs to be executed.
      // Then it is automatically executed
      // at this time.
      ProcessMessages
end

and


// This procedure is automatically executed
// every 5 min.
procedure Buff Every 5 min
      // Activate the Buff skill
      keys i
end

 

Thats what I was going to ask, @Ego  use this kind of command

procedure Buff Every 5 min
      keys i
end

I dont really know how does it works exactly but I can assume that , the procedure will only run every 5 minutes if my assumption is correct and I uderstood well I will procedures summoner_1,summoner_2 and buff for the first time and then tool will call only 1 and 2 until five minutes have passed after that it will call the buff procedure again right?

Share this post


Link to post
Share on other sites

Using the code above, which is better than mine that I posted as it will not do what you want.

You run a procedure with the call 1 and 2  combined and the last line before the last end statement is the processmessages

after that is the procedure buff every 5 minutes. It reads the buff procedure to see if 5 minutes has expired, then executes keys i, resets the timer and goes back.

Share this post


Link to post
Share on other sites
2 hours ago, ArcherRojas said:

I dont really know how does it works exactly but I can assume that , the procedure will only run every 5 minutes if my assumption is correct and I uderstood well I will procedures summoner_1,summoner_2 and buff for the first time and then tool will call only 1 and 2 until five minutes have passed after that it will call the buff procedure again right?

This is what it will do:

  1. Execute Procedure Summoner_1
  2. Execute Procedure Summoner_2
  3. Check to see if 5 minutes has passed.
    If five minutes has passed, execute procedure Buff.
  4. Repeat.

Buff procedure will not be executed the first time through. It will only be executed the first time only after the script has been executing Procedure Summoner_1 and Summoner_2 for five minutes.

 

Now, if you need the Buff skill to be executed the first time. Then you need to make the following changes:

// Execute the Builder_Sommoner_1 the first time
call Builder_Summoner_1
// Execute the Builder_Sommoner_2 the first time
call Builder_Summoner_2
// Activate the Buff skill the first time
Keys i

// Now execute the procedures in a infinite loop.
While 1 = 1
      // Execute the Builder_Summoner_1 procedure
      call Builder_Summoner_1
      // Execute the Builder_Summoner_2 procedure
      call Builder_Summoner_2

      // Check to see if the Buff Every Procedure
      // needs to be executed.
      //
      // If it has been 5 minutes since that last time
      // the Buff Every Procedure was last called. Then
      // call the Buff procedure and then reset the
      // timer for the Buff Every Procedure. Then
      // continue executing the script.
      //
      // If it has not been 5 minutes since the Buff Every
      // Procedure was last called. Then continue executing
      // the script.
      ProcessMessages
end

 

 

Now that your script has been written for you. Please enjoy it. And learn from it.

Share this post


Link to post
Share on other sites

Okay I think I get it now I was also reading about it on the help section of the program, I will try and then come back, also I'm working with a few objects based on a few posts I found in here.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and to our Privacy Policy.