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

Need some help on this script

Recommended Posts

Now what I would do at this point. Is to make the Buff procedure into a Every Procedure. And have set for 30 seconds. Then I would remove the Delay 4 min and leave that line blank.

Share this post


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

Now what I would do at this point. Is to make the Buff procedure into a Every Procedure. And have set for 30 seconds. Then I would remove the Delay 4 min and leave that line blank.

okay lemme work the code so th eupdate looks like this:

// 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

Delay 2 sec

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

Procedure Builder_Summoner_1 //builder/summoner 1
	keys w //cast skill 1
	delay 1 sec
	leftclick
	delay 3 sec
	keys e //cast skill 2
	delay 1 sec
	leftclick
	delay 3 sec
	call health
	delay 1 sec
	keys r //cast skill 3
	delay 1 sec
	leftclick
	delay 3 sec
	keys q //cast skill 4
	delay 3 sec
	keys z
	delay 1 sec
	leftclick
	delay 3 sec
end

Procedure Builder_Summoner_2 //use when 2 summoners are in
	keys w
	delay 1 sec
	leftclick 
	delay 3 sec
	keys e
	delay 1 sec
	leftclick 
	delay 3 sec
	keys r
	delay 1 sec
	leftclick 
	delay 3 sec
	keys q
	delay 1 sec
	keys s
	delay 1 sec
	leftclick 
	delay 3 sec
	keys d
	delay 1 sec
	leftclick 
	delay 3 sec
	keys f
	delay 1 sec
	leftclick 
	delay 3 sec
	keys a
	delay 3 sec
	keys z
	delay 1 sec
	leftclick 
	delay 3 sec
end

Procedure Builder_Summoner_3 //builder/summoner 1
	keys z //cast skill 1
	delay 1 sec
	leftclick
	delay 4 sec
end

Object hp_bar   // Test at coords 264, 611
228=0,0|228=2,0|228=4,0|228=6,0|228=8,0|228=10,0|228=12,0|228=14,0|228=16,0|228=18,0|228=20,0|228=22,0|228=24,0|213=26,0|171=28,0|110=30,0|
210=0,2|210=2,2|210=4,2|210=6,2|210=8,2|210=10,2|210=12,2|210=14,2|210=16,2|210=18,2|210=20,2|210=22,2|210=24,2|193=26,2|159=28,2|112=30,2|
203=0,4|203=2,4|201=4,4|201=6,4|203=8,4|203=10,4|203=12,4|201=14,4|203=16,4|203=18,4|203=20,4|201=22,4|201=24,4|181=26,4|148=28,4|113=30,4|
210=0,6|210=2,6|209=4,6|210=6,6|210=8,6|210=10,6|210=12,6|209=14,6|210=16,6|210=18,6|210=20,6|209=22,6|210=24,6|185=26,6|151=28,6|114=30,6|
25=0,8|25=2,8|25=4,8|25=6,8|25=8,8|25=10,8|25=12,8|25=14,8|25=16,8|25=18,8|25=20,8|25=22,8|25=24,8|25=26,8|25=28,8|25=30,8|
End Object



procedure consume_mp // mp Potion
	keys i 
	delay 1 sec
End

procedure health every 30 sec
if mp_bar is > 285,623
call consume_mp
end if
end

Object mp_bar   // Test at coords 285, 623
219=0,0|219=2,0|219=4,0|219=6,0|219=8,0|219=10,0|219=12,0|219=14,0|219=16,0|219=18,0|219=20,0|205=22,0|160=24,0|
193=0,2|193=2,2|193=4,2|193=6,2|193=8,2|193=10,2|193=12,2|193=14,2|193=16,2|193=18,2|193=20,2|178=22,2|147=24,2|
179=0,4|179=2,4|180=4,4|180=6,4|180=8,4|179=10,4|180=12,4|180=14,4|180=16,4|179=18,4|179=20,4|160=22,4|133=24,4|
End 


procedure buff every 5 min // buff
IsObject principal_buff at 172,545

else
keys q
end
end

