{"action":"created","comment":{"url":"https://api.github.com/repos/Windower/Lua/pulls/comments/61910568","id":61910568,"diff_hunk":"@@ -68,19 +68,36 @@ windower.register_event('login', initialize)\n \n windower.register_event('job change', initialize:cond(function(job) return job == 16 end))\n \n-function set_spells(spellset)\n+function set_spells(spellset, setmode)\n     if windower.ffxi.get_player()['main_job_id'] ~= 16 --[[and windower.ffxi.get_player()['sub_job_id'] ~= 16]] then return nil end\n     if settings.spellsets[spellset] == nil then return end\n-    if settings.spellsets[spellset]:equals(get_current_spellset()) then\n+    if is_spellset_equipped(settings.spellsets[spellset]) then\n         error(spellset..' was already equipped.')\n         return\n     end\n \n     log('Starting to set '..spellset..'.')\n-    set_spells_from_spellset(spellset, 'remove')\n+    if setmode=='clearfirst' or (setmode == nil and settings.setmode == 'clearfirst') then\n+        remove_all_spells(nil)\n+        windower.send_command('@wait .65;lua i azuresets set_spells_from_spellset '..spellset..' add')","path":"addons/azureSets/azuresets.lua","position":18,"original_position":18,"commit_id":"e28bbdd04355750d75934bbc2712e5a7b258b80f","original_commit_id":"e28bbdd04355750d75934bbc2712e5a7b258b80f","user":{"login":"z16","id":1635608,"avatar_url":"https://avatars.githubusercontent.com/u/1635608?v=3","gravatar_id":"","url":"https://api.github.com/users/z16","html_url":"https://github.com/z16","followers_url":"https://api.github.com/users/z16/followers","following_url":"https://api.github.com/users/z16/following{/other_user}","gists_url":"https://api.github.com/users/z16/gists{/gist_id}","starred_url":"https://api.github.com/users/z16/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/z16/subscriptions","organizations_url":"https://api.github.com/users/z16/orgs","repos_url":"https://api.github.com/users/z16/repos","events_url":"https://api.github.com/users/z16/events{/privacy}","received_events_url":"https://api.github.com/users/z16/received_events","type":"User","site_admin":false},"body":"Coroutine magic!\r\n\r\n```lua\r\nset_spells_from_spellset:schedule(0.65, 'add')\r\n```","created_at":"2016-05-03T16:20:41Z","updated_at":"2016-05-03T16:20:41Z","html_url":"https://github.com/Windower/Lua/pull/1434#discussion_r61910568","pull_request_url":"https://api.github.com/repos/Windower/Lua/pulls/1434","_links":{"self":{"href":"https://api.github.com/repos/Windower/Lua/pulls/comments/61910568"},"html":{"href":"https://github.com/Windower/Lua/pull/1434#discussion_r61910568"},"pull_request":{"href":"https://api.github.com/repos/Windower/Lua/pulls/1434"}}},"pull_request":{"url":"https://api.github.com/repos/Windower/Lua/pulls/1434","id":68649837,"html_url":"https://github.com/Windower/Lua/pull/1434","diff_url":"https://github.com/Windower/Lua/pull/1434.diff","patch_url":"https://github.com/Windower/Lua/pull/1434.patch","issue_url":"https://api.github.com/repos/Windower/Lua/issues/1434","number":1434,"state":"open","locked":false,"title":"Allow users to choose how to set spells.","user":{"login":"baharms","id":485074,"avatar_url":"https://avatars.githubusercontent.com/u/485074?v=3","gravatar_id":"","url":"https://api.github.com/users/baharms","html_url":"https://github.com/baharms","followers_url":"https://api.github.com/users/baharms/followers","following_url":"https://api.github.com/users/baharms/following{/other_user}","gists_url":"https://api.github.com/users/baharms/gists{/gist_id}","starred_url":"https://api.github.com/users/baharms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baharms/subscriptions","organizations_url":"https://api.github.com/users/baharms/orgs","repos_url":"https://api.github.com/users/baharms/repos","events_url":"https://api.github.com/users/baharms/events{/privacy}","received_events_url":"https://api.github.com/users/baharms/received_events","type":"User","site_admin":false},"body":"Added new setting and function argument to allow users to choose how to set spells. \r\n'clearfirst' clears all spells first, then adds all spells of the set back. Faster for large changes, slower for small changes, and preserves order.\r\n'preservetraits' removes spells one at a time and adds new ones in. Preserves traits across sets and faster for small changes.\r\n\r\nAlso updated the method for checking if the spells have already been set. Not the most elegant solution, but I'm not a native Lua person. Anybody want to comment on how to do it better?","created_at":"2016-05-03T02:16:37Z","updated_at":"2016-05-03T16:20:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"747ff6e5814dd4451a75c4c04d5a4eb9764f6a28","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Windower/Lua/pulls/1434/commits","review_comments_url":"https://api.github.com/repos/Windower/Lua/pulls/1434/comments","review_comment_url":"https://api.github.com/repos/Windower/Lua/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Windower/Lua/issues/1434/comments","statuses_url":"https://api.github.com/repos/Windower/Lua/statuses/e28bbdd04355750d75934bbc2712e5a7b258b80f","head":{"label":"baharms:dev","ref":"dev","sha":"e28bbdd04355750d75934bbc2712e5a7b258b80f","user":{"login":"baharms","id":485074,"avatar_url":"https://avatars.githubusercontent.com/u/485074?v=3","gravatar_id":"","url":"https://api.github.com/users/baharms","html_url":"https://github.com/baharms","followers_url":"https://api.github.com/users/baharms/followers","following_url":"https://api.github.com/users/baharms/following{/other_user}","gists_url":"https://api.github.com/users/baharms/gists{/gist_id}","starred_url":"https://api.github.com/users/baharms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baharms/subscriptions","organizations_url":"https://api.github.com/users/baharms/orgs","repos_url":"https://api.github.com/users/baharms/repos","events_url":"https://api.github.com/users/baharms/events{/privacy}","received_events_url":"https://api.github.com/users/baharms/received_events","type":"User","site_admin":false},"repo":{"id":54589644,"name":"Lua","full_name":"baharms/Lua","owner":{"login":"baharms","id":485074,"avatar_url":"https://avatars.githubusercontent.com/u/485074?v=3","gravatar_id":"","url":"https://api.github.com/users/baharms","html_url":"https://github.com/baharms","followers_url":"https://api.github.com/users/baharms/followers","following_url":"https://api.github.com/users/baharms/following{/other_user}","gists_url":"https://api.github.com/users/baharms/gists{/gist_id}","starred_url":"https://api.github.com/users/baharms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baharms/subscriptions","organizations_url":"https://api.github.com/users/baharms/orgs","repos_url":"https://api.github.com/users/baharms/repos","events_url":"https://api.github.com/users/baharms/events{/privacy}","received_events_url":"https://api.github.com/users/baharms/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/baharms/Lua","description":"Lua Addons and Scripts","fork":true,"url":"https://api.github.com/repos/baharms/Lua","forks_url":"https://api.github.com/repos/baharms/Lua/forks","keys_url":"https://api.github.com/repos/baharms/Lua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/baharms/Lua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/baharms/Lua/teams","hooks_url":"https://api.github.com/repos/baharms/Lua/hooks","issue_events_url":"https://api.github.com/repos/baharms/Lua/issues/events{/number}","events_url":"https://api.github.com/repos/baharms/Lua/events","assignees_url":"https://api.github.com/repos/baharms/Lua/assignees{/user}","branches_url":"https://api.github.com/repos/baharms/Lua/branches{/branch}","tags_url":"https://api.github.com/repos/baharms/Lua/tags","blobs_url":"https://api.github.com/repos/baharms/Lua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/baharms/Lua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/baharms/Lua/git/refs{/sha}","trees_url":"https://api.github.com/repos/baharms/Lua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/baharms/Lua/statuses/{sha}","languages_url":"https://api.github.com/repos/baharms/Lua/languages","stargazers_url":"https://api.github.com/repos/baharms/Lua/stargazers","contributors_url":"https://api.github.com/repos/baharms/Lua/contributors","subscribers_url":"https://api.github.com/repos/baharms/Lua/subscribers","subscription_url":"https://api.github.com/repos/baharms/Lua/subscription","commits_url":"https://api.github.com/repos/baharms/Lua/commits{/sha}","git_commits_url":"https://api.github.com/repos/baharms/Lua/git/commits{/sha}","comments_url":"https://api.github.com/repos/baharms/Lua/comments{/number}","issue_comment_url":"https://api.github.com/repos/baharms/Lua/issues/comments{/number}","contents_url":"https://api.github.com/repos/baharms/Lua/contents/{+path}","compare_url":"https://api.github.com/repos/baharms/Lua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/baharms/Lua/merges","archive_url":"https://api.github.com/repos/baharms/Lua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/baharms/Lua/downloads","issues_url":"https://api.github.com/repos/baharms/Lua/issues{/number}","pulls_url":"https://api.github.com/repos/baharms/Lua/pulls{/number}","milestones_url":"https://api.github.com/repos/baharms/Lua/milestones{/number}","notifications_url":"https://api.github.com/repos/baharms/Lua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/baharms/Lua/labels{/name}","releases_url":"https://api.github.com/repos/baharms/Lua/releases{/id}","deployments_url":"https://api.github.com/repos/baharms/Lua/deployments","created_at":"2016-03-23T20:06:38Z","updated_at":"2016-03-23T20:06:40Z","pushed_at":"2016-05-03T02:42:47Z","git_url":"git://github.com/baharms/Lua.git","ssh_url":"git@github.com:baharms/Lua.git","clone_url":"https://github.com/baharms/Lua.git","svn_url":"https://github.com/baharms/Lua","homepage":null,"size":13124,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"Windower:dev","ref":"dev","sha":"e103913a89ccc1ec0a35064782cfaa95183a4346","user":{"login":"Windower","id":1772042,"avatar_url":"https://avatars.githubusercontent.com/u/1772042?v=3","gravatar_id":"","url":"https://api.github.com/users/Windower","html_url":"https://github.com/Windower","followers_url":"https://api.github.com/users/Windower/followers","following_url":"https://api.github.com/users/Windower/following{/other_user}","gists_url":"https://api.github.com/users/Windower/gists{/gist_id}","starred_url":"https://api.github.com/users/Windower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Windower/subscriptions","organizations_url":"https://api.github.com/users/Windower/orgs","repos_url":"https://api.github.com/users/Windower/repos","events_url":"https://api.github.com/users/Windower/events{/privacy}","received_events_url":"https://api.github.com/users/Windower/received_events","type":"Organization","site_admin":false},"repo":{"id":7983964,"name":"Lua","full_name":"Windower/Lua","owner":{"login":"Windower","id":1772042,"avatar_url":"https://avatars.githubusercontent.com/u/1772042?v=3","gravatar_id":"","url":"https://api.github.com/users/Windower","html_url":"https://github.com/Windower","followers_url":"https://api.github.com/users/Windower/followers","following_url":"https://api.github.com/users/Windower/following{/other_user}","gists_url":"https://api.github.com/users/Windower/gists{/gist_id}","starred_url":"https://api.github.com/users/Windower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Windower/subscriptions","organizations_url":"https://api.github.com/users/Windower/orgs","repos_url":"https://api.github.com/users/Windower/repos","events_url":"https://api.github.com/users/Windower/events{/privacy}","received_events_url":"https://api.github.com/users/Windower/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Windower/Lua","description":"Lua Addons and Scripts","fork":false,"url":"https://api.github.com/repos/Windower/Lua","forks_url":"https://api.github.com/repos/Windower/Lua/forks","keys_url":"https://api.github.com/repos/Windower/Lua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Windower/Lua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Windower/Lua/teams","hooks_url":"https://api.github.com/repos/Windower/Lua/hooks","issue_events_url":"https://api.github.com/repos/Windower/Lua/issues/events{/number}","events_url":"https://api.github.com/repos/Windower/Lua/events","assignees_url":"https://api.github.com/repos/Windower/Lua/assignees{/user}","branches_url":"https://api.github.com/repos/Windower/Lua/branches{/branch}","tags_url":"https://api.github.com/repos/Windower/Lua/tags","blobs_url":"https://api.github.com/repos/Windower/Lua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Windower/Lua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Windower/Lua/git/refs{/sha}","trees_url":"https://api.github.com/repos/Windower/Lua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Windower/Lua/statuses/{sha}","languages_url":"https://api.github.com/repos/Windower/Lua/languages","stargazers_url":"https://api.github.com/repos/Windower/Lua/stargazers","contributors_url":"https://api.github.com/repos/Windower/Lua/contributors","subscribers_url":"https://api.github.com/repos/Windower/Lua/subscribers","subscription_url":"https://api.github.com/repos/Windower/Lua/subscription","commits_url":"https://api.github.com/repos/Windower/Lua/commits{/sha}","git_commits_url":"https://api.github.com/repos/Windower/Lua/git/commits{/sha}","comments_url":"https://api.github.com/repos/Windower/Lua/comments{/number}","issue_comment_url":"https://api.github.com/repos/Windower/Lua/issues/comments{/number}","contents_url":"https://api.github.com/repos/Windower/Lua/contents/{+path}","compare_url":"https://api.github.com/repos/Windower/Lua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Windower/Lua/merges","archive_url":"https://api.github.com/repos/Windower/Lua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Windower/Lua/downloads","issues_url":"https://api.github.com/repos/Windower/Lua/issues{/number}","pulls_url":"https://api.github.com/repos/Windower/Lua/pulls{/number}","milestones_url":"https://api.github.com/repos/Windower/Lua/milestones{/number}","notifications_url":"https://api.github.com/repos/Windower/Lua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Windower/Lua/labels{/name}","releases_url":"https://api.github.com/repos/Windower/Lua/releases{/id}","deployments_url":"https://api.github.com/repos/Windower/Lua/deployments","created_at":"2013-02-03T00:07:50Z","updated_at":"2016-04-07T04:20:50Z","pushed_at":"2016-05-03T02:42:47Z","git_url":"git://github.com/Windower/Lua.git","ssh_url":"git@github.com:Windower/Lua.git","clone_url":"https://github.com/Windower/Lua.git","svn_url":"https://github.com/Windower/Lua","homepage":null,"size":19366,"stargazers_count":70,"watchers_count":70,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":142,"mirror_url":null,"open_issues_count":23,"forks":142,"open_issues":23,"watchers":70,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Windower/Lua/pulls/1434"},"html":{"href":"https://github.com/Windower/Lua/pull/1434"},"issue":{"href":"https://api.github.com/repos/Windower/Lua/issues/1434"},"comments":{"href":"https://api.github.com/repos/Windower/Lua/issues/1434/comments"},"review_comments":{"href":"https://api.github.com/repos/Windower/Lua/pulls/1434/comments"},"review_comment":{"href":"https://api.github.com/repos/Windower/Lua/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Windower/Lua/pulls/1434/commits"},"statuses":{"href":"https://api.github.com/repos/Windower/Lua/statuses/e28bbdd04355750d75934bbc2712e5a7b258b80f"}}}}