{"name":"keepalive","enabled":true,"description":"Override timeout and maintain solid connection.","type":"group","id":1,"items":[{"type":"function","name":"Read_Me","enabled":true,"id":4,"code":"/*\n\nKeepalive v1.0.1\nby Zahan of Achaea\n\n\nThis package combats the dreaded idle/routing-related disconnect so you can stay logged in for days at a time, you sadist. It does this by sending a gmcp.keepalive packet every 15 seconds. \n\n\n!!!!! WARNING !!!!! This package will override your timeout. !!!!! WARNING !!!!!\n\n\nThe added benefit of this is that you can set your timeout really low. Then if your client/browser freezes up and may no longer fire triggers (like antitheft triggers), you'll disconnect quickly.\n\n\nUse the alias KEEPALIVE for status and commands.\n\nVersion notes:\n- added alias support\n\n*/"},{"type":"function","name":"onLoad","enabled":true,"id":2,"code":"if (typeof keepalive == \"undefined\") {keepalive = {};}\n\nfunction keepalive_gmcp () {client.send_GMCP(\"Core.KeepAlive\");}\n\nif (!keepalive.timer) {\n client.display_notice(\"Keepalive activated!\", \"red\");\n keepalive.timer = setInterval(keepalive_gmcp, 15000);\n}","items":[]},{"type":"alias","name":"keepalive [off|on]","enabled":true,"id":3,"matching":"regexp","whole_words":false,"case_sensitive":false,"prefix_suffix":true,"actions":[{"action":"script","script":"var suffix = args[1];\nsuffix = suffix.replace(/\\s+/, \"\").toLowerCase();\n\nif (keepalive.timer) {\n keepalive.status = \"on\";\n}\nelse {\n keepalive.status = \"off\";\n}\n\nif (suffix == \"\") {\n client.print(\"Keepalive is currently: \"+keepalive.status+\".\");\n client.print(\"Syntax:\");\n client.print(\" KEEPALIVE OFF\");\n client.print(\" KEEPALIVE ON\");\n client.print(\" \");\n}\nelse if (suffix == \"off\") {\n if (keepalive.timer) {\n clearInterval(keepalive.timer);\n delete keepalive.timer;\n client.display_notice(\"Keepalive deactivated.\");\n }\n else {\n client.display_notice(\"Keepalive is already deactivated.\");\n }\n}\nelse if (suffix == \"on\") {\n if (!keepalive.timer) {\n keepalive_gmcp = function () {client.send_GMCP(\"Core.KeepAlive\");};\n keepalive.timer = setInterval(keepalive_gmcp, 15000);\n client.display_notice(\"Keepalive activated.\");\n }\n else {\n client.display_notice(\"Keepalive is already activated.\");\n }\n}"}],"text":"^keepalive(|\\s+on|\\s+off|\\s+)$"}]}