Jump to content
AC Tool Forums
  • Sign Up
Sign in to follow this  
brandxman

Auto /heal on low mp??

Recommended Posts

Hi all

 

Attempting to build my own non-battle magic skill-up script, but I have come to a bump in the road. I cant seem to get the script to detect and act on low MP.

 

I have downloaded most skill-up related macros to learn/build from, but each seems to have its own method of detecting MP and each is in their own state of working/non-working.

 

can anyone suggest/point me in the right direction?? I'm currently able to cast a series of spells and loop that till I run out of MP. Once I'm out of MP I'm dead in the water. I'd like to be able to run through my series of spells till I hit a low level of MP, automatically rest till full, stand back up and start casting again.

 

Thanks for the help.

--Brandxman

Share this post


Link to post
Share on other sites

Been doing some more reading and have finally been able to get my script to detect low MP and rest.

 

Next task is to detect full mp, stand, and resume spell casting. I've talken my base code from SMN_Working.mac, sorry I dont have the origanl writers name, and modified it a bit to get this "detect low, heal, detect full, stand" code.

 

constants

///// ===== Heal ==================

healon = 1

healoff = 1

 

///// Do Not Change info in this area------------

CurHP =

CurMP =

MaxHP =

MaxMP =

sMaxHP=

sMaxMP =

start =

///// -------------------------------------------------

end

 

while 1=1

set $start = 1

if $start = 1

call bluskill1

delay 1 sec

call bluskill2

delay 1 sec

call bluskill3

delay 1 sec

Set MaxMP = $info_mp_max

Set CurMP = $info_mp_current

Compute sMaxMP = Int($MaxMP * .25)

If $CurMP > $sMaxMP

set $start = 1

else

If $CurMP < $sMaxMP

set $start = 0

if $start = 0

call mpreston

while 1=1

If $CurMP = $MaxMP

delay 100

call mprestoff

delay 2 sec

break

set $start = 1

end

delay 100

end

end

end

end

end

end

 

procedure mpreston

if $healon = 1

keydown {space}

delay 100

keys /heal on

delay 200

keydown {Return}

delay 500

end

end

 

procedure mprestoff

if $healoff = 1

keydown {space}

delay 100

keys /heal off

delay 200

keydown {Return}

delay 500

end

end

 

 

I know its a little rough around the edges, but can anyone spot why/where it wont detect full mp, stand, and cast?

 

I've attached my full file, incase anyone wants to take a look.

BlueSkillup.mac

Share this post


Link to post
Share on other sites

please use [ code ] tags makes things more readable. especially with messy nests.

 

I didn't clean the whole thing up but it should work for what you want. rest at 25% mp and rise when MP full.

 

// This line is necessary to select the proper window


include .\FFXI_info.dat
include .\window.mac
constants
///// ===== Blue Magic =========================================================
 pollen = 1 // Set to 1 to use spell
 cocoon = 0 // Set to 1 to use spell
 metallicbody = 0 // Set to 1 to use spell
///// ===== heal ===============================================================
 healon = 1
 healoff = 1	
///// Do Not Change info in this area----------------------
 CurHP  	=
 CurMP  	=
 MaxHP  	=
 MaxMP  	=
 sMaxHP  	=
 sMaxMP  	=
start     =
///// -----------------------------------------------------
end

SetActiveWindow $window
Set MaxMP = $info_mp_max

while 1=1
call bluski1
delay 1 sec
call bluski2
delay 1 sec
call bluski3
delay 1 sec
call mprest // calls routine to check if we need to rest and rests if needed
end

       
procedure bluski1
if $pollen = 1
   keydown {space}
   delay 100
   keys /ma "Pollen" <me>
   delay 200
   keydown {Return}
   delay 10 sec
 end
end

procedure bluski2
 if $cocoon = 1
   keydown {space}
   delay 100
   keys /ma "Cocoon" <me>
   delay 200
   keydown {Return}
   delay 10 sec
 end
end
 
procedure bluski3  
 if $metallicbody = 1
   keydown {space}
   delay 100
   keys /ma "Metallic Body" <me>
   delay 200
   keydown {Return}
   delay 10 sec 
 end
end
 
procedure mprest
   Compute sMaxMP = Int($MaxMP * .25)
   if $info_mp_current <= $sMaxMP
       call healkeys
       while $info_mp_current <> $info_mp_max
           delay 500
       end
       call healkeys
   end  
end

procedure healkeys 
 	keydown {space}
   delay 100
   keys /heal on
   delay 200
   keydown {Return}
   delay 500
end

 

try that

Share this post


Link to post
Share on other sites

Links dead on this post.. I guess its too old.. I got to hacking some skill up code.. I figured out simple basic stuff like casting a spell.. but I got stuck at healing mp.

too bad those links are dead

Share this post


Link to post
Share on other sites

FFACT has been discontinued I think. But you could rewrite a small portion of the posted code to work with color checks using LoadRGB and {RGBRed}, Green and Blue.

Share this post


Link to post
Share on other sites
FFACT has been discontinued I think. But you could rewrite a small portion of the posted code to work with color checks using LoadRGB and {RGBRed}, Green and Blue.

Oh okay, could you give an example? I don't know how to code much yet, just now learning. If you have some code with color checks that I could learn from.. could be useful in coding the script.

Share this post


Link to post
Share on other sites

Go to the AcTool help, it has code examples for how to use most all of the commands available. The Readme.txt is more up to date, but it follows what has been updated per version, so you may have to dig, or use the Find command to quickly locate something.

Share this post


Link to post
Share on other sites

I have problems trying to code the loadrgb, perhaps a sample code that does /heal if blue.. or something.. that or my other choice is to use loop command.

Both I struggle to get working, and need some code.

Share this post


Link to post
Share on other sites

You need to know what the color is you're checking.

 

LoadRGB is probably working just fine...but you're not getting the color you'd expect.

 

To test what you're getting, you can log the colors to the Test Log tab using TimeStamp (or write them to a file...but TimeStamp is way easier).

 

Ex:

LoadRGB $X, $Y

TimeStamp The Colors at $X $Y are R: {RGBRed} G: {RGBGreen} B: {RGBBlue}

 

When you use LoadRGB for detecting color, you'll probably have to use a range of colors that are 'blue'. My guess is RGBBlue will be higher than the other two, but you'll need to do much testing to see what colors are suitable. An if would look something like this:

 

This is an example only!! I don't know what colors lie between here.

If {RGBBlue} > 150 AND {RGBRed} < 150 AND {RGBGreen} < 150

 

 

Alternatively, instead of knowing what color the blue is (as each possible shade of blue needs to be accounted for), you can use the IsBlue command.

It's just like this:

 

IsBlue $X, $Y

TimeStamp Found blue

Else

TimeStamp Nope

End

 

What do you need to do with Loop that's not working?

 

Loop 5
  TimeStamp Looping example {loopno}
End

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.