Help - Search - Members - Calendar
Full Version: Auto /heal on low mp??
AC Tools Everything Macro > AC Tool Macros > Final Fantasy XI Online
brandxman
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
rzn
You can do this one of 2 ways.

1) Read the colors on the mp bar

2) use ffxi_info or ffact to read your current mp from memory
brandxman
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.
NotMe1963
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.

CODE

// 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
zamphire
Here, try this bot. I doubt you could really want anything more. It levels all forms of sel target magic, logs out when skill is capped, even has the option to use elemental staves.
aphixe
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
Ahk
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.
aphixe
QUOTE(Ahk @ Jul 19 2007, 05:31 PM) *
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.
Ahk
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.
aphixe
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.
Ahk
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.
CODE
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?

CODE
Loop 5
   TimeStamp Looping example {loopno}
End
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.