{"action":"created","comment":{"url":"https://api.github.com/repos/Windower/Lua/pulls/comments/23066579","id":23066579,"diff_hunk":"@@ -0,0 +1,166 @@\n+-- \n+-- autoLock v1.0\n+-- \n+-- Copyright ©2015, bangerang\n+-- All rights reserved.\n+-- \n+-- Redistribution and use in source and binary forms, with or without\n+-- modification, are permitted provided that the following conditions are met:\n+-- \n+-- * Redistributions of source code must retain the above copyright\n+--   notice, this list of conditions and the following disclaimer.\n+-- * Redistributions in binary form must reproduce the above copyright\n+--   notice, this list of conditions and the following disclaimer in the\n+--   documentation and/or other materials provided with the distribution.\n+-- * Neither the name of autoLock nor the names of its contributors may be \n+--   used to endorse or promote products derived from this software without\n+--   specific prior written permission.\n+\n+-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n+-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+-- DISCLAIMED. IN NO EVENT SHALL ReaperX BE LIABLE FOR ANY\n+-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n+-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+--\n+--\n+-- Automatically equips a gear set and uses the /lockstyle command when leaving town.\n+-- This addon requires the Gearswap addon.\n+--\n+-- To use this addon create a gear set titled sets.lockstyle in your job.lua file.\n+-- Ex:\n+-- \t\tsets.lockstyle = {\n+--\t\t\thead=\"Raider's Bonnet +2\",\n+--\t\t\tbody=\"Raider's Vest +2\",hands=\"Raider's Armlets +2\",\n+--\t\t\tlegs=\"Raider's Culottes +2\",feet=\"Raider's Poulaines +2\"}\n+--\n+--\n+\n+_addon.name = \"autoLock\"\n+_addon.author = \"bangerang\"\n+_addon.version = \"1.0\"\n+_addon.commands = {'al', 'autolock'}\n+_addon.language = 'english'\n+\n+require('luau')\n+config = require('config')\n+\n+defaults = {}\n+defaults.zoneDelay = 10\n+defaults.keyBind = '^x'\n+defaults.autoLock = true\n+defaults.ignoreZones = S{\n+    \"Ru'Lude Gardens\", \"Upper Jeuno\", \"Lower Jeuno\", \"Port Jeuno\", \"Port Windurst\", \"Windurst Waters\", \"Windurst Woods\", \"Windurst Walls\",\n+    \"Heavens Tower\", \"Port San d'Oria\", \"Northern San d'Oria\", \"Southern San d'Oria\", \"Chateau d'Oraguille\", \"Port Bastok\", \"Bastok Markets\",\n+    \"Bastok Mines\", \"Metalworks\", \"Aht Urhgan Whitegate\", \"Tavnazian Safehold\", \"Nashmau\", \"Selbina\", \"Mhaura\", \"Norg\", \"Rabao\", \"Kazham\",\n+    \"Eastern Adoulin\", \"Western Adoulin\", \"Leafallia\", \"Celennia Memorial Library\", \"Mog Garden\"}\n+\n+settings = config.load(defaults)\n+\n+tokens = {}\n+tokens.lockstyle = false\n+\n+windower.send_command('bind %s al':format(settings.keyBind))\n+windower.send_command('input /lockstyle off')\n+\n+function al_output(msg)\n+    prefix = 'autoLock: '\n+    windower.add_to_chat(209, prefix..msg)\n+end\n+\n+-- Accepts a boolean value and returns an appropriate string value. i.e. true -> 'on'\n+function booltostr(bool)\n+    local str = ''\n+    if bool then\n+        str = 'on'\n+        return str\n+    elseif not bool then\n+        str = 'off'\n+        return str\n+    else\n+        print('Boolean to string: unknown error.')\n+    end\n+end\n+\n+function command_lockstyle()\n+\tif tokens.lockstyle then","path":"addons/autoLock/autoLock.lua","position":90,"original_position":90,"commit_id":"d112919fdd2b8043671dd22da15f41d1b0265f2a","original_commit_id":"d112919fdd2b8043671dd22da15f41d1b0265f2a","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":"You've been using 4 spaces for indentation up until this point and here you're switching to tabs. Please switch the entire file to tab indentation.","created_at":"2015-01-16T07:41:33Z","updated_at":"2015-01-16T07:41:33Z","html_url":"https://github.com/Windower/Lua/pull/1187#discussion_r23066579","pull_request_url":"https://api.github.com/repos/Windower/Lua/pulls/1187","_links":{"self":{"href":"https://api.github.com/repos/Windower/Lua/pulls/comments/23066579"},"html":{"href":"https://github.com/Windower/Lua/pull/1187#discussion_r23066579"},"pull_request":{"href":"https://api.github.com/repos/Windower/Lua/pulls/1187"}}},"pull_request":{"url":"https://api.github.com/repos/Windower/Lua/pulls/1187","id":27477486,"html_url":"https://github.com/Windower/Lua/pull/1187","diff_url":"https://github.com/Windower/Lua/pull/1187.diff","patch_url":"https://github.com/Windower/Lua/pull/1187.patch","issue_url":"https://api.github.com/repos/Windower/Lua/issues/1187","number":1187,"state":"open","locked":false,"title":"autoLock addon initial release","user":{"login":"cantreadcode","id":4392854,"avatar_url":"https://avatars.githubusercontent.com/u/4392854?v=3","gravatar_id":"","url":"https://api.github.com/users/cantreadcode","html_url":"https://github.com/cantreadcode","followers_url":"https://api.github.com/users/cantreadcode/followers","following_url":"https://api.github.com/users/cantreadcode/following{/other_user}","gists_url":"https://api.github.com/users/cantreadcode/gists{/gist_id}","starred_url":"https://api.github.com/users/cantreadcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cantreadcode/subscriptions","organizations_url":"https://api.github.com/users/cantreadcode/orgs","repos_url":"https://api.github.com/users/cantreadcode/repos","events_url":"https://api.github.com/users/cantreadcode/events{/privacy}","received_events_url":"https://api.github.com/users/cantreadcode/received_events","type":"User","site_admin":false},"body":"autoLock addon automatically equips a gear set and then uses the lockstyle command when leaving town.\r\nrequires gearswap addon and a set called sets.lockstyle in your job.lua file.","created_at":"2015-01-16T01:17:34Z","updated_at":"2015-01-16T07:41:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"269145461c60986edfa6da0a6d5e1362e6ba9738","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Windower/Lua/pulls/1187/commits","review_comments_url":"https://api.github.com/repos/Windower/Lua/pulls/1187/comments","review_comment_url":"https://api.github.com/repos/Windower/Lua/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Windower/Lua/issues/1187/comments","statuses_url":"https://api.github.com/repos/Windower/Lua/statuses/d112919fdd2b8043671dd22da15f41d1b0265f2a","head":{"label":"cantreadcode:patch-1","ref":"patch-1","sha":"d112919fdd2b8043671dd22da15f41d1b0265f2a","user":{"login":"cantreadcode","id":4392854,"avatar_url":"https://avatars.githubusercontent.com/u/4392854?v=3","gravatar_id":"","url":"https://api.github.com/users/cantreadcode","html_url":"https://github.com/cantreadcode","followers_url":"https://api.github.com/users/cantreadcode/followers","following_url":"https://api.github.com/users/cantreadcode/following{/other_user}","gists_url":"https://api.github.com/users/cantreadcode/gists{/gist_id}","starred_url":"https://api.github.com/users/cantreadcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cantreadcode/subscriptions","organizations_url":"https://api.github.com/users/cantreadcode/orgs","repos_url":"https://api.github.com/users/cantreadcode/repos","events_url":"https://api.github.com/users/cantreadcode/events{/privacy}","received_events_url":"https://api.github.com/users/cantreadcode/received_events","type":"User","site_admin":false},"repo":{"id":27776753,"name":"Lua","full_name":"cantreadcode/Lua","owner":{"login":"cantreadcode","id":4392854,"avatar_url":"https://avatars.githubusercontent.com/u/4392854?v=3","gravatar_id":"","url":"https://api.github.com/users/cantreadcode","html_url":"https://github.com/cantreadcode","followers_url":"https://api.github.com/users/cantreadcode/followers","following_url":"https://api.github.com/users/cantreadcode/following{/other_user}","gists_url":"https://api.github.com/users/cantreadcode/gists{/gist_id}","starred_url":"https://api.github.com/users/cantreadcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cantreadcode/subscriptions","organizations_url":"https://api.github.com/users/cantreadcode/orgs","repos_url":"https://api.github.com/users/cantreadcode/repos","events_url":"https://api.github.com/users/cantreadcode/events{/privacy}","received_events_url":"https://api.github.com/users/cantreadcode/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cantreadcode/Lua","description":"obiaway fork","fork":true,"url":"https://api.github.com/repos/cantreadcode/Lua","forks_url":"https://api.github.com/repos/cantreadcode/Lua/forks","keys_url":"https://api.github.com/repos/cantreadcode/Lua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cantreadcode/Lua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cantreadcode/Lua/teams","hooks_url":"https://api.github.com/repos/cantreadcode/Lua/hooks","issue_events_url":"https://api.github.com/repos/cantreadcode/Lua/issues/events{/number}","events_url":"https://api.github.com/repos/cantreadcode/Lua/events","assignees_url":"https://api.github.com/repos/cantreadcode/Lua/assignees{/user}","branches_url":"https://api.github.com/repos/cantreadcode/Lua/branches{/branch}","tags_url":"https://api.github.com/repos/cantreadcode/Lua/tags","blobs_url":"https://api.github.com/repos/cantreadcode/Lua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cantreadcode/Lua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cantreadcode/Lua/git/refs{/sha}","trees_url":"https://api.github.com/repos/cantreadcode/Lua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cantreadcode/Lua/statuses/{sha}","languages_url":"https://api.github.com/repos/cantreadcode/Lua/languages","stargazers_url":"https://api.github.com/repos/cantreadcode/Lua/stargazers","contributors_url":"https://api.github.com/repos/cantreadcode/Lua/contributors","subscribers_url":"https://api.github.com/repos/cantreadcode/Lua/subscribers","subscription_url":"https://api.github.com/repos/cantreadcode/Lua/subscription","commits_url":"https://api.github.com/repos/cantreadcode/Lua/commits{/sha}","git_commits_url":"https://api.github.com/repos/cantreadcode/Lua/git/commits{/sha}","comments_url":"https://api.github.com/repos/cantreadcode/Lua/comments{/number}","issue_comment_url":"https://api.github.com/repos/cantreadcode/Lua/issues/comments/{number}","contents_url":"https://api.github.com/repos/cantreadcode/Lua/contents/{+path}","compare_url":"https://api.github.com/repos/cantreadcode/Lua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cantreadcode/Lua/merges","archive_url":"https://api.github.com/repos/cantreadcode/Lua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cantreadcode/Lua/downloads","issues_url":"https://api.github.com/repos/cantreadcode/Lua/issues{/number}","pulls_url":"https://api.github.com/repos/cantreadcode/Lua/pulls{/number}","milestones_url":"https://api.github.com/repos/cantreadcode/Lua/milestones{/number}","notifications_url":"https://api.github.com/repos/cantreadcode/Lua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cantreadcode/Lua/labels{/name}","releases_url":"https://api.github.com/repos/cantreadcode/Lua/releases{/id}","created_at":"2014-12-09T16:53:31Z","updated_at":"2015-01-16T00:21:02Z","pushed_at":"2015-01-16T00:21:02Z","git_url":"git://github.com/cantreadcode/Lua.git","ssh_url":"git@github.com:cantreadcode/Lua.git","clone_url":"https://github.com/cantreadcode/Lua.git","svn_url":"https://github.com/cantreadcode/Lua","homepage":"","size":11492,"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":"4.1-dev"}},"base":{"label":"Windower:4.1-dev","ref":"4.1-dev","sha":"0b7a32de8beb612a6a6fa4007fa75c4aa3d044b4","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}","created_at":"2013-02-03T00:07:50Z","updated_at":"2015-01-16T04:07:46Z","pushed_at":"2015-01-16T04:07:46Z","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":20932,"stargazers_count":52,"watchers_count":52,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":107,"mirror_url":null,"open_issues_count":14,"forks":107,"open_issues":14,"watchers":52,"default_branch":"4.1-dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Windower/Lua/pulls/1187"},"html":{"href":"https://github.com/Windower/Lua/pull/1187"},"issue":{"href":"https://api.github.com/repos/Windower/Lua/issues/1187"},"comments":{"href":"https://api.github.com/repos/Windower/Lua/issues/1187/comments"},"review_comments":{"href":"https://api.github.com/repos/Windower/Lua/pulls/1187/comments"},"review_comment":{"href":"https://api.github.com/repos/Windower/Lua/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Windower/Lua/pulls/1187/commits"},"statuses":{"href":"https://api.github.com/repos/Windower/Lua/statuses/d112919fdd2b8043671dd22da15f41d1b0265f2a"}}}}