Content:MirLua/Examples/protocols: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Switch all protocols statuses to online: {{Content:MirLua/Example|code= local protos = require('m_protocols') local ID_STATUS_OFFLINE = 40071 local ID_STATUS_ONLINE = 40072...") |
(No difference)
|
Latest revision as of 00:46, 27 September 2017
Switch all protocols statuses to online:
local protos = require('m_protocols')
local ID_STATUS_OFFLINE = 40071
local ID_STATUS_ONLINE = 40072
m.HookEvent('Miranda/System/ModulesLoaded', function()
for acc in protos.Accounts() do
if acc.IsEnabled and not acc.IsVirtual then
local status = acc:CallService('/GetStatus')
if (status == ID_STATUS_OFFLINE) then
acc:CallService('/SetStatus', ID_STATUS_ONLINE)
end
end
end
end)