Post by intp on Apr 13, 2006 21:28:51 GMT -5
I discovered Lunar this morning, so decided to make FFXI life a little easier with a script or two.. might as well share them too
Download: Booster v0.2 (right-click and "save as..." to download)
Background
This is my First script for the game. I'm a monk and I many times rely on doing the 12 Boost + chiblast thing for endgame. I found it annoying to have to press the boost macro every 30 seconds for 3 minutes between chiblasts. So, I've made a script that will Boost for me!
Details
When loaded, you'll get "Waiting for command to start" in the top ~middle of the screen. to start a boost cycle you'll want to send "go" as a command to the script:
.Lunar command Booster.lua go
This will send /ja "Boost" <me> and start a timer that counts down from 173 on the screen. This is the time before Boost will wear off.
Every 15 seconds another /ja "Boost" <me> will be sent. The current number of boosts are also placed on screen.
Once the 173 seconds are up booster will wait for "go" to be sent again.
At any time you can stop (stop, not pause, as in the current cycle cannot be resumed, you have to restart it) the cycle by sending "stop":
.Lunar command Booster.lua stop
(sent go again to get a new cycle going)
Issues
Unsuccessful boost: If you do other stiff while you are boosting you can sometimes delay the boost, that will throw off the timing about you'll miss the next boost. The script should be changed to check if the boost was successful or not and if not, keep trying every 10ms or 50ms or something and when finally successful, adjusting the time accordingly.
Future Plans
I'm pretty A.D.D. about the projects I start, so who knows how long I'll be working on this, you may never hear from me again. But some additions I might add if I do continue...
∙ Check the text to make sure each boost was successful, if not successful keep trying to boost until it is. This isn't really needed if you are just standing around while you boost, but if you do other things, you can cause a boost to be delayed, which would then cause the next boost to not be successful (it'll be called too soon).
∙ Add some way to get your attention 10 seconds or so before boost wears off.. ideally a sound (can that be done now? or is that sound stuff being tested what I'd need to wait for?). Is there any other way you can get peoples attention if they don't have the game in focus using lua?
∙ Make a "pause" command that will stop the boosting, but continue counting down the seconds before the boost will wear.
-----------
Any suggessions or comments are welcomed.
Download: Booster v0.2 (right-click and "save as..." to download)
Background
This is my First script for the game. I'm a monk and I many times rely on doing the 12 Boost + chiblast thing for endgame. I found it annoying to have to press the boost macro every 30 seconds for 3 minutes between chiblasts. So, I've made a script that will Boost for me!
Details
When loaded, you'll get "Waiting for command to start" in the top ~middle of the screen. to start a boost cycle you'll want to send "go" as a command to the script:
.Lunar command Booster.lua go
This will send /ja "Boost" <me> and start a timer that counts down from 173 on the screen. This is the time before Boost will wear off.
Every 15 seconds another /ja "Boost" <me> will be sent. The current number of boosts are also placed on screen.
Once the 173 seconds are up booster will wait for "go" to be sent again.
At any time you can stop (stop, not pause, as in the current cycle cannot be resumed, you have to restart it) the cycle by sending "stop":
.Lunar command Booster.lua stop
(sent go again to get a new cycle going)
Issues
Unsuccessful boost: If you do other stiff while you are boosting you can sometimes delay the boost, that will throw off the timing about you'll miss the next boost. The script should be changed to check if the boost was successful or not and if not, keep trying every 10ms or 50ms or something and when finally successful, adjusting the time accordingly.
Future Plans
I'm pretty A.D.D. about the projects I start, so who knows how long I'll be working on this, you may never hear from me again. But some additions I might add if I do continue...
∙ Check the text to make sure each boost was successful, if not successful keep trying to boost until it is. This isn't really needed if you are just standing around while you boost, but if you do other things, you can cause a boost to be delayed, which would then cause the next boost to not be successful (it'll be called too soon).
∙ Add some way to get your attention 10 seconds or so before boost wears off.. ideally a sound (can that be done now? or is that sound stuff being tested what I'd need to wait for?). Is there any other way you can get peoples attention if they don't have the game in focus using lua?
∙ Make a "pause" command that will stop the boosting, but continue counting down the seconds before the boost will wear.
-----------
Any suggessions or comments are welcomed.
-- Booster 0.2 by INTP
-- Copyright (C) 2006 Drew G. G.
--
-- Feel free to use or edit, just give me some credit.
--
-- Originally posted on the Lunar forms:
-- http://tinyterror.proboards37.com
--
-- To run (assuming you have Lunar installed):
-- load Lunar
-- .Lunar load Booster.lua
--
-- to start a boost cycle send go as a command
-- to Booster.lua:
--
-- .Lunar command Booster.lua go
--
-- sending stop at any time will stop and reset the boost cycle
--
-- .Lunar command Booster.lua stop
--
-- refer to the Booster forum post for more information
--
------------------------------------------------------------
-- Please don't delete
------------------------------------------------------------
Windower.script_SetVersion(".2")
Windower.script_SetAuthor("INTP")
Windower.script_SetContact("whiteleviathan@gmail.com")
Windower.console_Write("Booster --- v0.2 --- by INTP whiteleviathan@gmail.com")
------------------------------------------------------------
-- You can move these around as you see fit on the screen
-- they are on the top around the middle (I guess that
-- depends on what screen res. you're running ffxi on).
------------------------------------------------------------
Countdown=Graphics.text_CreateObject()
Graphics.text_SetColor(255,255,255,255,Countdown)
Graphics.text_SetPosition(320,2,Countdown)
Graphics.text_SetFont("Arial",10,Countdown)
Graphics.text_SetVisibility(1,Countdown)
Countboost=Graphics.text_CreateObject()
Graphics.text_SetColor(255,255,255,255,Countboost)
Graphics.text_SetPosition(250,2,Countboost)
Graphics.text_SetFont("Arial",10,Countboost)
Graphics.text_SetVisibility(1,Countboost)
------------------------------------------------------------
-- let's start the show
------------------------------------------------------------
ChatLine=string.format("Waiting for command to start")
Graphics.text_SetText(ChatLine,Countboost)
ChatLine=string.format("")
Graphics.text_SetText(ChatLine,Countdown)
while true do
------------------------------------------------------------
-- no command means don't do anything (should only happen
-- when the script is first loaded)
------------------------------------------------------------
while (Windower.script_GetCommandCount() == 0) do
Windower.script_Sleep(100)
end
------------------------------------------------------------
-- only start a new cycle if the command is 'go'
------------------------------------------------------------
while (Windower.script_GetCommand() ~= "go") do
Windower.script_Sleep(100)
end
boostDelay = 14;
boostCount = 0
------------------------------------------------------------
-- 173 is the # of seconds before Boost wears off. Obviously
-- this will loops once a second.
------------------------------------------------------------
for s=173,0,-1 do
------------------------------------------------------------
-- update the time
------------------------------------------------------------
ChatLine=string.format("Time Left: %i", s)
Graphics.text_SetText(ChatLine,Countdown)
boostDelay = boostDelay + 1
------------------------------------------------------------
-- If it's been 15 seconds since our last boost, boost again
-- (also update the boost count and reset the boostDelay
-- counter)
------------------------------------------------------------
if boostDelay==15 then
Control.control_SendString('/ja "Boost" <me>')
boostCount = boostCount + 1
ChatLine=string.format("Boost # %i", boostCount)
Graphics.text_SetText(ChatLine,Countboost)
boostDelay=0
end
------------------------------------------------------------
-- end the cycle if the user changes the command to 'stop'
------------------------------------------------------------
if (Windower.script_GetCommand() == "stop") then
s=0
end
------------------------------------------------------------
-- sleep for a second, unless we're done (no need)
------------------------------------------------------------
if (s > 0) then
Windower.script_Sleep(1000)
end
end
------------------------------------------------------------
-- Plause before the next cycle of boosts
------------------------------------------------------------
ChatLine=string.format("Waiting for command to start")
Graphics.text_SetText(ChatLine,Countboost)
ChatLine=string.format("")
Graphics.text_SetText(ChatLine,Countdown)
end