{"action":"created","issue":{"url":"https://api.github.com/repos/Windower/Lua/issues/1490","repository_url":"https://api.github.com/repos/Windower/Lua","labels_url":"https://api.github.com/repos/Windower/Lua/issues/1490/labels{/name}","comments_url":"https://api.github.com/repos/Windower/Lua/issues/1490/comments","events_url":"https://api.github.com/repos/Windower/Lua/issues/1490/events","html_url":"https://github.com/Windower/Lua/issues/1490","id":183819050,"number":1490,"title":"[Enhancement] A better way to get current job points","user":{"login":"Isilrhofal","id":16021222,"avatar_url":"https://avatars.githubusercontent.com/u/16021222?v=3","gravatar_id":"","url":"https://api.github.com/users/Isilrhofal","html_url":"https://github.com/Isilrhofal","followers_url":"https://api.github.com/users/Isilrhofal/followers","following_url":"https://api.github.com/users/Isilrhofal/following{/other_user}","gists_url":"https://api.github.com/users/Isilrhofal/gists{/gist_id}","starred_url":"https://api.github.com/users/Isilrhofal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Isilrhofal/subscriptions","organizations_url":"https://api.github.com/users/Isilrhofal/orgs","repos_url":"https://api.github.com/users/Isilrhofal/repos","events_url":"https://api.github.com/users/Isilrhofal/events{/privacy}","received_events_url":"https://api.github.com/users/Isilrhofal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-18T22:25:33Z","updated_at":"2016-10-19T18:32:18Z","closed_at":null,"body":"EDIT: Adjusted code as per @smd111 comment.\r\n\r\nCurrently I use the incoming chunks to read the job points spent on any character.\r\nUnfortunately this is only transmitted when zoning or chaning jobs, and returns nil if the addon was just loaded.\r\n\r\nCould we add something for job points to the library, or is there already something like this?\r\n\r\n```\r\nwindower.register_event('incoming chunk',function(id,org,modi,is_injected,is_blocked)\r\n\tif is_injected then return end\r\n\tif (id == 0x63 or id == 0x08D) and org:byte(5) == 5 then\r\n\t\tlocal offset = windower.ffxi.get_player().main_job_id*6+13\r\n\t\ttotaljp = org:unpack('H',offset+4)\r\n\tend\r\nend)\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/Windower/Lua/issues/comments/254901136","html_url":"https://github.com/Windower/Lua/issues/1490#issuecomment-254901136","issue_url":"https://api.github.com/repos/Windower/Lua/issues/1490","id":254901136,"user":{"login":"Isilrhofal","id":16021222,"avatar_url":"https://avatars.githubusercontent.com/u/16021222?v=3","gravatar_id":"","url":"https://api.github.com/users/Isilrhofal","html_url":"https://github.com/Isilrhofal","followers_url":"https://api.github.com/users/Isilrhofal/followers","following_url":"https://api.github.com/users/Isilrhofal/following{/other_user}","gists_url":"https://api.github.com/users/Isilrhofal/gists{/gist_id}","starred_url":"https://api.github.com/users/Isilrhofal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Isilrhofal/subscriptions","organizations_url":"https://api.github.com/users/Isilrhofal/orgs","repos_url":"https://api.github.com/users/Isilrhofal/repos","events_url":"https://api.github.com/users/Isilrhofal/events{/privacy}","received_events_url":"https://api.github.com/users/Isilrhofal/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T18:32:18Z","updated_at":"2016-10-19T18:32:18Z","body":"Please correct me if I am wrong, but windower.ffxi.get_player().job_points[main_job:lower()]  would return every single job points spent. So in this case I would have to count the job points and return the SUM of it as variable. But it would not return e.g. Total JP: 2100 similar to what the incoming chunk does.\r\n\r\nIn my example I am checking the total job points for SCH to calculate the correct timer for stratagems usage. So if it is below 550 jp the timer is 48 and above 550 jp it is 33 . (Not considering the merits)\r\n\r\nIdeally I would have something which would return 2100 if master etc. (Hope this makes sense)\r\nwindower.ffxi.get_player().total_job_points['war']\r\n> 2100"}}
{"actor":{"display_login":"Isilrhofal"}}