Anyone Know If A Lua Can Be Written For Pet Action |
||
Anyone know if a lua can be written for pet action
Offline
Posts: 128
I was messing with my lua the other day. I was wondering if anyone knows how to create an entry for pet actions for the auto. Like, have it swap in the TP set before it weapon skills.
This has been discussed alot in several different threads. A few attempts have been made.
The answer is no. Pup actions actually happen server side. They are then reported to the client like monster actions. Offline
Posts: 128
:(
Offline
Posts: 2269
The closest to what you want is to make an equipset for pet WS before it goes off, once its used its ws, or an action if you have attachments that do that, it'll swap you back into whatever your current set was.
I'm pretty sure ashita users have something that equips pup gear according to actions. Not exactly, but
Antisense said: » However you could automate equipment changes based on the pet's TP >= 1000 TP Doing that means it'll always act in your ws set since autos dont instantly go the second they hit 1k. you'll spent extra seconds in the ws set tough. I'm actually writing a lua that can equip petws gear before it ws. Once I finish first version, I'll share it. Kinda soon
As above, you can do any number of things to estimate when you should have the gear on, but it will always just be an approximation. No Lua will fully be able to overcome that issue, but there are things you could do to improve accuracy by doing things like observing how long a puppet takes to perform actions.
Ramuh.Austar said: » i doubt it'll work If your pet is tping alone, it'll switch to petws gear as soon as he's able to ws(>1000TP) and if you're tping with your pet, so it'll set petws at aftercast of master ws, for optimizing skillchain. I'm working on something to recognize which ws your pet will do after master ws, so it'll put specific gears depending on the ws(fTP for arcuballista, daze, pet vit for bonecrusher...) Phoenix.Faloun said: » I'm working on something to recognize which ws your pet will do after master ws, so it'll put specific gears depending on the ws(fTP for arcuballista, daze, pet vit for bonecrusher...) If you are going to all that effort, have you considered adjusting rules depending on attachments which adjust the weaponskill ai? namely, speedloaders and inhibitors. solo its easy in that auto will ws after you ws. but w/ a party it can be anytime someone else uses a weaponskill. I might think of tapping into the skillchain addon for this. Using the skillchain to calculate a window after anyone uses a weaponskill, in which the auto might contribute. Quetzalcoatl.Xilkk said: » If you are going to all that effort, have you considered adjusting rules depending on attachments which adjust the weaponskill ai? namely, speedloaders and inhibitors. I'm trying To Make it work with skillchains addon. But still wip so after watching this, i think the toggle for pettp would be the way to go?
YouTube Video Placeholder I have tested time, and time again, and even worked with some people on here, and I am 99% sure that the way I am doing it is working. With the way I have it setup, I see a significant increase in damage, and my numbers are pretty similar to when locked. I do notice that due to the speed of Pet WS packets, that sometimes it does what seems to miss the packet all together using messages to track this.
I also have enmity working using delayed triggers since the auto is predictable with JA's as long as you have Maneuvers up. The way I have it setup is using packet detection, to grab skill name, then call a gs c of the same name. The only problem is when you start doing stuff as master as well and engaged things just get sloppy. If you play using manual triggers I am sure it will be about 90% better than trying to use this method. Im just lazy on PUP. Ive posted a bunch before, but never anything full. If someone wants to mess with it, I will give the raw code for whoever to test on their own.
Settings code: Code ------------------------------------------------------------------------------------------------------------------------------ --## These are job-specific variables. Be careful adjusting as it may cause unwanted changes to your gearswap. ------------------------------------------------------------------------------------------------------------------------------ puppetmaster = {} puppetmaster.lastProvoke = 0 puppetmaster.ProvokeT = I{'on','off'} puppetmaster.lastFlash = 0 puppetmaster.FlashT = I{'on','off'} puppetmaster.WST = I{'on','off'} puppetmaster.ProvokeT:setTo('on') puppetmaster.FlashT:setTo('on') Code -------------------------------------------------------------------------------- -- Handle incoming chunk events. -------------------------------------------------------------------------------- -- @param act -- @return windower.raw_register_event("incoming chunk", function(id, data) if id == 0x076 then elseif id == 0x028 then local packet = p.parse('incoming', data) -- Finish Weaponskill if packet["Category"] == 3 then elseif packet["Category"] == 4 then elseif packet["Category"] == 6 then if pet.isvalid == true and packet["Actor"] == pet.id then end elseif packet["Category"] == 7 then if pet.isvalid == true and packet["Actor"] == pet.id then if packet["Target 1 Action 1 Param"] ~= nil then local action_name = gearswap.res.monster_abilities[packet["Target 1 Action 1 Param"]].name send_command('gs c ' .. action_name) end end elseif packet["Category"] == 8 then elseif packet["Category"] == 11 then if pet.isvalid == true and packet["Actor"] == pet.id then if packet["Param"] ~= nil then local action_name = gearswap.res.monster_abilities[packet["Param"]].name send_command('gs c ' .. action_name) if action_name == 'Flashbulb' then windower.send_command(';wait .7; gs c DelayedPetAftercast') elseif action_name == 'Provoke' then windower.send_command(';wait .7; gs c DelayedPetAftercast') end end end elseif packet["Category"] == 13 then end end end) function handlePetTimers() local currentTimer = os.clock() if pet.isvalid == true and pet.status == 'Engaged' then -- Automaton Provoke timer is 30 seconds. if puppetmaster.lastProvoke + 30 < currentTimer and puppetmaster.ProvokeT:current() == 'on' and puppetmaster.lastProvoke ~= 0 then windower.add_to_chat(5, "Automaton: Preparing Ability: Provoke.") windower.send_command('gs c EnmityGear') puppetmaster.ProvokeT:setTo('off') -- Automaton Flash timer is 30 seconds. elseif puppetmaster.lastFlash + 45 < currentTimer and puppetmaster.FlashT:current() == 'on' and puppetmaster.lastFlash ~= 0 then windower.add_to_chat(5, "Automaton: Preparing Ability: Flashbulb.") windower.send_command('gs c EnmityGear') puppetmaster.FlashT:setTo('off') -- Automaton TP WS on. elseif pet.tp < 900 and puppetmaster.WST:current() == 'off' then puppetmaster.WST:setTo('on') -- Automaton TP WS off. elseif pet.tp < 3000 and pet.tp > 975 and puppetmaster.WST:current() == 'on' then windower.add_to_chat(5, "Automaton: Weaponskill ready!") puppetmaster.WST:setTo('off') end end end Code function LocalAftercast(spell, act) if player.status == 'Engaged' then equip(sets.TP[sets.TP.Mode[_modeTPi]]) else equip(sets.NA[sets.NA.Mode[_modeNAi]]) end bpWSTPReturn(spell.type, player.tp) end Code function LocalPetStatusChange(new, old) -- Equip selected TP set if engaged on a mob. if pet.status == 'Engaged' or player.status == 'Engaged' then equip(sets.TP[sets.TP.Mode[_modeTPi]]) -- Not engaged then default back to Idle set. elseif pet.status == 'Idle' and player.status == 'Idle' then equip(sets.NA[sets.NA.Mode[_modeNAi]]) end end function LocalSelfCommand(command) -- Flashbulb timer set. if command == 'Flashbulb' then puppetmaster.lastFlash = os.clock() puppetmaster.FlashT:setTo('on') -- Provoke timer set. elseif command == 'Provoke' then puppetmaster.lastProvoke = os.clock() puppetmaster.ProvokeT:setTo('on') -- Bone Crusher WS Set. elseif command == 'Bone Crusher' then equip(sets.Automaton['Bone Crusher']) windower.send_command(';wait 1; gs c DelayedPetAftercast') -- Bone Crusher WS Set. elseif command == 'Chimera Ripper' then equip(sets.Automaton['Chimera Ripper']) windower.send_command(';wait 1; gs c DelayedPetAftercast') -- Acruballista WS Set. elseif command == 'Arcuballista' then equip(sets.Automaton['Arcuballista']) windower.send_command(';wait 1; gs c DelayedPetAftercast') -- Armor Shatterer WS Set. elseif command == 'Armor Shatterer' then equip(sets.Automaton['Armor Shatterer']) windower.send_command(';wait 1; gs c DelayedPetAftercast') -- String Shredder WS Set. elseif command == 'String Shredder' then equip(sets.Automaton['String Shredder']) windower.send_command(';wait 1; gs c DelayedPetAftercast') -- String Clipper WS Set. elseif command == 'String Clipper' then equip(sets.Automaton['String Clipper']) windower.send_command(';wait 1; gs c DelayedPetAftercast') -- Slapstick WS Set. elseif command == 'Slapstick' then equip(sets.Automaton['Bone Crusher']) windower.send_command(';wait 1; gs c DelayedPetAftercast') -- Delayed Aftercast Trigger. elseif command == 'DelayedPetAftercast' then equip(sets.TP[sets.TP.Mode[_modeTPi]]) -- Equip Automaton Enmity set. elseif command == 'EnmityGear' then equip(sets.Automaton['Enmity']) end gsCommand(command) end windower.raw_register_event('prerender',function() if bpcore.ping.send and os.clock()-bpcore.ping.last > bpcore.ping.timer and bpcore.ping.status == true then bpBuySparks() handlePetTimers() bpcore.ping.last = os.clock() end end) Note: I wont be handing out any other special code that is required in specific settings or libraries I have written. Its pretty simple to get the idea of how it works though. Also I dont use motes, I have no intention to, and I can't help implement. Sorry. :( Lakshmi.Elidyr said: » I have tested time, and time again, and even worked with some people on here, and I am 99% sure that the way I am doing it is working. With the way I have it setup, I see a significant increase in damage, and my numbers are pretty similar to when locked. I do notice that due to the speed of Pet WS packets, that sometimes it does what seems to miss the packet all together using messages to track this. I also have enmity working using delayed triggers since the auto is predictable with JA's as long as you have Maneuvers up. The way I have it setup is using packet detection, to grab skill name, then call a gs c of the same name. The only problem is when you start doing stuff as master as well and engaged things just get sloppy. If you play using manual triggers I am sure it will be about 90% better than trying to use this method. Im just lazy on PUP. I looked at your code. It very likely is working as you expect. Errors in not equipping are probably a result of Inhibitor or Speed Loader modifying the Automaton's check pattern. My suspicion is that Inhibitor or Speed Loader adds some kinda secondary check for the automaton where it will use TP the instant it is over 1k in some situations, obviously when a SC debuff is present on that target, but there may also be something else as I have observed it at other times. It's possible that if the Automaton is close enough to a WS when a check is performed, the Automaton will log that action and perform it as soon as it is able. Dunno. It doesn't matter, really. Quetzalcoatl.Trulusia said: » Lakshmi.Elidyr said: » I have tested time, and time again, and even worked with some people on here, and I am 99% sure that the way I am doing it is working. With the way I have it setup, I see a significant increase in damage, and my numbers are pretty similar to when locked. I do notice that due to the speed of Pet WS packets, that sometimes it does what seems to miss the packet all together using messages to track this. I also have enmity working using delayed triggers since the auto is predictable with JA's as long as you have Maneuvers up. The way I have it setup is using packet detection, to grab skill name, then call a gs c of the same name. The only problem is when you start doing stuff as master as well and engaged things just get sloppy. If you play using manual triggers I am sure it will be about 90% better than trying to use this method. Im just lazy on PUP. I looked at your code. It very likely is working as you expect. Errors in not equipping are probably a result of Inhibitor or Speed Loader modifying the Automaton's check pattern. My suspicion is that Inhibitor or Speed Loader adds some kinda secondary check for the automaton where it will use TP the instant it is over 1k in some situations, obviously when a SC debuff is present on that target, but there may also be something else as I have observed it at other times. It's possible that if the Automaton is close enough to a WS when a check is performed, the Automaton will log that action and perform it as soon as it is able. Dunno. It doesn't matter, really. Thanks, Good info to have! Im really not huge in to PUP, but I do have it geared well enough to do stuff with it. Its fun to tinker with. Asura.Zigzagzig said: » mote based / log chat = x2 windows ( use //gs showswaps in game to check swap ), hope its help a bit https://pastebin.com/RV4TxJxb I"m looking at this, and I'm wondering what of Elidyr's have you included? I see the following line: id = windower.raw_register_event('incoming chunk', update_pet_tp) but I don't see any of the rest. are you actually using Elidyr's functionality for automatic swapping for automaton enmity and WS? Quetzalcoatl.Xilkk said: » Asura.Zigzagzig said: » mote based / log chat = x2 windows ( use //gs showswaps in game to check swap ), hope its help a bit https://pastebin.com/RV4TxJxb I"m looking at this, and I'm wondering what of Elidyr's have you included? I see the following line: id = windower.raw_register_event('incoming chunk', update_pet_tp) but I don't see any of the rest. are you actually using Elidyr's functionality for automatic swapping for automaton enmity and WS? Most of mine will not be related to anything in motes, or taken from anywhere here. I think that is actually the most code I have ever posted of these particular functions. You would need to be very familiar with motes, and probably heavily modify my code to fit in. Elidyr is your entire pup lua posted anywhere?
I grabbed the pieces you posted in the forum, but its alot eaiser to modify a full lua, than to piece different ones together. I'm not sure if trying ot put your functions into motes would be worse than adding some of the functions I have into yours. Quetzalcoatl.Xilkk said: » Elidyr is your entire pup lua posted anywhere? I grabbed the pieces you posted in the forum, but its alot eaiser to modify a full lua, than to piece different ones together. I'm not sure if trying ot put your functions into motes would be worse than adding some of the functions I have into yours. Trying to adjust to add to motes will be best, and I cant post my files here. Sorry. :( Id be more than happy to explain any of it. Edit the problem I had before is I dont think it will work with motes. Due to conflicting functions in aftercast causing gear to double apply. |
||
All FFXI content and images © 2002-2024 SQUARE ENIX CO., LTD. FINAL
FANTASY is a registered trademark of Square Enix Co., Ltd.
|