|
Post by ifandbut on Nov 25, 2005 14:18:41 GMT -5
Yes, I know it's proubly allready been done 100 times before but I was borred and wanted to try out Lunar scripting and this was my excuse to do it. So, here it is, my first script for FFXI. You are free to use this scrit in any other scripts you make just be sure to give me credit ^^
-------Summon Magic Skill Up Bot v2.1 -------By Kevin Schneider (aka Ifandbut) -------Free to use in your own programs just give me credit -------Summons Carbuncle, Leviathan, and Ramuh untill you run out of MP -------Rest to full MP and continues.
Windower.console_Write("Summon Skill Bot v2.1") Windower.console_Write("By: Kevin \"Ifandbut\" Schneider") Windower.console_Write("Ifandbut@hotmail.com")
while true do current_mp = FFXI.player_GetCurrentMP() max_mp = FFXI.player_GetMaxMP() status = FFXI.player_GetStatus()
if current_mp < 7 then --If I dont have enought MP then Release pet and rest if status ~= 33 then --Control.control_SendString("/pet Release <me>") --Windower.script_Sleep(1000) Control.control_SendString("/heal on") end end
if current_mp == max_mp then --When I have full mp stop resting Control.control_SendString("/heal off") end
current_mp = FFXI.player_GetCurrentMP()
----Start of Chain Summon block.---- if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Carbuncle <me>") Windower.script_Sleep(9000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(1000) end
current_mp = FFXI.player_GetCurrentMP()
if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Leviathan <me>") Windower.script_Sleep(9000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(1000) end current_mp = FFXI.player_GetCurrentMP()
if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Ramuh <me>") Windower.script_Sleep(9000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(1000) end
Windower.script_Sleep(4000) --Make sure all the casting times are reset and account for lag end
If anyone has ideas on how to make this better please post them here. I look foward to hearing eveyone's coments.
|
|
petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Nov 27, 2005 18:05:03 GMT -5
this is sorta logical, time it. Write down the average times for it, the delay pacts and stuff, and then make it shorter. The Healing logic is cool, but the accouning for lag is good too, but make it run off of a timer script.
(I say trip a macros that makes this REALLY automated.) so the automation would go for 2 hours, and then log you out... Anymoose, Just random thoughts. but I'll look into a timer script myself.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Nov 27, 2005 21:16:10 GMT -5
Write down the average times for it, the delay pacts and stuff, and then make it shorter. Recast times: Avatars 30 secs Spirit Pacts 10 secs Release 10 secs Looks like these are already accounted for in the script. (I say trip a macros that makes this REALLY automated.) so the automation would go for 2 hours, and then log you out. I think this code was written to run indefinitely by design, not to run for a certain amount of time then quit. However, it would be nice to be able to terminate the script without having to force Lunar to unload it. Replacing while true do with capX=FFXI.player_GetXPos() capY=FFXI.player_GetYPos() while FFXI.player_GetXPos()==capX and FFXI.player_GetYPos()==capY do will release the script when the player moves. Spirit pacts have the same recast time as Release, even though it costs more MP to cast a Spirit, it'll result in less code. --Configuration spell="Air Spirit" --Replace string with what Avatar or Spirit you want cast cast=6 --Replace with casting time (in seconds) recast=11 --Replace with recast time (in seconds)
--Program code Windower.console_Write("Summon Skill Bot v3.0") Windower.console_Write(" Origional code by") Windower.console_Write(" Kevin \"Ifandbut\" Schneider") Windower.console_Write(" Ifandbut@hotmail.com") Windower.console_Write("") Windower.console_Write(" Rewritten by Zytre")
capX=FFXI.player_GetXPos() capY=FFXI.player_GetYPos()
while FFXI.player_GetXPos()==capX and FFXI.player_GetYPos()==capY do maxMP = FFXI.player_GetMaxMP()
if FFXI.player_GetCurrentMP()<10 then if FFXI.player_GetStatus()==0 then Control.control_SendString("/heal")
while FFXI.player_GetStatus()~=33 do Windower.script_Sleep(100) end end
while FFXI.player_GetCurrentMP()<maxMP and FFXI.player_GetStatus()==33 do Windower.script_Sleep(100) end
if FFXI.player_GetStatus()==33 then Control.control_SendString("/heal")
while FFXI.player_GetStatus()==33 do Windower.script_Sleep(100) end end elseif FFXI.player_GetStatus()==0 then Control.control_SendString(string.format("/ma \"%s\" <me>",spell)) Windower.script_Sleep(math.abs(cast)*1000) Control.control_SendString("/pet Release <me>")
Windower.script_Sleep(math.abs(recast)*1000) end end
Windower.console_Write("Summon Skill Bot Stopped.")
This code was rewritten to implement what I had in mind. It also has better code that handles healing (Doesn't keep sending '/heal on' if the client lags for more than 4 seconds).
|
|
petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Nov 28, 2005 0:51:31 GMT -5
A tip of the hat, and 'cheers'. I like the Idea of releasing the script when the player moves. I'm actually thinking of setting up a different script, so it releases the file, when you move out of a range. Perhaps just moving direction would be pretty darn good, just having to tap 4 or 6 on Numpad. Nice work!
|
|
|
Post by ifandbut on Nov 29, 2005 12:15:23 GMT -5
I'll take a longer look at that new code and maybe wright a better bot latter. I'm sick atm, hopefuly I'll be fealing better by the end of the week.
|
|
|
Post by r3aper on Dec 23, 2005 0:25:42 GMT -5
ok i just made simple edit to the timing and added more summons based on what i have been running for an hr now without any skipping summons or anything have fun =)
-------Summon Magic Skill Up Bot v3.1 -------By Kevin Schneider (aka Ifandbut) -------Free to use in your own programs just give me credit -------Summons Carbuncle, Leviathan, and Ramuh untill you run out of MP -------Rest to full MP and continues.
Windower.console_Write("Summon Skill Bot v3.1") Windower.console_Write("By: Kevin \"Ifandbut\" Schneider")(Edit By R3APER) Windower.console_Write("Ifandbut@hotmail.com")
while true do current_mp = FFXI.player_GetCurrentMP() max_mp = FFXI.player_GetMaxMP() status = FFXI.player_GetStatus()
if current_mp < 7 then --If I dont have enought MP then Release pet and rest if status ~= 33 then --Control.control_SendString("/pet Release <me>") --Windower.script_Sleep(2000) Control.control_SendString("/heal on") end end
if current_mp == max_mp then --When I have full mp stop resting Control.control_SendString("/heal off") end
current_mp = FFXI.player_GetCurrentMP()
----Start of Chain Summon block.---- if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Carbuncle <me>") Windower.script_Sleep(10000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(2000) end
current_mp = FFXI.player_GetCurrentMP()
if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Leviathan <me>") Windower.script_Sleep(10000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(2000) end
current_mp = FFXI.player_GetCurrentMP()
if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Ramuh <me>") Windower.script_Sleep(10000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(2000) end
current_mp = FFXI.player_GetCurrentMP()
----Start of Chain Summon block.---- if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Ifrit <me>") Windower.script_Sleep(10000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(2000) end
current_mp = FFXI.player_GetCurrentMP()
----Start of Chain Summon block.---- if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Shiva <me>") Windower.script_Sleep(10000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(2000) end
current_mp = FFXI.player_GetCurrentMP()
----Start of Chain Summon block.---- if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Titan <me>") Windower.script_Sleep(10000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(2000) end
----Start of Chain Summon block.---- if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Garuda <me>") Windower.script_Sleep(10000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(2000) end
----Start of Chain Summon block.---- if current_mp >= 7 and status ~= 33 then Control.control_SendString("/ma Diabolos <me>") Windower.script_Sleep(10000) Control.control_SendString("/pet Release <me>") Windower.script_Sleep(2000) end
Windower.script_Sleep(5000) --Make sure all the casting times are reset and
account for lag end
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Dec 23, 2005 3:13:06 GMT -5
I've done a bit of modifying to my own code to smooth things out, but it still goes along the principal of allowing the user to set what summon, the cast and recast times.
The personal addition I made also has a lag tolerence varible to configure and detection based if the summon upkeep cost drains MP to 0 before the release command is sent to speed things up and start the heal code. I think I also put in the unload on heal cancel so in emergency, if the player cancels heal, the code exits.
|
|
Onitaru
Junior Member
They call me Pope.
Posts: 62
|
Post by Onitaru on Dec 23, 2005 9:50:51 GMT -5
post it?
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Dec 24, 2005 1:14:43 GMT -5
Sure, even though the old code works well enough to my satisfaction of being published, here's the new stuff. Oh, and this code is touchy about the cancel code by design. If your character so much as twitches a finger without the script telling it to, the script exits. Don't worry too much, the script will try to finnish the command run before trying to exit, lol. Code: | --Configuration spell="Air Spirit" --Avatar or Spirit to cast (Case-sensitive) cast=3 --Casting time (in seconds) recast=10 --Recast time (in seconds) cost=10 --Summon casting cost perpetuation=5 --Summon perpetuation cost (MP upkeep)
tolerence=1 --Lag tolerence (wait in seconds for command lag)
--Program code Windower.console_Write("Summon Skill Bot v3.1") Windower.console_Write(" Origional code by") Windower.console_Write(" Kevin \"Ifandbut\" Schneider") Windower.console_Write(" Ifandbut@hotmail.com") Windower.console_Write(" ") Windower.console_Write(" Rewritten by Zytre")
capX=FFXI.player_GetXPos() capY=FFXI.player_GetYPos() capH=FFXI.player_GetHeading() exitflag=false
while FFXI.player_GetXPos()==capX and FFXI.player_GetYPos()==capY and FFXI.player_GetHeading()==capH and not exitflag do maxMP = FFXI.player_GetMaxMP()
if FFXI.player_GetCurrentMP()<cost then if FFXI.player_GetStatus()==0 then Control.control_SendString("/heal")
while FFXI.player_GetStatus()~=33 do Windower.script_Sleep(100) end end
while FFXI.player_GetCurrentMP()<maxMP and not exitflag do if FFXI.player_GetStatus()~=33 then exitflag=true else Windower.script_Sleep(100) end end
if FFXI.player_GetStatus()==33 then Control.control_SendString("/heal")
while FFXI.player_GetStatus()==33 do Windower.script_Sleep(100) end end elseif FFXI.player_GetStatus()==0 then Control.control_SendString(string.format("/ma \"%s\" <me>",spell)) Windower.script_Sleep((cast+tolerence)*1000)
if FFXI.player_GetCurrentMP()>perpetuation then Control.control_SendString("/pet Release <me>")
if FFXI.player_GetCurrentMP()>=cost then if recast<10 then Windower.script_Sleep((10-cast+tolerence)*1000) else Windower.script_Sleep((recast-cast+tolerence)*1000) end end end else exitflag=true end end
Windower.console_Write("Summon Skill Bot Stopped.")
|
|
|
kyvin
New Member
Posts: 2
|
Post by kyvin on Sept 22, 2006 10:04:58 GMT -5
This is the first script i have tried running, and thanks a bunch for creating it! However, it doesn't seem to work quite right. All my character ends up doing is healing, then standing up, healing, then standing up. I'm assuming this is because the program believes i do not have enough mp while standing to summon an avatar, therefor it has me /heal. Then it realizes that I do, in fact, have well over 1000mp and has me stand up to begin summoning but then for some reason gets confused and repeats the process.
I believe this is the problem. I have tried doing this:
Windower.console_Write(FFXI.player_GetCurrentMP())
and it displays "0" I have max mp, over 1000 of it. So for some reason FFXI.plater_GetCurrentMP() is not working.
How can i fix this? thanks!
|
|