Object principal_buff // Test at coords 172, 545
24=0,0|29=2,0|30=4,0|24=6,0|16=8,0|35=10,0|36=12,0|35=14,0|
24=0,2|26=2,2|26=4,2|21=6,2|23=8,2|24=10,2|26=12,2|23=14,2|
152=0,4|140=2,4|209=4,4|222=6,4|181=8,4|217=10,4|218=12,4|134=14,4|
130=0,6|147=2,6|255=4,6|255=6,6|170=8,6|255=10,6|255=12,6|192=14,6|
108=0,8|139=2,8|84=4,8|120=6,8|181=8,8|78=10,8|91=12,8|168=14,8|
89=0,10|148=2,10|255=4,10|255=6,10|56=8,10|255=10,10|255=12,10|222=14,10|
71=0,12|132=2,12|228=4,12|241=6,12|193=8,12|246=10,12|253=12,12|141=14,12|
54=0,14|182=2,14|210=4,14|205=6,14|182=8,14|210=10,14|213=12,14|151=14,14|
35=0,16|165=2,16|172=4,16|190=6,16|206=8,16|132=10,16|178=12,16|156=14,16|
End

 

Edited by ArcherRojas
update

Share this post


Link to post
Share on other sites

First, You are still using a IF statement to check for a Object. You can not use a IF statement to check for Objects. As I stated before you HAVE to use the IsObject command.

Second, move the contents of the consume_mp procedure to replace the Call consume_mp line in Health procedure.

Third change the Buff  Every Procedure to be 30 sec not 5 min.

Share this post


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

First, You are still using a IF statement to check for a Object. You can not use a IF statement to check for Objects. As I stated before you HAVE to use the IsObject command.

Second, move the contents of the consume_mp procedure to replace the Call consume_mp line in Health procedure.

Third change the Buff  Every Procedure to be 30 sec not 5 min.

Oh sorry I forgot to change the other procedures I have corrected the statements and the code looks like this now:

 

// 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

Delay 2 sec

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

Procedure Builder_Summoner_1 //builder/summoner 1
	keys w //cast skill 1
	delay 1 sec
	leftclick
	delay 3 sec
	keys e //cast skill 2
	delay 1 sec
	leftclick
	delay 3 sec
	call health
	delay 1 sec
	keys r //cast skill 3
	delay 1 sec
	leftclick
	delay 3 sec
	keys q //cast skill 4
	delay 3 sec
	keys z
	delay 1 sec
	leftclick
	delay 3 sec
end

Procedure Builder_Summoner_2 //use when 2 summoners are in
	keys w
	delay 1 sec
	leftclick 
	delay 3 sec
	keys e
	delay 1 sec
	leftclick 
	delay 3 sec
	keys r
	delay 1 sec
	leftclick 
	delay 3 sec
	keys q
	delay 1 sec
	keys s
	delay 1 sec
	leftclick 
	delay 3 sec
	keys d
	delay 1 sec
	leftclick 
	delay 3 sec
	keys f
	delay 1 sec
	leftclick 
	delay 3 sec
	keys a
	delay 3 sec
	keys z
	delay 1 sec
	leftclick 
	delay 3 sec
end

Procedure Builder_Summoner_3 //builder/summoner 1
	keys z //cast skill 1
	delay 1 sec
	leftclick
	delay 4 sec
end


//Here starts process to consume hp potion
procedure hp every 30 sec
IsObject hp_bar at 264,611
else
keys u 
end
end

Object hp_bar   // Test at coords 264, 611
228=0,0|228=2,0|228=4,0|228=6,0|228=8,0|228=10,0|228=12,0|228=14,0|228=16,0|228=18,0|228=20,0|228=22,0|228=24,0|213=26,0|171=28,0|110=30,0|
210=0,2|210=2,2|210=4,2|210=6,2|210=8,2|210=10,2|210=12,2|210=14,2|210=16,2|210=18,2|210=20,2|210=22,2|210=24,2|193=26,2|159=28,2|112=30,2|
203=0,4|203=2,4|201=4,4|201=6,4|203=8,4|203=10,4|203=12,4|201=14,4|203=16,4|203=18,4|203=20,4|201=22,4|201=24,4|181=26,4|148=28,4|113=30,4|
210=0,6|210=2,6|209=4,6|210=6,6|210=8,6|210=10,6|210=12,6|209=14,6|210=16,6|210=18,6|210=20,6|209=22,6|210=24,6|185=26,6|151=28,6|114=30,6|
25=0,8|25=2,8|25=4,8|25=6,8|25=8,8|25=10,8|25=12,8|25=14,8|25=16,8|25=18,8|25=20,8|25=22,8|25=24,8|25=26,8|25=28,8|25=30,8|
End

//Here starts process to consume mp potion
procedure mp every 30 sec
IsObject mp_bar at 285,623
else
keys i 
end
end

