So my main questions for this is where would i call the function so that it would buff me the first time. i tried to put in a line so when it started it just used "keyboardPress(settings.profile.hotkeys.Buff1.key);" but then every second it would try to cast the buff. Then once it casts the buff, how do you start the timer so that it starts to count down (or will this happen based on what i have). Sorry havent done much with lua, most of my experience has come from AutoIt.
In player.lua
Code: Select all
-- Check if you need to rebuff
function CPlayer:checkBuff1()
-- Still cooling down, don't use.
if( os.difftime(os.time(), self.Buff1LastUseTime) < settings.profile.options.Buff1_DURATION ) then
return;
else
local modifier = settings.profile.hotkeys.Buff1_Duration
if( modifier ) then keyboardHold(modifier); end
keyboardPress(settings.profile.hotkeys.Buff1.key);
if( modifier ) then keyboardRelease(modifier); end
end
end
Code: Select all
<option name="Buff1_DURATION" value="1800" />
<hotkey name="Buff1" key="VK_0" modifier="" />
Code: Select all
self.Buff1LastUseTime = 0;