I'm not sure why what you're describing would even work. Could you possibly post the full code?
function aftercast(spell,action)
if spell.type == "WeaponSkill" then
status_change(player.status)
add_to_chat(158,''..(player.name)..' uses '..spell.name..'. TP Return: ['..(player.tp)..'%]')
end
still shows tp precast once in a while
Since you're not getting anything out of that function, add this line and tell us what shows up:
Also, everything you do calls status_change() to update your equipment. However that's just a hack because your status isn't actually changing (ie: you're compromising the validity of the event handler function). If you want to run the gear update code from multiple points, create a new function to handle equipping the updated gear and call that function from status_change() and all the other locations that need to use it.Code:function self_command(command) add_to_chat(123,'self-command: ['..tostring(command)..']')
Was wondering if anyone could tell me how to lock a piece of gear while a buff is active? Editing my Pld lua I can't for the life of me get Valor breeches/leggings to stay locked on during Invincible/Sentinel. would really appreciate the help![]()
While general assistance can be given on that matter, one must first ask why you are attempting to lock those two pieces for the duration of those abilities. The only effects they have are applied on JA use, and they do not need to be worn for the remainder of the buff duration.
Yeah, that's the behavior I'd expect. Calling status_change(player.status) shouldn't delay your add_to_chat at all. The issue is in packet placement. Sometimes SE sends a player update chunk and changes your TP in the same packet that it sends your WS damage chunk. I trigger off the WS damage chunk, but if it's in the same UDP packet then your TP has not been updated in memory yet and so it's not updated in player.vitals.tp. You need to pick one of the options that I said if you want it to work all the time, and either way calling status_change() shouldn't be affecting anything.
This is an option as well, but it will crash you occasionally when you change jobs or log out until unregister_event is fixed:
Waltzes will trip it up, just ftr.Code:windower.register_event('tp change',function(new,old) if (old >= 100 and new < 100) and (old-new > 50) then windower.add_to_chat(158,'WS TP Return: '..player.tp) end end)
ok tyvm guys
adding the line you posted does give me a message of the command i enter, for example if i use //gs c c1 it tells me self-command: [c1].
about the 2nd part of your answer, the lua isnt mine and i got 0 programing exp >.>, i understand that the status change part is wrong? since my status is not changing so nothing happens? i was hoping its a small fix but i guess the whole toggle part is written wrong?
So you're saying you entered //gs c c1? Did you try entering //gs c C1?
I'm using KBeezie's rng files and can't get it to swap to precast and then ranged attack gear. Very new to Gearswap and Lua so probably missing something simple.
http://pastebin.com/uvDPP6wM
http://pastebin.com/ir2B2RKr
Thanks in advance.
Is there a way to force gearswap to handle switching between a staff and club/shield better? It seems like half the time I end up bare handed with a shield. I guess I need to define my sets a certain way?
You need to do
Code:main="Staff Name",sub=empty