Object mp_bar   // Test at coords 285, 623
219=0,0|219=2,0|219=4,0|219=6,0|219=8,0|219=10,0|219=12,0|219=14,0|219=16,0|219=18,0|219=20,0|205=22,0|160=24,0|
193=0,2|193=2,2|193=4,2|193=6,2|193=8,2|193=10,2|193=12,2|193=14,2|193=16,2|193=18,2|193=20,2|178=22,2|147=24,2|
179=0,4|179=2,4|180=4,4|180=6,4|180=8,4|179=10,4|180=12,4|180=14,4|180=16,4|179=18,4|179=20,4|160=22,4|133=24,4|
End 

//Here starts process for buffing
procedure buff every 30 sec
IsObject principal_buff at 172,545
else
keys q
end
end

Object principal_buff // Test at coords 172, 545
24=0,0|29=2,0|30=4,0|24=6,0|16=8,0|35=10,0|36=12,0|35=14,0|
24=0,2|26=2,2|26=4,2|21=6,2|23=8,2|24=10,2|26=12,2|23=14,2|
152=0,4|140=2,4|209=4,4|222=6,4|181=8,4|217=10,4|218=12,4|134=14,4|
130=0,6|147=2,6|255=4,6|255=6,6|170=8,6|255=10,6|255=12,6|192=14,6|
108=0,8|139=2,8|84=4,8|120=6,8|181=8,8|78=10,8|91=12,8|168=14,8|
89=0,10|148=2,10|255=4,10|255=6,10|56=8,10|255=10,10|255=12,10|222=14,10|
71=0,12|132=2,12|228=4,12|241=6,12|193=8,12|246=10,12|253=12,12|141=14,12|
54=0,14|182=2,14|210=4,14|205=6,14|182=8,14|210=10,14|213=12,14|151=14,14|
35=0,16|165=2,16|172=4,16|190=6,16|206=8,16|132=10,16|178=12,16|156=14,16|
End

I have a doubt if the buffing process needs to be called every five minutes why do I put the "EVERY" command on 30 sec?

Share this post


Link to post
Share on other sites
procedure buff every 30 sec // buff
	IsObject principal_buff at 172,545
		// If the buff object is present do nothing.
	else
		// if the buff object is not present
		// activate the buff skill.
		keys q
	end
end

 

As you can see the buff Every Procedure with using Objects checks to see if the buff skill needs to be activated. If it does not, then it does not activate the skill.

Share this post


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

procedure buff every 30 sec // buff
	IsObject principal_buff at 172,545
		// If the buff object is present do nothing.
	else
		// if the buff object is not present
		// activate the buff skill.
		keys q
	end
end

 

As you can see the buff Every Procedure with using Objects checks to see if the buff skill needs to be activated. If it does not, then it does not activate the skill.

Oho I see I do understand this, lemme give it a try and I will return with some proper evidence, I greatly appreciate all your help

Share this post


Link to post
Share on other sites

Is the game in windowed mode or fullscreen?

I build my objects in windowed mode and I create them from the game screen, not the screenshot. I found the objects more accurate this way.

Wabbit, create a separate heading for this game now there is a macro for it? or leave it here.

Share this post


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

Is the game in windowed mode or fullscreen?

I build my objects in windowed mode and I create them from the game screen, not the screenshot. I found the objects more accurate this way.

Wabbit, create a separate heading for this game now there is a macro for it? or leave it here.

I do use it in windowed mode because I find it easy to make changes on my code, also jaja its easy to use the object mapper this way

Share this post


Link to post
Share on other sites

16 x 17 for the object? that is a big object. Most of mine are 4 x 4 or 8 x 8 or I use is{color}) xx, yy

Share this post


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

16 x 17 for the object? that is a big object. Most of mine are 4 x 4 or 8 x 8 or I use is xx, yy

oh well i dont really know whats that, I thought I selecyed a very small square

Share this post


Link to post
Share on other sites

Read object in help screen if you have not yet. It is hard to read but after a while it makes sense.

I make mine in-game as I know exactly where the object is going to be.

I also move the screen to a set position every time I start the game using code like the example below. Was created with The WABBITS help a while ago.

procedure MoveWindow using DreamACE Episode X Reload
  timestamp move window
  setactivewindow DreamACE Episode X Reload
  delay $wait sec
  compute X = {WindowLeft} + 2
  compute Y = {WindowTop} + 2
  mousepos $x, $y
  delay $wait sec
  dragto 1, 1
  MousePos 722, 775
  keys {return}
End

Share this post


Link to post
Share on other sites

Okay sorry for the late reply, I spent the weekend with my fam :P, so let me get this clear, basically the code that @Ego posted is the same as the universal window mover and it does move the window to a certain position on the screen right? and the program that @The WABBIT posted basically is the official source of the code so I will try to do it, I think this will help me correct a few position relates issues I had

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.