Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _addon.name = 'Resist Tester'
- _addon.version = '0.1'
- _addon.author = 'Chiaia'
- _addon.commands = {'resist'}
- packets = require('packets')
- require('logger')
- local self = windower.ffxi.get_mob_by_target('me').id
- local totalCount = 0
- local silenceCount = 0
- local resistedTypeOne = 0 --(Resisted!)
- local resistedTypeTwo = 0 --Regular Resist
- local run = false
- local percent = 0
- windower.register_event('incoming chunk', function(id, data)
- if run and (id == 0x028)then
- local action = packets.parse('incoming', data)
- local target = action['Target 1 ID']
- local message = action['Target 1 Action 1 Message']
- local messageMod = action['Target 1 Action 1 _unknown'] --Message Modifier: 0 = Regular, Resist 2 = (Resist!)
- if target == self and action.Category == 4 and action.Param == 59 then -- Target is me, Finished Casting and Spell is Silence
- if message == 75 then --Don't log/count anything if No Effect
- return
- else
- totalCount = totalCount + 1
- if message == 236 then --Silence Landed
- silenceCount = silenceCount + 1
- elseif message == 85 and messageMod == 2 then -- (Resisted!)
- resistedTypeOne = resistedTypeOne + 1
- elseif message == 85 and messageMod == 0 then -- Regular Resist
- resistedTypeTwo = resistedTypeTwo + 1
- else
- log("We have an error!")
- end
- percent = (resistedTypeOne / totalCount) * 100
- log("(Resisted!): " ..resistedTypeOne.. " Reg Resist: " ..resistedTypeTwo.. " Silenced: " ..silenceCount.. " Total: " ..totalCount.."")
- log("Percent: "..percent.."%")
- end
- end
- end
- end)
- windower.register_event('addon command', function(command)
- command = command and command:lower()
- if S{'run'}:contains(command) then
- if run then
- run = false
- log('No longer logging data.')
- elseif not run then
- run = true
- log('Now resuming logging data.')
- end
- elseif S{'stats',}:contains(command) then
- log("Stats: (Resisted!): " ..resistedTypeOne.. " Reg Resist: " ..resistedTypeTwo.. " Silenced: " ..silenceCount.. " Total: " ..totalCount.."")
- log("Stats: Percent: "..percent.."%")
- else
- log('//resist run - To toggle on/off data logging')
- log('//resist stats - To display current data')
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement