repo_name stringlengths 6 69 | path stringlengths 6 178 | copies stringclasses 278 values | size stringlengths 4 7 | content stringlengths 671 917k | license stringclasses 15 values |
|---|---|---|---|---|---|
albag/Ultraxion-WoW | src/scripts/lua/LuaBridge/Stable Scripts/Azeroth/Karazhan/BOSS_Karazhan_Netherspite.lua | 30 | 1703 | function Netherspite_Portal_PhaseA(Unit, event, miscunit, misc)
print "Netherspite Portal PhaseA"
Unit:SendAreaTriggerMessage("PORTAL PHASE")
Unit:FullCastSpell(30400)
Unit:FullCastSpell(30401)
Unit:FullCastSpell(30402)
end
function Netherspite_Nether_Burn(Unit, event, miscunit, misc)
print "Netherspite Nether Burn"
Unit:FullCastSpellOnTarget(30523,Unit:GetClosestPlayer())
Unit:SendChatMessage(11, 0, "BURN...")
end
function Netherspite_Vode_Zone(Unit, event, miscunit, misc)
print "Netherspite Vode Zone"
Unit:FullCastSpellOnTarget(30533,Unit:GetRandomPlayer())
Unit:SendChatMessage(11, 0, "Bad Zone...")
end
function Netherspite_Banish_Phase(Unit, event, miscunit, misc)
print "Netherspite Banish Phase"
Unit:SendAreaTriggerMessage("BANISH PHASE")
Unit:FullCastSpell(35182)
Unit:FullCastSpellOnTarget(38524,Unit:GetClosestPlayer())
end
function Netherspite_Portal_PhaseB(Unit, event, miscunit, misc)
print "Netherspite Portal PhaseB"
Unit:SendAreaTriggerMessage("PORTAL PHASE")
Unit:FullCastSpell(30400)
Unit:FullCastSpell(30401)
Unit:FullCastSpell(30402)
end
function Netherspite_Enrage(Unit, event, miscunit, misc)
print "Netherspite Enrage"
Unit:FullCastSpell(35595)
Unit:SendChatMessage(11, 0, "You will all die...")
end
function Netherspite(unit, event, miscunit, misc)
print "Netherspite"
unit:RegisterEvent("Netherspite_Portal_PhaseA",1000,1)
unit:RegisterEvent("Netherspite_Nether_Burn",10000,0)
unit:RegisterEvent("Netherspite_Vode_Zone",20000,0)
unit:RegisterEvent("Netherspite_Banish_Phase",30000,0)
unit:RegisterEvent("Netherspite_Portal_PhaseB",60000,0)
unit:RegisterEvent("Netherspite_Enrage",540000,0)
end
RegisterUnitEvent(15689,1,"Netherspite") | agpl-3.0 |
douwekiela/nn | CosineDistance.lua | 26 | 2154 | local CosineDistance, parent = torch.class('nn.CosineDistance', 'nn.Module')
function CosineDistance:__init()
parent.__init(self)
self.gradInput = {torch.Tensor(), torch.Tensor()}
end
function CosineDistance:updateOutput(input)
local input1, input2 = input[1], input[2]
if input1:dim() == 1 then
input1 = input1:view(1,-1)
input2 = input2:view(1,-1)
end
if not self.buffer then
self.buffer = input1.new()
self.w1 = input1.new()
self.w22 = input1.new()
self.w = input1.new()
self.w32 = input1.new()
self.ones = input1.new()
end
self.buffer:cmul(input1,input2)
self.w1:sum(self.buffer,2)
local epsilon = 1e-12
self.buffer:cmul(input1,input1)
self.w22:sum(self.buffer,2):add(epsilon)
self.ones:resizeAs(self.w22):fill(1)
self.w22:cdiv(self.ones, self.w22)
self.w:resizeAs(self.w22):copy(self.w22)
self.buffer:cmul(input2,input2)
self.w32:sum(self.buffer,2):add(epsilon)
self.w32:cdiv(self.ones, self.w32)
self.w:cmul(self.w32)
self.w:sqrt()
self.output:cmul(self.w1,self.w)
self.output = self.output:select(2,1)
return self.output
end
function CosineDistance:updateGradInput(input, gradOutput)
local v1 = input[1]
local v2 = input[2]
local not_batch = false
if v1:dim() == 1 then
v1 = v1:view(1,-1)
v2 = v2:view(1,-1)
not_batch = true
end
local gw1 = self.gradInput[1]
local gw2 = self.gradInput[2]
gw1:resizeAs(v1):copy(v2)
gw2:resizeAs(v1):copy(v1)
self.w = self.w:expandAs(v1)
self.buffer:cmul(self.w1,self.w22)
self.buffer = self.buffer:expandAs(v1)
gw1:addcmul(-1,self.buffer,v1)
gw1:cmul(self.w)
self.buffer:cmul(self.w1,self.w32)
self.buffer = self.buffer:expandAs(v1)
gw2:addcmul(-1,self.buffer,v2)
gw2:cmul(self.w)
local go = gradOutput:view(-1,1):expandAs(v1)
gw1:cmul(go)
gw2:cmul(go)
if not_batch then
self.gradInput[1] = gw1:select(1,1)
self.gradInput[2] = gw2:select(1,1)
end
-- fix for torch bug
-- https://github.com/torch/torch7/issues/289
self.buffer:resize()
return self.gradInput
end
| bsd-3-clause |
tinybearc/sdkbox-facebook-sample | lua/src/cocos/extension/DeprecatedExtensionFunc.lua | 61 | 1351 | if nil == cc.Control then
return
end
--tip
local function deprecatedTip(old_name,new_name)
print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********")
end
--functions of CCControl will be deprecated end
local CCControlDeprecated = { }
function CCControlDeprecated.addHandleOfControlEvent(self,func,controlEvent)
deprecatedTip("addHandleOfControlEvent","registerControlEventHandler")
print("come in addHandleOfControlEvent")
self:registerControlEventHandler(func,controlEvent)
end
CCControl.addHandleOfControlEvent = CCControlDeprecated.addHandleOfControlEvent
--functions of CCControl will be deprecated end
--Enums of CCTableView will be deprecated begin
CCTableView.kTableViewScroll = cc.SCROLLVIEW_SCRIPT_SCROLL
CCTableView.kTableViewZoom = cc.SCROLLVIEW_SCRIPT_ZOOM
CCTableView.kTableCellTouched = cc.TABLECELL_TOUCHED
CCTableView.kTableCellSizeForIndex = cc.TABLECELL_SIZE_FOR_INDEX
CCTableView.kTableCellSizeAtIndex = cc.TABLECELL_SIZE_AT_INDEX
CCTableView.kNumberOfCellsInTableView = cc.NUMBER_OF_CELLS_IN_TABLEVIEW
--Enums of CCTableView will be deprecated end
--Enums of CCScrollView will be deprecated begin
CCScrollView.kScrollViewScroll = cc.SCROLLVIEW_SCRIPT_SCROLL
CCScrollView.kScrollViewZoom = cc.SCROLLVIEW_SCRIPT_ZOOM
--Enums of CCScrollView will be deprecated end
| mit |
testprmagma/amirpga-test | plugins/inpm.lua | 243 | 3007 | do
local function pairsByKeys (t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
end
end
return iter
end
local function chat_list(msg)
local data = load_data(_config.moderation.data)
local groups = 'groups'
if not data[tostring(groups)] then
return 'No groups at the moment'
end
local message = 'List of Groups:\n*Use /join (ID) to join*\n\n '
for k,v in pairs(data[tostring(groups)]) do
local settings = data[tostring(v)]['settings']
for m,n in pairsByKeys(settings) do
if m == 'set_name' then
name = n
end
end
message = message .. '👥 '.. name .. ' (ID: ' .. v .. ')\n\n '
end
local file = io.open("./groups/lists/listed_groups.txt", "w")
file:write(message)
file:flush()
file:close()
return message
end
local function run(msg, matches)
if msg.to.type ~= 'chat' or is_sudo(msg) or is_admin(msg) and is_realm(msg) then
local data = load_data(_config.moderation.data)
if matches[1] == 'join' and data[tostring(matches[2])] then
if is_banned(msg.from.id, matches[2]) then
return 'You are banned.'
end
if is_gbanned(msg.from.id) then
return 'You are globally banned.'
end
if data[tostring(matches[2])]['settings']['lock_member'] == 'yes' and not is_owner2(msg.from.id, matches[2]) then
return 'Group is private.'
end
local chat_id = "chat#id"..matches[2]
local user_id = "user#id"..msg.from.id
chat_add_user(chat_id, user_id, ok_cb, false)
local group_name = data[tostring(matches[2])]['settings']['set_name']
return "Added you to chat:\n\n👥"..group_name.." (ID:"..matches[2]..")"
elseif matches[1] == 'join' and not data[tostring(matches[2])] then
return "Chat not found."
end
if matches[1] == 'chats'then
if is_admin(msg) and msg.to.type == 'chat' then
return chat_list(msg)
elseif msg.to.type ~= 'chat' then
return chat_list(msg)
end
end
if matches[1] == 'chatlist'then
if is_admin(msg) and msg.to.type == 'chat' then
send_document("chat#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false)
elseif msg.to.type ~= 'chat' then
send_document("user#id"..msg.from.id, "./groups/lists/listed_groups.txt", ok_cb, false)
end
end
end
end
return {
patterns = {
"^[/!](chats)$",
"^[/!](chatlist)$",
"^[/!](join) (.*)$",
"^[/!](kickme) (.*)$",
"^!!tgservice (chat_add_user)$"
},
run = run,
}
end
| gpl-2.0 |
starius/lua-npge | spec/mosses_id65_len50_frame200_3.lua | 2 | 254644 | -- This file covers all sequences;
local not_sandbox = _G and not _G.setDescriptions if not_sandbox then local ShortForm = require 'npge.io.ShortForm' ShortForm.initRawLoading() end;
setDescriptions {["ANOAT&mit1&c"] = "ac=NC_021931.1 Anomodon attenuatus mitochondrion, complete genome",["ANORU&mit1&c"] = "ac=NC_016121.1 Anomodon rugelii mitochondrion, complete genome",["ATRAN&mit1&c"] = "ac=KC784956.1 Atrichum angustatum mitochondrion, complete genome.",};
setLengths {["ANOAT&mit1&c"] = 104252,["ANORU&mit1&c"] = 104239,["ATRAN&mit1&c"] = 115146,};
(function()addBlock{name="r15x51",consensus="GTTGGTGAGCCGTGTGATGGGTAACTATCTCGCACGGTTCGGAGAGCACTT",mutations={["ANOAT&mit1&c_29346_29296_-1"]={A={3,13,21,29},T={32},G={22}},["ANOAT&mit1&c_44045_44095_1"]={A={18},T={30},G={42}},["ANOAT&mit1&c_70096_70146_1"]={A={18},T={30}},["ANOAT&mit1&c_80325_80375_1"]={A={5}},["ANOAT&mit1&c_89926_89976_1"]={A={3,5,31},G={22,42},C={25}},["ANORU&mit1&c_29421_29371_-1"]={A={3,13,21,29},T={32},G={22}},["ANORU&mit1&c_44105_44155_1"]={A={18},T={30},G={42}},["ANORU&mit1&c_70174_70224_1"]={A={18},T={30}},["ANORU&mit1&c_80404_80454_1"]={A={5}},["ANORU&mit1&c_90006_90056_1"]={A={3,5,31},G={22,42},C={25}},["ATRAN&mit1&c_32062_32012_-1"]={A={3,13,21},T={32}},["ATRAN&mit1&c_49594_49644_1"]={G={42},C={25}},["ATRAN&mit1&c_77192_77242_1"]={A={18},T={3}},["ATRAN&mit1&c_88376_88426_1"]={G={22},C={25}},["ATRAN&mit1&c_99706_99756_1"]={A={5,31,41},G={22},C={25}},}}end)();
(function()addBlock{name="r9x78",consensus="TAGGAGCATTCGGTGGAACCGGTGAACCATACATTTTTCTAGATAGAGATGCGAATGGGACAGAGGGCTCGTAGTACC",mutations={["ANOAT&mit1&c_43728_43802_1"]={A={41},T={6},['-']={2,53,54}},["ANOAT&mit1&c_78918_78993_1"]={C={2},['-']={53,54}},["ANOAT&mit1&c_89506_89581_1"]={A={45},['-']={53,54}},["ANORU&mit1&c_43788_43862_1"]={A={41},T={6},['-']={2,53,54}},["ANORU&mit1&c_78997_79072_1"]={A={14},C={2},['-']={53,54}},["ANORU&mit1&c_89586_89661_1"]={A={45},['-']={53,54}},["ATRAN&mit1&c_49256_49330_1"]={A={38,41,45},T={6,51},C={29},['-']={2,53,54}},["ATRAN&mit1&c_86692_86765_1"]={A={34},T={14,30,38,48,69},G={32,33,36,59},C={2,35,50,68},['-']={44,45,46,47}},["ATRAN&mit1&c_99231_99306_1"]={A={15,38},T={51},C={29},['-']={53,54}},}}end)();
(function()addBlock{name="r9x51",consensus="TGAGAAGAGCCGTATGAGGCCGTAGGCTCACGTACGGTTCGGAAGCCAAGC",mutations={["ANOAT&mit1&c_19601_19651_1"]={},["ANOAT&mit1&c_48790_48840_1"]={A={1,22},T={39,40},G={5,20},C={25}},["ANOAT&mit1&c_101480_101530_1"]={G={47}},["ANORU&mit1&c_19713_19763_1"]={},["ANORU&mit1&c_48868_48918_1"]={A={1,22},T={39,40},G={5,20},C={25}},["ANORU&mit1&c_101560_101610_1"]={G={47}},["ATRAN&mit1&c_21742_21792_1"]={},["ATRAN&mit1&c_54401_54451_1"]={A={3,22},T={39,40},G={5,20},C={25}},["ATRAN&mit1&c_111452_111502_1"]={G={47}},}}end)();
(function()addBlock{name="m9x34",consensus="TGCCTACTCGAAAGAGAGTCTGTGAAGGGAAAGT",mutations={["ANOAT&mit1&c_43803_43809_1"]="TGCCTAC---------------------------",["ANOAT&mit1&c_78994_78998_1"]="TGTT-----------------------------T",["ANOAT&mit1&c_89582_89586_1"]="TGCCC-----------------------------",["ANORU&mit1&c_43863_43869_1"]="TGCCTAC---------------------------",["ANORU&mit1&c_79073_79077_1"]="TGTT-----------------------------T",["ANORU&mit1&c_89662_89666_1"]="TGCCC-----------------------------",["ATRAN&mit1&c_49331_49348_1"]="CGCCTACTCGAAAGGGCG----------------",["ATRAN&mit1&c_86766_86799_1"]={C={13,17}},["ATRAN&mit1&c_99307_99310_1"]="TGCC------------------------------",}}end)();
(function()addBlock{name="r6x198",consensus="ATGATGTGCGGAGCTTAGCATCTGATATTCGTTGGGCTAAGCGCCGCCTCTGCAGGAGCCAGTGTCCTTTTCGGGGCCTTGTGCAGTAAACCTCTTCCGAGCGATCTGAAGACCAGTAGGCCTCGCGAAGCTTTCGGAGAAGGGTAGTCTTGTGTGTAAGCATAGCAATTAAGTGCGAACCCATCGGATGACCTATTT",mutations={["ANOAT&mit1&c_50546_50722_1"]={A={74,135},T={3,97,101,121,166,167,170},G={15,32,37,171,182,195},C={31,34},['-']={55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,93,122,174}},["ANOAT&mit1&c_73265_73457_1"]={A={164,172},T={8,16,47},G={4,38,169},C={24,25,39,147,157,162,168,173,188},['-']={41,44,45,92,120}},["ANORU&mit1&c_50624_50800_1"]={A={74,135},T={3,97,101,121,166,167,170},G={15,32,37,171,182,195},C={31,34},['-']={55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,93,122,174}},["ANORU&mit1&c_73343_73535_1"]={A={164,172},T={8,16,47},G={4,38,169},C={24,25,39,147,157,162,168,173,188},['-']={41,44,45,92,120}},["ATRAN&mit1&c_55929_56106_1"]={A={80},T={3,111,112,113,119,166,167,170,174},G={15,32,37,97,99,101,171,182},C={31,34,92,100,122},['-']={57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,107,175}},["ATRAN&mit1&c_80428_80621_1"]={A={71,72},T={16,83,90,113,120},G={4,38,99,150,169},C={25,39,68,70,122,147,173,188,196},['-']={41,44,45,92}},}}end)();
(function()addBlock{name="r6x109",consensus="GTGCGAACAACCCTCCGGAGGAAACTGTAATGAACATGAAAAAGTGGTACACTAAACTAAACGACGAGCAAACAGCCAAACGTGAAAACTAGGGATCACCCAAATGGAC",mutations={["ANOAT&mit1&c_52752_52859_1"]={A={65},T={21,53,98},G={6,32,52,54,73},C={19,82,84},['-']={36}},["ANOAT&mit1&c_101839_101946_1"]={A={31,105},G={18,28,30,33,71,87,89},C={27,43,44,46,55,62,74,101},['-']={48}},["ANORU&mit1&c_52830_52937_1"]={A={65},T={21,53,98},G={6,32,52,54,73},C={19,82,84},['-']={36}},["ANORU&mit1&c_101919_102026_1"]={A={31,105},G={18,28,30,33,71,87,89},C={27,43,44,46,55,62,74,101},['-']={48}},["ATRAN&mit1&c_58142_58249_1"]={T={19,21,53},G={6,38,41,52,73},C={82,84},['-']={36}},["ATRAN&mit1&c_111799_111906_1"]={A={43,51,81,92},G={18,30,33,42,87,89},C={27,44,46,55,62,74,101},['-']={48}},}}end)();
(function()addBlock{name="r6x96",consensus="AAAGCTGAAAAAGTTATCCATGGACGAGCCACATGCGAGGAAACTCGCACGTGTGGTTCTGACCGGGGGGAGAGAAAAAAAGCACCCTATCGGAAT",mutations={["ANOAT&mit1&c_53418_53508_1"]={T={93},G={37},C={3},['-']={18,70,74,75,80}},["ANOAT&mit1&c_102704_102795_1"]={A={38},T={12,15},G={16},['-']={70,74,75,80}},["ANORU&mit1&c_53496_53586_1"]={T={93},G={37},C={3},['-']={18,70,74,75,80}},["ANORU&mit1&c_102801_102892_1"]={A={38},T={12,15},G={16},['-']={70,74,75,80}},["ATRAN&mit1&c_58821_58907_1"]={A={36,82},T={45,71,84,93},G={1,9},C={3},['-']={18,70,73,74,75,76,77,78,80}},["ATRAN&mit1&c_112676_112771_1"]={A={12,13},T={15,45},G={11,16,37}},}}end)();
(function()addBlock{name="r6x80",consensus="ATACTCACTATCGGATTTGAACCGATAACCCATAGGAACAGATTTTAAGACTGTCGTGTTTACCATTTTCACCAAGTGAG",mutations={["ANOAT&mit1&c_41825_41904_1"]={G={6,46},C={17,53,76}},["ANOAT&mit1&c_41906_41985_1"]={T={49},G={2},C={15}},["ANORU&mit1&c_41885_41964_1"]={G={6,46},C={17,53,76}},["ANORU&mit1&c_41966_42045_1"]={T={49},G={2},C={15}},["ATRAN&mit1&c_47299_47378_1"]={G={6,46},C={17,76}},["ATRAN&mit1&c_47380_47459_1"]={T={49},G={2},C={15}},}}end)();
(function()addBlock{name="r6x68",consensus="AAGAGCGGCTATTGTCGAGATTCGTAAACCTATACTGTAAAGAAGCCACTTTCCTAACTCCACGGCAT",mutations={["ANOAT&mit1&c_59414_59479_1"]={G={55},C={9,13,33,39},['-']={44,46}},["ANOAT&mit1&c_102965_102899_-1"]={G={27,61},C={25,26,32,41,51},['-']={36}},["ANORU&mit1&c_59492_59557_1"]={G={55},C={9,13,33,39},['-']={44,46}},["ANORU&mit1&c_103062_102996_-1"]={G={27,61},C={25,26,32,41,51},['-']={36}},["ATRAN&mit1&c_64815_64880_1"]={A={6,16},T={22},C={9,12,33,37,39},['-']={44,46}},["ATRAN&mit1&c_112941_112875_-1"]={A={6},T={25,46},G={43,55,61},C={26,32,41,51},['-']={36}},}}end)();
(function()addBlock{name="r6x51",consensus="TTGAGATGTCGTTTAGTTTTTTGTCCCCATTACTTTGGGTAATCTGCTTCC",mutations={["ANOAT&mit1&c_27106_27156_1"]={C={17,48}},["ANOAT&mit1&c_29719_29769_1"]={G={28},C={18,20}},["ANORU&mit1&c_27181_27231_1"]={C={17,48}},["ANORU&mit1&c_29794_29844_1"]={G={28},C={18,20}},["ATRAN&mit1&c_29960_30010_1"]={A={32},C={17,21,48}},["ATRAN&mit1&c_32434_32484_1"]={A={2,29,30,32},T={31},G={28,33,34},C={18}},}}end)();
(function()addBlock{name="r6x50",consensus="CCCCCCCTAATAGAACCGTACGTGATAGTTTCCCATCATACGGCTCCTCT",mutations={["ANOAT&mit1&c_59021_59069_1"]={C={29},['-']={8}},["ANOAT&mit1&c_103598_103551_-1"]={G={30},['-']={8,10}},["ANORU&mit1&c_59099_59147_1"]={C={29},['-']={8}},["ANORU&mit1&c_103696_103648_-1"]={T={13},G={10,30},['-']={12}},["ATRAN&mit1&c_64362_64410_1"]={T={4},C={29},['-']={8}},["ATRAN&mit1&c_114314_114265_-1"]={G={8,30}},}}end)();
(function()addBlock{name="r6x50n1",consensus="GTATAAGCTTTGTTGCTCAAAAATATCAAGTACTGACCACACTGAGAGAC",mutations={["ANOAT&mit1&c_19115_19164_1"]={T={32},C={10,12,23,25,27}},["ANOAT&mit1&c_46477_46526_1"]={G={2,18,22,46},C={16,20}},["ANORU&mit1&c_19227_19276_1"]={T={32},C={10,12,23,25,27}},["ANORU&mit1&c_46554_46603_1"]={G={2,18,22,46},C={16,20}},["ATRAN&mit1&c_21253_21302_1"]={T={27},C={10,23,25}},["ATRAN&mit1&c_52072_52121_1"]={A={45},T={17},G={2,3,18,22,46},C={12,16,20}},}}end)();
(function()addBlock{name="m6x1",consensus="T",mutations={["ANOAT&mit1&c_41824_41824_1"]="A",["ANOAT&mit1&c_41905_41905_1"]={},["ANORU&mit1&c_41884_41884_1"]="A",["ANORU&mit1&c_41965_41965_1"]={},["ATRAN&mit1&c_47298_47298_1"]="G",["ATRAN&mit1&c_47379_47379_1"]={},}}end)();
(function()addBlock{name="r5x264",consensus="AGTGGGTACCTCGTAGCTTTTCCCCAGACCTATACGTGTACCGAATGCTCATACGGGAAAGTGCGCTCCTAGGTCTGGAACCAGGGAGGGTTGCTACGAGAAAAATCTTCTCGTCTCATCCAAGGGGTGCAGAACACACTTGCGCGAATTACAGATGACAGCTACAAGGGTGGCGGGGGAAGGAAACAGTACCCCATATCCAGGGATGAATGTAAACTCATTGAACAGCTATTGAGCTGACAAGGATAATCATTCTGGTTCTGG",mutations={["ANOAT&mit1&c_50742_51002_1"]="AGTGGGTACTTTGCAGGACTTCACTCTGCCTACTCGAATATTGTATAAACATGCAGGAAAGGGTGCTCCTAGGCAGGGAAGAATGGAGTTTTGCTACGAGAAAACGGTTTTCGTGAAGTCTAAGGGGTGCAGA-CACACTTGCGCGAATTACAGATGACGGCTACAAGGGTGGT-GGGGAAAAGAAAAGTACCCGACGCCTGGGGATGGACATAAATTTGTTAACTACCTATTGAGCTGACAAGGATAATCGTCCTGAT-CTTG",["ANOAT&mit1&c_73479_73726_1"]={A={84,85},G={95,122},C={15,103,112,139,217},['-']={130,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242}},["ANORU&mit1&c_50820_51080_1"]="AGTGGGTACTTTGCAGGACTTCACTCTGCCTACTCGAATATTGTATAAACATGCAGGAAAGGGTGCTCCTAGGCAGGGAAGAATGGAGTTTTGCTACGAGAAAACGGTTTTCGTGAAGTCTAAGGGGTGCAGA-CACACTTGCGCGAATTACAGATGACGGCTACAAGGGTGGT-GGGGAAAAGAAAAGTACCCGACGCCTGGGGATGGACATAAATTTGTTAACTACCTATTGAGCTGACAAGGATAATCGTCCTGAT-CTTG",["ANORU&mit1&c_73557_73804_1"]={A={84,85},G={95,122},C={15,103,112,139,217},['-']={130,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242}},["ATRAN&mit1&c_80642_80887_1"]={A={15,105},T={172},G={154,187},C={95},['-']={122,130,174,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242}},}}end)();
(function()addBlock{name="r5x66",consensus="AGATAGGGGTCAGCGCTCTATGTCTGCCCTCCGAACCATACATGACAATTTCTTGTCATACAGCTC",mutations={["ANOAT&mit1&c_7684_7745_1"]={['-']={13,14,15,22}},["ANOAT&mit1&c_65396_65331_-1"]={A={60},G={18,19,41,47},C={52,53}},["ANORU&mit1&c_7796_7857_1"]={['-']={13,14,15,22}},["ANORU&mit1&c_65474_65409_-1"]={A={60},G={18,19,41,47},C={52,53}},["ATRAN&mit1&c_8719_8780_1"]={T={51},C={49},['-']={13,14,15,22}},}}end)();
(function()addBlock{name="r5x65",consensus="TGGCCTTTGCTTCGAGAACCATGTGAACGAAGAAAGGAAGTGCTGCTGTGAAAGCGAAAGGAAAG",mutations={["ANOAT&mit1&c_78999_79062_1"]={A={1},G={51},['-']={48}},["ANOAT&mit1&c_89587_89650_1"]={A={24},G={56},['-']={48}},["ANORU&mit1&c_79078_79141_1"]={A={1},G={51},['-']={48}},["ANORU&mit1&c_89667_89730_1"]={A={24},G={56},['-']={48}},["ATRAN&mit1&c_99311_99374_1"]={A={55},G={16,32,37,61},C={2,7,11},['-']={51}},}}end)();
(function()addBlock{name="r5x59",consensus="GCGAGGAATGTAGTTCTGGCTTTTTACCAGGAAGAAAGCGAAAAAAAAAAGACTGTTTT",mutations={["ANOAT&mit1&c_59176_59125_-1"]={T={25,32,40},C={14,21,23},['-']={27,28,33,36,37,38,54}},["ANOAT&mit1&c_103234_103291_1"]={['-']={30}},["ANORU&mit1&c_59254_59203_-1"]={T={25,32,40},C={14,21,23},['-']={27,28,33,36,37,38,54}},["ANORU&mit1&c_103331_103388_1"]={['-']={30}},["ATRAN&mit1&c_113208_113263_1"]={A={33},T={48},['-']={50,51,54}},}}end)();
(function()addBlock{name="r5x58",consensus="GGAGCCGTATGACGCGAGAGTGTCACGTACGGTTCTTTGAGAAGGGTGTGGATATCTA",mutations={["ANOAT&mit1&c_51205_51262_1"]={G={51},C={54}},["ANOAT&mit1&c_74019_74076_1"]={A={50},T={25}},["ANORU&mit1&c_51283_51340_1"]={G={51},C={54}},["ANORU&mit1&c_74097_74154_1"]={A={50},T={25}},["ATRAN&mit1&c_81203_81260_1"]={A={46}},}}end)();
(function()addBlock{name="r5x50",consensus="AGCCTGTCGTGAAAGGGGATCACAGGGAATGAATAGCCAACCCATAGCCG",mutations={["ANOAT&mit1&c_78540_78589_1"]={},["ANOAT&mit1&c_89146_89191_1"]="AGCATGTCGTAAAAGGAGATAACTGGGAA----TAGCCAACCCTTGGCCG",["ANORU&mit1&c_78619_78668_1"]={},["ANORU&mit1&c_89226_89271_1"]="AGCATGTCGTAAAAGGAGATAACTGGGAA----TAGCCAACCCTTGGCCG",["ATRAN&mit1&c_86312_86357_1"]={G={47},['-']={29,30,31,32}},}}end)();
(function()addBlock{name="m5x29",consensus="AAGACTAGGGGGATTGGGGGGTACCTTGC",mutations={["ANOAT&mit1&c_50723_50741_1"]="---------GGGATTGGGGGGTACTTTG-",["ANOAT&mit1&c_73458_73478_1"]="AAGACTAGGGGGA--------TACCCGGC",["ANORU&mit1&c_50801_50819_1"]="---------GGGATTGGGGGGTACTTTG-",["ANORU&mit1&c_73536_73556_1"]="AAGACTAGGGGGA--------TACCCGGC",["ATRAN&mit1&c_80622_80641_1"]="AAGATTA--GGGA------GATATCTTA-",}}end)();
(function()addBlock{name="m5x1",consensus="G",mutations={["ANOAT&mit1&c_79063_79063_1"]="C",["ANOAT&mit1&c_89651_89651_1"]={},["ANORU&mit1&c_79142_79142_1"]="C",["ANORU&mit1&c_89731_89731_1"]={},["ATRAN&mit1&c_99375_99375_1"]="A",}}end)();
(function()addBlock{name="r4x159",consensus="GGGTGACAGATCCTTCCATAATGTACTCCTGAGAAATACACCGGGCAATTAATGTTAAGCATACGACGATGCCCTTTAGAGTGAAAGCCTTGGAGGAAAAGGAGGTAGGTGATAATGCGCTGTACTTTACAGACGCGGCTGCGCGCCGCGTCTGGAAAG",mutations={["ANOAT&mit1&c_52970_53126_1"]={G={77},C={90,128},['-']={26,139}},["ANORU&mit1&c_53048_53204_1"]={G={77},C={90,128},['-']={26,139}},["ANORU&mit1&c_102090_102243_1"]="GGGTGACAGAT-CAGCCAT-AGGTACTCCGGAG-GATACACTGGGCAAAGCAAGTCGTGCATGCGACAATGCCC-GTAACGTGAAAAATTTTGAGGAAAGGGCTGTAAATGGTAATGTGCTACCCTTTACAGACGCGGGCATGC-CCGCGTCTGTAAAG",["ATRAN&mit1&c_58361_58518_1"]={A={30,94,129,138},T={133,143},G={56,87,99,126,127},C={29,55,131},['-']={26}},}}end)();
(function()addBlock{name="r4x79",consensus="GAGCTTTATGACGGGAAACTGTCACGTAAGGTTCGGAGGGCGGGGACTAATCTCCGACCCCTACTTTTGATTATGGTAT",mutations={["ANOAT&mit1&c_72767_72843_1"]={['-']={46,47}},["ANORU&mit1&c_72845_72921_1"]={['-']={46,47}},["ATRAN&mit1&c_71533_71611_1"]={A={14,41,67,75},T={28,34,54,63},G={50,52},C={44,64,68,71}},["ATRAN&mit1&c_79930_80006_1"]={T={28},['-']={46,47}},}}end)();
(function()addBlock{name="r4x68",consensus="ATTGATAGTCAACGCGTGGCTACCTTTTGTCAAAAATTTACACAGAGCTTCTTAGCAACTCATTCAGT",mutations={["ANOAT&mit1&c_83869_83933_1"]={['-']={13,14,15}},["ANORU&mit1&c_83949_84013_1"]={['-']={13,14,15}},["ATRAN&mit1&c_92720_92784_1"]={A={3},C={5},['-']={13,14,15}},["ATRAN&mit1&c_93303_93368_1"]={A={9},T={47,55,60,64},G={65},C={5,29,48},['-']={20,21}},}}end)();
(function()addBlock{name="r4x57",consensus="TGCGCCCTCATAATCAATTTCATGAGGAATGCAATTACATAGTAATTGCTAGAGAAT",mutations={["ANOAT&mit1&c_12268_12324_1"]={},["ANORU&mit1&c_12380_12436_1"]={},["ATRAN&mit1&c_14262_14318_1"]={A={51},G={16,55},C={13,19}},["ATRAN&mit1&c_110236_110181_-1"]={A={30,39},T={5,20,38,40},G={16,55},C={12,19},['-']={6}},}}end)();
(function()addBlock{name="r4x52",consensus="GCCGCAGGGCGCAGCAAAACTATATATATATATAGAATATTTTTTTTTTCGT",mutations={["ANOAT&mit1&c_58056_58106_1"]={['-']={19}},["ANORU&mit1&c_58134_58184_1"]={['-']={19}},["ATRAN&mit1&c_63412_63461_1"]={A={20,50},T={34},['-']={19,39}},["ATRAN&mit1&c_109068_109115_1"]={A={4,6},T={1,14,18},['-']={36,37,38,39}},}}end)();
(function()addBlock{name="r4x52n1",consensus="ATATATATATATATATATATATATTTATTTTTTTAATCTAAGGTCTTGTAAT",mutations={["ANOAT&mit1&c_42466_42517_1"]={T={26,35,40},G={39},C={8,20,48}},["ANOAT&mit1&c_74598_74649_1"]={T={34},G={3},C={24,43}},["ANORU&mit1&c_42526_42577_1"]={T={26,35,40},G={39},C={8,20,48}},["ANORU&mit1&c_74676_74727_1"]={T={34},G={3},C={24,43}},}}end)();
(function()addBlock{name="m4x43",consensus="TCTAAAAGAAAAAAAATATATATTTAATGGCTCCAGCAAATCA",mutations={["ANOAT&mit1&c_83934_83935_1"]="TC-----------------------------------------",["ANORU&mit1&c_84014_84015_1"]="TC-----------------------------------------",["ATRAN&mit1&c_92785_92786_1"]="G-T----------------------------------------",["ATRAN&mit1&c_93369_93411_1"]={},}}end)();
(function()addBlock{name="s3x6986",consensus="GGGGCGAAATTCGGGCTGCTAAAAAAATATGCGTTGTGTCCTCTCACAGAGCCGTACATGATAGTTTTGTGTCATACGGCTTTTCGCTTGAAGCCACGAAAAAAAAAGTATAGATTTTTTTATGTGTTGATATCCTCCATTTTCTATCACCAGTCAGCCTATCTCGCCAAAAAAGAGTCCGATACCGTCGCCGCGTGAATATACACGCGGCTCTTAGCGAATGAGGCCCAAGGGGCTGCGAAGACTGTGGCCTTTCATTTTCTTTTTTTTGTACCGAAAATAGAAAAAATGGCTAAGTAACATAAAGGTAATGTATTGGATTGCAAATCCTAGAAAGATGGTTCAAATCCGTCCTTAGCCTACTTGACAATTCTACTGTTTCTCTACAAGTACTGCACTTTCTTATTTAAGGAAGATCAAACCCTTTGATCAACCTCTATACTTACCCGCCATCTGCAACACAGACAGTGCAGGCGACAACCAGCTAAGCGCCCGCTGCCAGAAAAAAGGTATATTTTTTTTTTGAATTTTGGCAAGGCCTTGTTTTAAACTTCGAGGTTGCTCTTCATCGAAGATAAGAAGCAAGAGAAGTGAAATATATATCTATATCTATTTTTTTGTGAAGCAGTCTCCGGAACGAAGCATGCTTTTGTCTAAAGCCACTGCAAGATCGATTTTCAGACCACTTTATTCTCTCAAGATCTGAACTCCTTAAAAATTCTTTAATAGAAAGCTTCACTCTATTGTGTTTAGAAGTGGATTTGAACCACTGACACAAGGATTTTCAGTCCTTTGCTCTAACCACCTGAGCTATCTAAACGGAAATAAAAAAAAGGAACTATGTACAATTCTAGTTTGTTGGTTATTCAAAAATTATTAAGTACAAATGCATATCTGGGCCATCGAATACCTACTTCCGATTTTCAAGGATATTTATACGGATTTAGAAATGAAATGGCTATTATTAATTTAGAAAAAACACTTATTTGTTTACGAAGGGCTTGTAATTTGATTGAATCTATTATTCGTGCAAAAGGCCATTTTTTATTAGTGAATACCGATCCAGAATATAATAAAATAGTTCGACAAATGGCAAAAAGAACCAATCAGAGCTATATCAATCATAAATGGATTGGAGGATTTTTGACCAATCGCAAACATATGAAAAATGTACAAAAACACTTTCAGAATTTTTCTGCGCATTCCAAATTTAAAGACGCCTCTATATCGTCGCCCTTCGATTTTTTTCCGCATTTCAGAAAGATGCAAAAATGTTTTGAAGGAATCATGACACACGATATTCCAGATTGTTTAGTAATAATAGAATGCAAATAAAAATTCTATGGCTATACTTGAAGCCAATCAATTACAAATACCTATCGTATCTTTGGTGGATTCTAATATTTCGAACAGATTACAAAAATTAATAACTTATCCCATTCCAGTAAATGATGATTCTATACAGTTTGTATATCTATTTTGTAATTTGATTACGAAAACAGTCATTCTTTCACAAAGTGCTTGGCCGCTCTCGCGAAAACCCTTAGATCGGGGCCGCAGGCCCTAGCATAAAAAAAAAATATATAGATTTTTTTTTCGGATTGAAAAATTGGGAAAAAGAACCTTGAAACTCTTTCTAAACCTTTTTTATCAACAGATTCTACTTAATTCATCTACACTAATAACGACTTTTTCTCTATTTATGTCATATATCGTAGTCACGCCCTTAATGATAGGTTTTTCTAAAGACTTCTTATGTCATTTTCATTTGGGTCTAATTTGGATTTGTTTATTGTTTTCTTTTCTTCCCGAACGTTTTCTCCAGAATGATTTTGAAGATGGTACACTCGAATTGTATTGTTCAAGCGGCTATTGTTTGCAAAAAATATTACTTTCTAAATTGGTAGGTCATTGGGTTCTTCAAATAAGTGGTATTTTTGGTACTTTTCCAGTGGTACAACTTCTATACCAATTTGATCAACTCAAAATGAATTGGTTCACCCTTATTATAGGAAGTCTGATATTTACTCTTATGTGTGGTATTCATTCTTGTTTGGCTCTCGGAATAATATCTCATAGTTGGAACAGTTTGCAAAATCTTACCACTTTACCCACTCTATTACCCTCAATTCTTTTCTGCGCCTCTACCGAAACAGAATGGTTTCATGTTCTTTTATTAATGGGGTATTTACTTTTGTTTTTATTTCTTTATCCTATTTTGGTTTCGATCACTTCACAAAAGTTGATAAGCCAATAGAATTGATTGCCTTTGCGTCAACTAAAAAAAAGGGTATACCAGTTTTTATTGGCTCACTCATCGTAAATATTGTGGAGCAAACAAAGAAAAGAATATATATATATTCTTTTCCTTCTGTATTTATTTCCTATACTAAACTCCTGTACACCGTTTCATTCTGGCAGAGGGAAAGAGAAAGCAGGGCATTTGGTGAAGTTTGAGTGAGAAAACTATTTCCAGGTGGCCCAGATGGGAATGATCCAGCTTAGCAGAGCACAAAGCTTCTTTTTTTCCGCATTATAGATGAGATGTCTTGGGAAGGCCTGTTAATAAAGCGCTTCGAAGCGCAGGGCTCAGCGAAGAAAATTTGTTTTCTTTTTTCCTTGCTGGGCTGGCTCTTCTTCGGCAGGTTTCCACGAAGCAAGGAGCGAATCAGGTGGGAAACAGAAAAAAAAATGCTGTCGAATTTTAATAATTAGCACGAAATGATCCATATTTTTTTTCTAGCTGGGCCATTGATGGACTATTATTTCATGATAAAACGTTAGAAAATCCCTATGTATTTCGAAATACTACGACCTTCTTTGATCATGTCATGCTCTTTTCGCTATGCACGAATTCTCATCGGATTTTGTTGGTTCCTAGCAGCAATGGCTATTTATTTAAGTATCTGGGTAGCACCATCCGATTTTCAACAAGGTGAAAATTATCGCATTATCTATGTGCATGTTCCAGCTGCTTGGATGAGTTTACTCATTTATATCGCAATGGCTATCAGTAGTGTGTTATTCTTATTAACAAAACATCCGCTTTTTCGGTTATTTTCCGAAAGCGGCGCCAAAATAGGTGCTTTGTTTACATTGTTTACCCTATTAACCGGGGGTTTTTGGGGTAAACCTATGTGGGGTACCTTTTGGGTGTGGGACGCTCGTCTAACCTCTGTATTAATCTTGTTCTTTATTTATTTAGGTGTACTGCGTTTTCAACAGTTTTCCGCGGACGTCGCTTCTATCTTTATCCGTATAGGGTCAATCAATATACCAATAATTAAATTTTCTGTAAACTGGTGGAATACATTGCATCAACCTTCCAGCATTAGCCAATTTGGTACTTCAATACATATTTCTATGCTCATTCCAATCCTGTTAATCCTTATTAGCTTCCTTTGTTTAAGTGGGATTTTTTTTATTTTGGAAACACGTCAAATTATTTTATCTTTTTCTAGTTTTTCCGTAGAGAGTCAAATAAATCCGCAAAACAACAATAGAAAACAGGTTTTTTTTTATACGAACAATGGATCAAGCAAAAGCACCTAAGGAAAGGTGGACTTTTATTATTGGGTTTAAGCAAGTTGTTTAAGGCTTTGGGAGAAGCAAAGCGACGCTCTGCGTTAAAAAACGCAAAAAAATCTATTTTTTTTGCCAATTATAAGCAAAATTTACTGAAATGTATAATGAATTGGGCCATTATTTTTTAGTACTGAGTATTTTTGTTGCATTAACTTACAACAAAAGACCTGCGGCTATTTCACTTTATTTTCTCTTCTTTACTATTTCTTTTTTCGGTATTTTGTTTTGCTATATTTCCTCTGATTTTTTCAATTACAATGTATTTACCAACTCAAATGCTAATGCGCCTTTATTTTATAAAATATCAGGAACATGGTCTAATCATGAGGGCAGTTTGTTATTATGGTGTTGGATCTTAAGTTTCTATGGATTTTTTTTGGGTCATCGGGTTCGACCTTGCAATGTTTCAAAACGAGGGCGCAGCAAAAATCTATTTTTTTTCCGCAGACCGCTCGTGGCTTTTCGCTCTGCTTCCTTCATGAAAAAAGAGAATAAACAATTCAGACATCATTTGTTGCAGAACCTGTTTGGCACCATAAATCATAAAAGCTCCCTCGAGAGCCAGTCCAAAGCGGCGCCCTCAGGTATCGTCCAAGAGCCCTCGGATAGAAGGTTAAAAGAGAGTACAAATGCAGAAGAAAATAAAAGGCCCATAAGGCTTAAAAAATGGAAAGAGTTTGAAAAAAAAAAAATCTAGATTTTTTTTTTTGCTTTACGCTTTATGTAACAATTTAGATTCTTTATTTTTGGCACAAAATGCAAATAATAAAGTTTCCTTTATTGATGAACGGCGAATTTATATGGGCATTGCTTTCTTCTTTTCGATTTTCTTATTAGCAAGTTCCAATCCTTTTGTTCGAATCTCATTTGTTTGTACCAAATCACTTGCAGAATTAAATCCTGTTTTACAAGATCCTATATTAGCTATACATCCTCCCTGCATTTATGCAGGATATGTCGCCAGTGCTATCGGTTTTTGCTTATGTCCAGCCAAAATAATGAATGGTATCTCTGCACTCTATTTGCCGATGCGAAGAGAAAGCAAGGCCAAAGATAATGAAATTTTTGATGCTTTCTTGATTGAAGCTCGCATAACAAATGAGCTGATTACTCAGGAGAATGCAAAGAAAATTCTAAAAAATCTATTTGAAAATACCTGTTCTCTTCATCCCAGTTTTGCTTTCATCTCGCTACGCAATAGAAGCCTACTCGGGCTTCGGCACTTGGTGTCGCCCTCTTCGCTCCGGTCGAAAGAGCGGCTGAATCTTACAGAGAGCCAGTGGACGAAGCGTGTTGTTCGTAAAGCGAATACTGCGTTTTTGTATTTCGGTTGGACCCGTAGCGCGAATAAAGTGGTCTCTGGCCCACAATACCATGGGTGGAAACAAATTCAAATTTGGATCTTGACATGCTGGTGTTTTTTGACTGTAGGCATATTGCTAGGAAGTTGGTGGGCTTATCATGAATTAGGGTGGGGGGGTTGGTGGTTTTGGGATCCTGTAGAAAATGCTTCTTTTATGCCTTGGCTATTAGCTACAGCTTGTATTCATTCAGTAATTTTCCCTAAATTGAATTATTGGACTTTGTTTCTCAATATGGTCACTTTTCTATGTCGTGTTTTAGGAACTTTTTTCGTACGTTCTGGATTGCTAACTTCCGTTCATAGTTTCGCCACAGATTCTACACGAGGAATCTTTTTATGGTTTTTTTTCCTCAACATTACTATCATATCTTTGATGTTTTTTTCTCAAATGAAGCGGCAATCAAGTACTAGGCTAGTTGGTGCATTATTTGATTTATCATTAAATCAAAGCCTGAGGGCCCCAAAACCCGTAAACCAGATCTTATGGTATTCGCGGCGAAGCACTCTATTCGTGCACTGGCGTCAATCTACTCGTTTATTAAAGCTGATGGGGGACGAAGAAGGCCATGACAAACTAATTGTATACAAAACAAGGAAGATACATAAAGAAAAAAAGCTACCCTTTTTCTCGGGCCAAAGAGAGAAAAAGCTAGCACCATTTCGAATCCACACGGCCCCTTGTGTGAAACCTTTGGCTTTTTTGTCATTTGTTATGCGAAGGCTCCGCGCCTTCCAGGAACTATGGCTACGGAGGTAGCGTACCGAAGGGGCGCAAAGCCTTCGCCAAAGGCCGAGGAAGATAAAATGAAGCCCAAAAATTAAAAAACGGCCCTCATAGCCAATGAATCATTTTTTTGTTTCCATTTTGAGTTTTTCTATCTCGTATTCTCTTTTTCTTTGAAGCAAAATCCTAAAAACAAATAGAGCAGATGGTCCAACTACAGAACTTTTTTTTTCTTCTTATGTTTCTAGTTTTGCTTTGTGGTACGGCAGCACCCATACTATTTCAATGGTCGGTAAGTAGAGATGTTCCCACAGGTGCTCCTTTTTCTCATGGTACTATAATACCTATTTTTACCTCTTTATTACTGCTTCTAGTTCATGTACATTCCAGGGGATTCATACGCTCTATGGAGAAAACAGAAAGGATAGTTTTGGTAAGAGCAAAACCCATTTTATTACTTAACATAATTGAAAAAAGCTCCCCAAAAACTAGAGCTAAAAATGCATTTTTTTTCTTTTTTCTCTTTCTTTTTAATTTCTCCTATTTTCAAATCTATGGGAGACTTGTCATATTCAGAATCTTTCTGTGGTGTGCTTTGTTTTTCATTATCTCGTACATTTTTTTTATCATTTAAATATAGGCGCGATACGTGGGCAAACGAGGAGCGTGGGCTTGGAATGGAAGAAAAAGGAAAACCGCGTAGGCGGGCACAGAGAAGAAAGCGCCAAGCGCTTTGTTGGCCTAGCGGAAGAAAGAAACAAAGAAATAAAAAGAAAGAAAATTTTTCCTTTTTATTTCTTTCAAATAAATCAAAAATATTTTTGATTTATTTGCTGCAATTTTCAAAAACCTTCGGCTTCAACGAAAAAGCCAAAATTTTGGCTTTTTATTCTCTGCTTGCTTCTTTCGCAAGCTTATTCTTCTCGTCCTTGAAAATAATAAAGCGCTGGGCGCTTTCTTGGAAGAAAGCGCCCAGCGCTTTGATTGGAATAGATTTTTTATTGTTCGCGCCTCACCAAAAAGACTGATGGATGTTGGTCATGACTTTCGAAAAGTTCCCATGACCATGAAAATTTCACATGGAGGAGTTTGCATCTTTATTATGGGTGTTATTCTGTCGTGCGACCCGGCAGCTTATGCGCGACCATCATCGTGTTTAAGCTCACGCCATATGGGCGTGAACTCTGGTTGAATTCGGGTTCTAAATCCCGCCGCTGAGATGCTCAGTCGACTCTTGAACCTTGATAGGAAGACGGCTTCTTCCCAAATTAGTGCAAAAGGTTCAGGGACTTAGGATGAACTTAATGTGAATGG",mutations={["ANOAT&mit1&c_12325_19114_1"]={A={4834},['-']={21,22,23,24,25,26,27,28,30,125,126,166,260,367,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,1325,1569,1604,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2297,2298,2299,2300,2301,2302,2303,2304,2305,2306,2342,2421,2422,2423,2424,2440,2608,2609,2610,2611,2612,2613,2614,2615,2670,2671,2672,2673,2674,2675,2676,2691,2692,4261,4634,4635,4636,4637,4638,4639,4640,4641,4642,4663,4664,4665,4666,4667,4668,4669,4670,4671,5566,5567,5568,5621,5622,5623,5624,5625,5626,5627,5628,5629,5712,5713,5748,5749,5750,5751,5752,5753,5760,5761,5762,5763,5764,5765,5768,5769,5770,5771,5772,5773,5781,5782,5783,5784,6213,6578,6593,6610,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6821}},["ANORU&mit1&c_12437_19226_1"]={C={6037},['-']={21,22,23,24,25,26,27,28,30,125,126,166,260,367,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,1325,1569,1604,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2297,2298,2299,2300,2301,2302,2303,2304,2305,2306,2342,2421,2422,2423,2424,2440,2608,2609,2610,2611,2612,2613,2614,2615,2670,2671,2672,2673,2674,2675,2676,2691,2692,4261,4634,4635,4636,4637,4638,4639,4640,4641,4642,4663,4664,4665,4666,4667,4668,4669,4670,4671,5566,5567,5568,5621,5622,5623,5624,5625,5626,5627,5628,5629,5712,5713,5748,5749,5750,5751,5752,5753,5760,5761,5762,5763,5764,5765,5768,5769,5770,5771,5772,5773,5781,5782,5783,5784,6213,6578,6593,6610,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6821}},["ATRAN&mit1&c_14319_21252_1"]={A={1,50,59,70,89,123,134,137,194,216,231,246,275,372,400,407,411,417,421,426,472,475,529,530,570,575,592,596,603,609,633,645,664,720,820,821,860,861,998,1052,1059,1080,1083,1084,1099,1250,1407,1464,1503,1546,1551,1599,1603,1611,1612,1641,1719,1770,2131,2140,2184,2226,2244,2416,2435,2443,2459,2520,2543,2548,2551,2561,2577,2653,2660,2733,2818,2851,2880,3005,3052,3063,3116,3188,3326,3471,3475,3524,3531,3538,3561,3601,3603,3615,3645,3696,4015,4038,4039,4074,4141,4149,4158,4188,4189,4193,4204,4219,4287,4348,4399,4612,4617,4631,4643,4685,4711,4718,4727,4795,4856,4891,4923,4942,4976,5008,5146,5201,5302,5343,5401,5414,5471,5494,5545,5588,5604,5668,5737,5742,5754,5774,5775,5778,5787,5790,5791,5808,5809,5840,5845,5846,5916,5998,6185,6192,6198,6321,6331,6333,6340,6346,6352,6361,6374,6416,6419,6422,6434,6458,6608,6709,6845,6890,6957},T={84,86,94,112,121,143,154,158,164,178,212,228,274,282,365,381,386,401,408,410,415,445,491,493,539,550,563,566,587,629,653,727,728,1018,1139,1238,1256,1359,1410,1542,1568,1586,1660,1670,1676,1683,1702,1809,1821,1939,2061,2126,2147,2229,2234,2318,2392,2397,2405,2418,2473,2478,2507,2529,2546,2559,2636,2649,2665,2739,2753,2759,2768,2789,2801,2822,2825,2830,2834,2843,2861,2876,2877,2906,2921,2954,2969,2990,3062,3071,3161,3168,3191,3230,3239,3248,3254,3255,3265,3269,3377,3399,3467,3487,3502,3523,3527,3560,3602,3672,3775,3780,3798,3822,3834,3948,3967,3970,4003,4008,4026,4052,4116,4126,4137,4140,4151,4157,4166,4171,4176,4206,4272,4302,4323,4402,4447,4522,4543,4555,4574,4575,4596,4773,4797,4819,4821,4826,4829,4874,4912,4920,4921,4927,4996,5001,5017,5056,5062,5176,5185,5192,5198,5242,5254,5257,5296,5299,5301,5331,5409,5475,5478,5538,5542,5555,5575,5590,5602,5603,5612,5652,5696,5704,5705,5739,5785,5795,5827,5843,5904,5962,5979,6036,6058,6109,6152,6154,6194,6212,6224,6245,6255,6275,6281,6283,6323,6362,6397,6398,6469,6685,6737,6767,6811,6817,6826},G={7,19,31,57,74,145,155,220,229,279,383,391,413,438,460,466,482,496,548,572,579,583,697,706,716,719,826,1049,1094,1154,1267,1446,1545,1549,1563,1644,1666,1755,1881,1933,2020,2168,2325,2334,2410,2426,2442,2444,2462,2483,2485,2491,2495,2511,2518,2554,2565,2658,2666,2680,2681,2701,2885,3266,3491,3493,3536,3562,3584,3585,3593,3611,3629,3735,3760,4082,4091,4127,4144,4175,4201,4203,4210,4212,4220,4237,4240,4250,4251,4309,4338,4349,4360,4621,4648,4686,4698,4786,4792,4814,4855,4862,4925,4952,5053,5111,5116,5237,5310,5389,5396,5489,5502,5522,5537,5548,5559,5561,5584,5585,5686,5721,5726,5732,5733,5794,5844,5848,5864,5918,5922,6039,6044,6084,6115,6327,6335,6359,6360,6363,6367,6399,6423,6424,6427,6431,6439,6446,6453,6587,6606,6803,6843,6947},C={38,69,87,88,144,163,218,267,268,271,281,376,382,398,409,528,546,628,630,654,674,675,693,876,1043,1193,1225,1247,1665,1737,1763,1779,1780,1786,1800,1938,1974,1982,2088,2130,2199,2208,2219,2270,2327,2374,2379,2415,2434,2445,2454,2489,2525,2534,2560,2602,2619,2632,2635,2646,2697,2709,2737,2746,2758,2823,2840,2846,2972,3014,3059,3208,3218,3227,3243,3257,3332,3367,3391,3401,3402,3405,3410,3452,3542,3589,3590,3620,3622,3678,3726,3786,3806,3816,3828,3833,3909,3963,3974,3981,3988,3990,4053,4060,4174,4316,4332,4457,4558,4566,4588,4602,4654,4672,4684,4696,4720,4739,4750,4812,4832,4852,4865,4867,4902,4907,4924,4934,4935,5006,5167,5173,5253,5300,5317,5325,5356,5382,5388,5392,5403,5466,5470,5524,5539,5550,5648,5658,5805,5834,5912,5919,5927,5954,6083,6123,6130,6131,6201,6203,6226,6291,6293,6294,6303,6344,6407,6471,6529,6570,6601,6834,6942},['-']={103,104,105,106,201,202,203,204,263,264,265,266,427,598,599,600,601,602,620,621,827,835,1322,2349,2350,2480,2528,2537,2538,2539,2540,2541,2580,2581,2582,2583,2584,2585,2586,3566,3567,3568,4265,5650,5823,6208,6355,6356,6357,6574,6596,6973}},}}end)();
(function()addBlock{name="s3x4555",consensus="AATCAAATGCAAGGGTCGAAGACCTTGATAGGGGCACCGGTTTGTATAATAACTGCTATATACTAGGAATATGCAAGTCCCAATTGCTTCCAGAATGATCTTTTCTTTGGAGGGCCACTGTAGGCTGCGGCGGGCGTTCGCCTCCCCGCTTCTTGGGTATGAAGCGCCTCATACCTTGTTGAAATCGGAAGCGTTCTGAGCGAAGTTGTTTATTTCTCTCCCTCATTCATCTTTCTGCCGATGACGTTTACTATTTTGCCGTCAAGGGCCGGCGTACTTCGCCCCGGGATGAACTTAAAACATTTGTATGCCAACTCGGTCAGGTCTCCTTGAAATAGAAATCTGCAAGGGTTGAGGTTAACGTTGTTAAGGTTGCCTTTGTCGTTGTTAAGAATGGAATGCAGTTCTTTCGCTATCAGGTTAGTCATCCGCCTGACTAGTGAAGTCCTCACACGCCTGTGCGCCTGGCCCGCGTAGCAAGGGTATAGCAAAAAGATTTTTCCAAACCTCATTTGTCGAGGGCCTCCTCAGCAAAGTGAAGTGGTGGGTCACCTGCTGTCCCGTGCTTGACAGAAATGGCGTCATCCGGTTAGGTGTTGGGATTGGGAACCTTAAGTCCTTCATAGCGGGCGAGGCTTACTTGAGCCTCTGAATTGCTTGCACCCTACTGCTATTTGGCCACGTACGAGATTTTCGAGAGAGTTGACGCGTTGACCCGGTAGGGGGTCCACCGGGTTCGCCTCCCGTTAGTGCAAATCACCTCGTTGTTTTTGGTTCCCTCCGTTGCCTTTTTAGGGTACCACCTTTCGGAAGCCCCCGAAGGAGGGGTTTTTTCACCCTACTCATCTTTGCTTCTGGGGTCTCCCCTACACGTCAACTGGAGAGAGAATACGTCCGTCTGTCGCCATCCTTTCTCGGGGTTATGGTGAAGTAAACGTCATCCATTCCGATTAGCACGTCGCACCCCCCTACAGTAAACAAAAAGATAGATCCTACAGCAAATAACATGGGTGTTTTGTATTGTATTGAACCTCCCCACATGGTAGCAATCCAACTAAAAATTTTTATTCCAGTAGGCACGGCAATGATCATGGTAGCCGCAGTGAAGTAAGCACGTGTATCAACATCTAAGCCTACGGTAAACATGTGGTGCGCCCACACAATAAATCCAAGAACTCCAATACTGATCAAGGCATAAACCATGCCTAGATAACCAAATACGGGTTTTCTTGAAAAGGTAGAAACGATATGACTAATGATACCGAATCCTGGCAAGATTAGAATATAGACCTCAGGATCGGGATAGATTTTGCCGTTCCCAGCAAAGCCCCCCACAGAACCCAGCGAGCTCCTCTCAAAGCACTGGGCTCTTCGCGGAATATGCCCATAACCCATGTAGTCCATCCTCAAGCATGTTCTGTAACAAGACACCACGAGTGCACAAGGGATTTGTGCAACAAATTACCATCACCAGGCACTTCCGAGTTCTTATAAAAAGGCCGCAGGTCATGAATCTCTAAATTAGAGCTAGTCAAATAACCTAAGCCTTGATTGCATACGGGACATATACCTTTTTGGCGGATGAATAGCCTGCTAAATTCGTTACCTTTCCCGTCAACCACCAAAATTTCCCGATAGCTTTGAATCCGAAGATTCCATTCATCAAAGGGGGTTGAATCTATGAAAGGATTACCTAGATCACGAGATGCTCGAAACATATGAGCAGGAACTTCTTTTACCATAGACGCAAGGAGTGTTATCCATATCACGTCAGCACAATGGCGTTTGGCATCTACACTGGGCTCGGTCCAAGTAGCATGGAAATCCCAAAGTCTGCCACGGGGAGAGGGCACCCCCTGGTAGAATCGGGAAACCAGTCTGGGTCGAGGAGTTTTAGAGAATTTACGATGTAAATATCGCCAGCTTCTATGCCAGATCCAGTGATCCAGCAGACTGAAGGTATGAGAGAAAGTTGCCAATTCCAAAGTAGTTGCCCCAACCATGAAGAATTGGGTTTACCAATTTGATCATCTGGTAAGGAGAGAAATCTATATTTTCAGAAAAGACATTTTTTATTTTCCATTTCAGCGACATTATTCTATTGGGATTAGGATACACGTAGAGGCCCCCACGAGTGAAATTCTTCCCCACCTTCCATGAGGAAGTGATTTGGCTATAAGAGCGAGCCCTATCGATATTATGGAATATGAAGCCGATAAAATGAAGTCTCTCTCCGATCTTCCACGGGAATATGCGGGTTTTTTCTGACGACAATTGAAGGCCACGTTCCGCCAGGAAACTTTTTGCTTTTTCAAAAAGTCGTTCCACTAATGTCTCATCATTGGTAATAATGACAAAGTCATCAGCATACCTGATAAGGCGGACTGATTCTGTTTTTCGGGTCTGGTTAAAGAGATAACTATGGCCTTTTCTTTGCATCCATTCTGTCCTTTTGACAGGATCGGCCATAGTAGTCCGGTGTCCGCCGGTTATTCCCTTTTCTAGCCCATCCAGGGCAAAGTTCGCGATTAAAGGACTTATGACACCGCGGAACCCCATTGCAGAGACTTCAAGTTCCCCTTGATATTCAATTGGACTCTTAAGCCATTCCTCGAGTACAATTTCTGTACTACTAGGCATGGGAAAATTCTCTAAGGTCCATCGGTGAAATATTCGGCCGAGGAAGCCTTTTATATCAGCATCAATTACCCATTTGGAAACAAAATTTTTACTATTTTGTTCCATTCTCTTGTCGTTCACTTTGCGTACTCTTTGCCTTTTCGTGTCTAGTATGTAAGCAATTTCACCTACCGCCATGTGTGCACATTTTCCCCTCCGAGATCCGAAGCTATATCTGTCAGCAAAGGGTTCTGTTACAGGTTCAATAGCTAGTTTGAACAAGTGCTGGACGGTCCTGTCAAATATTGTGGGTATTCTTAGCAGCCTTTCACCATTTTTTGGTTCGAAAATGGAAACATGGCGAACGGGTGAGCTCTTGTAGTTCTTTAGATTAATCCGAAAGATACGACGAACTAGACCGATTCGGGAAGAAGCTTCTAGTATTTTACCATCGACTCCCGGAGTTCGACTTCCGGAAGTATAATAGAAATTATCTACGGCAATTATTCGAGAGGTTAATTGAGTACAGATTTCAAGCATGCAGTCTTTCAAAAATGGGTTTCTGAGTCCCAGGGAAGCTGCTAAAAGAGAGAGGATCCTTTGTTGGTTCTTTACTAATTTATGAATAGCCGTAAATTTCTTTCCCAACATGGGCCACCGACCCTCGTTCATGATGACCGCGGCTTTCCTGGCGATAATCCGTGATTTTTTTCGGGTCTCCTTCCATTCAGCGAAGAGACTGTCTGGAGATCCTGAGCCATTAGAGAAGCCACGTCTCTCTTTCCACGTCAAACGTTTCAGCATTACCCACATGTTATTGTGTATAGCCTTACGTCTCATCTCACCCTGTGATAGCATCATTGACTTGGATATATCAACAATGTCCAGTTGAATGGAAATGCCAATTTCGGCTCTTGAAAAAGGTTCCACCACAGGGGCAACGCTACCAATAGAATATCTGTCTTTTCGAAAGATGTTGGGTCTCGAGTGGTCCGCCCGGGCAAGGGCCGAAGGCTTCTTGCACGCAACGTGTGGAATCTTACCCTCGAAAGAAAGGAGGGCACACTCCAACCCCAAAAGATCCCTACTATTACCGGGGTCTAACCTAAAAGAGTTTGAAACTGAAACAAGAGAAAAAGGGCCTTTTTTTCTTTTTCTGGCACCATCCTCTACCTTTCTCATGACATCGACTCCCAAACATCCCACCTCATTGCCAGTTATCTGCATTCCAGGCAGATAGTTGATTTGAGGCACAGAACAGCTGTGCTCGCTTAGGTAGCGCTGTAAGGGCAGCGTACCACCTTTTCTATTGGCGCAATCGCGCCCATGACCAAAAAACCAAAAGAGATGCTGGTATAATATTGGATCTCCTCCTCCTGCAGGATCAAAAAAGGTTGTATTAAAGTTCCTATCAGTTAATAACATGGTAATTGCCAATCTATTCACACACTTTTGGTCAGTGGAGCACAATAAAAATCGATTTTTTTCTATGCCGTTGTGGTGCAGTTTGGACTATATCTTCATCTTTTCTTAATCATACCCGCTTTGATGTGCACAATACCCTTTTTTTTAGCCCGCATGGACCACAAGGCCAAAGGATTTGCAAACACTAGGATCATGCACCCATCACTTCAAATCAAGCCGGCCAAATAGGCATCAAGCTTTTGTTTGCCTGGATGGCAAAAGTAGGTTTGACCAGAGATGTTTGGCGTATAGTCTCTGAGGGCGAACCATCATGGTTCGTTCCCTGCTGATCGTCGTTGCAGAGTTCCCAGCATATAGTCAAATTCGACCAAGACATCGCTGCCTTGTCAGGCGCAAATACACCTGCCAATACTGGAAGAGATAATAAAAGTAGGAATGCTGTCACTAATACGGACCATACGAATAGGGGTAATCTATGCATGGTCATTCCTGGCCCACGCATGTTGAAAAT",mutations={["ANOAT&mit1&c_3209_7683_1"]={['-']={3,46,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,146,147,148,149,152,153,154,155,156,157,158,159,166,218,219,220,221,222,223,224,225,226,227,228,229,230,231,239,240,241,294,359,360,361,648,907,908,909,915,1615,1616,1617,1965,2453,2454,2455,2554,2555,2556,2557,2558,2559,2560,2561,2562,4107}},["ANORU&mit1&c_3322_7795_1"]={G={2393},C={3308},['-']={3,46,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,146,147,148,149,152,153,154,155,156,157,158,159,166,218,219,220,221,222,223,224,225,226,227,228,229,230,231,239,240,241,294,359,360,361,648,675,907,908,909,915,1615,1616,1617,1965,2453,2454,2455,2554,2555,2556,2557,2558,2559,2560,2561,2562,4107}},["ATRAN&mit1&c_4215_8718_1"]={A={14,16,17,22,28,56,62,108,124,125,212,250,285,318,322,353,458,466,519,537,599,604,615,636,649,818,869,913,988,1086,1137,1236,1245,1275,1280,1433,1436,1474,1475,1487,1504,1559,1579,1580,1583,1601,1613,1622,1667,1670,1682,1799,1806,1847,1849,1859,1868,1878,1898,1955,2025,2079,2080,2103,2105,2118,2158,2160,2166,2193,2291,2318,2332,2344,2456,2458,2475,2487,2496,2504,2526,2649,2656,2681,2726,2757,2839,2844,2891,2907,2960,2964,2971,2986,3017,3117,3132,3191,3250,3312,3334,3364,3375,3432,3541,3652,3653,3666,3674,3736,3749,3757,3775,3835,3978,4061,4073,4121,4166,4226,4256,4509,4510},T={5,10,12,18,20,23,47,57,90,123,170,173,174,185,195,300,316,320,327,376,382,425,429,447,449,470,494,502,516,600,621,630,660,757,776,778,822,846,854,895,1188,1392,1400,1401,1404,1468,1473,1507,1532,1558,1646,1699,1781,1804,1836,1837,1880,1909,1946,2028,2031,2127,2142,2145,2148,2222,2299,2390,2465,2476,2486,2495,2505,2662,2674,2675,2678,2696,2702,2708,2746,2748,2753,2835,2854,2928,2948,3003,3038,3105,3189,3217,3270,3307,3318,3665,3690,3782,3796,3798,3812,3821,3861,4080,4122,4124,4231,4241,4251,4291,4300,4314,4345,4378,4382,4420},G={55,63,176,211,214,291,298,301,347,364,369,389,422,484,503,533,573,643,661,666,689,696,729,753,949,1130,1161,1215,1273,1279,1281,1335,1408,1490,1491,1508,1523,1533,1550,1652,1675,1745,1772,1777,1823,1829,1883,1897,1997,1999,2045,2130,2159,2177,2199,2267,2277,2357,2364,2376,2408,2416,2460,2472,2535,2667,2686,2756,2794,2823,2967,3012,3019,3034,3036,3137,3153,3170,3171,3173,3195,3231,3239,3243,3251,3252,3352,3374,3408,3418,3472,3498,3536,3540,3654,3696,3737,3745,3748,3815,3896,3951,4069,4114,4123,4206,4227,4266,4277,4303,4313,4452},C={11,13,15,19,26,49,58,95,106,179,190,196,236,247,256,289,330,331,341,415,448,459,541,612,641,650,691,735,747,767,792,798,830,849,855,923,926,1062,1128,1134,1197,1230,1403,1489,1551,1565,1571,1574,1607,1608,1681,1694,1731,1765,1779,1962,1980,2030,2097,2102,2108,2139,2140,2196,2395,2418,2430,2435,2490,2492,2623,2695,2706,2735,2743,2755,2760,2766,2769,2774,2777,2779,2853,2867,2871,2894,2936,2937,2953,2954,2962,3065,3166,3174,3180,3182,3314,3330,3448,3508,3512,3659,3758,3770,3773,3890,3963,3990,4085,4126,4145,4147,4150,4170,4250,4275,4288,4292,4428,4501},['-']={29,30,31,32,33,34,35,36,37,38,39,40,41,42,501,668,669,670,671,672,673,674,675,680,681,682,683,1971,4172,4173,4174,4175,4176,4177,4178,4179,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199}},}}end)();
(function()addBlock{name="s3x4198",consensus="AAAAAAATTACATATTTCTAATAAACCGCTATACTTGGGGCAGCGCGGGTAACTGCTGCGCAAAAAGAAATATTTTGAAATATTTTGCGGCGCCGTTGAAGAAAACCTTATTATGTGCGCGGGATAGAGTAATTGGTAACTCGTCAGGCTCATAATCTGAATGTTGTGTAGGTTCGAATCCTACTCCCGCCAAATAGTCTAAGTGGTTTTTGTGGAACAGCGGGATTTATATAAAAAGCAGCAGTGCATCCATAACTTGGTTATTTCTGCGCGTTCTTGATCTATTTTTCGGTCAGAAAAATATTGAAATGTTCACTTATATAAATTATGGTGAATTAAATGATAAGACAAATACTCATTCTATTGTGTCTAGGCAAAAGGAACCCTGTATTCTGCTTGTGATGCGAATGATGCGATATGTAAATAAAAGATACGTATTCTATTGATGATCTGAAATAGTCATTTACGGGATAATGAAGGGGTGAATCGATCCAGTTATTTTAGTGGCCTGGATTTTCGTATGCCTTTTTTTCCATCAGATGTTCTTTATTTTTTCCTCTCTTGAAAAAATATGCACAAAATGCATAAACCTTCGTCGTCAAGCCTGAATGCACCTTCGAAGGCGCTCCAGTAAATGACCTGACTAGAAGGCAAGCCCGCCATTCTGAAGTATGAATAGAAGTCTCATTGGCGAATATTCTGATAATGACTAGTGAGGTAGGTGCAATTCCTACTTTGTCCAAAATAATGCATCGGATGGATGCCTGGGCATTGAGAAAGAAGGACGCTTTCAAGGGCGAAACGCCATGGGGAGATACCGTCTGTGATCCATGGATCTCCAATCGGGAAACCGTATCCAAGCGGGGCGGCGCATTAGTGTGCCGCGCTCTGTCTTGGACTTTCGAAACTTAGCGAACTGAAACATCTAAGTAGCTAAAGGAAAGGAAATCAACCGAGACTCCGTTAGTAGCGGCGAGCGAAAGCGGATTAGGCTTTGTGAGAAGGCCGCAGTAGAAAGCGCAATGCGCTTTCTACTGCGGCCTTTTCTCTTCATCCAATTTATTTGAAATTGAATGATGGAAAAACCATTCAAGGAATTGTGAAAAGATTGGAAAATCTTGCCAAAGAAGGTGATAGCCCTGTAAATTTTTTCCTATGGTTCGACTCAATGAGTAAAACGCGGATACCGTGTTTGAATCATGATCGCTCTTATGTGACCAAGGGGGACCACCCTCTAAGCCTAAGTATTCCTCAGTGACCAATAGCGTACAAGTACCGTGAGGGAAAGGTGAAAAGAACCCTAAGAAAGGGAGTGCAATAGAAAACCTGAAATCCGATGCAAACAATCAGTCGAAGGACAAAGTAGGCTAAGTCTAAATGGCGAGAAAGAAGAGATTGCGTTCTCTTTTGCGCTTCGTTATTCAGAACTTTCCACTCTAACGGCGTACCTTTTGCATAATGGGTCAGCGAGTAAATGGACACAGCAAGCTTAAGCCATTAGGTGTAGGCGCAATGAAGTTGGAAGTAAATAAAGAATATAGTTGTTTCTATTTGACCCGAAACTGAGTGATCTAGCCATGAGCAGGTTGAAGAGAGCTCTAACGGGCCTTGGAGGACCGAACCCACGTATGTGGCAAAATACGGGGATGACTTGTGGCTAGGGGTGAAAGGCCAACCAAACTCAGAGATAGCTGGTTTTCCGCGAAATCTATTGAGGTAGAGCGTAGAATGTTTATGGCCTGAGGTAGAGCACTCAATGGGCTAGGGTGGCCCAAAGCTTGACCGACCCCAAGGAAACTCCGAATACTGGCCATGATCTTGTACAGACAGACTTTGGGTGCTAAGATCCGAAGTCAAGAGGGAAACAGCCCAGATCGTACGCTAAGGTCCTTAAGCAATCACTTAGTGGAGAAGGAAGTAATCGAGCAATGACAACCAGGAGGTGGGCTTGGAAGCAGCCATCCTTTGAAGAAAGCGTAATAGCTCACTGGTCTAGCTTTATGGCACCGAAAATGTATCGGGGCTGAAGTGATTCACCGAAGCGACGAGACCTTGAAAGCACCCACCATATGCAATTACGCAGTAATTGCATGCTCCGCGGTTACGGTACCCTGATACGTATCGGCAGTGGGACCAAATCGGGTAAGCAAGGAGCACCTATAATAAAGTGCAAAAAAAATCTTTTTTTTTCAAGTGTCAGTAGCGGAACGTTCTGTAAATCAAAGAAGGTTGTTGGTAACAACACCTGGAGATATCGGAAGTGAGAATGCTGACATGAGTAACGATAAATCATATGAAAAACATGATCGCCAAAAGTTCAAGGGTTTCTGCGTTCAGTAAATCTACGCAGAGTGAATCGGTCCCTAAGGAACCCCCGAAAGGGCTTAATCCGATGGGTACACAAAAGTGACGAAGTTGCTTTGGCTACTACTAAACCACGGGTTACTTCTTTAACTCGTGAATTGGATGATTGGGCAGGCCAGTGAACTTCCAGGAAAAAACTTGGTGGAATTGGAAGAATCTTGATTCTTCCAGTGCGAAACAAACCGTACCCCAAACCGACACAGGTGAACAAGTAGAGTATACTAAGGCGCTTGAGAGAACCATGTTGAAGGAACTCGGCAAAATGACCCCGTAACTTCGGGAGAAGGGGTGCTTTCCTATCCTTAGATTAGGAAAGCGGCACATACCAGGGGGTAGCGACTGTTTATTAAAAACACAGGACTCTGCTAAGTGGTAACACGATGTATAGAGTCTGACACCTGCCCGGTGCTGGAAGGTGAAAAGGAGAAGTGTTATAGGCTTCGAATGGAAGCCCCGGTAAACGGCGGCAGTAACTCTAACTGTCCTAAGGTAGCGAAATTCCTTGTCGCATAAGTAGCGACCTGCACGAATGGTGTAACGACTGCCCTGCTGTCTCCAACATGGACTCAGTGAAATTGAACTCTCCGTGAAGATGCGGAGTACCAACGGCTAGACGGTAAGACCCCGTGCACCTTTACTATAGCTTTGCAGTGACAACCTTGATTGAATGTGTAGGATAGGTGGGAGGTGGTGACGTTGCACGTCACCACCAATCTTGAAATACCACTCTTTCGTCCAAGGATGTCTAACTGCCGAAACAGAGGCGGGACACTGCATGGTGGTTAGTTTATCTGGGGCGGATGCCTTTAAGTAAGGGGCGCTTGGATGGTAACATCCCAGGCTAATCTGGCTATATGCTGAAATCTCCATTTCTTGGACAATCAGCAGGGAAGGCTGAAAAAAGCCACTACATTGTAGCGAAAATAAAAAAAATTTATTTAGGCTCCCTCAACGACTGCATGCCAGGTATCCAATGCAATAATGATTGGATAATGATACAGTCTGAACTTCCAGTAAACTGGAAGCCTAAAGCACTGTTCACTACGAAACAATGATAGGACATTCAAACTGCTAATAACATACGAAAAATGAACAAAGAGACTGAAAAAGAAAAAAATAGCAATACTGAAGTGAGCACTTCAATTGAATAAAATACAACGACAAATATGTTGCAGAATGAATGAACATAATTGCCCAAAGAGTAACGGAGGTGTGCGAAGGTAGGCTCGAGCTAATATTATGACAGCTTTAGAGCGTAATGGTAGAAGCCTGCCTGACTGTGAGACTTACCGGTCGAACAGAGACGAAAGTCGGCCATAGTGATCCGGGAGTCCCGTGTGGAAGGGCTCTCGCTCAACGGATCAAAGGTACGCCGGGGATAACAGGCTGATGACTCCCAAGAGCTCTTATCGACGGAGTCGTTTGGCACCTCGATGTCGACTCATCACATCCTGGGGTTGAAGAAGGTCCCAAGGGTTCGGTTGTTCGCCGATGAAAGTGGTACGTGAGTTGGGTTTAGAACGTCGTGAGACAGTTCGGTTCCTATCTACCGTTGGTGTTTGAAAGAGAACTGCGAGGAGCCAACCCTAGTACGAGAGGACTGGGTTGGGTCAACCTATGGTGTACCGGTTGTTATGCCAATAGCAGCGCCGGGTAGCTAAGTTGGTATAGAAGAACTGCTGAAAGCATCTAAGCGGGAAATCCTTCTCTATACAAGTTCTCATAAAGGGTGAAAGACCATCACTTTGATAGGCGAGAGGTATAAACACCGTGAGGTGTGAAACAAGGCTTACGGCTCTTGTTGAGCTTACTCGTACTAATTATCTATTTCCCG",mutations={["ANOAT&mit1&c_34887_38955_1"]={['-']={7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,49,310,311,312,313,314,315,316,317,318,319,320,321,333,334,335,336,337,338,339,615,616,617,618,619,620,621,622,2063,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2139,2140,2141,2142,2143,2158,2159,2160,2161,2162,2163,2447,2450,2451,2452,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,3273,3274,3275,3276,3277,3278,3279,3280,3284,3285,3286,3287,3288,3289,3290,3291,3304,3438,3439,3440,3441,3442}},["ANORU&mit1&c_34946_39014_1"]={['-']={7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,49,310,311,312,313,314,315,316,317,318,319,320,321,333,334,335,336,337,338,339,615,616,617,618,619,620,621,622,2063,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2139,2140,2141,2142,2143,2158,2159,2160,2161,2162,2163,2447,2450,2451,2452,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,3273,3274,3275,3276,3277,3278,3279,3280,3284,3285,3286,3287,3288,3289,3290,3291,3304,3438,3439,3440,3441,3442}},["ATRAN&mit1&c_39148_43302_1"]={A={48,88,116,198,202,223,290,305,365,367,383,394,400,409,439,460,467,468,478,492,658,716,737,766,864,903,1162,1170,1215,1254,1379,1521,1784,1910,2002,2105,2150,2256,2472,2473,2482,2538,2775,2819,3063,3122,3174,3417,3461,3473,3483,3484,3491,3496,3542,3592,3655,3941,4091,4122},T={106,180,190,196,204,213,220,249,255,281,293,295,348,369,374,426,433,450,475,487,491,533,555,556,558,560,564,577,578,579,593,597,639,643,653,664,699,739,882,886,1021,1022,1054,1164,1187,1198,1204,1673,1726,1761,1817,2079,2113,2134,2135,2137,2177,2444,2445,3070,3100,3135,3305,3428,3462,3489,4072,4141,4188,4196},G={195,229,262,292,296,326,347,349,353,366,388,401,453,484,489,580,608,702,705,715,735,778,1028,1061,1083,1107,1144,1167,1375,1383,1683,1927,2080,2116,2132,2221,2237,2293,2387,2485,2492,2515,2543,2573,3061,3069,3225,3415,3471,3478,3485,3528,3540,3608,3665,3942,4079,4125},C={95,253,273,276,285,386,408,501,550,554,562,605,644,682,734,889,891,1033,1044,1059,1064,1363,1378,1407,1413,1999,2081,2100,2152,2471,2639,3062,3177,3206,3235,3495,3513,3603,3628,3700,4191},['-']={66,67,68,69,70,71,72,73,74,75,76,96,97,98,99,100,101,102,103,104,167,168,231,234,235,236,237,238,239,330,360,524,525,526,527,539,540,2180,2430,2431,2432,3176,3467}},}}end)();
(function()addBlock{name="s3x4012",consensus="GCAGTCCTATTAATTAGGTCAGGATGGATATCTGGAGGCCTTTTATTATTTGTAATAGTCTTATCTTTTGATACCTTTGGCGCAGATTAATCTATGATTCAGCCTTTGCGTATACGTATCTGCGAGTTCGAAAAACCAGTTCCCATGCAATCTATAAGGGGTTGGGCCATCTGAACCTTTTTCCGCAAAGCCGAGAAAGCTGGTTTTACGAGTAATGTCCCCGGGCTTACCTTGGATACTTTCATAGCAGGAAACCAGAAATTTAGGATCCGATAGAATTATTCTCAGTCCATTATAGCGTCCCTGGTTATTTTTACAATTGTTTACTATCTTATTAGCATATGTACGGGCGTCGCTTTGTTAACCATTCTTCTGATTTCTTCGAAGAGGCCTGCAAGAGTAACTTTCTTTGCCCGAAACGGATGAAAAAGAACTATGGATCGTTTTCTGACTAGTCACCTTTGTGTTCTGGCCGGGTGGGTTTCCTTCCCCTTGCTACTATGAGACCTCTGAGCCCGCGCATCATTTGTCGGATGATGTGAAGCGGTTACTTCCCGTGGTTGCCCCATTTTTGTGTTCTCTTTTTGACCTTTGTCAAGGCCTTCAGTAGTTTAAGGTCCTTGCGCACTTGCTTGATTGCTCAAGCCGGTTCCCATGTTAGAATCACCCGTGGCTGTCCAACAACTATGACCGTTCACTACATCAGTCAAAGCTTTCGCCCAGATTGGTATCGGTTCCCGGGTTACTCTACCACACATATACCGACGTATTCTGCCTGGGATATGTAGCCTTTTCAGAGGCAGTGAGTGCGTATCAAGTTGGTTAACCTAACCCTTACTACCCTGCTTAGAGGATACCACCAAGGAGGGCAGTCCCCTTTGGCCTCCCCATCGACCAACTGCTCGCAAACATGATGGATTATTGACCCAAAATGCCGCATTGGCCTGCTGCATGTATTTCTTTGAAAGAGTCAGACATACATGTAGGAATATGGATATTAGTCCTCACTGAAAACGAGCCTCGCACAGCGCACTAGTGATAAAATTGATAGAACCTAAAATAGAGGAAACACCTGATAAATGGAGACTGAAAATGGCTAAATCCACAGATCCTCCAGAATGACTGGTTATACCACTTAACGGCGGATAAACCGTCCATCCGGTACCAGCGCCCACTTCTACCAGAGCAGAACTTAAGAGAAGTAACAGTGACGGTGGTAACAACCAAAAACTAATGTTATTTAATCGTGGAAATGCCATATCAGGTGCACCTATAAGAATCGGAACGAACCAATTACCAAATCCACCTATCATCGCAGGCATAACCATAAAGAAGATCATTAAAAAAGCGTGAGCTGTTATTAACACATTATAAAGTTGATGATTTCCACCAAGAATTTGATTGCCAGGCTGTGCTAATTCCATACGAATTAGTACCGAAAAGCATGTACCCATAACTCCAGCAATGGCACCAAAAATGCAATATAGAGTCCCTATATCTTTGTGGTTCGTGGAAAACAGCCATCTTTGTGCAAAATTGTTCATTTCAGAACTCCATCTTTCAATAATACCATGCTTTGTTGAACTAGTTTCGATTGATGTTTTCGCAATTTAGAAAAGCGAAATTCGTCACAAACTGTTTCGCGAAAACAGGTGACTATCTTCTCTTGTAAACTGCTGCGAGAATGCTCTTGAATAGCTAATAGTGTTTTCAACTTTTGCTCTACTTGTTGGCATAACACAGCTTGCACTGTCTGTTTGCACTTAGGTGCGCAGCGCGTAAGCAGATCATTTATACAAGATTCTCCAATCATTTGCGTACTTGAACGCAAACTTATACTACGTAATTCATGCTGTTTCTTCAACTCGGACAACAGAGCTTCTTGAGAACTCATCAATTGCTGTAGCTCTGAAAGAAGAGCTTCGCTTCGCGCATCAGAAGTAGCTTTTAAAATTTCACCAAAGGTTTTTTGACTAAATATAACAAAACCTACAAAACTTAAAGCTACAATAATTTCTTCATTATAAATTAAGATTTGTTTTGAACTTAAAACACTAGAAATTAAAATAGCGAATATAATAAATTTACGCATTCGTATTTTTCTTTTTTCTTGGTCCGTTCTTGATATTCATTAGGGTGTTCCTTTGTCCGCGTAAAACATAGATTTTGTTAAGAGCTGTGGTTCGACGTGACGCTAAAGAAGTTATATGATAAGTAGAGGGACTCATAATTGAAAGTGCGTTTTTTTTTATCACTTGTGAGACACTAATTTCTCCTAAGGAACATACATAAGATTTATTCAGTCGTTTTAATTGATTAGCATTTAAGCTTTTTACCATTTCGTTACACCACTTGGATGCTCCAGATACACCCGAGTACAGATAGGATATACTGGTATCAAAGCATTCTTTGAAAACAACATCCTGTTCAACACTGTAATCGCTCGGCTCTGTGCCTACATCCTGATGTGAAATCAGCTGTTTTCGTAATTTGAGAATGCGACTTATTTTGGGTAATCCATCATTATATAATAATACATAAAAGGCCATATAAAAGACACATAACCAAACAAATTGCGTCAAATAGGTAAATTGATCTAGTTGAGGCATTTTTTTTTTACTTTTTCTTTGCTGATTCAAATACTTTTATTGAATCACGAGAGAAGAAAACAAGTTTTCTTCTTTGAGCCCTTATTGAGCCCTTAATGGTAAGCTCTTTAAGCAAAACCTACCAAACGGGCCGCAGATTTTCATGGGGAATTAAAGAAGGAAAAGTTGGTGAAGAAACTAGAGTCATGATTAAAATCTATATATAGATTTTTTTGGTATTAGTATTCTACATAACGCGGAGCGAACACCACGATTATTTCGGAGTCTGGACGAAAAAAAAGATTTTTTAAGCTTATAGAGCTTATAGATAGATAGGTTAACTAAAAGCTACTAATATTTCCACTACTATCCATTCCATCATCAAAGAGGTATCGAGTTTCCACATGGGCATATCCCCCACATTACCGGAGGCGTGGGGCAATGATAAATCGCTTGTAGTCACACTAATTGGTCATTTCCATGACATCCTTTCTTCAAACCCAGTTCTTTAGTTGCTCCGCGTTAACACACCAACAAAATTGAATTCCTTGCCCGGCCTTGATCTCTGAGTCTAGATACGTTATTTGTGGTGGATCGTTCCGTATTTTCATGCGTTTCCTCAGTGCGGGCTTGAGGCTTTGGGCCTAAGCGCTTTAAGCTTTGTTTGGTCTTTTGGGTCGTAAAGACCATAGGAATAAAGCTCGAATTTTTCTTTTTTTCTTTTTCGGTCTTTTCATATTTATGAAAAACTGTGTCTTTTTTCGTGTCTTGCAAGTGTTTCCGCTTTGTGCCCAAACGCTTTACTCGTTTCTGACGCGGTTTTGCCGGCGAAGAATAATCTAGTTTGCCATCACCAATTTCTTTTACTACGATATTGCCAATTTTTGAGTTCATGTTCAAAATAGAGAAGATTCTCCATTGACTATGAAATACTTTTCGATTTCTGCGAAGACTCTTTGGAAGAAAAGCTATATGACCTGCGATTGCTACCGCATAACCTCCTTTGACTGAATTCAAAATAAACCCTTTGATCAAATTCCGGTCACTTCGCCAGATTCTAGTTAGTTCAGTCCAAACTAGTTTGCTTTTACATTTTCTTTCTAGAGGTTTTGACAAAAGCATTTTTGGTTCACCAAACACTTCCACATCTTCAATTCCCAAAATAAACCTCGTTTGCTTAGTGATTGGCACTCTTTTCAGCTCATGTTGGAAACAAATTATTGGAGTTTTCAGCCCCGTATCCACCAATATCATGCTTTGTCGTAATTTTTTAACTGAACATTGTATAGCGCTTCCGCGTAATGGATTCAAACTAGAATTATATTGGGGAAATAGTTGAGTAAAGCTCATGTTGCTTTTTTCTCTTTTTTTAGTACTTATTTTCTAACCTGATTCATCTGCTTATAGAGGCTTTCAGACCACGC",mutations={["ANOAT&mit1&c_8299_12267_1"]={['-']={36,37,38,39,40,41,42,43,44,45,46,47,48,49,796,2816,2817,2818,2971,2972,2973,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3951}},["ANORU&mit1&c_8411_12379_1"]={['-']={36,37,38,39,40,41,42,43,44,45,46,47,48,49,796,2816,2817,2818,2971,2972,2973,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3951}},["ATRAN&mit1&c_10295_14261_1"]={A={5,22,26,33,69,109,121,192,209,222,262,283,420,421,424,531,562,598,624,675,849,912,963,1005,1082,1088,1103,1139,1183,1196,1511,1651,1771,1834,1867,1905,2057,2071,2135,2192,2199,2225,2294,2342,2368,2445,2474,2492,2510,2693,2708,2736,2756,2773,2777,2779,2782,2805,2889,2892,2976,3066,3067,3162,3263,3264,3272,3299,3315,3337,3362,3415,3593,3641,3691,3770,3810,3842},T={11,12,16,51,91,128,218,220,250,285,298,302,330,347,379,407,473,478,564,566,578,580,588,601,646,653,667,668,738,747,775,794,795,842,891,926,1000,1007,1454,1570,1591,1654,1676,1711,1785,2129,2184,2252,2302,2304,2372,2461,2545,2758,2776,2814,2824,2868,2941,2949,2954,2956,2964,2975,3031,3075,3088,3089,3106,3129,3139,3183,3187,3205,3213,3266,3307,3343,3355,3380,3391,3393,3398,3402,3404,3435,3436,3466,3526,3620,3645,3821,3824,3843,3860,3938,3963,3971,3985,4002},G={18,19,24,35,58,62,63,64,85,100,182,193,384,395,400,597,643,659,679,728,749,764,829,835,850,924,964,966,994,1026,1195,1262,1307,1439,1460,1909,1952,2056,2177,2204,2234,2396,2418,2552,2729,2761,2781,2799,2864,2992,3028,3049,3064,3065,3112,3149,3170,3221,3270,3271,3278,3285,3290,3467,3491,3548,3578,3647,3700,3767,3949},C={3,15,17,25,54,68,92,93,98,104,174,226,280,327,333,357,361,482,486,493,534,582,583,584,612,838,952,1073,1552,1594,1702,1778,2079,2080,2085,2111,2131,2202,2270,2443,2468,2555,2585,2631,2635,2752,2766,2798,2831,2957,3082,3133,3152,3160,3198,3247,3297,3311,3318,3357,3376,3446,3455,3596,3650,3686,3692,3698,3742,3838,3948,3967},['-']={6,117,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,572,729,730,731,732,733,734,2643,2644,2696,2697,2698,2699,2702,2703,2704,2705,2706,2707,2880,2897,2898,2899,2900,2904,2905,2906,3118}},}}end)();
(function()addBlock{name="s3x3783",consensus="ATTGAGAAAATGAAGGACAGATCCTTTCAGTTCCAAGCAAGATAACACACCCAGCCACAGAAACCGGTAAGTTTTTTAGGACATCAATAGGTACTAGGAACAAGAGGGAGACGGGAAGCCTATTGCTAGAAAACAATGGGCGGAGACATAAGGCGGCCGACCCAGAGATTTTTGTACGGGATAAATAAACTATGGGTTCACTGGGTCATTCCTACAACCTGGACTATCACTCCTTTTCTTCGAACGTTCCACTTGTTGAACAAAGGATAACTAGATTGGATTCGTTTTATGTGGTTAACTATGCAGTAAGGTCCCATACTTTTTTTTTTCACATGATCTGTGTCTTGCTCATAAAATTACTGAAATTGCGGAAGCACATTATTACAGACATATCAACAAAAAGGCCACAGTTTTGACCTCGAAAGGTTTCACTAAAATCATAGTTCAATAAAACAAGAAGCAGATCCCCTGATAACGCCACCCGAAGATCCACTGTAGAGAGTATATTACGTTTTATTCCCGATAAAATTAGGTGGGAAAGAACTAGACATTCTACTCTTCGAGTCTTAATGAGCGTGGAGAGCTGTCTGCGGGGAAACTTGCAAGTACAGTTTGGTGGGAGGCGTATGGGCTCTTGGGACCAAGGACCGGCCGTCGACCCAACCTTATGAGTATTCAGACTATAACAGTTCTGATGAACAGTCACTAACTTTTGATAGTTATATGATTCCAGAAGATGACTTAGAATTGGGTCAATTGCGCTTATTAGAAGTAGACAATCGAGTAGTTGTACCAGCAAAAACTCATCTACGTATGATTATAACATCTGCTGATGTACTTCATAGTTGGGCTGTACCCTCCTTAGGTGTAAAATGTGATGCTGTACCTGGCCGTTTAAATCAGACTTCCATTTTTATTAAACGAGAAGGGGTTTACTATGGTCAGTGCAGTGAACTTTGTGGAACTAATCATGCGTTTATGCGTGCGCCCGAATAAATAGGCCGACTGCTGAGCCTATTCTGGCTCAGTCGCACTTTCTCGAACAAGGCAAACCTGAGTGCGAGCTACCCAAAAAAGCTATCATAGCAATATCATGGCTAGAGCAGTAAGGAAAAGCCGGGGATCGATGGGCCTGCCCCCATTAGGGCTCCCCGGGGAAGCAGAGGATATGGTTAGGATAACGAGCTTGAAACGCGGAGCCCGTCCTAAGCTGGACCGACCGTCCCAAGCAGGATATAGCGGCGAGCGAGTGGTTAATAAACCAATAGTGTTAAACCCGCAGTTGATGGCATTAGCTTCTGCGGCACTCGAGAAACCACAGGGCACTCCATACAGAGTAAGTCCGAGAGATCAGACGCCCGCGCAAGGACCTAAATTCTCACTAGGAGGTAAAACCTAATTCGGACCTATGGAAGTCGGGGCTAAACATCCCCATGGCAGTGTCGTGAGGGAGTTCAGAGGCCTCATAGTATTACAGGCCTCTTCAGGTCATGCGAAGGGGGCCAATCCAAGATCGTACTTTCCCTTTACTAAGACAACAAGAGCTCTCAACAAGTCTATACGCTAGTTTACGCTCAAGTTAAACTGGACAGATCTTGTTTGTCTCTCAACAGCCATATGGGTGAGGATCTACAAAAACAGACACGGCAGATACTACGGATTCACCCGAATGAATATTGAGCGATTCTTTGTTCTTAGCTGTCTGGTACGAGGCTATTTGAAAAAGGCAAAAAAAAATGACACCGAGATCTGTAAGGAATACTCTGAATAGAAAAAGAACCCACAAAGGTTCGCCCATTTAGTAAATAAGCCGAGCAAAAATCAGTTCTTTTTCACACCACCTTGTAAAGTAAAAATACCCAAGCCAGGCAAGATCAGAACAAGGGTAGCAGCATCGTGTGAAAAGACCTCCGGCTAATGCTGGAGGTCCTATTTTTTGCCTATCTTTCTTCGGTCGCTTGCGCGGATTTCGGCCTCACAAAGGAAGCCAAGGATATGTTCCCAATAGGCTTTAATTACACGCGGGCCCGCTAAGGGCCGAAGGCCATAAAGGTTTTTAAGTCTGAGCAATTAGCGCTCCCGCATAAGATTGTAGATGCGAGCTGGGGCGCCAAAGTTGACTCGCTCGGGGTTATTTCGGTTGTGTACTATTCGTAGATCTAATCGGGGAGATATACATAGAGGGTAAGAGACGTAAGAGCTAAAATTCGCTCGGGAAGTGTTACCTATAACCAGTGTAAGTATGAAACTGCTGTGTGGACAACAAATACCACAACGCCGCCAACGGTGAGTGACTTATGGGCTGCGGCGCAGATTAAGATACTGAGAACTCTAACTATTGTGGAGAAGGTTGCCTCAAGGTCCAAGGTTAAGATCTAGGAAGGTGAGCAGTACGAGCTGAAAGGCTCCCATACTGTTCGGAGGGCAGGGGCTTATATTTCTTTCCTGACCCCTATCTATCGTTGTAGAAGCTGTTTCTTTGGATGATTATGTTTCTTGGATATCAAATAAATTAGACTAAAAAGCAAACACAGGACGAATTATGAGTGTCTCTCAAAAGCATCCTTATCATTTAGTAGATCCAAGTCCATGGCCTCTTTTGGGTTCATTGGGAGCTTTGGCAAGCACCATTGGTGGTGTTATGTATATGCACTCTTTTATGGGAGGTGGAACACTTCTTAGCTTAGGCTTGGGAATGATCCTATATACTATGTTTGTATGGTGGCGCGATGTTATACGTGAATCCACTTACGAAGGACATCATACATTTGTGGTCCAATTAGGACTTCGCTATGGTATGATTTTGTTCATCGTGTCTGAAGTCATGTTTTTTTTAGCTTTCTTTTGGGCCTTTTTTCATTCTTCTTTGGCACCCACGGTAGAAATTGGAGCTATTCGGCCCCCCAAAGGAATTGATGTGTTAAATCCTTGGGGAATTCCTTTTCTAAATACCCTTATTTTACTCTCATCCGGAGCTGCCGTGACTTGGGCTCATCATGCTATATTAGCTGGATTCAAAAAACAAGCTGTTTATGCTTTAGTAGCTACCAGGCGACCGTCAGATTACCAAGGAAACTTTTTGATTACCTCTCGTAATCATACCATTGCTGATGCTCGCGATGAGACGGATGCAACTTACCATTTAAACCAACCGGGACAATAGCATGTTGCAAAAGGAAAGGACAGGGTTGACCAACTCTAGAGAACTTTTCCGACCGTGTCTTGGAAATATAGCCGAATGGGTCATTCATGAATGTGAGGTGTTTATGAGACACTAACTCGAGCGTGTTCGGTCAGGTTATTGATCAACCAATAATATTACAGCGCTATCTCCTCCATGGCAGAATGGTAGCCTGCCTGTGGCAGAGCAGGAGGAGGTCCCAATTTCAATATGAAACAAAAACACTGGAAGCACGGCTGCTTTTTTGTCCGAACTAGCACCATTAGTTGGAAATCTTATGTGTTTTCATGTAAGTATGAGAGTACCTTGGTAGTACCGGTGAACTAGATAGCCATGATCCATCCGGCTATCTGGGACGGAGGACTTGTAGTATCCGCCTACTTGAAAGAGAGCTGGCAACAGTAAAGCACTTGACTCGATCTCATTCGTTTAAGGGCAAAGCGAGAAGGAGTCTAAATCACTGTACAGAAATGATTTTCATTTATGGACTTTACCTGATTGACACGGGAAATCTGACTTTCATGTCTGAATAGAATTAAGCCTAAGCCTTTAACAATGGAATAAAGGACTACGTGCCCTATAGAGACGTGGTAAAAAATCAG",mutations={["ANOAT&mit1&c_66446_70095_1"]={G={450},['-']={40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,154,155,156,157,158,159,160,170,171,172,173,174,175,176,177,178,240,464,520,521,522,523,524,525,526,527,528,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1782,1785,1786,1787,1788,1789,1790,1791,1842,1843,1844,1845,1846,1847,1848,1849,1850,1943,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2184,2285,2286,2287,2288,2356,2434,2435,2436,2437,2438,2439,2440,2441,2528,2529,3521,3522,3523,3524,3557,3558,3559,3560,3561,3562,3563,3564,3700,3733,3734,3735,3736,3737,3738,3739,3740,3741,3766,3767,3768,3769,3770,3771}},["ANORU&mit1&c_66524_70173_1"]={C={464},['-']={40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,154,155,156,157,158,159,160,170,171,172,173,174,175,176,177,178,240,326,520,521,522,523,524,525,526,527,528,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1782,1785,1786,1787,1788,1789,1790,1791,1842,1843,1844,1845,1846,1847,1848,1849,1850,1943,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2184,2285,2286,2287,2288,2356,2434,2435,2436,2437,2438,2439,2440,2441,2531,2532,3521,3522,3523,3524,3557,3558,3559,3560,3561,3562,3563,3564,3700,3733,3734,3735,3736,3737,3738,3739,3740,3741,3766,3767,3768,3769,3770,3771}},["ATRAN&mit1&c_73447_77191_1"]={A={3,63,64,79,105,114,117,138,141,142,181,254,257,278,346,404,407,456,507,546,552,571,640,645,649,758,929,954,1092,1156,1195,1206,1219,1384,1385,1396,1436,1477,1481,1541,1597,1601,1619,1623,1625,1640,1711,1725,1755,1776,1812,1827,1883,1900,1929,1997,1999,2139,2156,2165,2166,2193,2210,2218,2310,2326,2331,2348,2352,2654,3118,3148,3186,3292,3359,3397,3478,3485,3527,3590,3598,3687},T={84,107,125,128,214,218,227,231,237,245,298,331,337,347,349,368,374,419,445,482,489,548,565,648,807,860,890,1014,1152,1155,1224,1239,1328,1343,1484,1489,1493,1503,1522,1544,1546,1554,1584,1594,1605,1735,1794,1795,1815,1841,1859,1880,1911,1919,1970,1978,2020,2027,2028,2079,2080,2152,2168,2322,2363,2393,2460,2682,2700,2701,2808,2811,2850,2874,2896,2904,2964,2970,3059,3087,3091,3115,3152,3309,3379,3429,3441,3597,3603},G={2,77,92,121,130,131,143,163,165,182,210,248,350,353,401,435,449,454,455,457,496,498,530,572,734,767,995,1011,1044,1045,1056,1087,1108,1256,1259,1312,1339,1425,1505,1552,1558,1582,1595,1608,1614,1636,1637,1662,1685,1722,1729,1731,1802,1820,1839,1857,1866,1873,1874,1881,1887,1895,1921,1980,2032,2084,2119,2126,2175,2179,2181,2186,2195,2216,2229,2238,2239,2248,2261,2264,2297,2315,2328,2346,2355,2371,2381,2500,3264,3265,3311,3388,3709,3727,3762,3764},C={1,74,109,190,205,230,247,256,267,281,289,299,326,333,356,360,410,443,559,632,818,1015,1024,1034,1054,1268,1271,1337,1422,1444,1472,1526,1540,1564,1566,1585,1600,1626,1628,1718,1728,1803,1830,1886,1897,1906,1927,1931,1946,1954,1959,1975,1984,1985,2051,2061,2151,2249,2312,2463,2660,2679,2985,3033,3079,3088,3090,3194,3224,3281,3329,3384,3546,3610,3723,3746},['-']={10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,133,134,135,328,468,1075,1667,1668,1669,1670,1671,1769,1951,2114}},}}end)();
(function()addBlock{name="s3x3386",consensus="CGAAGTTAAACGGGAGTTGGATTATCGTCTAAAACCCCGACGAAGTGTTTACACCATCGAGTAGTGGGCGCGAGCTCCGCACGTAAATGAAAGATAGAAATTTCCTATATGAATAGGAATCAATGGAATAATTGCAAATTGTTCTAGCGGACTGCAAGCCATGATGAATTCTCTTTTTTTTCTTTTAGCGCGAGGGCGAAACTGAGAAGCCGCTTCGTTGCTTGACGCTTTTCAAGGCAAAGTCTTGAGAGAAAATAAAAAAATATTTTTATTTCTTTCGGTATTTTTTCATATATATATTATATATGACAAAATACCTCGAAGCCAAGCTTGATTTGCCCTACATTCGCCATTCGCGCAGCGAATAGAGCGTTAATTTCTATTTATGTTCCTTTTTTCTTGTCTTAAATAATGAATGGTAACTTTTTGAGAAAAGAAGGAAAGCGGAGCATAATCAAATGGATTTGAAGAGCTAAAAAAAAATCTTTTTTTTTACTTTTCTGCATTTTGGAATATATATGAAAAAAAATCTATATATTTTTGTGCGCCTAGATTTTTTGTCGGTTTGCTGCGTGCCTTTCTTCTATAAGCTGATGGACAAAGTATGCGTGATTTTGTGCCATCTATGTTCGTTCCAGAAGAGAATAAAACTCAAAGTTTCTAAGCCTCTTCTTGCCCCAATTCCATAAGTTAACCAAGTGGGGTCGAAGACCCCAACCATGTGCTTTCCAATATTTGATCAAAAAGCAAAAGTGAAAAACGCTCATTTACATAGCGAATTTATGAATCGTTTTGTACGGAAACAGCTCGAAGCGGTTTCAGCTCTAGGGAGCCTTCGGTGATGCAAGGTCCAAGAGTGTCTAAGTAAATGGCACAAAGAATAAAGTTTATAAATAAAGATGGTCATTAATTATCATACATGATGAATTTGCTTTATACGAATTCAGGAATCAAAAATAGTCTACGGATTTCACGATGTGGGCGAAAGATAGTTTTGTATCTAATTATGCGCAAAGTTCGCCATGCATTTACTATTACGATATATCGAGATTTATCTACTCGACTGACGTAGCGAGTAAAGAACCTGAGACACTTTTTCTTTATGATGTCGTTCCACGAAGCCTTCTGATGAGCTATATCCGAAGCGGGGGGAGGGAAGCGGATAAGAAAAAAAATACATATTTGTTTTGCTTCCTTATCGTTGCACCTTATAACCGAAGGCCTCTTTCGTATCGAGAGCGCCCTTATTTCGCACTTCTTCCTCTGCTCTAGTAATTTCAGCAGGATCTCTTTCCTATGGGGCTTTTTTCTTATGCCGCGTACATGTGTTGGCTTCAGTTGTTCTTCCGCTTGGTTTGTGTTTGCCCGCATCATCTGGAGAACAGATGATGCGTAGAAAAAAAATCTATAGATTTTTTTTCATTGTTGAAGCAAATGATAAAAGGGACTTAGTAAAATAACCATGATACTTTTTTCTGTTTTTTCGAGCATTGCTTTAGTCTCTAGTGTTATGGTAATACGTGCTAAAAATCCAGTCCATTCTGTTTTATTTTTCATCTTAGTTTTTTTCAACACTTCGGGTTTACTTGTTTTGTTAGGTCTCGACTTCTTTGCTATGATCTTTTTAGTGGTTTATGTAGGAGCTATTGCCGTTCTATTTTCATTTGTAGTTATGATGTTGAATATTAAAATAGCAGAAATTCACGAGAATGTATTGCGTTATTTACCTGTAGGTGGTATTATTGGAGTTATTTTTTTGTTGGAAATTTTCTTCATTGTAGATAATGATTACATTCCAATATTACCAACGAAATTGAGTACAACCTATTTAACATATACAGTTTATGCTGAAAAGATACAAAGTTGGACTAATTTGGAAACATTAGGCAATTTACTTTATACCACCTATTTTGTTCTGTTTTTGGTTTCTAGTCTTATTTTATTAGTAGCTATGATTGGGGCTATAGTACTTACTATGCATAAAACTACTCGAGTCAAAAGACAGGATGTGTTCCGACAAAATGCTATAGATTTTGAAAATACTGTCAAAAAAATCAGAGATATTTGAAGGCTTTAGCTCTCTGAAGCCATTAAGAAGCTCAAAAAAAAAGGTATATATATTTTTTTTTGTACGCTTCTCCTTTTAAGTGCTCCTCTGTCATGCCTTCCCAATCTCTGCTTTCCTCTCGCACGAAGCAAAGGAAGCGGGTAAACCCCCGGAAAGCTAAGGTTTTCCGGGACTAAAGTCCTTCGTAAAGCCAATAATAAATATAAGAGCGAAAAGAAGAAAAGGTAAATACAAAAATATAGATTTTTTTGACGTATGCCGGAGAATAAGCTGGACGGACGACTTAAGTCCTACTTTACATTTTAGTGGTCGAAGAATCGAAAAGCAAACAAATTTTCTATTTTATAAAAGAAATTGCTGCGATTTACGTGCTGCAACCGCCAAAAAGCGCGGGGCGGAACAGCGGATAAATGAAAATAGAGGTGGTGGCATGACGGCTCGTTTTCTTTTCCAAGTTACTGCATTGCCCTTGATGCATTTCTCTTTTCTATTCAATCCAAACCCCTTTACTGCAACTTTTGCCTCTATGGCCAAAGGCGCGAAGCGCAGCCAAATAGTTTTTCGTGTTCTTTTCCTTTAGGAGTTCCGCGGTTAGCACAAATGACTGTTAAGTGCGCTGAATATATTGAGACAGGATTTAGCTTTTTACTATGCCATTGTTCGGAGCATATCTAGAACAACTACCTTACCTTTATTTGAAGACAAATTGAAAAAACGCAGCATACTATAGATTATGTCTAAGTTAGGCCTCATATGGATAAATCTTATGGTTAAACGCAATTCATTTGGGTTTTTTTAGCTCTCGTTCATGTAAGTATAGCATGGTCAAGCTGTCAAGCATAAAGCATGTAAATTTTTAATGTGTTTTACCGCTTTGCGCCTAGCTTTTAATTCCGAATTATGGGTCTACTTAGTAGATCCATGGCGTAGCATCTAATTACTATGTTATTGCAGAACTGAATCAAAGCCAAGTGGTTTTTCCATTATATGAATAATTAACAAGTTGCATAATCTGCTACTTTTAATCCCCTTTCTAAGCATTGTATTGGTTCGACTGTCTGTACTTAGATAGACTAAGAGGTTAGTTATACTTATTAAAGCAAATAACCAAAGCCTTTGTAGGCAGGCTCCGTTTCTTCTATATGATGGCGCATGGTTAACGGAAGATTAATACTGATCATGTAGAACAGATTCAGTTGCGCGAAGCACTCATACTCATAATGGTGCGAAGCACTCGAAATGCATGATGCATCGTGTTTAGCTCTAGTGTAGGGCCGAAGGCCCGGGCTTATTAGGATGTAAGTATGATACCCGATTG",mutations={["ANOAT&mit1&c_59480_62732_1"]={['-']={6,195,402,403,404,405,406,429,692,693,694,695,696,697,698,699,825,865,866,867,868,869,949,976,977,978,979,980,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1069,1072,1073,1074,1075,1076,1077,1078,1079,1080,1196,1197,1198,1199,1269,1270,1271,1272,1273,1274,1275,1276,1277,2145,2146,2147,2148,2149,2150,2151,2152,2273,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2430,2431,2432,2433,2434,2435,2436,2472,2473,2474,2475,2644,2645,2742,2935,2936,2978,2979,2980,2981,2982,2983,2984,2985,3097,3098,3130,3131,3134,3135,3136,3137,3138,3139,3140,3188,3189,3190,3191,3321,3322,3323,3324,3325,3326,3327,3328,3329,3375,3378,3379,3380}},["ANORU&mit1&c_59558_62810_1"]={['-']={6,195,402,403,404,405,406,429,692,693,694,695,696,697,698,699,825,865,866,867,868,869,949,976,977,978,979,980,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1069,1072,1073,1074,1075,1076,1077,1078,1079,1080,1196,1197,1198,1199,1269,1270,1271,1272,1273,1274,1275,1276,1277,2145,2146,2147,2148,2149,2150,2151,2152,2273,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2430,2432,2433,2434,2435,2436,2437,2472,2473,2474,2475,2644,2645,2742,2935,2936,2978,2979,2980,2981,2982,2983,2984,2985,3097,3098,3130,3131,3134,3135,3136,3137,3138,3139,3140,3188,3189,3190,3191,3321,3322,3323,3324,3325,3326,3327,3328,3329,3375,3378,3379,3380}},["ATRAN&mit1&c_64881_68210_1"]={A={38,146,181,203,211,236,302,304,337,435,439,445,446,483,485,592,595,596,616,637,640,658,805,844,939,959,974,1088,1095,1127,1132,1140,1141,1146,1153,1236,1300,1303,1322,1427,1680,1959,1991,2035,2044,2046,2066,2111,2143,2192,2201,2277,2376,2405,2455,2465,2479,2480,2548,2654,2663,2726,2730,2768,2797,2836,2872,2900,2905,2937,2944,2972,2994,3090,3101,3152,3206,3230,3243,3246,3261,3292,3342,3350,3356,3366,3367},T={147,205,215,223,274,278,324,347,401,484,509,510,545,548,561,576,583,598,607,634,635,665,677,683,706,707,776,808,850,851,863,921,973,1018,1060,1092,1110,1113,1184,1193,1207,1215,1222,1240,1242,1243,1250,1260,1301,1316,1318,1335,1343,1346,1349,1365,1377,1378,1380,1410,1554,1569,1602,1608,1620,1654,1661,1695,1770,2070,2110,2137,2139,2140,2159,2163,2167,2168,2182,2185,2327,2331,2373,2386,2393,2418,2421,2458,2507,2519,2566,2567,2572,2592,2598,2624,2641,2697,2699,2776,2871,2875,2894,2912,2931,3021,3119,3126,3141,3198,3216,3217,3218,3228,3267,3269,3293,3294,3295,3297,3331,3334,3341,3344,3349,3370,3374},G={227,232,251,300,389,433,437,441,442,444,580,601,732,738,743,759,895,937,952,967,1131,1137,1302,1304,1305,1391,1405,1515,1851,2037,2048,2068,2080,2092,2135,2142,2144,2160,2268,2270,2294,2360,2391,2412,2454,2467,2501,2564,2569,2594,2635,2664,2671,2721,2737,2766,2777,2779,2791,2792,2865,2886,2903,2914,2918,2919,2938,2953,3030,3065,3121,3144,3235,3245,3332,3359,3360,3372},C={96,178,185,202,281,330,334,346,375,383,443,448,573,579,604,628,670,679,686,690,708,781,835,849,858,862,864,946,1029,1056,1123,1150,1169,1256,1258,1267,1306,1313,1379,1381,1524,1558,1624,1665,1743,1755,1950,2064,2074,2158,2161,2165,2228,2276,2351,2370,2437,2508,2511,2517,2552,2559,2568,2591,2651,2725,2799,2848,2854,2870,2885,2966,2967,3051,3064,3102,3207,3209,3221,3237,3270,3298,3333,3340,3348,3353,3361,3369,3373},['-']={3,191,306,307,308,309,310,311,312,348,349,350,351,352,353,354,390,391,392,472,829,1098,1099,1100,1155,1157,1158,1292,1293,1294,1295,1296,1297,1298,1299,2283,2297,2298,2299,2631,2748,2941,2942,2943,3159,3160,3161,3215,3275,3276,3277,3278,3279,3280,3301,3302}},}}end)();
(function()addBlock{name="s3x3229",consensus="TCGATCCAATACTATTACAGATTATGACATCTATATATTTCGGTCCAGTGCACTGTGGCGCGTTTTGCGACATGGCTCAGTGTCGCGCCTCGAGCTAAGCCACGGCACAATACGACGACTAATGCGCTGTCCCGCCGAATAAAAATCTCCTCAAGCTTTTCAGGGTACTGCCCTATTTTTCGGCTGCCAAGCACAGAGCCACCAGCTGAAGATCATTCCTTTTTCTTGAATGAATCATCATAAATAATGATTATATATTTTTTTTCATAAAGAGAATATCTTGTTTTTTGCTAGAATATCTTGTTTTTTGAGAGAATATCTTGTTTTTTGCTTGATTCTGCAAAAGAATTACACAACGTTAAGATCTGTAAAGGTTACATGCTTCAACCAACAAAATAAAAATTTTGTTTTAAAAAAGGGTAACTAATTACCCTACTTACGGATGGAGAGGGATTCGAACCCCCGGTATTCTCAATACTTCGGTTTTCAAGACCGACTCTTTCAACCGCTCAGACATCCATCCTTATCTTAGTAAGATCATCGGCTCAAAGGAACCAATAATCAACCTACTATTCATTTGCTATGTAAATGGAGATTTGAGAGAAAAAAGCGGGAAGAAATAAAAAAAAATTTTAGGCGGATATAGATTAAAGGTAAATTATCTGCCTTCCAAGCAGGAGATATGGGTTCGATTCCCGTTATCCGCAATGGCTAAAAAAACAAATGAAACTTCATATGCCTGCATCAAGATTCAAAACTTGTCGTCAAATTTCGGAAAATGTTTGGCAGACCAAAAAACTTACTCAAAAACAAAAAGCCATTATTTTGAAGCTTCAAAAAAAAACAAATAAAAAACAATCTGACTTTTCCAAAGAATTACAGACTATACAAAAGTTGTCCCTTTTTTATGGAAAATTACCCATTAAAAAGATGCGAAGGTCTAAAACGCAGACTTATCTAGATAAAAAAAATAGTTTGTTATTCGATATAGAACGAAGATTAGACGTGATTCTGGTTCGTCTCAATTTCTGTTTGACTATTTTTCAAGCAAGGCAGCTAATAAGTCATAAAAAAATTTGTGTCAATTCTAAAATGGTCAATATTCCTGGTTTTCAATTATCTAAGGGTGATCTTATATCTATTCAAGATAATTTTTTATATTTCATTAGATCAAAAATAAGACAAAATTTTCAAAGTAACCGAATATGGAGAATAAAACCTACTCATTTGGAGGTTAATTATAAAACACTAAAAGCCGTGGTATTGTATGAACCTCAACAAATACAATTCCCTTATAGCATAGATCTAGACCTTCTTGATTAAAGCAAGAACGTATGTAAATTATTTATTGGCAGAGCGATAACAGAGTTACGTATCTCTCGTAGATAGTGAAAAAAAGATATATATTCCGGGAAATCTTTTGATTTTCTCGAACCATTTTTGGCTTTTTGCTATGGATATAAAGACAATACTACAATTGCGCAAAAAAATCAAGTAAAGCTCGTATGCCCAGGCAGACGGAGCATTCGTTTTATGCTCTACGAGCTTCTTTCTTGGCCTTGTATTATCTTCTTGCGTCTTCAGGGCTAGAGATGGAAAAAGACAGCGGGGAATTCTTTTCGTTAAGTCCGCTTTGTAGTGTGGAGTGAAAAATACTTTTGTTTGCTGCGCCCTGGCTAGTTTTGTAACAGCTAGAAGCAAGCCTAGTCTTATATCATATCGAATTGGCGAAGACTATGGCCTAGTGGGCGTCGCAGAGCAGTTCCTAGAGCCATTTCGGCGAAGCGCCTATTCGTTGCTTGATGGCGTCGTCACGGTTGCTTTGCCCTGCTCGGCCGGATCCGAATCGACCATAAAGCATCTAGGGTGGGGGAGGGTCGGCGAAGCGCGAACAAAAGCTATTGGGCTTCTGCGCGTCCTTTTCCCGCATCGGCGAGAGAGAAAAGAAAGGTAGCCGGACAAAGAGAGAGGGAATAAATAGATGGTTAAAGCTTAATGCATAACAGCAAGCAAAATTGGGCCAAAGATCAAAAAAAATCTATCTATATTTTTGTTTTTTGCTGCGCCCCGCGGCCTTGCCCCCTGGCCATGGCCCAATTTCGGTTAAAGGACTAGTTGCTTCTTATAAACTTGTATAATCAGTGCGTAAAAAATGGTCAACTCTATTATACAATAAATAAGTAAACAAGCGACAATTTGACACCAGATATCTGGAGGTGTTGAAAAAGCTGCTGTAAAAATCGAAAGAACCATAAAAAAACGACGATTTTTTATGCAGCTTTTCACAAAAATCCCTTTTGATTCTAGCAAAAAGATCACAAGTACCTGTACTTGGGAGCATATTGATGAAATAAACAAAATACGAACAGTTAATAAAATATAGTCAAAAATCTTAGGTTGTAACTTTATTATAAGCAGATTAGTTGATGTTTTATTCAATTCATATAAAAAATGCCAAACATTGGGAACTATCGCGACGAGAGTGACAAAAAAGAACGAGAAGAAGCAAAAACCACTTAAGTAAAAGAATTTGTTGTATTTTTTTCTTTGTTCTTCATAACAACTGGGAATCAAAAAACACCAGATTTGATAACTTGAAAAAAAAAATAGAAAATAAAAGCATGATATTAGAGAAATAGTAACATACGTGCTTAAGGCCTCCGTTAATCGTGTACAAATAAGACCTGAATAGGAGAGAATAAGAAAGGATTTCGCTGACGAAGAAAACAAATCTTCTGAAAACCAATAACACGTGAACCATGTTAAACTGAAGCAGATAAATATCCAAAAAAAACGAATTCTAACTTCTTTCAGAATAGTTTTAAATAAAAAATTCGTGATATTTCATTGTGTGTTGAACCTAATAGGAGCGAAAAAAAACGTTGGGTTGGCTTTTACTGCGCCCGGCAAAGTGTGCAATCAATCGTAAGGCCCTCCCTACCAAGATTTTATTTTCATTTCATTAGTAGTTAAGGGTTCGCCTCTAGAATTTTACTACATTTAAGGGTACTCATTCATCATAATGCAATTACTATGTACTAAAACCGTATTACAGCCGAGCATTTCTATTTCATTGAGTAAAAGGCATGGCATAGAGCGCATATAGCCACAGGGAATCTATGGCTAAATCATATTTTTTTTTGCTTCATGTATGACTATGTATATTTTATTTCTGGTGCTATTCTTCCGCTGCGCGCCCTTTATTCGTCACACGAAGACAGCTTTTTTC",mutations={["ANOAT&mit1&c_22310_25450_1"]={A={290},G={291},['-']={2,15,114,115,116,117,118,119,120,121,122,123,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,1371,1372,1373,1403,1404,1405,1406,1415,1528,1603,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1757,1758,1759,1760,1761,1762,1763,1764,1767,1768,1769,1770,1877,1878,1879,1880,1883,1884,1938,1958,1959,1960,1961,1962,1963,1964,1965,1966,2076,3110,3156,3157,3158,3159,3160,3161,3162,3163}},["ANORU&mit1&c_22426_25525_1"]={['-']={2,15,114,115,116,117,118,119,120,121,122,123,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,327,328,329,330,331,332,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,1371,1372,1373,1403,1404,1405,1406,1415,1528,1603,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1757,1758,1759,1760,1761,1762,1763,1764,1767,1768,1769,1770,1877,1878,1879,1880,1883,1884,1938,1958,1959,1960,1961,1962,1963,1964,1965,1966,2076,2972,3110,3156,3157,3158,3159,3160,3161,3162,3163}},["ATRAN&mit1&c_24892_27990_1"]={A={21,24,27,53,181,185,190,201,202,217,273,437,531,569,574,579,591,612,616,724,773,827,881,934,994,1034,1087,1168,1229,1235,1259,1265,1358,1408,1434,1456,1490,1491,1512,1589,1593,1595,1642,1643,1674,1741,1746,1833,1834,1843,1848,1931,1945,2038,2141,2180,2190,2221,2292,2334,2475,2493,2497,2526,2583,2596,2609,2630,2691,2694,2706,2719,2722,2754,2769,2775,2856,2866,2867,2869,2925,3046,3070,3088,3101,3133,3134,3135,3137,3148,3149,3150,3152,3153,3155,3172,3173},T={19,40,42,44,47,51,83,90,126,132,135,172,213,265,345,435,439,538,546,551,566,627,725,752,1007,1022,1388,1398,1409,1422,1428,1481,1483,1541,1555,1599,1629,1668,1670,1671,1672,1694,1720,1788,1793,1826,1832,1925,1930,2067,2068,2079,2080,2436,2473,2668,2897,2902,2907,2944,2978,2983,2986,3038,3056,3094,3130,3132,3143,3177,3178,3186,3187},G={5,17,22,23,26,29,32,33,35,45,69,109,110,111,137,138,139,216,224,288,346,554,595,603,605,615,621,624,644,835,942,1070,1116,1148,1184,1199,1214,1322,1327,1368,1369,1370,1375,1387,1395,1438,1475,1476,1485,1488,1511,1543,1549,1588,1596,1598,1612,1705,1743,1844,1873,1894,1900,1942,1952,1968,1972,1976,1995,2002,2041,2078,2092,2096,2110,2136,2171,2222,2225,2240,2244,2278,2385,2412,2442,2451,2498,2559,2591,2597,2602,2603,2613,2676,2708,2739,2823,2846,2870,2896,2939,2967,2972,3071,3086,3093,3128,3136,3138,3144,3145,3183},C={18,25,34,36,37,43,46,48,68,104,129,157,164,178,212,226,272,289,293,295,410,414,416,433,598,721,726,873,971,1014,1050,1124,1188,1328,1335,1377,1427,1437,1452,1458,1542,1556,1591,1597,1602,1627,1633,1641,1659,1673,1680,1704,1721,1737,1813,1828,1857,1915,1919,1932,1934,1950,2232,2309,2311,2375,2471,2652,2848,2861,2938,2948,2954,2982,2987,3001,3048,3078,3103,3139,3175,3176,3180},['-']={7,140,141,142,143,144,145,146,147,148,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,327,328,329,330,331,332,417,418,419,420,593,1551,1560,1561,1562,1563,1564,1565,1568,1569,1570,1571,1572,1573,1574,1575,1709,1710,1811,1815,1816,1817,1818,1819,1820,1821,1822,1892,2042,2043,2044,2045,2055,2056,2057,2058,2059,2060,2061,2931,2932,2933,2934,3061,3062,3063,3064,3065,3066,3067,3068,3188,3189,3190,3191,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221}},}}end)();
(function()addBlock{name="s3x3055",consensus="AGATGTATTGCATCAGTCTTTTCTTTCTTCTAAAATGAATCAATCATTTTCGATGATTGCTTCGCTACCTTCACCAAATTCTAGCTAGTGTAATCAGGAGAAAAGGGATTCGAACCCTTAACCTGTGGTTTTGGAGACCATTGTTCTACCATTGGAACTATTCTCCTAGAAAAAAAAGTGGTTCTTGGTTTATGGAATTTGCACCTATTTGTGTCTATCTAGTAATAAGTTTGCTATTTTCTTTGATCTTAATCGGTGTTTCCTTTCTATTTGCTTCTTCTTCTAATTCGGCTTATCCGGAGAAATTGTCAGCTTACGAATGCGGTTTTGATCCTTTCGATGATGCCAGAAGTCGTTTCGATATACGATTTTATCTCGTTTCTATTCTATTCATTATATTCGATCCGGAAGTCACCTTTTTATTTCCTTGGGCAGTTTCTCTTAACAAAATTGGTTTGTTTGGATTTTGGTCTATGATAGTATTTTTATCGATTTTGACGATTGGATTTTTATACGAATGGAAGAAGGGCGCTTTAGATTGGGAGTAACCCGGCAATTTCCGAGCCAAAAAACGATAAAAGCAAAAAAACTAGTTTTTTTGCTTTTATCGTTTTGCAAGCTTTTAGCATTCCTTCCATTGCCGCGTAAACAAAATGGGATAAACCTCGATAAGTAGGCATAATAAGTCATTCATTAACTTTATTGAGCTCTCAGAGCCTTTGTTGGCGTAGCCAACAAAGTGCAGCCCACGGCAAGAGAGCCCGTGAGGCCGCACCGATATAAGGGCTCTCGGATGAAATTAACTGAAAGGATGGTGGGACGTGGGGTCCTGTCAAACGAATCGAGCAGGGCGCTGCCAAATTAGTTTGTTTTCCTGCGTTTGATTCTCTCTGTCCTGTCTGGTAGTTTAATATCTTTTACCCTATCGGGTGGCAAATATTAAAGCGTTTCGCGGAACAATGACTGTCTGTTCCCGTACAGTGAATGCCTGAAAATAATAGAATAGATCTTTTTGCGATGGGGGAAGCCCTCTTAGATGAAAAAGCGGCTGGGAGGTCAACTTTGTTCGCACAACGAATGAAAGGTGAAGGTAGTTTTCCGGGGCTACTTTTTCCCCTCGCTGAAGAGCTTCTGAATAATATGCTTCGCTTCCCCCGCGCTCTTTTCAACAGAAATGAAAAAAAAAGAGACATTATATATTAATTACATAGTATACTCAATTATATACGCTCAATAAAGATATATTATATAAAATCAATAAAGAGATTAGCGCATGAAGACGGTCTACCTTTTGTCGATGCTCTATGCTATATAACGAGAGAAACAAGTGGTAATAGAGATTTTTATTTATCTTTTTAGTTATGAAAAAAAAGAAATCTTTTTTTGCTATGCTTTTTATCTTCAAGCCTTACGCTCCTACTTTCGGGTCCGGCCCTTTATCCGCTTCACCTTAACCAATAGGCTGGAGGAACCACTTCGGTGGCGTAGCTGTGAAAGATCAATTTGAGTGATGTGCAATAAAATAAAGCGTCAAGCAATTGGTAAAAAATGAACACCTTTAAGAAAAAAGAAACTAATCATGATGTGTTCTTTTTTAATTGATTATTTAGCATATTAGGGTAATTAGCTCAGTTGGTAGAGCGCCTCGTTTACACCGAGAGAGTCAGCGGTTCAAGTCCGTTATTACCCAAGGGTTTTCATTATCCATGATTCTAAATTGAATCTAGCGTATGAATAAATTTACTAATTTAATTGATGATAATGAAACCGCGATAATAGAAAAAAGGGGGCTTTTGGAAAAAAAGCAAGCCCGCTTTATTCGCACGGCGAATGAGAGCTTATTCTTTTCGAAAGAGAATGACACGGTTAAGGAGAACATAAGAAAGTGGCAAACGCAGAGCAAAAAAAGCGATAATATATATTACCGCTTTTTTGCTCTGGTTTTCGTTTGGGCCAACTAAAGCAGAAAACGCTATGCGTTTTCTTAGTTTATGGTACAATCTGGATTCTAAGATTCTGAATTCTAAGATTCTGCTAAGATTCTGAATTCTAAGATGGTCATGAGAAAAAAAATATATAGATTTTTGGACGTTTTACTGTGGACATTTAAAAGGTGCCCTGGTTCCATGCAAAAAGCACGGCTCCACTAGCATAGCGAGTAGAGGCCGAAGCGCTTCGCCCAAAAACCGATCTAGCCTTATTGCATGCTTTGGGGCCATTACTGTGTAATCGGCTTGACGCATGCGAGGCCACAGGTCAACTAACCTTCTCGCGAAAAAGTGCCTTTCGGTGCAAAGCAGAGAGCCGCGCAGCCTGACTGCGCGCGGCTGCTGGCGATATTAGACTCGTGGCTTCAGGTTACTTTCTTTTCCCTGAAAGCTTGAACGATACTTCCGGAGAAAATAGAGTTTCTACTAACGTATTTCTACTGACATAGCCAGTAGAATGGAAAGATTCCGATGAATCATCTACGATGATTCATTATGTTTGGGAAAATAGCTTAGTTGGTTAGAGTGCTGGTCTGTCACGCCAGAAGTCGCGGGTTCAAATCCCGTTTTTCCCGGTAATTTTTTGATTCAAAAATGAATTATTATAAAATCAGTTCATAAAGAGAGATATATATATCTCTCTTTATGAACTGGTAACTAAATCAGTTAAAATCTTTTTTTTTTATTGAAATAGAACCAAAAAAGCATGCGATATAATATGAAAAGCTATGCGATATAATATGATTCAATTTTACAGGGCGTAGCCCTTATCCTACCCTGCGTCAAAAGTAATCTTGAGGTGTGAAACTTTAGGGATAATGTAATAATGGTTAAGATTACATACTGAGCTGATGCTAGAGTAAAGAGATTGGAAAAAAAAATTATGCTATGCCTTTTTCTTCAATGGATGAATAGTGCAAGGAACTAATACAAAGACCTTGTCAAAAAGACTCTAAGATCTTAATCGGTGTTAGCGGAACCGAAAAATTTTCTATATAGAATTTTATAGAGTAAAGATTAGAATATCCTAGGTTGGCGTAAGTCGTATGTGGGCGCAGAGCGCCAGC",mutations={["ANOAT&mit1&c_84358_87110_1"]={['-']={6,65,66,591,776,777,778,779,780,781,782,783,821,822,823,824,825,826,827,828,829,830,914,1029,1030,1031,1032,1033,1034,1035,1036,1056,1057,1058,1059,1060,1061,1062,1063,1099,1100,1101,1102,1103,1171,1186,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1274,1275,1276,1277,1278,1281,1282,1283,1314,1315,1316,1317,1318,1340,1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1894,1901,1947,2006,2007,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2086,2087,2088,2089,2090,2128,2129,2130,2131,2132,2133,2134,2135,2136,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2264,2265,2266,2267,2268,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2615,2616,2617,2618,2715,2766,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2999,3000,3001,3002,3003,3004,3005,3006,3023,3051}},["ANORU&mit1&c_84438_87190_1"]={T={1425},['-']={6,65,66,591,776,777,778,779,780,781,782,783,821,822,823,824,825,826,827,828,829,830,914,1029,1030,1031,1032,1033,1034,1035,1036,1056,1057,1058,1059,1060,1061,1062,1063,1099,1100,1101,1102,1103,1171,1186,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1274,1275,1276,1277,1278,1281,1282,1283,1314,1315,1316,1317,1318,1340,1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1894,1901,1947,2006,2007,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2086,2087,2088,2089,2090,2128,2129,2130,2131,2132,2133,2134,2135,2136,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2264,2265,2266,2267,2268,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2615,2616,2617,2618,2715,2766,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2999,3000,3001,3002,3003,3004,3005,3006,3023,3051}},["ATRAN&mit1&c_93412_96378_1"]={A={16,17,19,20,59,80,168,177,298,523,544,552,589,634,642,763,765,774,805,933,975,990,1038,1089,1122,1125,1271,1284,1299,1320,1324,1377,1442,1478,1489,1492,1499,1505,1509,1512,1529,1660,1708,1712,1754,1763,1771,1778,1828,1839,1843,1853,1859,1870,1873,1897,1973,2004,2062,2105,2112,2195,2224,2236,2238,2245,2247,2288,2452,2471,2567,2568,2573,2625,2718,2749,2784,2789,2801,2833,2838,2847,2908,2909,2938,2990,3041,3048},T={11,29,44,73,74,214,218,253,262,322,337,358,386,391,400,404,405,415,489,514,560,592,626,631,641,643,666,697,747,762,791,792,795,837,842,864,877,886,888,890,894,895,899,974,1045,1115,1146,1174,1295,1302,1338,1363,1364,1372,1399,1402,1407,1411,1415,1416,1446,1449,1454,1477,1563,1569,1688,1705,1750,1768,1777,1824,1924,1974,2079,2095,2270,2273,2393,2411,2416,2417,2470,2604,2647,2693,2742,2748,2973,2998,3038,3039},G={14,34,47,82,86,285,448,535,553,611,660,680,700,748,772,801,836,874,937,991,1037,1073,1092,1132,1272,1304,1310,1365,1447,1452,1458,1471,1506,1548,1597,1608,1706,1714,1733,1758,1760,1761,1764,1816,1872,1890,1944,1975,1984,1992,2108,2138,2171,2199,2222,2230,2274,2293,2310,2388,2389,2420,2433,2469,2628,2648,2685,2688,2689,2710,2716,2723,2773,2774,2794,2813,2820,2821,2846,2898,2920,2933,2982,3046},C={15,70,283,394,502,645,694,710,755,804,814,898,903,912,918,947,976,1085,1094,1111,1121,1200,1291,1298,1463,1549,1557,1587,1594,1595,1607,1612,1697,1753,1798,1846,1940,1943,2066,2119,2223,2232,2234,2235,2271,2275,2276,2286,2311,2343,2412,2455,2572,2598,2682,2699,2739,2740,2750,2755,2782,2804,2826,2857,2900,2913,2927,2941,2991,3037},['-']={2,22,23,24,25,26,61,574,576,1430,1431,1432,1433,1434,1435,1436,1437,1438,1559,1560,1561,1848,1934,1935,1936,1937,2098,2099,2100,2101,2102,2103,2156,2157,2660,2661,2674,2675,2676,2677,2678,2679,2680,2681,2697,2702,2703,2704,2705,2706,2707,2708,2859,2860,2861,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2969,3012,3013,3014,3015,3016,3017,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036}},}}end)();
(function()addBlock{name="s3x2947",consensus="GATGGGTAAATCCTGCCCATGATGGATTGCGTTAATCATGAAGAACACAAAGTTTCCATGATCCGCAAAAACGAGAAAGCACGAAACATTCATATGGCAAGACGACTATCGATTCTTAAACAACCTATATTTTCTACATTTAACAATCATTTAATAGATTATCCAACCCCAAGCAATATAAGTTATTGGTGGAGTTTCGGTTCGTTGGCTGGTCTTTGCTTGTTCATTCAGATAATTACAGGCGTTTTTTTAGCTATGCATTATACGCCTCATGTGGATTTAGCTTTTTTAAGCGTAGAACACATCATGAGAGATGTGAAAGGCGGCTGGTTGCTTCGTTATATGCATGCTAATGGGGCAAGTATGTTTTTTATTGTGGTTTATCTTCATATTTTTCGTGGTCTATATTATGGAAGCTATTCGAGTCCTAGGGAATTAGTTTGGTGTCTTGGAGTTGTCATTTTACTTTTAATGATTATAACAGCTTTTATAGGATACGTACTACCGTGGGGTCGATTTGGCCCCTCCTTCTACTAATAGGAGGATAAAAAAACCCCACTAAATGCGGGAAACTCTTTATTACTAAGGTACTTTTCTCCCATGGAAGGCGTAAAATGGACGATTTTTGGTGGCGATCCCTAGAATTTTAGCCTTGCTGTCTTGTGTGGGTTCAAATTCTAAGTAAAAATCCTTAGCATGTCATCATAGACAATCCGCAGGAAAACTCTTGCTACACGAGAATAGGCGTCTTCGGCCTTGGAAAAAATGGCGTGGAGATTTCCTCAGAGACTACACGTGGGGTGCCTAGTCTATCATCGATCTCTGGCTAGGTAAATATATAGTCCCATTTCTCTCTAAAAAATCATGTCTATTTCACTCTAATGAATGAATAAATAAAGGCCGGAGGCCTATTATCGAATTGGAGTCTTCTCAGAATCTATTCAAGCCGTATATTAAGGTGCTATTCTAGAAGCCTTACTTAAGCAGCTTTGTAACCTTTTGCCATAACAGATCCAGGATATTTTAATAGGGTTTTTATTGTTTGGTTTTACTTTCAATTCTTGCTCCGGGGATATTTGATTTCTAAGGTAACACTCAATTTAACGAATAATAGTAAGGCCGAAGGCCCGCCAGTATCTAGGATTTCAAATCAAAACCTCGGCTAGTTTGAATTAGTTCCACCCCGAATGTTTTTTTTTTGGCGAGTTGAGAGAGTTTCTAAGAAAATTATTGACTATTCGACTCTTGGAGCATTAGCCTATTGGCTTATGGATGATAAGGCCAAAGAGCGCGCGGGCTCAAGGTTCCTTATTCGTACAGATAGTTTCACCTAAGAAAAAAAATACTGCAGAAAACATTTCGTATCAGGGCTAATTCCAGTAAAAAATACTTTAAATCGCTGCTCGATATTCTGAATGAAATGCTGAAATGAAAAACAACCAGTGGAGCCTGACATCATTCATCCATAGAGTCTAAAAAGGATCTTTGGTTAGAACGTAGAAAAGACATGGTTTGGGGGAATTTAGGCAAATGAGTTTTTGGGGAGCTACAGTCATTACGAGCTTAGCTAGTGCAATACCTGTGGTAGGAGATACTATAGTAACTTGGCTTTGGGGTGGTTTCTCGGTAGATAATGCTACCTTAAATCGTTTTTTTAGCCTTCATTACTTACTTCCTTTCATAATAGCTGCCGCTGCTATTATTCATCTTGCTGCATTACATCAATATGGCTCTAATAATCCATTGGGTATCAATTCTTCTGTGGATAAAATAGCTTTTTATCCCTATATGTACGTAAAAGATTTAGTATGTTGGGTAGCTTTTGCCATTTTTTTTTCTATCTTTATTTTTTATGCACCTAATGTTTTGGGGCATCCCGACAACTACATACCCGCGAATCCCATGTCAACTCCGGCTCATATAGTGCCAGAATGGTATTTCTTACCGGTTTATGCGATTCTTCGAAGTATACCTAACAAATTAGGGGGTGTAGCTGCCATAGGACTAGTTTTTGTGTCATTATTTGCTTTACCGTCTATTAATACATCGTATGTACGTAGTTCAAGTTTTCGACCAATTCACCAAAAATTATTTTGGTTGCTTCTGGCAGATTGCTTACTTTTAGGCTGGATCGGATGTCAACCTGTGGAAGCACCATATGTTACTATTGGACAAATTGCTTCAGTTGGTTTTTTCTTCTATTTTGCTATTACGCCCATTCTCGGCGAATTAGAAGCTAGATTAATCCAAAATTCTAATGTTTGCGAGGACTTAAGTCCTCGCAAGCTTTCCCACATTTTTAAGAATTCAATTTATGTTGTGAAATGAAAAGCCATCAATTTATTAACCGTCTTATTACTAAATCCCCGTATCCGGTTCTTACCTATTATTTCCGCATTAATTAGTGGTGTGTTCTCAATTGCGCCACTTTCCAAACCTATCATTGCACTTTGTGAAAATCGGAAAAAAATTCTAGAGGATTTGGACAAGTATCCTTGCCGGGATTGCTCCAGCAATTACAACGGGTATTTCTGACAAGGAATCCAGCGTCGGTCAAGAATTCCGGATCAAACAAAGTTTCTGTCCAGGATTCTTGACCTATGAGACTTCGCCGAAGTTTATCCGCTCATAGTTCACAAGAGATCTTTGACAAACAGATTGGGATAAAAGGAGAGGTTTTGCGCTGCGGCATCTCTGTACTAAATTTATTGGAGCTCACGCCCTACCCTAGGCTAGAGAAGTTCTGGTAGAAGAGGGTATGATGGCCGCCCAGGCGTGCTGCGCCGTCTTCTCTTTTCTATCGATCCTGTCCCGTTTATTCCTTTATTAATCTGCTGAGATTTTGCCGATTCCACACCAGATCCAGCTACGACGCAAAAAACGTCTATGCCCGGAAATAAAAAATTACCAACTTTTATGAGCAGATTTATTATACTGGAAATTCTCA",mutations={["ANOAT&mit1&c_74650_77473_1"]={T={2894},['-']={913,914,915,916,917,918,919,920,967,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1080,1081,1082,1083,1084,1085,1086,1087,1180,1181,1182,1183,1184,1185,1186,1187,1203,1298,1299,1300,1301,1302,1303,1304,1305,1306,1331,1332,1333,1334,1335,1336,1337,1338,1483,1484,1485,1486,1487,1488,1489,1490,1491,1492,1493,1494,1495,2532,2533,2534,2535,2536,2644,2724,2725,2726,2727,2728,2729,2764,2765,2766,2779,2780,2896,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937}},["ANORU&mit1&c_74728_77551_1"]={T={2895},C={441},['-']={913,914,915,916,917,918,919,920,967,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1080,1081,1082,1083,1084,1085,1086,1087,1180,1181,1182,1183,1184,1185,1186,1187,1203,1298,1299,1300,1301,1302,1303,1304,1305,1306,1331,1332,1333,1334,1335,1336,1337,1338,1483,1484,1485,1486,1487,1488,1489,1490,1491,1492,1493,1494,1495,2532,2533,2534,2535,2536,2644,2724,2725,2726,2727,2728,2729,2764,2765,2766,2779,2780,2809,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937}},["ATRAN&mit1&c_81815_84730_1"]={A={72,514,540,603,609,630,767,770,772,773,824,863,887,903,929,948,954,1001,1010,1016,1078,1105,1117,1129,1140,1141,1194,1199,1247,1264,1271,1314,1319,1355,1361,1425,1436,1468,1515,1559,1707,1790,1868,1877,1895,1946,2048,2226,2472,2484,2557,2588,2641,2687,2735,2743,2745,2746,2866,2892},T={197,323,326,402,416,465,595,598,641,671,746,816,822,883,942,961,963,969,1002,1067,1079,1096,1212,1317,1327,1330,1350,1377,1464,1562,1679,1892,1976,1997,2035,2103,2132,2216,2222,2254,2333,2367,2378,2393,2431,2439,2460,2483,2493,2498,2510,2611,2623,2627,2716,2736,2756,2760,2774,2783,2801,2806,2810,2811,2820,2821,2846,2852,2854,2863,2870,2884,2891,2898,2900,2943,2945},G={66,152,420,605,611,614,645,651,670,761,777,813,846,856,935,977,1057,1102,1112,1147,1174,1202,1229,1277,1283,1287,1415,1423,1441,1467,1476,1481,1845,2090,2150,2308,2347,2457,2466,2521,2541,2544,2573,2637,2666,2750,2770,2788,2827,2843,2864,2877,2897},C={32,116,140,223,248,288,593,610,622,623,640,644,663,728,736,810,823,847,855,960,979,989,991,998,999,1058,1095,1176,1197,1198,1207,1208,1217,1359,1391,1392,1393,1405,1580,1592,1637,1695,1700,1709,1829,1835,1866,2012,2036,2042,2122,2204,2310,2375,2379,2380,2384,2394,2398,2438,2450,2455,2518,2530,2647,2684,2700,2709,2731,2747,2752,2753,2758,2786,2791,2798,2819,2835,2842,2880,2896,2901},['-']={551,552,632,633,634,931,932,933,985,986,987,2406,2407,2408,2409,2410,2411,2412,2413,2414,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2740}},}}end)();
(function()addBlock{name="s3x2927",consensus="TATTCTATTGAGAGAATGCATAGGGAAACTGCGGCTCTGCGATGGAATTTTTGACTCTATGTATTCAATATAACTCACGCATTCGTGTACAAACCAGTGTGGACGAAATAACTCCAATTTGTTCGGCAGTCACTATATTTCCGTCAGCCGGCTGGTGGGAGCGAGAAGTTTGGGATATGTTCGGTGTTTATTTTTCTAATCATCCCGATTTACGCCGTATATTAACAGATTATGGTTTTGAGGGTCATCCATTACGAAAAGACTTTCCTTTAAGTGGATATGTGGAAGTACGTTATGATGATTCAGAGAAACGTGTGGTTTCTGAACCTATTGAGATGACTCAAGAATTTCGCTATTTTGATTTTGCTAGTCCCTGGGAACAAAGTTCGCGTAGTGACAAATCGAGGAAAAAGTAAAGAATTTTTGCTTACAGCCATCTTAATAATATTCAATTTCGTAGTAATTGCATGCTCGGCTCAGTTCTACGGCATGCTGAATAATCCGCTTTGCCTGTCTGAACCAAACTCGGTCTTTTCGATCTAAAACAGCGGGAGTGTTGACCTTTTATGGAAACGCCGCGCTCGGGTGATGAGGATTCGAGAGAATAAAGTGGGCCTCCGCTACTTCATTGGCTTAACAGAAGAAAGAAAGGTGGAAAGAGGAATAGAAAGAAAAGAATTTTTTGCTGCGAGAAAAAATATATAGAAATCGCCCCAAAATTTTTTATCTATTTTGCGTCTTTCATCTCCTCTTCCTTATGTTCTACTAGCTTGAAAGAGCTTGGCCAATGAATGCCTCTCCCCTTCCCCGTCTCGATCTATCATCTAAGATGATAAATTGGACACAATCTGAAGGTTCAGATTGTGGAATTATTTAATTTATTGGTAGAAGGTTTTATTAATTTACGAACAAATTAACTGGAAATAAGTTGGCTGGAGCAGAACTATCTACATTATTAGAACAAAGAATTACCAATTACTACACCAAATTGCAAGTGGATGAGATCGGTCGAGTGGTATCAGTTGGAGATGGAATTGCACGTGTTTATGGATTAAACAAGATTCAAGCTGGAGAAATGGTTGAATTTGCCAGCAGTGTGAAAGGAATGGCTTTGAATCTAGAAAATGAGAATGTAGGAATTGTTATATTTGGTAGTGATACTGCTATTAAAGAAGGAGACATTGTCAAGCGCACTGGATCTATTGTTGATGTTCCTGTAGGAAAGGCCTTGTTAGGTCGTGTGGTTGATGCCTTAGGAGTACCTATTGATGGAAAAGGTGCTTTAAGCACTGCAGAACGAAAGCGTGTAGAAGTTAAAGCTCCCGGGATTATTGCACGTAAATCTGTGCACGAACCCATGCAAACAGGATTAAAAGCAGTAGATAGCCTGGTTCCTATAGGTCGTGGTCAACGAGAACTTATAATAGGAGACAGACAAACTGGAAAAACTGCTATCGCTATTGATACCATATTGAACCAGAAGCAAATCAACACACAGGGCACCTCGGATAGTGAAAAATTGTATTGTGTGTATGTAGCGATTGGACAGAAACGTTCAACCGTGGCACAATTAGTTAAGATTCTTTCAGAAGCGGGTGCTTTAGAATATTGCATTATTGTAGCAGCTACTGCTTCGGATCCTGCTCCTCTGCAATTCCTGGCACCATATTCAGGTTGCGCTATGGGAGAGTATTTTCGAGATAATGGAATGCACGCATTAATCATTTATGATGACCTTTCAAAGCAATCAGTGGCATATCGACAAATGTCATTATTATTACGTCGACCACCAGGTCGTGAGGCGTTCCCTGGAGATGTTTTTTATTTACATTCTCGTCTATCAGAAAGAGCCGCTAAAATGTCAGACCAAACTGGTGCAGGTAGCTTGACTGCATTACCTGTAATTGAAACACAAGCTGGAGATGTATCTGCTTATATTCCGACCAATGTTATTCCCATTACAGATGGACAAATCTTTTTGGAAACAGAACTTTTTTATCGTGGAATTCGACCTGCTATTAATGTAGGATTATCTGTAAGTCGTGTGAGCGGGGTGAGATTCACATGGGATCGCTGGAGTTGGAAAGCTCTGCGTAGGATCCCTCAGCGCGTAATCTGCCTTACTCGATTATAACTGAGTCGAAAGCCGGTAAGTCAGAAACTAACTATCGGAAGTTCAGGAAAACAAACCTCGATGATGGTCGCCCTACTCTCAGAGGGAAGACACCCAGGATTCTACCTGCGTGAACTTGGGATATGTGCCGTCTGCAGCATGAGTACTTCCACTACACGAGAAGGAAAAGGGGAACCCTGCGTCGGAAAACACACGAACTCCACGGCGATGAACGAGTCAACCCAAGGCTCTACAAATCGTTAAATACCTAGAGGGAACTCCCGATGGGAATCCGGACCTATTCATGAGGAAAGGCCGCGATTCGTACGGTCCCGGTGGAACCACCACAAAAACTTACGAGGGGGGAACCTCGTTGGTTCGGCGATGGATAGAACTGAGAATTAGGAAAGTCCTGCTTCTCCTGCCCGAGTTGAGGCTGCAGCCGATCGAATTCGAGAACTGGAACTTAACGTCGACAGAAAATATCAGAAAATCATCAACATAATAACGGACCCACATGCGCTCATAGCATCGTACCAACGCATCAAATCTAGATTCATAAAAATTACTCCAGGAGGGGATAACGAAAAGAATGATGCTTCCAGGGAGGAAATCCACTTCTTATTCCTTAGACTGCGTTGATCAAAGATGATTCGGGCACATCGCAGAACAACTGCGCACGGGGAAATATCCATTTAGACCCGCGAAACGAGGTAAACATCCCAAAATCAACAGAACCCGGGAAGACAAGACCGCTTACGATGATCAGCGCCAGAGACCCGATATTACAAACGGCCATCAAGGCGGCCTTTAA",mutations={["ANOAT&mit1&c_80376_83250_1"]={['-']={642,643,644,645,646,647,652,653,654,655,656,657,679,680,681,682,683,684,685,686,687,688,709,736,737,808,2354,2678,2679,2680,2681,2682,2683,2684,2738,2739,2740,2741,2742,2743,2744,2745,2803,2805,2806,2807,2808,2809,2810,2811,2812,2826}},["ANORU&mit1&c_80455_83330_1"]={['-']={642,643,644,645,646,647,652,653,654,655,656,657,679,680,681,682,683,684,685,686,687,688,709,736,737,808,2678,2679,2680,2681,2682,2683,2684,2738,2739,2740,2741,2742,2743,2744,2745,2803,2805,2806,2807,2808,2809,2810,2811,2812,2826}},["ATRAN&mit1&c_88427_91336_1"]={A={4,11,420,421,422,449,569,628,660,664,670,675,704,734,782,895,1188,1302,1506,1659,1689,1809,2235,2366,2447,2511,2575,2666,2715,2718,2721,2728,2753,2769,2770,2853,2854,2863,2873,2889,2893,2905,2906,2915},T={10,205,352,373,402,406,433,485,514,614,639,666,676,718,750,762,765,785,813,824,905,1056,1227,1467,1657,1837,1841,1941,1954,2125,2177,2202,2283,2328,2363,2393,2395,2429,2537,2622,2626,2659,2701,2850,2882},G={15,21,67,132,235,398,404,408,416,440,538,541,566,591,635,767,775,826,841,939,1093,1206,1285,1288,1301,1446,1485,1492,1602,1662,1869,1878,1926,2025,2131,2137,2352,2406,2413,2546,2568,2590,2600,2611,2620,2638,2644,2650,2658,2660,2695,2704,2714,2724,2746,2747,2757,2758,2764,2792,2820,2844,2845,2856,2861,2865,2924},C={8,20,22,49,85,209,222,417,493,499,515,540,690,691,700,701,725,732,743,760,766,772,796,798,803,812,1155,1266,1614,1821,1838,1923,1992,2022,2060,2124,2342,2415,2487,2515,2544,2579,2585,2668,2674,2751,2752,2766,2775,2802,2828,2841,2883,2899,2922},['-']={745,755,756,757,758,2354,2473,2474,2706,2707,2708,2709,2710,2711,2712,2713,2823}},}}end)();
(function()addBlock{name="s3x2718",consensus="CCATCTTATCATCGAAGATGATAGCAAACCTTGCTGCAGAAAGAAGTGTACCTGCGGTACAATCATCGTAGATGAGACATTGATACTTGAAATGAAATAAAAGAGGCAAATACACCATGATAAATAGTTGCTGGAAGGAAAAAGCACTAAAACAATTAACTTTTCGTTTAAAAAAAAAGTCTGCTGGCAGAAATTCATCAGGGCGTATTACTGTTTTTCATCGAGGAGGTGGATCGAAGCGATTGCATCGGAAAATGGATTTTCAACGGAGCACTTCGTCTATTGGCCTTGTACAAAGAATCGACTATGATCCTAATCGTTCCTCTTGGATTGCTTTAGTACGATGGCTCGGAGCAATGGGACGCCCCGCAAAGCGGAGTGCATTCTCTAAAGCCAATAGTCAAACAGAAGAAAACGCCAAGCGTTTTCTTGGTCGGAGAGAAAAAAATCTTTTTTTTTTCGGCCTCTTATTTTCGTCTTCCTTCTTGTTCAGGAAAGCCCAGAGAAGAAATTACGTTTTTTTCTCTGCCCTTTTCTCTCCAGAGACAAAGAGAGAGGCTGCAATTTTAGGGCCTTTCGGTAGCTTTCTCGATTTACCTAGGATAGCCTCAGCCGGGTCAAAGCCCGCTTTCTTTGCTTCGCGAATGAAAAACTTTGGAGGACATGATACGTTTTCTGAAAATGAGGGCGGAAGATGGAAGACGCATAGCGCTCTCTGGGTGCAAAGAATCGAGCGCAAAGCGCTTTCTTGGCTTAAAAAAAGAAGCGATTTTTTTGCTGCGCATAAAAATAAAAGAACCAATATATTTTTTTCTTTCAAACCTGAGCATAGCGAAAAAGGACCAATGGTTGAGGCGGGCAAAGTAGATCGTGCACCTTTCACTTATATATTAGCTAGTGATCAGTTAGAAGCTGGCAAGACGGTAATGAATTGTGATTGGTCTAAACCTTCGACTTCGTTCGATCAACATAAATCTTCCCATAATTTGCTAGCCCATAACGACCTTCGGTTCCGAAACCACTTTGTTCACCTAACAAATGAAGGCCAAAGGTCCCTCAGGGTGGAAGAGCCCGTGCAGCGTAGTCAGGCTGCTTCTTGGTTACGCCCTGGGGGGGACTACGCTTCAAGTGAGAATAAAAACATACTTGATTCCTATTATCAAATGGTAGGAAATTGCGTATCATTGGCTCATATACCTATAGGCACATGGATACATAATATTGAATGGAATCCGGGTCAAGGCGCAAAGTTGATTCGAGCTGCAGGGACCTTTGCCCAAATAATCAAGAAATTCGAAAATACACCACAATGTATTGTGCGATTGCCTTCGGGTGTTGACAAACTCATAGATTCCCGATGCCGAGCTACTGTCGGTATAGTGTCCAATCTTCATCATGGTAAACGTAAGCTTGACAAAGCAGGACAAAGCCGATGGTTAGGCAGACGTCCCATTGTTCGGGGTGTTGCTATGAATCCGGTGGATCATCCTCATGGAGGAGGTGAAGGACGCACAAAAGGAGGTAGACCTTCGGTATCACCTTGGGGAAAGCCCGCCAAAGGTGGATTTAGAACAGTAGTAAGAAAACGCAGAAATTAGTTTATGACACGATCTGTATGGAAAGGCCCTTTTGTGGATGCTTGCTTGTTCAAGCAAAAAAAGATCAGATGGAAAATTTGGTCACGTAGATCTTGTATTCTGCCTCAATTTGTCGGTTGCTATGCACAAATTTATAACGGAAAAGGTTCTGTTGGTTTGAAAATTACTGAAGAAATGGTTGGTCATAAATTTGGAGAGTTTGCTTCTACACGGAAACCTTCTTCCTCTGGGAGGAGAGCTTCGCCCTCGAGAACGAAAATAAGACAAAAAAAAAAGGTACGATAGTGAACTATGGCGCAAAAAATAAATCCGATTTCAGTCAGACTGAATCTGAATCGTAGTTCAGATTCAAGTTGGTTTAGTGATTATTATTATGGAAAATTGTTGTATCAAGATGTAAATTTTAGAGATTACTTTGATTTAATACGTCCACCTACGGGAAAAACGTTTGGCTTTCGTCTCGGTAAGTTTATTATTCATCATTTTCCCAAAAGGACATTCATTCACGTCTTTTTTTTGGATCGACTTAGCCGATCGAGACACACAGGCCTTGGGGCAATACAATCGGTCAAGCTGATTAGGCGTATTGACGACGCTACGAAGATACAGCGAAACGAAGTCAAGATTCGGCCCAGAAAACGCTATGGATACGATGATAAGTTACCATCGATGCACGGAATCGATCAATTACTTCGGATCAGCGGTTGGATGGCCTCCAAAAACTCTACTTCTTTGAGCCTAAGTGGGAACGATGCCCTTTTGGAGAATGATGACAGAAAAATGTCAGAAAAAAGCTATGCGTTTTCTTGTTTTGGCTCTCTGCGTCAAATTAGCGATGTATTTCCACAGACCCTTTTCGCGGCTGTGCGTGCTCCTCTAAATCATTTGGTCATGCAATACTTCTTTTATTCAAAGAACCGAATTCAATTTGATCCTATTGTTAACATAGTTTCCAATTTGGCGGCACGGAGCATAATTAAAAAATATATTACGAAGGGAACAGAAGAAAAAGAGGTACACAGCTTGAAAAAAAGAATGCGTTCTATTCTGTCAAATAAACGCATTTGTTCGAAAAGCTTCATTCGCTTGGCGAATGAAGTGGGCTTTGCAAGAAGGCTTA",mutations={["ANOAT&mit1&c_91664_94211_1"]={C={803},['-']={12,13,39,40,41,42,43,44,45,46,47,48,49,50,51,52,58,86,87,88,89,90,91,92,94,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,363,364,365,366,367,368,369,370,379,383,384,385,386,387,388,389,390,391,711,712,713,714,715,716,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,2228,2229,2230,2231,2232,2233,2234,2235,2236,2334,2335,2336,2337,2338,2339,2340,2341,2342,2613,2614,2615,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706}},["ANORU&mit1&c_91744_94291_1"]={G={1253},['-']={12,13,39,40,41,42,43,44,45,46,47,48,49,50,51,52,58,86,87,88,89,90,91,92,94,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,363,364,365,366,367,368,369,370,379,383,384,385,386,387,388,389,390,391,711,712,713,714,715,716,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,2228,2229,2230,2231,2232,2233,2234,2235,2236,2334,2335,2336,2337,2338,2339,2340,2341,2342,2613,2614,2615,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706}},["ATRAN&mit1&c_101348_104061_1"]={A={6,24,33,35,102,235,250,304,338,351,436,449,502,542,627,656,660,665,675,685,700,733,795,798,824,833,840,847,851,853,922,962,988,989,1000,1014,1031,1051,1063,1079,1114,1153,1186,1190,1234,1267,1324,1397,1553,1569,1660,1830,1846,1860,1918,2107,2116,2134,2179,2197,2266,2274,2309,2406,2450,2458,2473,2522,2595,2603,2617,2657,2713,2714,2715},T={14,22,25,37,61,67,69,70,74,76,256,322,360,377,378,418,419,477,481,484,499,535,589,607,609,613,615,639,724,747,821,1055,1057,1075,1105,1107,1125,1252,1276,1285,1294,1304,1414,1450,1697,1711,2028,2086,2128,2140,2164,2171,2261,2262,2265,2314,2366,2373,2417,2455,2474,2497,2559,2649,2668},G={1,26,29,36,64,65,66,72,99,164,171,175,177,187,252,283,287,293,313,347,354,355,356,394,405,420,505,545,553,555,598,599,617,650,662,664,678,681,692,694,699,836,844,846,925,966,1029,1034,1036,1058,1077,1094,1211,1321,1432,1513,1573,1671,1741,1759,1900,1948,2064,2198,2209,2294,2353,2383,2387,2413,2443,2476,2552,2576,2578,2587,2591,2592,2597,2599,2601,2605,2650},C={30,34,71,73,97,211,359,376,478,483,488,489,534,543,564,566,571,591,645,655,677,689,904,906,964,1032,1084,1097,1100,1101,1118,1154,1315,1447,1480,1643,1715,1816,1852,1858,1863,2068,2114,2115,2249,2318,2379,2419,2434,2475,2504,2586,2647,2670,2671,2672},['-']={5,2621,2622,2623}},}}end)();
(function()addBlock{name="s3x2439",consensus="TATTATTTTACTCGAGTGAACGGCCGCCGCATTGCGGTACGCAAAAAATTTCCTGCTTGATTCTGCGATTAAAGGCCCCAGTAAAATAAAACTTTTGACTCTGTGTTTGATAGTCCGACTGTAGTTATGTTAATTGTGGTTACATTTGTAAGTAGCTTAGTTCATCTCTATTCCATTTCATATATGTCTGAGGATCCACACAGCCCTCGATTTATGTGCTATTTATCCATTTTTACTTTTTTTATGCCAATGTTGGTCACCGGAGATAACTTTATCCAATTATTTTTAGGATGGGAAGGAGTAGGTCTCGCTTCATATTTGTTAATTAATTTCTGGTTTACACGACTTCAGGCCAATAAAGCAGCTATAAAAGCTATGCTTGTCAATCGAGTAGGTGATTTCGGATTAGCTCTCGGGATTATGGGTTGTTTTACTATTTTTCAAACAGTAGACTTTTCGACTATTTTTGCTCGTGCTAGCGCTTTTTCCGAACCCCATCATTATTTTATTTTCTTGCAATATGAGATTTCATGCCATAACTGTTATTTGTATCTTACTTTTCATCGGCGCTGTTGGGAAATCTGCACAAATAGGATTGCATACTCGGTTACCTGATGCGATGGAGGGTTTTCGAAATATCTGAGGGCCCTCATGTGCCAATAGGTACATTATACCAATCTCACTGTATGCCGGAATCGTCGATCAAATGAGAGTCCCCATCGGAATGGAAAAATATCTCATTTTGGCCAATCGGCAGGAAACCTATAAAGGAAGGCCAAGCCCACCCAACAAAGTAAAGGCTGAAGGAGCTCTATAGGGTCCTCAGAGACTGTACGTGAGACCTCTTGTCCGAAATGGAATTTATTCTTGAAAAGCGAAGCTGACCAGATTTAACTAAGATACGAAGCATTCTTTTGTCGTGAAGATTCGATCATCTTTTTTTCTAGATTATATAGTCTAGATATGCAGGTCTTATGGAATAGAAGGATCCGTATAGGGTTTGGGCATGTAGAAAACCTTGTATTGAATCAAATCAACTCCTCATCAGTTTGGTTATAAGCTGGAAACGGAAAAAAAGGAATAAAAGAGTATATATATTGTTTTTTTCCAGCGCGGCCTGATGTTACATCCCAACTTTCCGCCTGAGCCCAGCCTTATTGTCATCCTCACTAAAGCGCCGCGCGCTGAATCTACCAGGATGCAGTTTAAAAAAGCTTAAATATTTTTTTTTGCTTTGCGAAATATATCTATATACTCGCGAAAAGCGTTGGGAGGATGGAGCTGAGACGGTGTCTCATGTATAAAAGAAGAAAAAACATCTTAGTTGTTAGGGACGCAGCGGCCATCCGTAAGATTCTTGGGAGAGTCTCTATTTCATAAGTGGAAGATACAGTCCCTACTCTTGCTAGGCTCATCAGCTTATTACCTAATGCTCTAAAATAGTATTTCTTTGCCTTATGGGAGCGTAAGAGATTATTAAAGAGTAGCCCACTCCAGTATCTGCTTTGATTCATGCAGCTACTATGGTAACAGCAGGCGTTTTTATGATAGCAAGGTGCTCCCCTTTATTCGAATATTCATCCACTGCTTTGATTGTTATTACTTTCGTAGGGGCTATGACGTCATTCTTCGCGGCAACCACTGGAATATTACAGAATGATTTAAAGAGGGTCATAGCCTATTCAACTTGTAGCCAATTAGGCTATATGATATTTGCTTGCGGTATTTCCAACTATTCCGTTAGCGTATTTCATTTAATGAATCACGCTTTTTTTAAAGCATTACTTTTTTTGAGTGCAGGTTCAGTGATTCATGCCATGTCGGATGAGCAAGATATGCGTAAGATGGGAGGGCTTGCTTCCTTGTTACCTTTCACTTATGCCATGATGCTTATAGGCAGTTTATCTTTAATAGGTTTTCCTTTTCGTACTGGATTTTATTCTAAAGATGTTATTTTAGAGCTCGCTTATACTAAATATACGATTAGTGGTAACTTTGCTTTCTGGTTGGGAAGTGTTTCTGTCTTCTTTACTTCCTATTATTCTTTTCGTCTACTTCTTTTAACTTTTTTAGCACCAACAAATTCATTCAAGCGAGACATCTTACGATGTCATGATGCGCCCATTCTTATGGCAATCCCTTTAATCTTTTTGGCTTTTGGAAGTATTTTTGTAGGATACGTGGCCAAAGTGTGACCTGTTAGCCCATAAGTCACTCCTGTGACGAAGCGGCTGTTGCTCACTCAAAACGAAAAAATAGATTCTTTTTCGTGTTAAGTGGACAATAATTGAGAATTGGATGCGGGCGAAATTCCCGCCAATGGCTGAGATGTTCAGTCGACTCTTCTTCCCTTTGTAGGAGGTCCGGCAGCCCCCGAGTTGAAGGTGAGCAAAAAAGGGAGGAGGAAAGAGGCCTTGGTGAACCACTATAAGTAAACAA",mutations={["ANOAT&mit1&c_44096_46476_1"]={C={2165,2325},['-']={511,635,721,722,723,724,725,943,1034,1035,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1230,1252,1253,1315,1340,1341,1342,1343,2248,2249,2250,2251,2252,2253,2270,2271,2272,2273,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343}},["ANORU&mit1&c_44156_46553_1"]={['-']={511,635,721,722,723,724,725,943,1034,1035,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1230,1252,1253,1315,1340,1341,1342,1343,2248,2249,2250,2251,2252,2253,2270,2271,2272,2273,2343}},["ATRAN&mit1&c_49645_52071_1"]={A={207,254,350,576,618,673,745,752,779,818,851,875,911,929,955,969,1011,1016,1037,1039,1052,1069,1114,1115,1238,1247,1269,1271,1330,1460,1461,1612,1633,1654,1729,1897,2092,2152,2256,2258,2260,2279,2377,2383},T={20,55,70,114,115,167,173,200,227,246,247,257,260,275,479,552,561,564,604,631,639,647,650,659,670,674,690,716,717,720,780,849,876,921,928,971,1026,1042,1047,1062,1063,1065,1066,1067,1131,1148,1153,1161,1167,1178,1200,1254,1256,1257,1273,1287,1426,1442,1448,1561,1584,1606,1627,1693,1711,1873,1882,1925,2051,2057,2075,2137,2228,2257,2259,2262,2316,2364,2371,2372,2374,2381,2425},G={14,42,85,197,344,704,766,788,870,883,899,925,953,963,1013,1072,1075,1120,1130,1139,1165,1187,1333,1455,1472,1777,2274,2275,2282,2382,2433},C={8,53,188,232,431,437,482,506,640,702,734,865,867,893,909,927,1018,1061,1076,1158,1170,1206,1215,1216,1233,1290,1389,1427,1513,1580,1657,1723,1750,1774,1785,1789,1900,1918,1939,2017,2052,2060,2147,2242,2246,2368,2379,2426},['-']={514,934,935,1020,1021,1022,1023,1275,1276,1279,1308,2348}},}}end)();
(function()addBlock{name="s3x2428",consensus="AGCACTTTTCTCGTTTCTCCCCTTTAGAGACGAATAGAATAAAGCGCATAACGTTGAGGTCGAAGACCCCCGAGTGAAGCGCTAAGGCTTCCGGGCTAAAATATTTGCTGCGAAAAGTTAAAAACCATTTTTTTCGCTTCCTTGGGGCGCGAGGCTAATCAAGAGCTTGCTACTACGTCCTCCTACGCTCTTTCTTCCTATTACGTAAAAGGAAGGCATAACAGCCCGCTATTTCTGAATCAGATAGGGGACAGTGCTTATATCCGTTTCCACCTGAAATAAAAAAAAAAGCAGCCAACTTATGTTCACTCCAAATAGACTCCGTTTTCATTACGAAAATTTATTACGTCAAGATTTGTTGTTAAAATTGAATTATGGCAACATTATGGAAGTTCCTAGATTGTGTAAAATAATAATAGTTCCAAAGGCACCCTCTAATTTGATAAAAAATGTAAAATTAGCTATGGAGATTGTTTGTGGTCAAAAATTCATACGGACACGAAGCAGAGATTCGGCAGGAAAGTCGTTTCGATTTAATAAATTTCTATTGAATCGAGAGTCGAAAAAAGACACAGGATATGTCACTTACCTAGCACAGAGCACTCTACGGGGGCATACCATGTATAATTTCTTGGAAAAACTTATTACGATAATATCTTTTTACGATTACCCAGTTAAAGTACAAAAAAGCTCCATTCGATTATCAATGCCAACGCCGTTGTTACGATTATTTCCGGAAATACAAAATCATTTCGAGATTTTTGAACATATTCAAGGGTTTGATGTAACTATTGTTACTTCGGCCAAAACACAAGATGAGGCTTTCATTTTGTGGAGTGGTTTTCTGCAAAAAGAGGTTTAGTCATATGTCAAATCAAATTATACGAGATCATACACGTAGATTACTTGTGGCTAAATATGAATTGGAGCGAATGCAATGTAAAGCTATTTCTCGACACAAAAACCTCCCTAATCAAATACGTTATGAATATTTTTTAAAGTCGTCTAAGTTGCCAAGAAATAGTTCCAGAACACGAGTAAGAAACCGATGTATTTTCACAGGTCGCCCCCGTTCCGTATATAAGTTATTTCGCGTTTCTCGTATAGTCTCTCGTGAATTAGCATCTAAAGGTTCTTTAATAGGCATAAACAAATCGTGTTGGTAGTCAATGGAAGAAAGGTTAGCTTTGCGAGTACCCATAGGGTGCAGCAAAAAAAACTCTTTTTTGCCTGAAATAGTTTTTTTTTGCTCTACGTTTTTTGGCTTTCATCCTTTACAGCGCTGTGCGCTCTTTGGCTTCTGAATACCGAACGAACTCGACCGGTGTGCCGCGCTATGTATGCGCCCTAAACCCAAGACGGATGAGAAGTACTTGCTGGGCTTTGTTACCATAAGGTTGCAACATGCCCCACTCCTAATGAATTAGCAGTCTCGAGGCGGTTATACTGGAATGCGCGAAAGCCCCTCCTAAGCTAAACCACGGAAAAAATTATGTAGAGGACTTCGTCATCATCAGGGTTGCCTCGATCTTCCTGACTGAAGTTCTAAAATTGCCATTATAACAAGAAGAATGCGGTCCTGTTTCCAAAGAGGTCAGGACCGAAATAATGAATAGAAAGCAGGGTCCTTTAAAATGAAGGATATTGAAACCACGGGCTTCGCCCCAAGTTCAAGAAAATCTCGCCGGGCGTAAACCATTATTGTATCACAATCCTACCTAACTTACAAAGTGTGGCTACTTTCTCTTTGCGTATTAAAATGCGCGAGTTGATGGCGTGGAATAACTCCATTGCTAGAATTCTACAAGATTTTAATCTTCTCTCAAGAGATTAGTCAAGTTACGCGCAAATCTCATCCGCTGCAATAAGCAGGCAAGGAACTCATGTTTCGTGCAGCGTGCTCGAATGAGCGTACAAGAAAATATCTATCCGCCCGCGTTTACTAATAAAATATACGATTCTACCGCCTCCGTCACCTTGAAAATGACCAGAGATCCATCGAAGCAGCTTTTCTTCAACATAAGAACTTTCAAACGCGTAATGGTCAAATCCCATGAAATAAGAGTTCAACCTATACCCAAGTGAAGGCCAGAGCTCTTATTAGAAGCGCCGCAAAATACTTATAAATAGAATATCTCCATAGTCTACCGTAGGTGCAATTACTGGCGTGTAGTCTATAAAGAGGGTGACTATACGATAGATAACTGGTGAATCTGCACCACATGAAACCTCGGTCAAAAGGTCGCGGCCGGGATGCTTTTAACATATAACCTTTGCATGCTACTTGCCATCAGCAAATCACGCGAAGTAATACTAGATTTGCGGATGAACCAAAAATGCCTTGAGAGCGCCCGCGGACGCCCGACGATAGCACCTCTGAGAATCAACTTGAGCCGTATGAAGCGGAAGCTTTCACGTATAGTTCTGA",mutations={["ANOAT&mit1&c_95698_98020_1"]={['-']={18,19,20,21,22,23,24,25,26,27,28,29,30,189,1264,1360,1361,1362,1363,1364,1365,1366,1367,1368,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1723,1724,1725,1728,1729,1730,1739,1740,1741,1742,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1834,1835,1836,1837,1953,1954,1955,1979,1980,1981,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2014,2015,2198,2220,2221,2222,2227,2228,2229,2230,2231,2232,2233}},["ANORU&mit1&c_95778_98100_1"]={['-']={18,19,20,21,22,23,24,25,26,27,28,29,30,189,1264,1360,1361,1362,1363,1364,1365,1366,1367,1368,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1723,1724,1725,1728,1729,1730,1739,1740,1741,1742,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1834,1835,1836,1837,1953,1954,1955,1979,1980,1981,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2014,2015,2198,2220,2221,2222,2227,2228,2229,2230,2231,2232,2233}},["ATRAN&mit1&c_105793_108165_1"]={A={2,12,71,124,144,145,146,150,152,155,227,234,236,249,275,441,494,514,544,561,597,609,612,633,675,679,689,698,777,801,820,890,925,1179,1191,1219,1221,1268,1296,1313,1319,1324,1434,1457,1482,1545,1592,1597,1598,1602,1610,1640,1680,1690,1763,1779,1801,1838,1851,1865,1882,1897,1907,1977,2087,2184,2195,2201,2224,2324,2345,2363,2405},T={1,3,16,36,69,70,81,125,139,181,182,203,214,263,269,270,560,670,715,753,844,958,967,1057,1069,1108,1175,1197,1230,1238,1251,1254,1271,1287,1308,1318,1323,1464,1465,1483,1525,1579,1585,1600,1626,1636,1663,1665,1682,1685,1902,1911,1917,1936,1956,1966,2018,2050,2052,2089,2156,2166,2189,2209,2235,2243,2249,2330,2348,2352,2380,2387,2394,2426},G={11,13,49,50,156,167,239,245,284,415,445,596,709,765,773,904,927,1015,1018,1060,1168,1169,1200,1265,1289,1315,1371,1442,1484,1488,1489,1605,1607,1611,1633,1637,1721,1758,1759,1805,1829,1908,1938,2012,2031,2063,2090,2118,2157,2180,2200,2239,2297,2306,2315,2334,2357,2371,2372,2385,2403,2407},C={14,53,268,274,288,369,377,534,840,892,932,946,994,1205,1260,1290,1294,1298,1327,1373,1385,1386,1391,1495,1499,1519,1524,1528,1534,1617,1629,1674,1747,1754,1755,1782,1786,1796,1860,1884,1887,1958,1971,2035,2053,2065,2082,2103,2150,2163,2187,2255,2259,2266,2341},['-']={197,290,1393,1394,1395,1396,1397,1398,1399,1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,1431,1564,1565,1566,2107,2108,2109,2128,2129,2130,2178,2179,2366,2367,2368}},}}end)();
(function()addBlock{name="s3x2310",consensus="CCTAGAATGAAAAGGAGGAATGAAGGGGTACTTGCAGTGCAAATTTTTGGTCTTGCATTGAACATCCAATGGACCTTGGACTAAATGGCCACTGCCTGAAAGGACTATGTCCAAGAGACCACCCCGCAAAGTACATCTTGCGCCTATGGGCCGCTATAACTATCCAATACACTCGAAAACTGGAAAACTCTGGTAGGGCTCCCTTGCGGCGGGCTGCCAAGCTATAAACCCAACGAGAGTAGGATTCTCTAAAAAGCCAAGGCCGCAGAGTGCAGCCAGCCAAAATAGATTTCTTTTCGCAGCATTTTTATTATGCCCACTTGGAGATTTAGAATTTCAGTAAAAACTGGAAAGGAGAATAAGTTATGAGTAGGTTCTACATAGATACCCAAACGATACCCTGGGAACAAATTCCTTGGCCCAAGGTCGAGGCAGTTGTTTTTAAACTCCAAACCAGGATTTACCAAGCTTCTCGCTTCAACGATATGGACAAGATGCGTGCTCCGACAATATGGACAAGATGCGTGCTCTACAATTTAGACTCATACGAAATCTACATGCCAGACTCTTAGCCGTAAGACAAGTTACGCGGGAGAACCAAAGGAAAAAGGACCCTGACATTTACAAGAAGTTGGTTGCCTCGGGATCACAAAAAATAGAGATGGCAAGAGGTCTTCAATTGGATGGAAAGGCTACGCCCGTTCGTCAGAATGATAATAGCAAAGCCCCGAAAAGAAGAAGAGCACCCCAGAAAACTACGAGCAAAAAAAAAATCTAGATTTTGTTGCGCCTTTTCTGCACTAGGCGCAACAAAACGTAGAGTCAATCGAGGCACGCTTTGCGCCTGGAAAATGGAAAGCAAAAAACAATCTATATTTTTTTTTTCGAACTAAACTTCGCGTCTTTTTCTCTTTTTGGCCCATTTGCGTTATTGAAGACAGAGCGAAGCAGGCTTTAATCAAAATGGCCTTAGAAACTGAATGGGAAGCCCGCTTCGAACCCAATTCTTATGGATTCAGACCCGGACGAAGCTACCAGGATGCCATCAAAGCCATATTCGACGCTATTCGAGCCAAGCCCAAGTATGTTTTGAACGCGGACATTTCCAAATGTTTCGATCGCATCGACCACCAAGCCCTCTTGAACAAACTGAAAACTTTGCCTAATTTAGCCAAACAGGTCGAAGCCTGGCTTAAAGTCAACCTCATGACCGGATTAGGAAATAATGCTCAGTACGCGGAAACCATGGAAAGGGGCACCTATCGCGTGATCTTTCCACTGCTAGTCAACATTGCTCTCCATGGGATGGAGACGGCTTTAACAGAGTGGTCACTGGAAGCATATCCCAAAGGACCAACTCCGATACTGGTTAGATATGCCAACGACTTCGTTGTACTTCACCAATCCGAAGAGATCATAGAACAAGCTCAGGCATTCCTGAGGGAATGGTTAAAGTGCATGGGACTAGAATTGCACTCAGAGAAAATCCAGGTAGTCGACACTGGATCCGGGTTCCAATTTCTAGGGTTTTCAATCAATCATATCTGGAAATGGGGCAAAGTTAGAACTTTAATAACTCCGTCTCGTGAGTCTCGCCGGAGATTTCTCGAAGATATGCGACGGGCCATTCAATTGTCAAAAGGAAAAGCAGCCTACCAACTTATCATAACCCTAGTACCCCGAATAGTAGGATGGGGCAACTACTTCAAATACTCTGAATGCAACAATCTATTTCGAAGATTAGACCATGATATCTTTCAAAAAATCCGGGCATGGGTATACCGACGGCATCCGACATGGGGTCGTGATAGAATCAAACAAAAGTACTTCCCCGAAAAGAGAAGCTGGCTCTTCAACAAGAAAGTATACCAAGATAACTGGATTTTGTACGACTCTCGCACAACGGCCTTCGGGGTGAAAAGAGAATATTACCTGGTCAAACTGAGTTGGATAGCTAGCCACAAGCACATGTTGGCAAGACAAGATAAGAGCCCGATAAAATGAAAAGCCGCGTGAAAAAAGAGCGCAACAGCAAAAAAAATCTAGATTTTTTTTTTGCTCTTGACTTTTCCGTTCTACTGCGCACCTCTAACGGAACTACTATCTACTGAAATCTAAAGGTTCCAAATGCGGTAACCAAAAAGCTGAAAGGGCTCTTTCTTTATTACATCGCCCAAACATGTTAGAAAACCATGAGAGCCTAAAAGTAGAGCACATCAACGTGAAATCCTTGTGTGTTCGTAGAGCACAACCTTTAACTTATGAACAAGCACTGCCATATTGGAGACAAGCAAGAAGACGTAAAAATTC",mutations={["ANOAT&mit1&c_46531_48789_1"]={['-']={24,174,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,710,828,1236,1237,1238,1239,1240,1241,1242,1243,1244,2040,2146,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255}},["ANORU&mit1&c_46608_48867_1"]={['-']={24,174,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,710,828,1236,1237,1238,1239,1240,1241,1242,1243,1244,2146,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255}},["ATRAN&mit1&c_52126_54400_1"]={A={16,75,116,169,292,588,590,631,636,637,642,700,712,737,759,774,866,876,908,927,1061,1125,1142,1151,1158,1182,1248,1313,1335,1351,1377,1392,1407,1431,1491,1497,1521,1589,1597,1680,1681,1728,1769,1810,1856,1921,1971,1972,1973,1974,1978,1983,1994,2072,2082,2097,2120,2123,2131,2162,2164,2167,2198,2199,2200,2220,2245,2283,2285},T={4,17,21,94,206,231,279,287,316,317,504,543,567,719,728,771,836,854,920,926,1052,1059,1060,1145,1149,1250,1252,1259,1289,1481,1535,1567,1616,1634,1664,1670,1724,1896,1910,1970,2002,2045,2057,2071,2088,2142,2170},G={5,6,10,11,12,23,115,185,227,253,268,332,360,444,570,576,601,629,645,687,714,730,744,752,764,799,802,810,935,956,957,962,1029,1033,1131,1165,1200,1246,1261,1263,1359,1408,1409,1413,1453,1484,1505,1562,1673,1688,1723,1736,1763,1857,1858,1919,1962,1977,2005,2017,2019,2020,2022,2058,2077,2135,2178,2197,2208,2264,2279,2292,2301},C={57,85,224,239,270,296,447,558,599,667,803,845,901,913,914,923,924,925,932,944,958,969,1007,1089,1168,1227,1268,1273,1274,1285,1502,1751,1790,1854,2001,2004,2050,2054,2068,2089,2141,2143,2193,2211,2233,2261,2308},['-']={175,505,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,529,530,531,532,533,534,535,536,537,707,831,2040,2118,2158,2159,2160,2161}},}}end)();
(function()addBlock{name="s3x2261",consensus="GTAATCAAGTTCACTACAAAGAAAAAACATGAATACTTTGTTGATTGATTTGATTAGCTCGCGTTTAGGTTTTACTGCCAAAAAAAAAAATCTATATATAGATTTTGTTTTCTCATTTCTCCCAATCTATTGGCTCCATCCAAAAAGCGAAAATGCAGACGTTATTAAAGGTCGCTCTTGGTGTAGGTGTAATGTTGACCAGGTACAGAGTTTTTGTTTTTAGTTGAAAGCGTCATGGATTATCGTAGGTAAATGAGAAAAAAAGTGGCACATAAACGGGCCACAGGCCGCAAATTGTGCCACTTTTTTTTTCTTTTTATTGCAGCGCAGCTCTGGCTGACTATTTTTCTTTGAAATAATTTTGTCCCTTTCGTCTAGGGGTATAGGACATCGTCTTTTCATGGCGAGAACACGGGTTCGAATCCCGTAAGGGATAGCCTTACTTATAATTACTATGCTTGCTCCGAGAGCCAAGCGAAATGAGCTTTCTAGTGCACGTAGGAATTTTTTGTTTGGAGAAGAAAAGGACACAAAAAATGGAAAAAAGACTTTTTTTTCAGTGTCTTCGCTCTTTATTCCAGTTTTTCACCGTTCTCTTCTATTATTTCTCCCCGTGCCCTCATGATGAACGAAAATCGTGGAGAGCATAGTGATGAAAGGACGCAGGATATAGCGGCCAAAGGCCCCATTCCCGGAACGAATAGAGCATGAGAAATAAAAAATAAAAATTTTATGCAACTTTCTAAGAAAAACCAAGTAAGTGAAATATGCCTACAATAAATCAATTGATTCGTCATGGTAGAAAGTCAAAACGGCGCACACAACGTACTCGAGCTTTAACCCAATGTCCTCAAAAGCAAGGAGTATGCCTGCGTGTTTCGACGAGAACACCAAAGAAACCTAATTCAGCTTTACGCAAGATAGCCAAAGTACGTTTAACCAATCGAAATGAAATAATTGCTTACATTCCCGGCGAAGGCCATAATTTGCAAGAGCATTCTGTGGTTATGGTTAGAGGGGGTAGAGCGAAAGATTTGCCAGGTGTAAAATACCATTGTATTCGAGGAATTAAAGATTTGCAGGGAATACCGAGTCGACGTCGAGGCAGATCTAAATATGGTACAAAAAAACCCAAAGATTCTATATGAATTTATTTGTCAAATCATCAAATTTCAGCTTTGTGTTTGGTTCATCCTCTGATTGGTTTCACCAAGCAAGACTTTCATTAAAGGCAGGGATCAAAAAAAAGGAAAATTGGCTAAAAACTTGGTCATTTAGCGGAAAAAATCTATTTTTTTTTCCAGAAAGCTTTTTTGCGCGTCGTTTATCGCATCGTAGATATTTATGCCATGCCCTGGAAGGGCATGTGCTATCAGGACCTAAAGGTCGTGGAGCAAGCATATACAATAGCTCAGACAATTTGGGCTATATCCGGGGCTTGCATGGTAAACAGAAACAATTAATAAAAAAATTGGTCCATATTTGCATGATTAATGGTAGAAAAACGAGATCTCGTGCTATTGTTTATAAAACTTTTCATTGTCTAGCTCAGCATGGCGATATATTGAGACTTTTGGTTAATGCCATAGAAAATGTCAAGCCTGTTTGTGAAGTGAAAAAGGTAAGAATTTCTGGTACTACTCAATTAGTACCATCTATTATGGCAGCAAATCGTCAAGAGACCTTAGCCATTCGTTGGATGCTCGAAGCGGCAGCCAAACGACGTATTAACAAAAAAAGCATGAGCTTAGATCAATGTTTAGCTGATGAGATATTGGATGCTTCCCGAAAGATGGGGATTGCACGTAAAAAAAGGGATGATCTTCATAAACTGGCTCAAGCCAATCGTAGTTTTTCGCATTATAGATGGTGGTAAACTATTTAGAGTGTAGGGAAAAAAGGGGATCAGGCGACGAGGGAGGCGAAGCGCAGTTATTTAGAAACTTTTATGCGCTTCGCCCCCTTTTGCCTCGTCCCATTCGGGGATTGGGGAGAGAAAAAAAAGGCCAAGCTTCGTTATGCGCTTGGCTACTCATTTAGAAGGATCTCATGGCTTTTATCATAATGAAACTATTCGTCCCTTCTTAGAATCAGACATTGAGCGTCTCAGCTCAAGATAAGCCTGCTTTTTCTCCCGGGCCGCATCAAAGTAAGAGTTGCGAGAAAGTGGGCGCAGCAAAAATCTATGGCGACCAAAGAGAACTTTTGTCAAGGCGTTTCTGCGGGGGGAAGGGGGGAGGAGTATCTGCGGCCTCTTCGTC",mutations={["ANOAT&mit1&c_55827_57990_1"]={C={1948},['-']={12,13,14,15,16,17,18,19,20,27,28,29,185,186,187,188,189,190,215,448,449,450,451,452,459,460,461,462,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1270,1883,1887,1931,2121,2122,2123,2124,2125,2129,2130,2131,2132,2133,2134,2135,2136,2137,2150,2213,2214,2215,2216,2217,2218}},["ANORU&mit1&c_55905_58068_1"]={A={1893},T={1356,1948},C={1357,1358},['-']={12,13,14,15,16,17,18,19,20,27,28,29,185,186,187,188,189,190,215,448,449,450,451,452,459,460,461,462,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1270,1883,1887,1931,2121,2122,2123,2124,2125,2129,2130,2131,2132,2133,2134,2135,2136,2137,2150,2213,2214,2215,2216,2217,2218}},["ATRAN&mit1&c_61065_63201_1"]={A={9,30,36,39,40,41,42,44,46,77,78,125,126,140,148,196,205,237,248,253,278,340,348,465,467,470,476,480,530,586,613,623,630,642,659,703,746,1018,1101,1226,1234,1236,1366,1375,1416,1423,1441,1444,1452,1499,1566,1620,1662,1666,1680,1710,1787,1891,1932,1933,1935,1947,2099,2153,2183,2220,2225,2228,2231,2232,2242,2244,2248,2252,2254},T={6,11,31,35,47,79,80,100,106,128,135,136,139,172,198,199,464,528,538,546,578,598,609,611,612,617,620,626,629,684,694,714,841,1003,1166,1176,1248,1300,1319,1348,1408,1425,1551,1762,1833,1918,1939,1960,1980,1984,2046,2066,2079,2080,2089,2180,2187,2188,2189,2209,2210,2221,2222,2223,2224,2226,2227,2233,2234,2235,2239,2247,2250},G={4,38,81,110,147,166,204,246,250,269,273,292,355,533,579,600,624,632,669,707,716,717,718,722,892,952,1045,1067,1167,1225,1229,1233,1239,1244,1316,1392,1492,1623,1665,1728,1733,1737,1915,1965,2085,2112,2116,2142,2154,2164,2245},C={134,178,320,337,341,351,441,446,498,512,513,537,561,569,583,584,592,597,599,650,651,660,836,850,1296,1314,1323,1370,1400,1524,1578,1978,1983,2000,2010,2054,2106,2117,2238},['-']={53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,90,91,92,261,262,263,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,514,515,516,517,520,553,1898,1899,1900,1901,1943,1944,1945,1969,1970,1971,1972,1973,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2008,2009,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2144,2190,2191,2192,2193,2194,2195,2196,2197,2198,2199,2200,2201,2202,2211,2259}},}}end)();
(function()addBlock{name="s3x2202",consensus="TATTTTGATGATGGGAATATTCTGGCTTTTTATGAAAAGTAAGGTAGACTAGAAAAGCCCTACGAATGAAAGGAAACTTAATAGGTAATAATCTGGGACTTCAGTACTCTTAATGTTTGGAGCTTAGGAAAGTGTTACGCATAGACGAAAAAAGAAAAAGAATCTTATTATCTTTATTTAGTGTGGAATCTTAGGTTTAAAGTTCAAAATATTTTCTATTTTAAAGGTTGTTTAAATGAAATGACATAAAACAACCACACAAAGTTTTCATAATTCTCTGTCATTTTGGCAAAACGAGGACCTGTAAAGGCTGTTGAAATAGCTGGTAATGCCATAGGCGCTTTTATTGCGGCAGGGGTACTCGGTTGTACGTCACGTACATGAATAATTTGAATAGAGCGAATGCATTAGAATTCTGAGAAAAAAGCCTAAAATTGAAAAAGCTAAAGTTCAATTAGAAGGTACTTACTGATAAAGCTAAAAACACGGATCAGCTTTTGGAAGAAATTGAAGAGCGTTAAATGAAAGAAATTAATGCTTGTTGGTTGGGTAGTAAAAAAAAGGAGTACTGATGAAGAATGAACAGCCACGTCTAGATGATGCTGTTTAGCATGTAGTAGAAGCTAAATACGACAAGCTGCAAGCTGAGGGTAAGGGTCTTTGCGCGACAAGATTCAAAACCCTAGAGATCAGTATGCGGAACAGACGACCATGGAAGAAAGACCACAAGTATCATAGGCAGAACTTCAACAGGCGCCTAAAAAAAAATTACCACCTAAATTATCTATTAAGTACCCTGTCCCAAACGCAAACTTCTTCGTTTCTATAAGATATGAAGATATTTTGGTTTTTCGAAGAGCCATCGGGAATTTAGGTTTTTCTATTTATCGAGTTTAGCAAGTATATCTTTCTCTTAGGATTTAAATCCTATTAATTTGAACGTAGAGTTGTATGATGCGAAACTATCACTTACGGTTTCAAAGGGTGGGTTTACTCTTAGATTTTTTTATTTTCTGGGTTTTCATGGGATCATTATCGCGGGTTTGTCTATCCTAATGGGCGTCTAACAAAAAAATCTATATTTTTTTTGTTGGTTGGTCCTTTTGTGGGGCCTGTCGAAGGGCCGAAGTAGTTCTGAAAAAAACAAGAATATACCAAATGAGTTTGAAAAATACATGGCTATTTCCAATTGGTTATTGTGACGCTGCGGAACCTTGGCAATTAGGATTTCAAGACGCAGCAACACCTATGATGCAAGGAATAATTGAGTGCGCCTAGATATATCATCACGGTTGCAGAGCTCTGCTCCAACTCTGCCATATCTGCTCGAGCTGGCTATCGCCAGGATGTGAGCTACACAGGTGGGGCATCCTTAGCAATAAGATTGCCCCGAAAGCATCATGTGAAACTCGCAGAACATTGAGACTGCCCTCACTAGGATGCTTCGACAAGGCATAAGGAAAGATCAGGATAACAAACTTGATACGTGAATCTAGTCCATCCAATTCTGGGCCGTATGTCTGAAGCAGAATATCGGGGCATACGCGTGGATAGTAAGCCTGCAAAACGGCCGAACTCGCGCTCGATATCAATTACGAACACGGGACTTGAGTTCCCACGTAGCACTCTATACGAGAATAGCCCGAGAAATCAGGCATTCACGCAAGGATCTAACCCTTGAGGAGATAACAAATCCGTGATGGTGGAAGCTGGGGAACTAACTCCCTGTACAAGGAGAATTCAGAGATCCCGTAGTAAGAATGCATAGTTTTAGCTATTAAGGGGATCAACCTAAGACCGTTTCGTATCCTCTCTGAGGTATCGGACTATAGAAGGGGCTTTGAACAAAAAAAATATATCTATTTTTTTTCCCGTGTCCTTATCTCGGTCAAGAGGCGGATAAAAGCCTGTAAATGCGAGAATGAAGCATACAATGGACTGTTACGCGCTCAACGATACCATCATCTTAATTACGTGTTACGAAGCAATCAGTTTATAGCCTCGATGATGCCACTGCGCAATAGTTTGTGGAATAAAGCAAGCAAAAAAAAATCTATATAGATTTTTTTTTGCTTGCTTCTGTGCAAGCTTCCCTGCTGACTGATTGTCCAACACATGCCCACTTTGTTCGCTTCGCGAACAAAGAAAGGTGCGCGTAGCGCCGTTACGTTTCATATTTTGTTTTGGAGAAGAGTGGCAAAG",mutations={["ANOAT&mit1&c_63148_65289_1"]={['-']={37,357,377,378,379,380,381,382,383,384,385,386,676,677,678,679,680,681,682,683,684,743,744,745,746,747,748,749,750,751,912,913,975,976,977,978,979,980,981,982,1080,1081,1082,1681,1682,1683,1684,1685,1686,1687,1688,1689,1822,1823,1824,1826,1845,1862,1863,2194}},["ANORU&mit1&c_63226_65367_1"]={['-']={37,357,377,378,379,380,381,382,383,384,385,386,676,677,678,679,680,681,682,683,684,743,744,745,746,747,748,749,750,751,912,913,975,976,977,978,979,980,981,982,1080,1081,1082,1681,1682,1683,1684,1685,1686,1687,1688,1689,1822,1823,1824,1826,1845,1862,1863,2194}},["ATRAN&mit1&c_69193_71335_1"]={A={3,19,38,42,46,59,67,118,237,295,297,298,315,332,339,341,363,367,391,396,405,426,436,470,503,547,563,573,580,604,607,616,631,656,666,675,699,704,710,713,714,717,755,784,874,993,1039,1075,1076,1328,1451,1535,1615,1633,1646,1702,1705,1717,1892,1894,1898,1915,1917,1926,2006,2029,2063,2072,2114,2165,2167,2168,2197},T={18,23,24,51,72,101,133,136,137,145,153,159,180,204,242,257,275,277,281,360,362,370,371,373,464,491,494,523,562,595,706,707,772,794,823,863,880,888,897,904,949,972,1013,1022,1030,1099,1124,1162,1342,1408,1571,1625,1643,1679,1725,1798,1808,1811,1831,1885,1896,1931,1938,1953,2013,2016,2018,2038,2060,2079,2081,2092,2093,2102,2108,2109,2112,2134,2173,2195},G={20,21,25,50,65,70,73,80,88,89,122,130,207,233,292,294,299,306,317,328,353,375,415,425,433,437,439,484,485,505,506,518,519,525,553,574,577,642,672,694,703,722,868,895,924,1065,1066,1138,1279,1343,1383,1449,1594,1621,1634,1732,1846,1879,1893,1899,1920,1969,1982,1986,1997,2004,2039,2089,2169},C={4,27,29,30,31,39,40,41,68,77,86,107,110,113,116,174,214,227,343,346,389,414,416,435,507,576,605,632,645,673,761,799,814,821,822,841,842,845,847,869,877,892,896,902,907,919,920,969,998,1002,1035,1043,1044,1046,1064,1094,1098,1114,1172,1192,1197,1319,1483,1508,1522,1613,1667,1727,1729,1820,1829,1833,1835,1941,1947,1957,1961,1966,1970,1992,1993,1996,2035,2104,2116,2163,2166,2170},['-']={6,12,13,14,15,16,250,450,452,453,454,455,456,457,458,511,512,513,646,647,648,649,650,1051,1052,1053,1054,1101,1102,1103,1104,1105,1106,1107,1496,1497,1498,1499,2042,2052,2053,2141,2142,2143,2144,2172,2175,2176,2177,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187}},}}end)();
(function()addBlock{name="s3x2124",consensus="ACGTGTGGTTCTAACCGGGGGAGAAAAGCATGAGAGGGCCCGCTCATCCTGACAAATACAACAATACTGTATCCTGGGTTCAAATCCCATTTTCTCCGTAGGGGACGTAGTTCAATTGGTAGAGCGCATGTTTTGCAAGCATGAAGCTGTCGGTTCAACTCCGATCGTCTCCAAATAAACAAGTGATATATTGTAGAAAAGCAGTATAGGTGCTTGGATGAATTACGCTTTCTACTAGCTGCAGGAGATCTCGTTATGCTTTGCACTTTGACTTGACTTTGGAGAAAAGAATCTGGAAACCAAACGGAATAATTTGTTAAAAGAGAATAAAACGTGTTGAGGGTAAAGATGGAGGACACGTAGCGTTCTTCTAACGCTGGCAAAATATAATTTTGGCTGAAAGAAAAAGAGAAATAGTTGGCTGTGCTCTATGCTCGGATAAGTAGAGAGTTGGCGCCCTAATGCGATAAGGGCCGCGGGCAGCAGTGCCCCCGGATTCTTATTCCTCTCCCGTTCGTGTCCCGCCTCGCAAAGCTACGATGTTTCGGTTTCACGGGCCTTCAGGCTGCGAAGCAGCCGAGCCGAGAAACAGAAACATCGTAGTGTGAAGCCAGCAACTGGCTCGAATTACGGTATTTTTCTACCAGTAATACAAACAGTGGCTATATATTGGCCTGCGTAGCTCAGATGGTAGAGCATTCCCATGGTAAGGGAAAGGTCTCCGGTTCAAGTCCGGTTGTAGGCTCTGTAAAGAGAAAAATGATTAAATATGGCTAAAACCAAACAAATCAAAAATTTTACTTTGAATTTTGGACCTCAACATCCTGCTGCTCATGGTGTTTTACGATTAGTATTGGAAATGAATGGAGAAGTTGTAGAACGCGCGGAACCGCATATTGGATTACTTCAGTGCGGCATGAAGCCGCTGACGCCGAGTCGGCATATCCTATGCCGCTAGCTATGTCCTGCTCGTTCCCCACCACGGGTGGCGCGTGGAGGCAACTCCCGCGTCATAAGCACCGGGCAAAAGGCGTTTTGTTGGGCAACTCAAGTGAGGCAAATCGCTCGGGGGAAAGGGGGGAGAAGGTCGTGAAGGTGGCCTCGTTATCCACACTAGAGGTCTCGACAGAGATGAATAGGGGTATGTCAATACCACCACTGTGGTTGACTTACAAGTCGACCACTGGGCTTTCTTGGAAACGAGAACGCGTCGGCGGGTCCTGGAGTGCCCGTCAAGGGCGCACGCGTATTCCTACGGGGTGATTATCACGACCAGCCCCTCCGCATCTCGGCACAGCGGAACGTGTAACCGGCCTAAGGTCCCATTTCAACCGCCAATTCATTGTCCCTACAATGGGTAGGCTAACCACAAGGTACGGGCCAGAACCTTATAGGTCGGGTAGGACGGCACTACTGGCAAATACTATCTAGCAAAGGCACGAGTCGTGAAGGATAAAGCTTGCGTCAAAAGCATACGGAAAGATTCTAGCAACAAGGAAACCGGAGGAGGAAGCCGGTAGAGCTGCAGGAGCATAACCGGAAGGTCAAGCCAGGGAGGCCGGGTCATTTAACGGAAGTGGAAAGGTTCGAATCGAGGCTGAAAGAGAAAGGGAGAAATAGGTGGTAGCTCGTAGGACCCCACTGTAGTTGAAACGCAGGACCATAGGGGCAAGACTGCGGGTGTTGGATACGACAGATGGCGCTGCCTAAACTTCATGGAATTCCATGAACTAGGGAAACAAGCAGTCTCAAATTTGCGCATGCACATTTCCAAGCTACCAAAACGGCTGCAGAGCATAGCATATATATCTATTTTTTTTTGCAGGCTTCAGACTCTTCTTTATTGAATCTCGGGCCACCTGTAATAAATGGCGCGAGCCGTATGCGAGGAGACTTGCACGTACGGTTCTTAGGGGGGTTCCGGCCGAAAGATCGGCGCCTACCCGACTAGAGGCACAGAAAAATTAATCGAGTATAAAACTTATCTTCAAGCTTTACCTTATTTTGATCGTTTAGAGGGCGACCGCGAAGTCATCGAATGAACTCCTCCAGAATGGAGGTGCTGCAGAAACCCGCAGCAAAACAGATACGACTAATCGACATATAGAATATGGCGACGACGAC",mutations={["ANOAT&mit1&c_87111_89145_1"]={['-']={43,317,318,319,320,321,322,323,324,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,438,439,440,441,465,468,469,470,471,498,499,500,501,502,513,514,515,595,596,597,598,599,600,601,602,603,604,618,619,620,621,622,623,624,646,1173,1174,1175,1176,1177,1178,1179,1180,1512,1605,1656,1657,1658,1659,1660,1661,1662,1663,1664,1834}},["ANORU&mit1&c_87191_89225_1"]={['-']={43,317,318,319,320,321,322,323,324,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,438,439,440,441,465,468,469,470,471,498,499,500,501,502,513,514,515,595,596,597,598,599,600,601,602,603,604,618,619,620,621,622,623,624,646,1173,1174,1175,1176,1177,1178,1179,1180,1512,1605,1656,1657,1658,1659,1660,1661,1662,1663,1664,1834}},["ATRAN&mit1&c_96691_98797_1"]={A={2,4,6,16,33,37,41,50,73,158,195,208,219,231,234,246,269,280,283,295,340,354,360,370,432,437,477,492,494,510,555,578,583,652,676,686,752,754,850,855,995,1040,1067,1196,1223,1377,1378,1379,1383,1436,1447,1481,1524,1527,1530,1542,1576,1592,1593,1613,1630,1678,1683,1684,1698,1723,1735,1739,1756,1784,1809,1852,1945,2051,2059},T={40,85,93,96,241,299,305,359,361,410,416,433,435,464,484,495,511,512,525,527,538,569,570,606,615,617,644,662,733,970,1004,1064,1066,1088,1126,1145,1269,1331,1332,1340,1341,1346,1367,1405,1445,1610,1616,1629,1655,1682,1779,1829,1835,1838,1851,2049},G={14,15,29,180,242,268,275,282,297,329,430,535,607,749,750,766,792,979,1058,1115,1127,1135,1137,1142,1147,1148,1150,1254,1316,1317,1350,1351,1368,1374,1432,1448,1449,1456,1458,1466,1478,1594,1600,1617,1650,1651,1652,1673,1687,1737,1764,1793,1796,1801,1832,1849,1887,1981,2076,2082,2094},C={49,92,187,190,204,288,342,371,424,427,436,463,519,549,550,571,616,642,670,737,917,1033,1039,1065,1144,1149,1151,1154,1253,1315,1349,1389,1443,1459,1584,1668,1675,1697,1707,1709,1722,1797,1815,1827,1844,1932,2034},['-']={22,23,24,539,540,541,640,1117,1391,1392,1504,1620,1621,1622,1623,1732,1812}},}}end)();
(function()addBlock{name="s3x1852",consensus="CTAATAACTATCTTATTGGTCGCTTCTAGCACACCTCTAACTGTTGCCAATTTATTCTATAATAATTTAATAATAGACAATTTTACCTATTTTTGCCAAATCTTTCTATTAATAAGTACGGCTAGCACTATAGTTATGTGTCTGGGTTATTTTAAAGAAGAGGGTTTGAATGCTTTTGAATCTATTGTCTTAATTCTACTTTCTACTTGTAGTATGCTCTTTATGATCTCGGCTTACGATCTAATTGCCATGTATTTAGCTATTGAGCTTCAAAGTTTATGTTTTTATGTGATTGCAGCATCAAAAAGAGACTCTGAATTTTCTACAGAAGCTGGCTTAAAATATTTTATTTTAGGTGCATTCTCCTCTGGAATTTTATTGTTTGGTTGTTCTATGATTTATGGATTTACTGGAGTTACCAACTTCGAGGAATTAGCTAAGATTTTCACCGGATATGAAATCACTTTATTTGGTGCTCAATCTAGTGGTATCTTTATGGGGATTCTATTTATTGCCGTAGGTTTTTTATTTAAGATCACAGCAGTTCCTTTTCATATGTGGGCACCTGATGTATACGAGGGTTCACCTACTCTGGTTACAGCATTCTTTTCTATCGCACCTAAAATATCTATTCTTGCCAATATGGTACGTGTTTTTATTTATAGTTTCTATGATCCAACATGGCAACAACTATTCTTTTTTTGCAGCATTGCTTCTATGATTTTAGGAGCATTGGCTGCAATGGCTCAAAACAAAGTCAAAAGACTTTTAGCTTATAGTTCTATTGGACATGTAGGTTATCTTTTTATCGGTTTCTCATGTGGAACCATAGAAGGGATTCAATCGCTACTAATTGGTGTTTTTATTTACGTATTAATGACCATCAATGTATTCGCCATAGTTTTAGCATTACGTCAAAACCGTTTCAAATATATAGCAGATTTAGGTGCTTTAGCCAAAACTAATCCTATTTTAGCGATTACTCTTGTCTATTACCATGTTTTCATACGCAGGAATACCCCCGTTAGCCGGATTTTGTAGCAAATTTTATTTGTTTTTTGCTGCTTTAGGCTGTGGGGCTTACTTACTAGCCTTAATAGGAGTTGTTACTAGTGTTATCAGTTGTTTTTATTATATACGCTTTGTGAAAATAATGTATTTTGATACACCTAAAAAATGGATTCTATATAAACCAATGGATCGTGAAAAATCCTTACTACTAGCAATTACTTTATTTTTGATCAGTTTTTTCTTTTTATACCCTTCTCCTCTATTCCCAATTAGCCATCAAATGGCACTAAGTCTATGTTTGTAAGTTGTATGTCTGATAAATAAATAAAATTTTTATTTTATAAGTTTACTATAATAAGTTCAGCATAATAGAATAGTTGCATAATCCACAAGTATGAATTGGATTCAAGGCTGAATTCGAGCAAGGCCACAGAGCGTAGCTTTTCGCGGGGCGCGATAAAAAAAAAGAATTTTTTTCGCAGATATTTTATTTGGCCTTTGCTAAAAACAAGGAAAGCACTGCGCCTCCAATGACTCTCCGTACCGTCTTATTTCTCCATCCTCCCGGTCGTTTCCAGCCCCATCATTTGTTATGCGAATAATGTGGGCACAGCACCGGTTTAATTGCGTTTCGCAGAGAAATGGCCACCGCAGCGTGAAAAAAGATGGCTGCACCTGCGCCCTGAATCATGACAAATGATTTCCAAAATATTTTTTTTAGATTTTTATTTCAAATATTTGAAGCTGCAGCCTCAAGGCCAAGCAACGAAGCGGCCCCCTGCTTTTGTTGGCTATTCCCTCCCGGTATTATTGGTCACTCTTTCCTGGTGCCTTAGGCAAG",mutations={["ANOAT&mit1&c_53509_55253_1"]={['-']={986,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1495,1496,1497,1498,1499,1500,1501,1502,1670,1671,1672,1673,1674,1675,1676,1677,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840}},["ANORU&mit1&c_53587_55331_1"]={['-']={986,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1495,1496,1497,1498,1499,1500,1501,1502,1670,1671,1672,1673,1674,1675,1676,1677,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840}},["ATRAN&mit1&c_58908_60722_1"]={A={86,162,218,227,836,922,1328,1341,1413,1424,1466,1504,1564,1644,1713,1714,1715,1806,1807},T={36,95,236,240,425,449,491,504,515,575,591,614,668,809,815,869,977,996,1119,1276,1346,1369,1417,1533,1558,1595,1804,1817,1849},G={20,30,68,111,1089,1279,1325,1399,1620,1648,1658,1700},C={8,23,41,51,109,152,209,221,293,320,323,332,368,470,632,737,740,785,866,951,990,1036,1056,1066,1255,1263,1281,1283,1374,1405,1416,1560,1633,1635,1636,1667,1810,1845,1850},['-']={983,1324,1382,1384,1385,1386,1387,1477,1580,1581,1582,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803}},}}end)();
(function()addBlock{name="s3x1715",consensus="TTTGTAGTTCACGAATGAATGAAGGTTAGTATTGTACTGCATTCTTAGCTCAGTTGGATAGAGCAACAACCTTCTAAGTTGAAGGTCACAGGTTCAAATCCTGTAGGATGCTTAAAGAAAATGCATAATGAATGAATCGATAATATATACCAACGGTACATGCATTTATCGATTGGTTCAAACCCATTAAAGGTTACATACCATACATACTACATACACGCGCGGATTGACCGATTTATAAATAAATAATTTTTTCTTTATTTTGGGGGAGAGTGGCCGAGTGGTTAAAAGCGACAGACTGTAAATCTGTTGAAGGTTTTCTACGTAGGTTCGAATCCTGCCTCTCCCATATACTCCGTATTTGAAGAATAGAGACGAAGCACTTGTTTTTGTGCTTATCCCTTCATGCAATTAAATAGGGTGGAACTTTCTCAGAAACATATTGAATGCTTTGGTATTCGAGCCCTCTCCGAACCGTACGAGATAGTCGCCCATCATACGGCTCTCTAATTCAACCTCTATTCGGATTTGCCTCTGTCGTTAGATTCTGGCTTGTTTTCCCAGTGACCGATCTCCAAGTGGCTTAAGTACCATAAAGCAACTTGCTTTTTCATTATGACGATCATGAGGAATTCTAGCAAGAGATAATAATAGAAAAAAAATGCATTTTTCATTATCTCCTCTGAGCTCGTTCCTAATACCCTGAACATGGTGCATTCTATTCTAAATCTGAATAGAATGAAGGAAGCACGAAGAGCAGTTACGCTGCGTTTTAGTCATCAAGCAAGTGATGCCATAGGATTCTTGATAGCAGAATTTATTCTGCAGTTTAGAACGTATCGAAACGAATTTTGAGATAGTCAAGGTAGGGCAGGGCTTTTGACAAGGACGCCACTAAGCTGGCATCGAAGACAGTATGGTTTTTAGTATATCCCCATAGTGAGGATTTTTCGGTTTCATATTTTGCGTGGAGTACCTCTTTCACTCATAGATTGTTTCCATGCTCCCATCTGGGTGTCCGTGATACCGCAAAAAAAATCTATATATATATAGATTTTTTTTTTGCTATTGGTTCTACTTTAACCTTCATATGAAAGTAGGTCTTCAAAACAGAAAGGCATAGCGTTTTCCATTTTCGGCTTCTCATCCTGTTTCGTCCGCATAGCAAATGACGGCGCGCAGCATGTAGATTCGTTTTGTGCTGAACTTCTTCCGATTACCGTGCTTCGTTCTATAGGGCTCGCAGTTTCTGGTTCCATCAATGGTCTCCTTTCGTCTGATATTGGTGTCATCGATTCGGATCCTGCCGCCCCAATTGGACATAAAGCATTATTCACGAGTCCAGGTTGCCCACGATGTTTTGCAGATCTGAATAGGTTTCCCTAGCTTTGCGAAAGCGGGAAATCCAAGAGTCCATTGAAAGAGCGGCAGCGCCCTACCCAATTGCTTTTCTCTTTCTTTTTGGACAAATCCTGTTTGAAACCCGTAAGGGCTTAGCTAGGAGACGTGGTTGAATATGGTCTGCTAAGGTACAGCAGACGGTTAGGCCCCTTCCCTTTTGTCGGCAGTTTTAGCGAAAAAAATCTTTTTACTACGTACAACTCAGGCGGGTACTATGGGCCCTCTGCCATCCACCTTCGGTTAGCTGGACGAAAGTGGATTTCACCGGTGTTGCCTACAGTTTTTGGCCAATTTTAATTCAAGGCCATTTTGCG",mutations={["ANOAT&mit1&c_25451_27105_1"]={['-']={666,840,853,936,937,938,939,940,941,942,943,944,945,946,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1110,1113,1114,1115,1116,1117,1118,1119,1120,1121,1136,1171,1172,1173,1174,1175,1176,1177,1242,1248,1438,1439,1440,1634}},["ANORU&mit1&c_25526_27180_1"]={['-']={666,840,853,936,937,938,939,940,941,942,943,944,945,946,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1110,1111,1112,1113,1114,1117,1118,1119,1120,1121,1136,1171,1172,1173,1174,1175,1176,1177,1242,1248,1438,1439,1440,1634}},["ATRAN&mit1&c_28278_29959_1"]={A={12,138,174,175,182,232,255,363,366,418,419,525,617,623,629,651,679,724,730,751,754,759,769,784,1014,1042,1056,1096,1223,1237,1298,1337,1382,1390,1392,1399,1400,1409,1418,1456,1464,1471,1490,1496,1501,1503,1518,1529,1563,1584,1639,1647,1703},T={178,222,355,401,459,489,492,532,534,559,561,567,568,582,641,663,664,665,680,694,700,701,702,727,729,736,763,783,789,794,825,876,889,906,982,1005,1129,1142,1144,1147,1157,1209,1241,1251,1273,1302,1303,1312,1336,1342,1349,1351,1368,1398,1451,1472,1482,1483,1484,1506,1565,1597,1640,1651},G={120,177,570,618,632,657,705,725,732,741,749,752,766,781,795,807,815,819,834,894,920,935,1001,1026,1089,1166,1183,1233,1269,1279,1296,1300,1307,1314,1316,1325,1330,1366,1401,1480,1488,1495,1590,1594,1596,1604,1652,1696,1697,1707},C={4,135,165,252,309,349,361,431,507,535,552,564,571,573,613,653,656,683,685,688,692,731,820,837,865,879,954,955,980,981,988,996,1009,1011,1132,1133,1151,1184,1194,1226,1229,1254,1272,1326,1369,1432,1436,1437,1444,1455,1460,1462,1473,1493,1525,1541,1558,1561,1570,1642,1660,1683},['-']={210,213,214,215,216,217,218,844,871,872,873,874,875,1032,1033,1034,1035,1036,1037,1038,1039,1040,1052,1053,1054,1319,1422,1457,1598,1599,1600,1601,1648}},}}end)();
(function()addBlock{name="s3x1622",consensus="TTACAAATTTATGATATAATACTATCTATGAATTTCCGTGAAGGCTCCGGCCGTAAATCTTTAATAGTAGTTATACCTTTTTTTTGTCAAATGTCGTTTGTTCCAAAGATGTCTATGAATTTAGGTGAGGGCCGCAGCCATAAATCTTTAATAAAAAAATTCAAAACATCAGAGGGATTTCTATTTATAGATCAAGCAATCTGGTTACACTTAATCTTGATATGGGTCTTAGAACCTAACCACTCGAATTACTAAGCCTGTTTTTTTTTAAGGCGTTAGATACACGAAAATAACCGCGGTGATTAGAGGATGGTGCGATCACTGCGGTCCCTTCCGCACAAATAGGTTGGGATTAGAAAATGCATGTCATATTAATATCAAATATATCACAATGATATATTTGAATTAAATGGGAAATAATAATGCTAAACAAATAGTTGTTTCTTGGAGCCTCGTAACTTCCGCTGGTAATAATCATAATCTAAGGAAAGATAAGTTTCGGAAAATTCTCGTCATAGCCTTATGTTCTTGCGATAAGGGCAGAGTTTAGGGTTAGCTTCAAGCTTCTATTACCTAGGAAAAATCGTGGACTCATTATGTTATTTTATCGTCGTCACTTCATAATATTGTCCTACTTGGCGCTTACTGTGGATTGGGCACCTTTATTCTTCATTCTTCATCCATATTTGGTTGACCTGCGCGTAAATTTGTGGTCACTTCGTGATTCGACTGCCATTAGTTGAATATGCCGGGTGCGGCTCGACAATCTACCATAGCTGGTGGCACTCATACTATCTCAAGAAGCAGTATTAACTGGGAAACAGTAATTCTATAGTAGGCTATATTTGCTAAACAAATAGGGGCCAGAACAACTAAAGGCCGCAGTGGGTCTCCGATCGAGCCCTAGTGATCGCAGAACTTGAAGTTCCGACTTGTACGGATAGAGGGACTCGAACCCCCACAAACATTATGGTCACCAGAACCTAAACCTGGCATGTCTACCAATTCCATCATATCCGCCAAAATTTGATCAAATCTGTGGAAATTTTTTTTTATTTTCTCTCTAGTTATTAGACTCTCTTAATGGCCTCAATACCATTTCAGATGGTAGCTCAAGGGCCCATGGATTGCCATATTTTTTACCGCCGATCGATAATCACAGTCACATGAATGGGTCAAAGGCCCTCTCGTCAAACTAGAATTGAACTTACACCATCATATTTGGCCTAACCTCTGTAGGTTAGGTCGTGTTTTATGGTTCTCTGAGTCGTGCCTATAGATAAAGTCATTTCTCATGGTTCGTCATTGTAAAAAGAAACTAAACTAAATTTGCTTATTAATGATCCATAAGTCAGTTATATTGTTTTTTGCGTCTGCGGGTATACTATCTAAGCATCATATCTTTTTGACTGCGTCGAAAGAAAGAGGGCGAAGCATTGTATTTGGTTCTTTGCTTTCGCGCAGTGAACCACTAGTGCCGGTAGTCTATCTTGTAGGTCATTTGATTGGTATACTGACGATTTTATTATGTCATTTTCTTATTGTCGTCTCTTGTTCCATCATATTGTGGTTGAGCGCGTGATGATATTTTGTTTTTTTACAAAAACATGCAAATTTTTGAT",mutations={["ANOAT&mit1&c_20823_22309_1"]={['-']={24,25,26,27,28,29,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,230,402,405,406,407,408,409,410,411,412,445,529,675,676,677,678,679,682,683,785,786,787,788,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,865,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,1061,1064,1232,1260,1354,1355,1356,1357,1435,1436,1437,1438,1439,1440,1441,1442,1443,1539,1552,1561,1562,1563,1564,1565,1584,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599}},["ANORU&mit1&c_20938_22425_1"]={['-']={24,25,26,27,28,29,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,230,402,405,406,407,408,409,410,411,412,445,529,675,676,677,678,679,682,683,785,786,787,788,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,865,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,1061,1064,1232,1260,1354,1355,1356,1357,1435,1436,1437,1438,1439,1440,1441,1442,1443,1539,1552,1561,1562,1563,1564,1565,1584,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599}},["ATRAN&mit1&c_22923_24434_1"]={A={19,66,113,180,225,285,297,348,508,537,550,562,566,590,612,631,663,688,718,719,727,741,751,756,761,791,800,816,823,829,838,869,872,873,906,915,1066,1107,1147,1223,1226,1227,1256,1264,1301,1350,1352,1445,1458,1463,1520,1556},T={2,13,171,223,235,244,273,349,355,389,390,391,425,453,481,500,510,531,559,573,584,608,637,639,644,647,649,651,657,698,731,797,864,874,908,911,974,1031,1059,1096,1113,1119,1142,1143,1157,1188,1198,1212,1219,1243,1246,1286,1303,1314,1323,1362,1373,1396,1419,1424,1457,1485,1489,1495,1531,1545,1557,1560,1575},G={1,20,23,35,36,187,239,280,284,341,430,507,519,560,567,615,629,646,648,652,659,660,661,704,717,771,798,812,821,867,870,919,1029,1093,1109,1132,1133,1137,1169,1206,1221,1222,1229,1230,1254,1275,1277,1311,1318,1321,1342,1381,1397,1415,1417,1446,1498,1516,1573},C={178,231,332,360,436,570,574,604,627,656,658,664,687,696,697,724,725,777,781,807,921,1025,1032,1039,1057,1071,1076,1080,1082,1099,1110,1116,1141,1202,1208,1224,1289,1305,1361,1374,1405,1408,1416,1418,1449,1455,1472,1487,1509,1608},['-']={10,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,110,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,259,266,267,268,269,442,526,665,666,1180,1181,1182,1183,1216,1266,1410,1411,1412,1413,1414,1536,1549}},}}end)();
(function()addBlock{name="s3x1488",consensus="CAGGAGCTTTTTCTCGACTCATTTATCACGGGGAGATAAAGCCGAGGGCCTATCATCCCTTACTCTCCTATTATCATAGGGGTATGGGGTTCTAGACAAAGAAAAATCCAAGCAGCATATCAGTTTTTCTTATATACTTTACTCGGATCTGTCTTCATGCTCCTAGCCATTTTATTCATTTTTTTCCAAACAGGAACCACCGATTTACAAATATTATTAACCACAGAATTTAGTGAGCGACGCCAAATATTGCTATGGATTGCTTTTTTTGCTTCTTTTTCTGTCAAAGTGCCTATGGTACCAGTTCATATTTGGTTACCTGAAGCTCACGTAGAGGCACCTACGGCTGGATCTGTAATCTTGGCAGGAATTCTTTTGAAATTAGGAACCTATGGTTTTTTAAGATTCTCTATACCCATGTTTCCTGAAGCGACACTCTATTTTACTCCTTTCATTTATACCTTAAGCGTCATTGCTATTATATATACTTCCTTGACTACAATAAGACAAATCGATCTGAAGAAAATTATTGCCTACTCTTCAGTAGCTCATATGAATTTTGTGACTATCGGTATGTTCAGTCTAAACATACAAGGAATTGAAGGTAGTATTTTACTTATGTTAAGTCATGGAATGGTTTCTTCAGCCCTTTTTTTATGTGTTGGTGTTTTATATGACCGACATAAGACTCGACTTGTTAAATATTATGGAGGTTTAGTCAGCACCATGCCCATGTTCTCTACGATCTTCTTATTCTCTACCTTAGCCAATATGAGTTTACCTGGTACTAGCAGCTTTATCGGAGAATTTCTTATTTTAGTAGGAGCTTTCCAGAGAAATAGCTTAGTGGCCACATTAGCGGCACTTGGAATGATTTTAGGCGCAGCTTATTCTCTTTGGCCATATAATCGTGTAATTTTTGGGAATTTCAAACCCAAATTCCTCCAAAAATTCTCCGATTTAAATAGAAGAGAAGTTCTAATATTTTTCCCTTTTATTGTTGGAGTTATTTGGATGGGTGTCTACCCCGAAGTTTTCTTAGAGTGTATGCATACTTCCGTAAGTAACTTAGTGCAACATGGAAAATTTGATTGAAAAACATAAAAAAGAGGTTTGAAGAAATGTTTGAACATGATTTTTTGGCGCTTTTCCCAGAGATCTTTCTTATTAACGCAACCATCATTTTGCTGATTTATGGAGTTGTATTTAGTACCTCTAAAAAATATGATTATCCACCATTAGTGTGTAATGTTAGTTGGCTTGGTTTACTTAGTGTTGTGCGCCTAGGAGGGCGCGTTTGAGAAGACGATGGTTTTGAAAACAATCGCTCGGATAGACTCCCTAACCTTATGTGGGATCAGACCGCAAGGAACCATAGCATGGGTACCATCCGCGTTTCGTCGCAAGTACAATCGTACGCATAGGAGTAAGGTAACTTCCCCCAACGAAAGGCGGGGCCGGAAGACACGTGGGCTCGAACGCTACTCA",mutations={["ANOAT&mit1&c_51263_52750_1"]={},["ANORU&mit1&c_51341_52828_1"]={},["ATRAN&mit1&c_56658_58140_1"]={A={32,42,107,251,284,359,377,721,731,833,989,1093,1141,1309,1407},T={162,176,185,200,407,416,437,461,533,569,746,757,800,901,1022,1028,1189,1292,1387,1473},G={239,368,470,542,593,656,716,803,869,914,962,1034,1252,1300,1332,1367,1370,1464},C={7,18,21,27,36,182,278,281,443,462,540,633,653,659,669,743,756,782,1038},['-']={54,55,56,1314,1315}},}}end)();
(function()addBlock{name="s3x1387",consensus="TATTATGTGATGCGAGTGAATGTGTGCGGCATAGCTGGCATCAATTAAATTTCTGACTCTATTTATGTTTCTATGATGGCCCAAGAACATGCTTATTCTTTAGCTGTAGAGAAACTTTGTAATTGTGAGGTACCATTACGAGCTCAGTATATACGAGTGTTATTTCGTGAAATAACTCGAATTTTAAATCATTTACTTGCTTTAACTACTCATGCTATGGATGTGGGGGCATTAACTCCGTTCCTGTGGGCCTTTGAAGAGCGAGAAAAACTTTTAGAATTCTATGAAAGAGTTTCAGGAGCCAGGATGCATGCCAGTTACATACGACCAGGCGGAGTTGCACAAGACATGCCTTTGGGCTTAAGTGAAGATATTTTTCTATTTACACAACAATTTGCTTCTCGTATTGATGAAATAGAAGAAATGTTAACCAACAATCGTATCTGGAAACAACGATTAGTTGATATTGGTACTGTTACCGCACAGCAAGCTTTGGATTGGGGATTCAGTGGTGTAATGTTAAGAGGCTCAGGAGTATGCTGGGATTTGCGAAAATCAGCACCTTACGATGTGTATAACCAATTGATTTTCGATGTACCCGTAGGTACCAGAGGAGATTGTTATGACCGTTATTGTATTCGTATCGAAGAGATGCGACAAAGTATTCGAATCATTATGCAATGTCTTAATCAAATGCCTAGTGGCATGATTAAAGCGGATGATCGTAAGCTATGTCCCCCTTCACGATCTCAAATGAAACAATCCATGGAATCTTTAATTCATCATTTCAAACTTTATACAGAAGGTTTTTCTGTACCAGCTTCTTCTACCTATACTGCAGTAGAGGCACCTAAGGGAGAATTTGGTGTGTTTTTAGTCAGTAATGGAACCAATCGTCCTTATCGTTGTAAAATAAGAGCACCTGGTTTTGCTCATCTACAAGGGCTTGATTTTATGTCCAAACATCACATGCTATCAGATGTTGTTACCATAATTGGTACTCAAGATATTGTTTTTGGAGAGGTAGATAGATAGAATTACTATTTCACAGGTAGGAAGGGCCCTACCTTTCTCGAGCCAAAAAAGATTTTTTTCGCGAAACTCGAGAACGTCGCTGAATCATCTATGATGACTCATCAACATAGCGTGCAGAGAAGTATATACATAGCGAATTGCTACGGAATGCGCGCAATTTACTATTTTAAGGCTTTTCTTTCCCGGAGCTACGCACTTTTCTGTTCGTTTCGCGAACGGGGAGCACAGAGGCAGAGGGTGCCTTGGCGCTTTTCTTCTCTATGCCCCTTTAATGAGTAGAGAAAATAAGCTTGCAAAGGTCACAGAGCGCAGTAAAAAAAAATCTATATAGATTTCTATTCTGCTGTCTGCT",mutations={["ANOAT&mit1&c_89977_91351_1"]={['-']={51,1106,1188,1189,1190,1191,1192,1193,1194,1195,1196,1371}},["ANORU&mit1&c_90057_91431_1"]={['-']={51,1106,1188,1189,1190,1191,1192,1193,1194,1195,1196,1371}},["ATRAN&mit1&c_99757_101076_1"]={A={25,27,227,305,339,845,854,1050,1061,1067,1101,1148,1151,1252,1253,1254,1311,1313,1320,1358},T={38,251,479,572,578,590,599,626,737,788,820,830,936,1060,1065,1066,1078,1085,1094,1103,1132,1146,1212,1216,1240,1245,1309,1328,1378},G={101,112,233,296,428,1035,1062,1096,1098,1141,1150,1166,1181,1197,1203,1256,1259,1316,1319,1321,1329,1330},C={98,104,416,476,740,782,824,836,947,1037,1056,1057,1058,1059,1095,1097,1102,1104,1215,1242,1263,1310,1317,1331,1383},['-']={52,1070,1071,1072,1073,1233,1234,1235,1264,1265,1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1295,1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307,1308,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1346,1347,1364,1365,1370}},}}end)();
(function()addBlock{name="s3x1379",consensus="GACCCGAAATTTCTCCGAACATCCAAACGGCTTATTCAGTTTGGCTTTTCTCTGAAGATATTCATTCCGGAAGGACAGAGATGCGTAGCGCGGAAGAGCTTTTAGCTTTGCGCACGGCGCTCCCCAGCTTTGTCCGGGCACTAACGTTCCCACACCAAAATGCCCTCCACTGTTTGCGCAAACAGAGCCTTTTAAGGCTTCGTTCTCGAATTTATCGCGAGCAAGGCGTGCCATTAGCTGATAATTACATGATGAAAAATACAGAGCTGAAAGCCTTCGGCAACCCTGGTCTATATTGGATTTTGGTGCTCCCTTCATTTCAAGAGATGCTGAATGGAGAAAAGTTCACTCTTTGTTCAGTCGTTATTATTATTGGAAAAAAATGCAATTTTTTTTATCTAATCAAACAAAAACTAATACCTTAATTAGGCCAGTCAAAATAGCTTCTGTTTATCAAAGTGCTTCTCTAATTGCTCAAGAAATATCTTGGAAACTGGAACAAAAAAAATCATTTCGACAAATTTGTAAATCTACATTTCAAGAGATTGAAAAATGCCAATATGTTAAAGGAATCCGTATTTGTTGTTCAGGCCGATTAAATGGCGCAGAAATAGCTAAAACTGAATGCAAAAAGTACGGTGAAACCTCTTTACATGTATTTTCCAATCAAATCGATTATGCGAAAGCACAAGCATCTACTCCTTATGGGATTTTAGGTGTCAAAGTGTGGGTTTCATATTTTTAACACAAAAAAAGGGACAAGTTGTGCTATATCCAAAACGTACAAAATTTCGTAAATATCAAAAAGGCAGATTTAAGGGTTGCAAAGCAGACGGTACACAACTTTGTTTCGGAAAATATGGCATGAAAAGTTGTGAAGCTGGTCGTATCTCATATCAAGCAATTGAAGCAGCGCGTCGTGCTATAAGCAGAGAATTTCGAAGAAATGGTCAAATATGGGTAAGAGTTTTCGCAGATATTCCTATTACTAGTAAACCCACCGAAGTCAGAATGGGAAAAGGAAAAGGGAATTCTACAGGTTGGATTGCTCGTGTGGTAGAAGGACAAATCTTATTTGAAATGGATGGTGTGAGTTTGTCAAATGCGCAACAAGCTGCCACATTAGCGGCGCATAAACTATGTTTGTCAACCAAGTTTGTTCAATGGTTTTAATTGATCAGTTAATGGATAGAAGAACGAAGCCGAGCCAAGGAACGCAGGGCGGAGCGAAGAAAGTGGGTAAAGACCAGGAATCTTTGTAAACTTATGGCCTCTATGGGCCCGAAAACGAACAAGCAGTCGAGACGATAGAAATGTTGAGACCGTGAAACGAGTAAAAAATTTATTATTATAAAGAATTCATGGTCTTTGACCCCAAT",mutations={["ANOAT&mit1&c_94315_95678_1"]={['-']={270,271,272,273,274,1175,1176,1177,1178,1191,1206,1207,1208,1213,1214}},["ANORU&mit1&c_94395_95758_1"]={['-']={270,271,272,273,274,1175,1176,1177,1178,1191,1206,1207,1208,1213,1214}},["ATRAN&mit1&c_104062_105438_1"]={A={9,62,79,84,91,184,207,217,227,239,250,253,495,543,645,1127,1186,1189,1204,1219,1220,1223,1231,1283,1289,1320,1326,1370},T={138,178,204,231,279,284,315,435,672,998,1001,1007,1282,1330,1355},G={58,85,124,232,234,235,240,246,258,264,339,400,411,570,629,664,748,941,974,1100,1101,1163,1182,1195,1196,1202,1229,1284,1290,1291,1302,1307,1312,1313,1329,1337,1353},C={31,107,129,132,172,210,211,212,229,233,236,267,291,303,344,393,541,621,1192,1240,1259,1277,1325,1327},['-']={259,260}},}}end)();
(function()addBlock{name="s3x1290",consensus="CATCTACTGACCTCGAGAAGCAGCTAAGCCACTGAACAAGGGCTCAATGCGTGCGAAAGCATAGGGAGCAAACAGGATTAGATGACCCTGGTAGTCTATGCCGTAAACGATGAGTGTTCGTCCTTGGTCTGCGCTGTGTGCAAAACGGCTGATCAGGGGCCCAGCTAACGCGTTAAACACTCCGCCTGGGGAGTACGGCCGCAAGGCTGAAACTCAAAGGAATTGACGGGGGCCTGCACAAGCGGTGGAGCATGTGGTTTAATTCGATACAACGCGCAAAACCTTACCAGCCCTTGACATATGAATAAGTTTGCTTGTCCTTAATGGGACGGTACGAAAATTTCTACAGGTGCTGCATGGCTGTCGTCAGCCATGGCTGTCGTCAGCTCGTGTCGTGAGATGTTGGGTTAAGTCCTATAACGAGCGCAACCCTCGTTTTGTGTTGCTAAGACATGCGTTTTGGATTAAAGGATCGATTCTCGATCATTTGAGACTGATAAAGACCACGCGATTAAAAAAGAATGTCACGACGCCGTCTGGCTACGATCACACGGTTGACGAAGGGTACTTCGACGAGCACAGCTCTCCTAGCGTGGCACACAAAACAATGTGGCACCCAGTCTTTGGAAACAGAATTGACAATCCATGCCATGGACTGCACTCACAAGAAACTGCCAGTGATATACTGGAGGAAGGTGGGGATGACGTCAAGTCCGCATGGCCCTTATGGGCTGGGCTACACACGTGCTACAATGGCAATTACAATAGGAAGCGAGGCTTGAAGGCGGAGCGAATCCAGAAAGATAGCCTTAGTTCGGATTGTTCTCTGCAACTCGAGAACATGAAGTTGGAATCGCTAGTAATCGCGGATCAGCATGCCGCGGTGAATATGTACTCAGGCCCTGTACACACCGCCCGTCACACCATGGGAATTGGCTTCGCCCGAAGCATCAAACCAAGGATCACCCATTCTTTCAGTGTTCTACGCCGTTGGTGAGTGTGGTCTACCAGAGGAATTGGTGGTCTGATGTGGGATACCAAGGTGGGGCCTTTGACTGAGGTGAAGTCGTAACAAGGTAGCCGTAGGGGAACCTGTGGCTGGATTGACTCCTTTTTTTCGACAAAAGAGAGAAAAAAAAAGACTCCAAAAAAGAAACATCTATCTAGTTTCTGTCGTTCGGTTCTGTTTGATAGTAACACATTGATAGTAACACAAAGAAGCGGAAAAAAAAGAGTAGATACGCCCTGTGCTCTTCATTCTTTGGACTAGGATTGCATGGCCCAGAAGCA",mutations={["ANOAT&mit1&c_31891_33120_1"]={G={471},C={234,1182},['-']={1,11,12,13,14,15,16,17,18,19,20,21,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,83,462,463,464,465,466,467,468,511,512,513,514,515,516,517,558,559,560,561,562,563,564,565,566,567,1283}},["ANORU&mit1&c_31966_33179_1"]={['-']={1,11,12,13,14,15,16,17,18,19,20,21,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,83,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,463,464,465,466,467,468,471,511,512,513,514,515,516,517,558,559,560,561,562,563,564,565,566,567,1283}},["ATRAN&mit1&c_35618_36795_1"]={A={58,59,137,343,478,489,491,495,507,508,523,528,531,552,587,630,773,786,971,1026,1128,1159,1163,1270,1274,1278},T={50,63,65,66,80,145,329,480,547,557,602,626,632,653,780,985,993,1013,1024,1161,1165,1166,1232,1233,1269,1288},G={51,483,493,498,520,536,805,953,1245,1271,1286},C={60,64,486,497,509,546,810,974,1114,1126,1130,1164},['-']={4,6,67,70,71,72,73,74,75,76,77,78,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223,1224,1225,1226,1227}},}}end)();
(function()addBlock{name="s3x1266",consensus="TGTGTTTAAAGCTAAGGGCCCCAGAGCCCCCTATTTCCCACCGTTTCCGTCAATCAAATAAAGGCTTCGTTTAGCCAGGGGTTATTCTTCTCCCCTGCTGAATTGCTTCGCGAACGAAGTAGGCTAAAAAAATAAAGATTTTTTTTGTCCGCCTTATTCTCTTCTATCATTCAAATGGCCCTATGCGTTTTTGCCAAGCAAAATATTGATTGCATAAGCCATCGGCTTCCACAGAGACCAATAAAGTGATAACAGCAGCGTAGCCAAGCTTGTTCCGCCCGCTGTGCGCAAAAAAAGAGTTTTTTTCCGTAGTTCTTGCATAATGAAGGCACTTAGTAAAACAAAATTTTGACACTCCTTGCGTTGCGGATGGTAAGTGGATTACTAATAAAATGGAGTGATCCAAGATGACCTCTCTTTCAATTTCAATTATGTCATTATATAGTAATGGCATGCGGCGAACTCTATTGGATGCGCCAAAAGAAAACTTGATTTGTTGGGCTGTGTCGTCAATTTAGTAAGATTGACAGAGCCTTCATCTAAGTCTCGGCTCGTGCAGCTGTCGCCCAAAATACAATCAATTATCTATCCAATCGACTGTATTTTGGTCACAATAAAAAAAAAATGATTTATGTATGTATTTATTAATTGTAACTTTACCTTTACTAGGTAGTTGTGTAGCAGGTGCTTTTGGTCGTCTTCTTGGTCTACGAGGAACTGCTATAGTCACAACCACGTGTGTTTCATTATCTTTCATTTTCTCTTTGATTGCTTTTTATGAAGTTGCACTGGGAGCCAGTGCTTGCTATATGAAAATTGCTCCATGGATTTTTTCCGAGATGTTTGATGCTTCTTGGGGCTTCTTTGGCGACCGTGAAGTCACCGGATGAATTGCTGGATAGATAGATTATCTGGACGCTGCAGTTGCTCTGCGGTGAGACGGACTCGACTCACTCTCTGGGGCGAACTCCTGTAGAGCATCATAGCATGTCGGGAAACGGGCATACTGGACGTAGCCAAAAATATCCTTGGCTGTGCCCCGACCGTGTCTTTGAGACACAGGTGAGGCCGTAGGTCACGAACGTAAGGTGGAGGAGGTATCCCAAACTTGGCGCATCGGGCGAGGCCCTAGTAATAGAGGCTAGATAACACGGCGTTTCCCCCTGCATATAGGCAGCAAGAGGGCGCATATGCCTGAACAAATAGGGGGCCTGAGTCCAATAAGGACAGCACACCACTTCAAGCGCACCTATGTCTCGGTATCGA",mutations={["ANOAT&mit1&c_42518_43727_1"]={['-']={21,22,23,305,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,482,483,484,485,508,509,510,624,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1158}},["ANORU&mit1&c_42578_43787_1"]={['-']={21,22,23,305,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,482,483,484,485,508,509,510,624,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1158}},["ATRAN&mit1&c_48002_49255_1"]={A={1,50,115,122,123,185,223,233,274,288,367,372,414,498,521,525,527,686,760,811,901,957,998,1070,1073,1118,1172,1243,1259,1264},T={46,91,108,136,148,160,167,179,180,193,286,298,352,356,403,409,459,477,517,547,552,589,597,665,698,707,754,796,883,963,972,1040,1128},G={7,39,53,120,124,126,129,234,239,243,256,436,441,557,1171,1204},C={4,24,25,44,45,98,113,166,170,175,187,266,269,335,489,491,588,702,764,912,971,1195,1260},['-']={137,357,358,359,360,361,425,426,427,428,429,430}},}}end)();
(function()addBlock{name="s3x1253",consensus="ATGCGTAAAAAATAGATCTATCTTCTTCTCGTCCTTACCGTTCTTAGCCAACCAGCAGGCTGAAAGCATAACAGTGTTCGTTCGTGCGATTCCTCGCGTGCATTTTTTTCGCACTAGTTCGCTGTAGGGTAGGCCGACCCGAAAAGAACTGCGATTCTTTATAGAAGTTTTATCATCTCATGCTAAATGAAATCTATATATAAATATATATATAGATTTCATTTGGCAAGCGCCAGCGGACTCGCGGAGGATTATCGAGTAGGCCGAGAAACTAGCCGACAGCCGACGAATATCTCCTTTATCGCTGCCTCCGTGGCATGCTCCCCTTTTTCCGCTATTGGGTAAGCCCCGAGCCCCTCGGGCAGTAGTGCCTTTGTTGTGATCACAAGTAATCTAACGGCCGCCCCTAAGAAAGCCCCAGAAATTCTATGAAAAATAGAGAAGGTAGAAGTAAGCTGTGGCTTATAAATGGTAAGATGAGGGGATAAGGGTCGATTGATTTTCATGTTTTTAGTTGACTCTGATTCTGACTCAAGGTGACAGGATTTGAACCTATGGCCCTCTGTACCCAAAACAGATGCGCTACCAGACTGCGCTACACCTTGGCTGATGTTCCCTAATGAATATTTGATAAATGCTTAAATTGTTATTGAGCAACATACAAAAAGAACTAAAACTAATAAAAAAAATTCTATTTTTAACGCCACTGAAAAAAAGCACTACCATCTCGTTCAGTTTCTTTTTTGTTGTTCTTTGCTTGAAAATAGTTTTTTGGTGAACGTTTATGATCGTCTCAGCCCTTTAATGCTTGCTCGAGGCCAGAAGGGCGAGTCGGTCATTGTCCGACTTATTTACAAAGCTTTATAATGATTAGCTTTATAATGCAATTACATGTAATTGCATTATAAAGTCAAGTATTCAACATAATATATTATTAATCTTTTAGTTTCGTTATTAATTAAGTAATTCCTCATGGGAATAGCCATGAATAATCATAAATAGATGACGAAGGCCCAAATCCAAAATTGCGCGATTAATCTTGCAGCCTCAAAAAACTACGGCCCAAAAATGGAATTATTATCAAGACTGAAAAGAATAAAAGCCACACAGAACCGAAATGAGGCTTTCGTCGAAATCTAGGTAATAGCTCTGACCCACTGTGAACGACTAGGTTTATTGCAATGTCGGCAGAGCCTCGAAGCGGGATGGAACAAAAAAAATGAATTTAGGAATTCGGATCGATAGCAACGGGG",mutations={["ANOAT&mit1&c_29770_30943_1"]={C={205},['-']={6,158,159,160,161,162,163,164,165,745,746,747,748,749,750,751,752,753,754,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,969,970,1003,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1128,1129,1130,1131,1132,1133,1134,1135,1170,1171,1172,1173,1174,1175,1176,1177,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205}},["ANORU&mit1&c_29845_31018_1"]={G={428},['-']={6,158,159,160,161,162,163,164,165,745,746,747,748,749,750,751,752,753,754,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,969,970,1003,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1128,1129,1130,1131,1132,1133,1134,1135,1170,1171,1172,1173,1174,1175,1176,1177,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205}},["ATRAN&mit1&c_32485_33703_1"]={A={188,224,237,246,287,340,360,380,443,557,635,643,651,691,796,816,828,844,945,948,1001,1004,1059,1070,1084,1105,1109,1121,1165,1207,1234,1240,1249,1250,1251},T={14,24,27,29,134,249,257,267,271,288,295,302,308,322,323,325,348,356,401,455,482,520,526,608,615,637,653,703,704,715,722,766,780,789,792,797,798,799,827,836,854,911,939,949,1013,1014,1019,1071,1145,1149,1153,1154,1155,1185},G={50,104,115,179,239,242,324,336,387,390,422,431,437,626,632,641,642,673,674,675,700,701,706,710,777,788,822,823,929,996,997,1015,1016,1108,1210,1219,1220,1227,1242},C={93,108,114,129,150,167,169,241,259,297,327,328,335,392,488,671,689,716,758,803,809,845,910,914,915,958,1009,1076,1087,1118,1124,1139,1142,1150,1152,1208},['-']={20,21,49,75,76,77,78,101,102,103,192,193,194,195,196,197,198,199,200,213,214,255,256,279,280,281,282,286,662,699,709,974,1027,1028}},}}end)();
(function()addBlock{name="s3x1241",consensus="ACTCTCAGCCATACGACTCCGAAGAGTCTCTCCTGGCTTCTGGCTTTATTAGTCGAGATTGTGTAAATAGAACACGTCTTTACGCCTTCATTTGTGTTCTAACCACATGAAATGAATATGACATCACCCCCCTTCTGGTTAGGCTAAATGGTTGGGTTGGCCTCATTTCGATTGATCAGCCCTTGAATGGTCATTGTTTTGACAGAAACAAAAATGAAATTGTTATGCTAGAAGGTGCAAAATTAGTGCGACCCGTTGGCCCACAAACCTAAAAATACTTTTGAAAAAAAAATATATCTATATTTTTTTTTGGCCGGAACTTAGTATTCTAACTCTTGTCGGATGCAGGTGTAATCCCTGTTGCGCGGTAATGTCCCGCAAACTCTCGATCATTACATGGGAGTGGCAACCCCGGAATTTCTAGCAGAATGGTCGCAGGAAGAAAACCGAGAGGAACACTTTGGTCAACGAGTTAAAGCTTCGGTGCCCGATCACCTTCGGTATGCTGAACCCTTACTGGGGGCTAGACTACAAGTCAATGAGGACGAGTATGATTAGCTTGATTTCTAATCATAGGCATTCTGGGAATACAGTAAAAGAGGCCAGGAAAGTAGTTGCTTCCACTACGTTCTACGTGCATGTTCCACCTCCCGCAGTATTGCTCGTCTCTTAGGTTTTCGCAACAATCCGACTCGGGAACGGGGTAACTACCTTGAACTCCAAACAGATGATCGTAGGGTAGGCTAGCCAGGCCATATGTTCATTGGTAGCAGGATTCTCCAAAAAGCGAAAGCGCGGTGATAAATTCTTGTGATATGCTTACTTGGAGACTCATAACTTTGAAAAAAACTGGGTGTTCCGGGTAAAAACTATATATATTTTTTTTAAGTGATAGGGTTTTTCAATAAAAAATCTATTTTTTTTTACCTGTGGCCTGGACACGCTATGCCCGGGCCAAAGGCCGAAGGGCTTGTGTTCAGATTAGAATCCAGGATCTATAAGGCTTCGCGGCAGAATGACCATAGAAAACAAAACGCAGGCACTCCAAAAGAGGCTAACGGCTGGAACACAGACCATATTGATAGGTATGCGGTATGTCGAACAAGGGCAGGCTGCAGGCAGGGTGAATCATATTAATTCCAAAAAGAGCGGAGGGCATAGCAGGACAAATATGCAAACTTTTAATTGCTGCATAAAATTTTTCTTTTACATGGCCGAAACTCTCGAAGATACAAACATTA",mutations={["ANOAT&mit1&c_100342_101479_1"]={['-']={20,21,22,23,39,40,41,127,128,129,130,131,132,133,134,135,136,137,140,280,281,282,301,894,895,896,916,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1190,1191,1192,1193,1198}},["ANORU&mit1&c_100422_101559_1"]={['-']={20,21,22,23,39,40,41,127,128,129,130,131,132,133,134,135,136,137,140,280,281,282,301,894,895,896,916,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1190,1191,1192,1193,1198}},["ATRAN&mit1&c_110237_111451_1"]={A={29,38,69,75,82,93,200,420,545,583,593,726,796,807,841,900,905,913,1002,1017,1029,1035,1050,1071,1203},T={18,35,62,105,143,202,215,339,447,617,693,748,969,1008,1034,1067,1169,1214,1215},G={114,216,266,465,568,591,638,800,892,898,901,945,1023,1028,1051,1066,1072,1076,1087,1223},C={33,34,45,46,48,49,99,116,361,419,462,529,546,670,755,809,819,820,854,856,867,882,890,899,930,951,970,982,984,1037,1085,1136,1168,1182,1206},['-']={290,291,292,293,294,295,296,297,860,861,862,863,864,865,870,871,872,873,874,875,876,877,878,879,880,881}},}}end)();
(function()addBlock{name="s3x1161",consensus="GCTGGCACTGTATGTATGACGGAGGGGAAGGAGCTTAAATCGACGTACCCCCTGGCTACCCATTAAGGTAGGAGGGGGTACGTTGCGTACTCGAGCAGCATGAAGGGACCGAGATTGAGCTTGGATGAGACTAAGCAGTTAAAAAAAAATATATATATATTTTTTTTTGCTGCTTCGACATATTCTAATCGTCTGCATGTTTTTTGGAAACATTGTCATAAAGAGCAGTTCCAGACAGAAAGCCTTTTTCAGCTTATAAAGGGTATCAATCTGTGGATTACCGCCTAGAAAAAGCTTTTACCTAATCGAGGTTCGGAGAATGGTGCTTATAGGAAAACTACTATATGCGGCACTTTGATCAAAGTACCATAAACACTGTGAGGGACTAGGTAATCCACTCCGAATTCCATTCTAAAGCGAAAAACGCTAAAAGCGTGCAGCAAATAATTTCTTTCTTTTTTCTCATGTAGCTTTCCTCGGCCACACGGCGATACATGGAGCCATAATTGAAACAGTAGGAAACCTCGGTCTAGGCCATCCGCAAGACATCCATTTTCAGTAAACTATGTGCGTTTCATAGATGACTTTTACTATTGGAGTAATTGGTCCACGAGCTCTGGCAGAAAAGATACTTGACTTGGTTACATGATTTATTGAAGTACGGCTTTAGCCTGGGCTTGACCTGGATAAGACTCTAATAACCTGAACCAAAATTAATAAAATTTCTTTCCTTGGATATCTTACTAGTCGCAATTCAGAATATACCTACAAGTTTTGACGACAATACGGCGGCAATTAGATAATATATAGAATCCATCAATCTGGTGGGCTTAGCTTACTTGTCAATATGTGTAAAATGATAAACCGTCTGGCAAAGAAGAGGTTTTATGATAAATGAAGTAACCCGAAACCCTGTTTTGCTCACTTTCAGTATCTTTAAAGCTATTCAGTAGTGCGCGTTAACCTCCATTCTCTGACTCTGCCCTGTCAATTAGTAAGTAGCATCTGGCAAACTCTAAAAACCAATGTATAACGCACCGCGCTTAAGCTACATACTACGTATTTCATCGGCTAAACCATATACAGCTAATTTGAATTCTACACCGCGGCTAAGAAAGGCAAAGCCCGCTCGAATTGCATAACTCATTCGCTTACAAAAAT",mutations={["ANOAT&mit1&c_79064_80154_1"]={['-']={14,15,16,17,58,59,60,61,62,63,64,65,66,148,156,158,164,165,166,167,378,381,454,459,460,461,462,463,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,584,873,874,875,876,877,878,879,880,973,974,975,1084,1085,1086,1087,1088,1089,1090,1091,1092}},["ANORU&mit1&c_79143_80233_1"]={['-']={8,9,10,11,58,59,60,61,62,63,64,65,66,148,156,158,164,165,166,167,378,381,454,459,460,461,462,463,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,584,873,874,875,876,877,878,879,880,973,974,975,1084,1085,1086,1087,1088,1089,1090,1091,1092}},["ATRAN&mit1&c_86800_87916_1"]={A={3,20,105,218,260,262,315,321,322,324,369,395,418,479,496,503,595,622,673,679,690,849,858,889,913,1037,1041,1076,1093,1107},T={53,108,184,194,243,287,331,347,359,375,394,399,411,466,486,512,539,589,590,648,671,702,707,748,755,811,817,834,896,922,967,976,981,989,1005,1015,1068,1105,1149,1150},G={18,68,69,72,102,132,177,186,234,240,250,290,303,325,333,391,408,414,429,609,660,667,689,705,717,720,769,782,948,978,983,1019,1045,1082,1098,1099,1100,1146,1148},C={34,52,54,121,138,170,185,191,193,199,200,201,254,298,307,320,364,412,435,472,515,517,566,577,632,638,703,724,777,807,836,914,927,935,945,985,987,1031,1062,1063,1072,1096,1152,1153},['-']={336,337,338,647,959,992,993,994,995,996,997,998,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145}},}}end)();
(function()addBlock{name="s3x1139",consensus="CCCTGCAGTGATGCTGTGGCTTAGGTTAACCAACACAAAAAAGAGACAGTTTACTCAATTATTGCCTTTAGGTTCTGAACTACATATAGGAAGAGAGCATTGTTGTTTGCGAGGTATTGATCAATTACATGGACCCACCTTTCATTCCATTTGTGGTAATTTGATTATTTATAAACCGTCCTTAAAAAATCCATTCATTTTTGATTATGATGAATCATTTCGTGCCATAATCGACTTGTTGCCAATTGCTGCGCTTTCGTACCAGAATGAAAAAGTTGAAAAAAAATCTATAGATTTTTTTTCAACTTTTTTCCATGGTGACAGATCATGGAGAAATCGCGAACATCATAGTTTCCCACTTTGGTTGACTGTGTTCCCAGAAAAAAGATTTTCTTTTTCTAATCAAGAAACAAGCACTACCAAAGTGGCTATACATAGTAATCTTTTTACGGATCTATATGCTTTAATTGGAACTGGAAGTTTCGAAACAGGCTGGTATATTACCATAATGAAACTACCTTTCATTTTCTGTATTTGGATAGGCTTCATTTTGGCTTCATTGGGAGGCTTGCGTAGTTTTCTACGTCAGCTGGCTTTATATAGATTGGATCGGAATTGAAAAAAAAAAATATATATATATTTTGTTAATATGTAGAAAATGCAAAATTACATAAATCTGGAGTAAAAGGATTCGAACCTTTGCCTGTCGGTATCAAAAACCGAAGCCTTTCCACTTGGCTATACTCCAAAAAATCTACCTACGGCCTGTTTTTCTAAAGCTTGTAAAGTGCTATGCACCCACCTAAAACAAAAACAAAATAACTTCCCACTCTGCCAATGGCTCATAACAGACCAACGTAGGGGTGGTTAATTTGCTTATGTTCTCCTACAATATACAATATTTTTTGATAATCGAATTATTCATCTATATCGTGAAGGAAGGACCTATAACTTTAAGCCTGAGCTATTCTCCTATGCATACATAGTAAATAAATAGAGCACATAATAGTTTCTAATCTGATTTATGAATTGAGCACACTTCTTATGAATAAACATAGATTCTTTTTTCGCCAATCAAGCAGCATGGCTTCTCTTCCAATTTTCAAAAACAGTTTGATCACGACTCGTGTTCGATCCGC",mutations={["ANOAT&mit1&c_19652_20778_1"]={['-']={275,276,277,645,646,647,648,649,650,651,652,774}},["ANORU&mit1&c_19764_20893_1"]={['-']={645,646,647,648,649,650,651,652,774}},["ATRAN&mit1&c_21793_22922_1"]={A={9,92,96,162,250,287,305,346,617,782,852,860,874,903,907,961,1012,1061,1095},T={79,82,135,138,180,257,292,302,303,522,543,546,571,610,626,638,643,654,660,767,799,843,848,913,937,944,964,969,972,1057,1068,1075,1082},G={27,69,90,93,98,204,212,271,400,465,655,661,662,663,752,769,773,815,831,849,854,867,875,966,992,1043,1054},C={16,75,161,189,205,217,254,255,256,304,390,426,463,550,585,597,607,744,772,783,793,820,832,858,864,887,912,918,965,974,1009,1101,1102},['-']={628,801,802,803,804,994,995,996,997}},}}end)();
(function()addBlock{name="s3x1082",consensus="CTCCTATTGGTTGGCATATAGGCGCAACGGGTCAAAGGGCGCAGTAAATCTATATATATATATATTTTTTTTGAGTCATCGCATATTTTTCATCTATTCTTGCACCGTAACCGCTTCTCGGCAGGGCGGGCTCGGATAATAGAATTTCTCACCCAGAGAACCAAAAGCTGCGGCGTTCTCTTTTGTTTAATGGATTATTTTGTACAAATTTGTTCTTATTTTCCACAAAATTTATTTTTGATTAGTAAACAGATAAGATGGATTGGAAAAAAACCCGATCGATGATATCAAACAAAATCTAAACGTTCAAAAAAAAACTCATGCAGAAGAAAAAAAAGCACGGTATTGCATATATTCGATCAACTTTAAGTAATACCATCATTACTGTAACAGATCATAAAGGAGATACAAAAACTTGGTCCTCCTCAGGTTCATTGGGGTTCAAGGGATCTCGTCGCTCAACCAATTATGCTGCTCAAGCAACTGCAGAAAATGCTGCCCGAACTGCTATTCAACTAGGAATTAAGTCGGTTGAGGTTGAAATAAAAGGGTTAGGTTATGGAAAGGAATCGTCGCTACGTGGTTTACGACTAGGAGGTCTTATTATTACTAAAATTAGAGATGTGACCCCAACCCCACATAATGGATGCCGACCCCCTAAAAAACGCCGTGTTTAAATATCATCATAAAGTTATTCATTTTCAATTACTTGACAATGCAATATAGTGAAATCCCGGGGTACAGGCCCGGTTTCACCATTTTCTAATGCTAATGTAGGAAGCCCTCGTTAGTATTTAATAGCGAGTTTATCATATCTGGGAAGATAACAACAAGTGCCAATCCTTTCCAGTTTTATTAGAAAAACCAGCCAAGTTTGTGGGTAAAGATACTTTCTTTCTAGAAAAAACAACAAGAAGTAACTTTGGATCAATTTATGACACGGATTTTCTTTTTTGAGGAAAGAAGGATCGAATAAACTCGAAAGCGAACCCGGGGCTATTTTACTTGTCTTATAGAAGATTACAGAAACGTAATAGACGCGATAAGAGGCCGAAAGAAAAATATAGATTTTTGCTACACCC",mutations={["ANOAT&mit1&c_99242_100293_1"]={['-']={211,212,213,214,215,216,217,218,316,791,792,793,794,795,796,797,798,995,1038,1039,1040,1041,1042,1043,1044,1045,1046,1061,1062,1063}},["ANORU&mit1&c_99322_100373_1"]={G={62},['-']={211,212,213,214,215,216,217,218,316,791,792,793,794,795,796,797,798,995,1038,1039,1040,1041,1042,1043,1044,1045,1046,1061,1062,1063}},["ATRAN&mit1&c_109130_110179_1"]={A={4,11,12,14,29,116,117,118,141,239,276,304,307,535,625,717,735,948,1015,1036,1056},T={27,30,63,90,102,105,110,111,223,249,265,379,395,442,634,728,738,745,757,810,846,858,865,900,913,936,1004,1022,1025,1066,1080},G={3,10,71,103,115,122,136,149,231,293,592,764,779,837,839,847,859,940,974,975,1076,1078},C={5,87,97,99,100,114,145,181,208,243,396,496,508,604,610,749,787,806,812,850,851,875,916,999,1010,1031},['-']={19,20,21,22,36,37,38,39,40,41,42,43,44,48,49,50,74,720,721,722,729,730,731,732,955,956,957,958,959,960,961,962}},}}end)();
(function()addBlock{name="s3x1081",consensus="TCGTGCAGGCTCTGTAATATCCGCCCGCAGGGTTTCTTTTTCTATTCTGGCCTCACCATAATTTATTGATGGCAGACTGAGAGCTTGACAGCGCGCACTCGTGTGCATTACCACAGGGGAGTTCCTCGTGATTAACTGCAGGTCCAGTTTGACCGAAAGAGACTTTGATTTGCCAGAGCAGGGGCTCATCTCATACAAGAGCAGGCTAGCGTAGTGGTCTTGGGTTGTTTGAGCTAGAATCATTCGTTTGCTTCGTGAACCTTTAGGCTTTGTTCAAAAAAAAAGAGAAAATTGTTTTGCTATGCACCCTTCGCTGCTTTTTCTCATCATAATCAACCTTTTATTCGAATCTTCTACTCGCTAAGCAAAGAAGTAGACCGCAGGTCAAACGTATTTTCTTTTCTGAACGCTGCCTGTGGTCCTATGGGTGCTTTTAAGGCGCTTTGCGCTTTATAGGATAGCAAAAAAGCAAGTTGAAAGCCTAAAAGACATACTCTACCATCATGAGGTCTTCCTTGTTTCTTTTCTCTCTTCTCTCCTCCTTTTCCCAACTACGTTTCTAGAGCATGCTGTGGTTCCCACCCGTTTACACGGTGGTTGGGTAAGCTCTATGCCTGGCACGCGGAATAGGGTCTCGCGTGGTTTGCTATATGGCCGCTAGCGCAAAACTGCGAATAATTTCCATATGGCTAAACAATGACTGTAGGCGACGCGAACGGTCGCCCTAAATTCCACTGCGATAGTCCCACGAATTCGAAAAGTTATAACCAGAATGGCCAGCCCAATAGCGGATTCCGCAGCTGCCACCGTCAAAACAAATAAAGCAAATAATTGACCCATCATATCATCTAAATAAACCGAAAATACCAGAAAGTTTAAATCGACCGCAAGTAACATTAACTCAATTGACATTAACATAATAAGGATATTTTTTCTATTCAAGAAAATCCCCCAAATACCTGAAAGAAAAAGAATCATAGAAAATGTTAAATATTTTACTAGATCCATAATAAGAGTCTCTTTTTTGAAAGCCAACTCGGTTTCAAGCCAAGCACATGCCGATTCCTTAGCCAATAAGTAC",mutations={["ANOAT&mit1&c_27157_28193_1"]={['-']={118,347,348,349,350,351,352,353,354,355,356,357,358,359,435,436,437,445,446,447,448,449,450,451,526,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547}},["ANORU&mit1&c_27232_28268_1"]={['-']={118,347,348,349,350,351,352,353,354,355,356,357,358,359,435,436,437,445,446,447,448,449,450,451,526,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547}},["ATRAN&mit1&c_30011_31050_1"]={A={1,86,108,158,236,260,284,425,431,432,433,434,487,498,513,514,515,516,672,698,738,858,924,942,961,1026,1046,1077},T={41,50,53,93,99,126,173,198,240,244,253,286,293,307,421,423,500,551,655,677,780,810,885},G={18,130,231,238,276,304,305,317,362,373,374,428,454,665,666,691,747,816,851,870,1061},C={10,14,66,165,225,263,310,383,395,414,416,419,424,429,452,453,458,462,511,518,552,630,679,876,1056,1075},['-']={24,25,26,27,256,257,258,259,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,397,400,401,402,403,494,503,504,505,506,507,508,509}},}}end)();
(function()addBlock{name="s3x1054",consensus="TAGAAAAAAAAGACAACAAAATGAGACTGTATATCATTGGTATTTTAGCGAAAATACTTGGAATCATAATACCCCTTTTACTAGGAGTAGCCTTCTTAGTTCTAGCCGAACGTAAAATAATGGCTTCTATGCAACGTAGAAAGGGTCCTAATGTAGTGGGATTGTTTGGATTGTTACAACCTTTAGCAGATGGTTTGAAATTAATGATAAAAGAACCTATTTTACCAAGTAGTGCTAATTTATTTATTTTCCTAATGGCTCCAGTAATGACATTTATGTTAAGTTTGGTTGCTTGGGCTGTTATACCGCGCGCCGTGCAAGGTGCTTTCGTCGCTATGGGGCATATCCTGGTGCCCAATCTCCAGTCCGCGTCAATGGAGTCAATCGCCCAGAGGTAGCGTTGCCGCAATGCGCGTGGAAAAGCATCTGGGAAACCAAGTCATAGGAGACCCATAATTCCAAGGACGACTTGGAAGATACTGTTGGGATTGATGAGGCTGACGAATCCGAATGACGTAGCTGCTGAACGACAGCATTCACCAAGCCAGCGGGGAACGACTTGGTCCTGGAATCGGTTCTTTTGGTAGGTATAACGGGGGCCGGAGACGGAAAACAAGGGCGAAGTTTTTTTCAGGGGCATTCTCAGTAAGGGAATAAGACTATGCGGACATCTTACCTCGACGAACAGGTAGAAAAAGTCGAAGACGCAATCACGGGATCGACCTACTCTCTAGCGAGAGGGTCGGCGGAGCCGCTATAGTAAGTCAATAGGGAAATCGACCGAGCCAGGTACTGAAGGGCGGCAGTCATGATCCGAGGGTAGAGGACCACTTCAGTGGCAGCGGCATGGCTGGCATGTGGCCGCGAATGCGGCATGGCATGTGGCCGCGAATGCGGGGCAGGCGGCGACGCTTCAACTCTTCTGAGAAGACGGGTTGGTCCCAGCAGACATAAGAATGCTGCTACGATCTCATTCAAGAAGTACCTCGTAAAGCGCGTCAAAAAAATCTAGATCTAGATTGTTGTTGATGTGCTTGAAGAAATCAGTGGCGGA",mutations={["ANOAT&mit1&c_71733_72766_1"]={['-']={443,444,445,446,456,457,458,459,624,625,626,627,628,629,630,1002,1003,1004,1005,1006}},["ANORU&mit1&c_71811_72844_1"]={['-']={443,444,445,446,456,457,458,459,624,625,626,627,628,629,630,1002,1003,1004,1005,1006}},["ATRAN&mit1&c_78919_79929_1"]={A={64,251,381,386,434,472,596,602,613,617,619,635,691,745,770,778,782,818,884,886,899,941,954,966,981,1008,1014},T={73,80,94,106,250,268,308,355,367,372,404,455,512,552,568,616,618,620,622,623,751,813,817,874,876,879,894,906,914,931,942,952,953,978,1011,1017,1021,1024,1036,1039},G={10,51,116,344,356,452,467,473,487,632,690,721,734,756,765,766,767,768,776,826,928,982,990,1040},C={12,95,124,166,249,279,325,442,470,566,581,858,877,883,897,902,921,923,936,951,968,1029,1031},['-']={3,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,863,864,865,866,867,868,869,870,871,872,888,889,890}},}}end)();
(function()addBlock{name="s3x1036",consensus="TTTTTTCTTTTTAATAATTATTTTGATCTTTGTATTATGGATGTTGGTTCGCGCTTTATGGCATTTTCACCATAAAAGAAATCCAATTCCGGAAAGAATTGTTCATGGGACTACTATAGAGATTATTTGGACCATTTTTCCTAGTATTATCCTGATGTTTATTGCTATACCATCTTTTGCTTTATTATATTCAATGGACGAGGTAGTAGATCCAACAATTACTATCAAAGCTATTGGACATCAACGGTATTGGAGTGCGCCCTTTTACAAGAATGATGGAAGTGCAACGAAATGCGCCGGACTGGTTCTATGGTCTGCAAAGCTTCTGGCTTACCAAAAGAAAGATGAGCCAAAATCATTCTTCGTTTGACGTTGAAAGACTCGAGAGACTAGAGCATGCCAGAAACGGGGAGTTAAGGTTAAACCTATAGACTGAAAAGGCTCCCCCAGCTAATAGGCCCATGGTTCCATTCTTTAAGTTGCTAGAGGTACACATTCCTCTTCTCGGTGTAGGCAATATACGGGAAATAGACTACTCAGCCTGCAATGTCCAATAACAGCGCTGAAGTATTGAATCTATCGGCACCACAGCCAGTGGCATACGACTTCGAATCTAACAGGCCCGGCCCCGTCATTTTCTGGAATAGGGGATCCCCTAACGTTGACAACAACCATGGTAGTGGCAAAACTGCCGGAAGAAGAAGAACGAGCCTCTCTGAGGCTTGCTCTTCTTCTTTGGGGACGGAGGTCCTCCAGTAGGTAACATCAAGAACAAGAACTTTACCGAAGGGGACCAGCGCTTATACCGTACTGAAGTCTCGGCCGCTCGCAAGGGACGTCGGGCAATTTCAGCGAAAACTCAAGGGTCACAGAAGATTTACTTACGGTGGAAATGTTACTATCTTAGTCTATTCGACCTAATAAAGAAAGAGTTACAAAACTGCATATCGCAGGATCAAATGAAAATTTGGGAACATTACTCCAGGAGTCGGCGAGTCCACTCTCGACGATCCAGGGCGTGACCCGTCTTATCATC",mutations={["ANOAT&mit1&c_65410_66445_1"]={},["ANORU&mit1&c_65488_66523_1"]={},["ATRAN&mit1&c_71612_72638_1"]={A={108,288,295,349,383,407,523,532,572,581,625,641,871,874,898,906,949,952,956,970,990,1005,1012},T={70,132,151,225,260,334,460,629,638,672,794,806,810,902,913,917,931,948,961,974,981,995,997,1011},G={96,268,352,386,415,484,511,518,534,565,570,618,765,773,813,850,854,873,878,977,1009},C={66,315,355,373,473,480,635,637,639,674,736,776,808,811,881,903,932,962},['-']={361,660,919,920,921,922,923,924,925}},}}end)();
(function()addBlock{name="s3x1017",consensus="ATGGAGTACATGGATTCCATAAAATGCTAAGAAAACTAATTAGGTTATGATTAGTTTTGGCGGCCACGCCTTCGGCCCTTGTTGAATATCTGGCACTTTGCCATGACCTTTCGGGGGCGATGTGGGGCTCCGCCCCCCCAATGGACTAGGTCCTTAGAGGGCAGAGCGGGTAAGTGCTTAAGTGGCACCATCTGCTAAGACGTCTAAATGCTTTCCTTGATAACCGGAAGTTCTGAAAAAGTGTGAAATGCCGGAGGGCTTTTGACCATCCATTCAAGTGTCGTTGAATTCTGTTCAACAGCCCAAGGACTTGAAGCACACTTGTTTTCACTGGTTAGGGTGGAAAAAACCACTACAAAGAAACACAAAATTCCTACTACAGAAACATACGAGCCGAAACTACTAAAGGCATTCCATCCAGCGTAAGCATCTGGATAATCTGGAATGCGACGTGGCATACCTGCAAGACCTAAAAAATGCATAGGAAAGAAAGTCAAGTTCACGCCGAAGAAAGTGATCCAAAAATGAATTTGACCTAAAGTCTCTGGATATTGAAGACCAGTTATTTTCCCTATCCAATAGTAGAATCCTGCAAATGAAGCAAAAACAGCTCCCATAGAAAGAACATAATGGAAATGTGCAACCACATAATAAGTATCATGTAGAGCGATGTCCAGCCCAGAATTGGCCAATACTATTCCAGTAAGAGTAGAGTAGGTGCCCTTACTCGGGTGGGGCCAATTTTGGATTTCCTTTGCGCCTCTAGTGCACCTCTCTCGTAACCGTACATGATAGTTTCCCCATCATACGGCTTGCACGCGCGTCTAATTCTTTTACGACTTGGCACGGGTTTTATAGCCTGTACCGACGTGTCGAACAAGGCTGCGATTGCCTCTCCGGTTTCTTTCTTTTCCTTCTGAGATTCTCCCTTTCGATCGGGGAGAGTCAGAGTTCGAAGAAGTCTTTTCTTCCCTATGTTGCTATTTGATGACTGTTGAGCATGGTCATTTTGTCCTC",mutations={["ANOAT&mit1&c_1398_2347_1"]={['-']={26,27,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,95,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,145,146,147,148,149,150,151,152,153,154,155,921,924,925,926,933,945,946,991,992,993,994,995,996,997,998,1003}},["ANORU&mit1&c_1511_2460_1"]={['-']={26,27,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,95,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,145,146,147,148,149,150,151,152,153,154,155,921,924,925,926,933,945,946,991,992,993,994,995,996,997,998,1003}},["ATRAN&mit1&c_2286_3289_1"]={A={12,14,24,30,73,75,90,242,337,341,342,365,488,503,506,509,515,569,597,668,686,837,866,922,937,938,950,953,967,975,976,980,1009,1014},T={2,5,16,17,18,22,72,74,77,218,251,376,760,762,798,824,858,864,865,873,877,896,916,918,954,955,956,970,971,989,990,1005},G={23,86,89,120,222,236,239,313,747,878,888,951,962,963,966,968,972,977,978},C={11,20,25,87,91,94,122,338,590,730,743,792,832,834,852,853,893,904,908,909,919,947,957,958,959,965,973,987,1011},['-']={58,59,60,61,62,63,64,65,66,67,68,69,887}},}}end)();
(function()addBlock{name="s3x961",consensus="TTTTTTTTGCTGCGCTCTCCGCGCATATTTTCGCCCTATAGCACTATCTGAATCTTTAAATGATTATAAAGTTTTTTTAAAAAACAAAAAACAAAAAAACGTATTTGATAATTATTAAACAAAATACTCTGAAAAGAATCAAGATCCAATTTCGTGTTATTTCATGGTGAACATAATCTGTCAGAATTTCTTCAATTCCCACATGAATATGCCAGAATAACAAAATGTTTAACAGAATCAAAGTAGAAACATTTGATATAAAAATGGTTGGGATTAGAGAAGCGGCAGTCATTCTTTGAAGAAGCCAATGCCCCAAGGTTTCTCTATGAGCTTTCATTGCTTTTTACCTTTTTTTTCGAGAGTAAAAGGAAACTGGCCTTTTTGGTCCGGCCCCTTCTTGTAGAAGCGTATGTGACAATTGTCCGTCATACGGCTCTGCCTATCTAAAAAGTATCCTGTCGGCCGAAATAATACTGGAACAGGTTGTAGGCTTGTCTTGGTTAAGCCTCCGCAAGATAAAGTAGACCCAATTCCGAGGCATCGCTGAGCTGATCAGGGAACAAAAGTCTATATTTATATAGACTTTTGTTTCGCCTCTAGGGATTATCGTATTTCGTGCCTATGAGAAATAGAATCGGATAATATTCGATACAGCTAAAAAAGTTGCACAGAATAACATAATAATTCCGGAAGTATATACTTTGGATAATTCTAAAAAAAAACCTAAATCCCACAATAAATGACGAATTCCATTACTCATATGATAGCACAAAGCCAATAAACTGAAATTGACTACGCTTGAAATCAACCAATAGAAATAGAAAGTGAAGAAAAAAGCGTACCGGTAAAGATAATAAGAAGTAAGGTTAAGATCGCCTATTTTCAAGAAGAGGATACTAGAAAAAACCATAATGGATAGAGTCAAACTTCGGTAGGAAGTTATGATTAACCCCTGCCTCCT",mutations={["ANOAT&mit1&c_28348_29295_1"]={['-']={355,550,560,573,574,587,593,594,595,596,597,598,602}},["ANORU&mit1&c_28423_29370_1"]={['-']={355,550,560,573,574,587,593,594,595,596,597,598,602}},["ATRAN&mit1&c_31052_32011_1"]={A={1,3,100,142,226,399,420,481,493,498,534,557,565,567,625,647,688,800,838,843,844,849,874,889,892,899,934,943,958},T={16,19,24,31,34,139,313,396,430,463,495,508,509,580,582,614,619,950},G={58,89,121,124,193,240,244,261,363,365,446,477,512,519,524,528,535,603,714,720,726,772,782,813,830,885,888,910,911,940},C={29,30,44,48,56,187,319,344,394,405,419,421,436,492,504,521,544,549,611,613,616,622,659,663},['-']={77}},}}end)();
(function()addBlock{name="s3x928",consensus="AAGACCGTGGTATTCCATAGAATATAGCATACTTAGAATCTGCAATCAATTTGCAATCACTACGTAATTCCATGATGCGAAAGAAGCATAGCAAGTTTATTGGACCAAAGGTTCTACTCTACATAGTGAATGCATTTTGGTTTATGGGTAGTAAACCTTAGTATGATGATGATTTAGTTAGTGATACGCAGAGGTTTTCTATTGGAAGTTTGGCAGGTTCAGAACCTACTTCTGTGTAAAAAATCATACTCAAAAAAAAGAGTTTGATCCTGGCTCAGAATGAACGCTAGCGATATGCTTAACACATGCAAGTTGAACGTTGTTTTCGAATCAGAATGAGAACAAAGTAGCGAACGGGTGCGTAACACGTGGGAATCTGCCAAACAGTTTGGGCCAAATCCCGAATGAATAAAAGCTAAAAAGCGCTGTTTGATGAGCCCACGTAGTATTAGGTAGTTGGTTAGGTAAAAGCTGACCAAGCCTACGATGCTTAGCTGGTCTTTTCGGATGATCAGCCACACTGGGACTGAGACACGGCCCAGACTCCTACGGGAGGCAGCAGTGGGGAATCTTGGACAATGGGCGAAAGCCTGATCCGGCAATATGGCGTGAGTGAAGAAGGGCAACGCAGCTTGTAAAGCTCTTTCATCGAGTGTGCGATTGTGACAAGACTCGAATAAGAAGCCCCGGCTAACTCCGTGCCAGCAGCCGCGGTAAGACGGGGGGGGCTAGTGTTATTCGGAATGACTAGGCGTAAAGGGCACGTAGGCGGTGAATCCGGTTGAAAGTGAAAGTCGCCAGCTCAACTGGCGGAATGCTTTCAAAACCAATTCACTTGAGTAAGATAGAGGATAGTGGAATTTCGTGTGTAGAGATAAAATTCACAGATATACGAAGGAACACCAAAAGCGAAGGCAGCTTTCTGGGT",mutations={["ANOAT&mit1&c_30974_31890_1"]={['-']={48,49,50,51,52,53,54,55,56,57,58}},["ANORU&mit1&c_31049_31965_1"]={['-']={48,49,50,51,52,53,54,55,56,57,58}},["ATRAN&mit1&c_33785_34704_1"]={A={69,73,90,167,176,198,221,333},T={15,104,133,156,213,250,401,673},G={21,33,34,71,97,329,332,348,410,785},C={12,19,22,35,131},['-']={83,84,85,116,117,118,119,120}},}}end)();
(function()addBlock{name="s3x919",consensus="AGCTTTTTGCATCCCGCGCGTTCAAAGGTCTTCGACCATCGGTGTGCATTATTCTGCGTTCATCAAAAGCAAATCCCAGCTTTTTTTATTATGGTTGACGATGACGCGCTTAAGAAAGTAAAGAAGTGATGTAGCAACTGTTTTGATGCTCCCTACACCAGTCTTTTAATGAAGGTTTATAGCATCATTTAAGTAAATACAGATTAAAATAGTAAAAACATAAGCTTGTAATATAGCAACACCTAATTCCAAACCAGTTAATGCGAATACTATTAAAAAAGGAGCAAGATGCGCTAAATACATAATACCCCCCATAGATAGCATAGTCCAAGCAAACCCGCTTAGAATCTTTACTAAACTATGACCAGCCATCATATTGGCGAATAAACGTATTCCTAGACTTAATGCGCGAAAACGATAAGAGATTAATTCGAGAAGTACTAGGAAGGGTGCTAACGGCAAGGGTACTCCTTGCGGCAAGAAAAAACTAAAAAAATGAAGCCCATGTGTTTGGGATCCAACTATAGTGATTCCGATAAAAAGAGATAATGAAAGACCCAGGGTAATTATAAAATGACTTGTTACTGTAAAACTATAAGGTATCATACCAATAAGATTACTAAATAATAAGAAAAGTAAAAGTGACAAAAATTAGAGGAAAAAAGCGTTGTTTTATCGAAGAAGGACCGCTTATTTGTTCATTTACCAAGTTAAGCACAAAATCATAAATAATTTCAACAAAGGATTGCCAAGCATTTGGTACTAAGTGTCCTCCATTTAAAGTAACGAAATGAACTAGAAGCAATACTAGACTGATAGTTAATAGCATAAACAAAGATGAATTGGGTCGGTAGGGGAAAAAAATCATTTTTTTTTTGCTCCGTTTGAACCTTACTTAGGCCCAGGGTTTAGAGCCGTT",mutations={["ANOAT&mit1&c_58107_59020_1"]={['-']={59,74,111,631,866}},["ANORU&mit1&c_58185_59098_1"]={['-']={59,74,111,631,866}},["ATRAN&mit1&c_63462_64361_1"]={A={31,201,287,344,381,398,416,432,443,447,513,514,561,620,688,798,810,881,882,886,909,911},T={22,39,53,98,137,150,151,291,480,664,848,902,903},G={50,61,121,234,240,351,411,428,481,540,570,612,655,784,829,867,884,914},C={4,7,21,82,273,396,429,507,673,703,736,887,907},['-']={64,65,66,67,68,69,70,71,80,114,628,865,894,895,896,897,898,899,900}},}}end)();
(function()addBlock{name="s3x861",consensus="CGTTCCAGCAATGGAACGGCTTAGGAACCGATATGATGATTGGTTTAGGTACCAATTTTTGGGCTAATTCTCTTTTCATACTACCAAAAAATGAAATTATTGCCGAATCCGAGTTTGCTACTCCAACAATTATTAAACTAATTCCTATTTTGTTTAGTACTTCAGGTGCTTTTATGGCATATAATATAAATTTTGTAGCAAATCCATTCATTTTTGCTTTGAAAACTAGTACTTTGGGTAATCGATTATATTGCTTTTTAAATAAGCGCCGGTTTTTTGATAAACTTTTCAATGACTTTATAGTCAGGTTCTTTTTGCGTTTTGGATATGAAGTTTCATTTAAAGTTTTAGACAAGGGTGCTATTGAAATCCTGGGACCTTATGGAATTTCGTACACATTTCGAAAATTAGCCAAGCAGATAAGTAAACTTCAAAGTGGTTTTGTTTATCATTATGCTTTTGTAATGTTGATCGGCTTAACCATATTTATTACCATAATAGGTCCGTGGGATTTTATTTCTTTCTGGGTAGATAATCGATTGTATTTTATTTACATAGTGAGTTTTCTATTTATTCATTTTGAAAACGACATTAGCACGAACTAAAGGGGCATACTTCCTTATATAATACCATGAAACTTTGAGGGACGCAATGATAAGCCAGTGCTACGCCCTTTTTTTGGCCCCGCCGAGAGGGAGGGCTGAGGCCCGACGAAGCCTAACAAGCAAAAAAAATAGATTTTTTGGAGCCTAAGCTATGCTCTGCGGTCTAGCTATGATAAACCGTGGGAAGAAAATGGATCCCTTCGAACCTGACTGGGGCCGTCCGGTCATAATAGCAAGCCCTAAAGTAAAGCACGTT",mutations={["ANOAT&mit1&c_48841_49659_1"]={['-']={803,804,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849}},["ANORU&mit1&c_48919_49737_1"]={['-']={803,804,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849}},["ATRAN&mit1&c_54452_55271_1"]={A={175,204,284,307,469,586,587,606,607,641,680,693,721,736,748,749},T={76,109,137,162,269,289,304,371,472,523,553,609,647,683,684,685,688,756,758,759,761},G={25,178,343,367,376,385,463,690,752},C={98,133,214,219,313,322,334,620,701,745,746,747,751,760,809},['-']={708,709,710,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,856,857}},}}end)();
(function()addBlock{name="s3x857",consensus="TAGTCTTATGGCTAAAGATACGAGGTTATTCCCGAAAAAAAAGATTTTTCTGTTCAAAGCTGCCAGTACGGAAGGCAGTTAATCTATTGTGTGCCTTAACAAAATTATTGTATAGTACGACGCAAGGTTGCCCTCACCTCCACTATTTGTGCCATGCGGTTTATTATTCAGAAAATAGAAACCATGTTGACAAACATAGCATTTGTTTGATATAGAAAAAAAACCCGGCATCACTTACTTAAATTCAGGGTATGTCGAAGAAGAAGAAGAAAAGAAACTAAAAAAAAAATAATAATAATGATCCTATGCTAATAAAACAAATTGTTATACGGAAAAAAGCCCAAGAGATTGAAAAAAAATCTCCATATATTCTTTTATTTCATTGTAGTGGCTTGACAAGTCGACAATGGCGACAACTCAAAAATCTATTGTGTGCCTTTCGAGGTAGAACTTTATTTCGACCAAATTACAAAAGAAAACTACCACGTAGAAACAAGCAAGGTGGTTTTATTGAGCAGCTTGCTTCTAGCGCAGGTCCCACTTGTATCTTGTACTTAACTAAAGAAGCACCAGATAATACATGGTCACAGTTATTACCTTTGGCCTCATACAACCAAAATCTAGTTTTATTATACGGACAACTTCAATCTACTTTAATCAATCATATGGATATAGAAAAAGCGGCTAATTTAGAAATAACATCAGTATTTCAACAACTTTTTGAGCTCATTTTTTACCCATATAATTCTTTATGTTCTTGTTTGAACAAGCCAATTTATGCTCTACCCACTATACAAGAAAAGACGCAAGGAGGGTTGCTTAGTCACCAGAAGATAACCAACCACTTAATAACTAAC",mutations={["ANOAT&mit1&c_40824_41650_1"]={['-']={3,4,5,27,28,29,30,31,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79}},["ANORU&mit1&c_40884_41710_1"]={['-']={3,4,5,27,28,29,30,31,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79}},["ATRAN&mit1&c_46129_46960_1"]={A={10,11,23,25,84,86,87,89,90,91,130,185,188,247,256,259,268,425,459,486,489,572,589,601,674,794,804,829},T={13,24,41,49,83,88,151,152,177,245,255,262,529,558,606,682,771,798,801,805,812,813,814,827,830,832,838,840,851},G={18,40,80,85,106,111,181,211,240,258,274,280,403,473,560,592,655,656,764,790,792,795,799,808,820,828,837,839,841,842,843,845,850},C={14,45,46,81,108,115,154,175,207,244,379,520,559,600,607,654,696,744,749,762,767,793,802,803,809,810,833,834,846},['-']={16,36,37,38,39,52,213,775,776,777,778,779,780,781,782,783,784,785,786,787,822,823,824,825,826}},}}end)();
(function()addBlock{name="s3x845",consensus="TAAAAAAAAATTAAGTCAAGTTTATGGAAGCCAAATTCTTTTGTTTTTTGGAAATAATTGGAGTTGGGTACAAAGCCAGTACTAATCCACAAGGCTCTATTTTATATCCAAAATTAGGCTTTAGTCATGAGATTCGACTCCAAGTCACGTCTGCAGTTCGCGTTTTTTGCTTCAAGCCCAATATCATTTGTTGTACCGGAATAGATCATCAAAAAGTAACTCAATTTGCTGCCAGCATCAAAAGTTGTAAACCTCCTGAAGTTTATAAAGGAAAAGGTATACAATATCGAAACGAAATTCTACATAAAAAACAAGGAAAAAAAAAATAAATCATGTCATATATTTTAGGAACTAATTTAGTGCCGAATGAACAAGTAGAAATTGCTTTAACTCGAATCTTTGGACTTGGCCCTAGAAAAGCAATTCAAGTGTGTGCTCAATTAGGTTTTAATGATAACATTAAAGTTAATAAGTTAACTAAGTATCAAATTGACCGAATTATCAAAATAATAAGTCAAAATTATTTAGTTGATTTGGAATTAACGAGAGTAATTCAGAGGGATATTAAACAATTGATGAGTATTGGTTGTTATCGCGGTTTTCGCCATAATGCGGGATTGCCCTTACGTGGTCAACGAACTCATACTAATGCTAAGACTTGTCGCAAATTCAGAAACGTTTCGATCAATCAACGAAGTTGATTCAGGCCGCAGGCTGTAAGTCTTTTTTTATTATCCATGATAAATGATGAAGGCGCGAAGCGATGTGTAATGAAATTTAAATTTCATTACACAGTTTGTTATTGGCTTTTTCTCCGCAAAAACATCATCGATTGGTAAGGCCGG",mutations={["ANOAT&mit1&c_98398_99241_1"]={C={779},['-']={722}},["ANORU&mit1&c_98478_99321_1"]={A={37},G={778},['-']={722}},["ATRAN&mit1&c_108197_109041_1"]={A={118,135,404,414,435,535,556,613,682,739,746,757,767,785,790},T={107,139,195,196,238,362,595,708,716,735,775,794,817},G={115,141,274,307,467,526,542,788,793,827},C={1,11,85,182,400,430,441,446,448,534,729,732,738,784,811}},}}end)();
(function()addBlock{name="s3x695",consensus="TGCGATAGTAGCCTTTAAAGACTTGAGTGAATTTTTGGTCTATGTCAGTTAGTGAGAGCCTACCTCGCAGTACTGCATGCCTTTCCAATTATGCCTGTGAATGCCCTTACTATTACTATACAATAACGGCAGTCACAAGTTCAGTCGCTATTATGAAATATCACGTTGGCGCAGGGCGCTCTAATAATCTACTCCGTTTGAACTTCATACATAAACAGTTACTTCTATCGTTCAGAATGACGAAGCCGTTGCCCCATCGGGGCCAGGTTAAAGGGCGCATGAGGCGAATTATCATCCAACAGCCAGGGAAATGAGCGGCAGATTGGTAGAACAGCGGATTAATAATTCGCATGTCGGAATAGTTTAGTCGGTTAGAACAGCGGGATCATAATTCGCACACGGGGGTTCAAATCCCTCTTCCGATAGGAACTTTCGGATAAGAATTGAACCTACGGGATAGTGGGAGGCAAAAAAAAGATATATATATCGTTTTTTTGCTGGTCACTAACCTTATCCTAAATCTCCTTCTTCTATCACAGAACACGGTAAAGAAAGATTTACCATGGTTCTTAGCATAACTAGAAATGCAACATAATCAATGTTGTTCTGACAAAGCGATCAATCATCATAGAGTAATTCATTAAAATACATAGAGACTCAAATTGCTAAAATACATAGAGACTCAAATTGCTATA",mutations={["ANOAT&mit1&c_33127_33742_1"]={G={342},['-']={12,13,14,15,69,70,71,72,73,74,75,76,77,116,117,118,130,131,132,133,134,135,136,137,138,157,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,457,458,459,460,461,462,463,464,566,567,568,569,570,571,572,573,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,632,691}},["ANORU&mit1&c_33186_33801_1"]={['-']={12,13,14,15,69,70,71,72,73,74,75,76,77,116,117,118,130,131,132,133,134,135,136,137,138,157,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,457,458,459,460,461,462,463,464,566,567,568,569,570,571,572,573,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,632,691}},["ATRAN&mit1&c_36815_37482_1"]={A={3,52,148,165,166,170,173,247,249,258,263,266,273,282,324,338,538,636,648,652,654,656,665,677,683},T={7,26,57,58,85,94,105,120,171,180,191,205,250,252,253,254,255,257,368,536,541,543,565,581,639,645,647,651,653,659,660},G={20,31,56,59,61,161,262,267,268,275,471,534,539,561,596,643,644,655,661,684,686},C={38,49,54,55,64,91,95,112,164,185,189,198,204,213,223,259,264,265,269,270,272,455,491,513,525,540,586,630,635,637,664,666,670,679},['-']={153,307,311,312,313,314,429,433,434,435,436,437,438,439,440,441,442,443,444,445,487,529,530,531,626,681,682}},}}end)();
(function()addBlock{name="s3x677",consensus="GAACAAAGCGGTGAAAGGCGAAGCATGCAATTACATAGTATGCGCGTATAAAAGCTCATCAAGTTATGCAATTATTGCGGGCTTTATGTATGATAAGTGCAGGGGGTTATGATGATATACCCATAAGGCCTCTATGGCTGGAAAGCCGGGAGGAAATATGGACCCGCGGCCTGCGAAGAAAGCTGCGTCCCCGGGATCTTCTGGAAAAAGAGTAAACATTTATGTTACAATTTTTAGCTCCATTTTATTCCAATCTCAGTGGTCTCATTCTGTGTCCTTTATTAGGAAGCATCATTCTTTTCGTTATCCCCGATCCCAGAATACGACTGATACGAAGTATTGGTTTGTGCACCTCTTTGATTACTTTCTTATATTCCCTTCTTTTCTGGATACAATTTGATAATTCTACAGCCAAATTTCAATTCGTGGAAACCATTCGATGGCTTCCTTACTCAAACATCAATTTTTATATAGGTATAGACGGTATCTCTTTATTTTTCGTGGTCTTGACCACATTTTTAATTCCTATTTGTATCTTAGTAGGTTGGTCCAGTATTAAAAGTTATAAAAAAGAGTATATGATAGCATTTTTAATTTGTGAATCTTTCATGATTGCTGTGTTTTGCATGCCGGATCTTCTATTATTTTATGTTTTTCTTGAAAGCGTTTTAATCCCT",mutations={["ANOAT&mit1&c_49870_50545_1"]={['-']={91}},["ANORU&mit1&c_49948_50623_1"]={['-']={91}},["ATRAN&mit1&c_55272_55928_1"]={A={9,80,107,147,151},T={42,73,190,200,265,292,301,310,314,315,352,367,385,412,451,481,499,535,630,638,656},G={1,2,125,130,280,370,586},C={11,48,55,90,356,397,406,506,532,536,596,641,652,658},['-']={105,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182}},}}end)();
(function()addBlock{name="s3x670",consensus="GGAGGAAGTTGCGTATCATGGGTACCTTCTTCTCGCCGCGAAGGGCGATATGAAAATGACCACCCCCTATCCAACCTCATTCTGTTGCGCGAAATCCATCATTGGCTAAGCAATTATTTGGTTATGCCATTTTAGGTTTCGCTTTAACAGAAGCTATTGCTTTGTTTGCCTTAATGATGGCCTTTTTGATCTTATTTGTTTTTTAATTTTTCGGTGCTGGGATTTTTTGGGAAAAAACATATCTATTTTGGCTGCACTTTGTTGGCGTAGCCAACAGGGCTGCGCCCAAAAAATCTAGATGTTTTATTTCCTAAAATGGGCACCTTAGGGCCGAACGATTCGTACGTTCGAGCCCTTCACCACTTGCTACCAGGAGCATGAGCGTAAAAGAACTGAACTGAGAACCTGCGGCCTTTCCAATGGGGCGGGTTTAACCGTTGCAACTGCTTTGGGAGCAGAGCCCTAAAGGCTCATTGGGATGAAAAGAGAAGCAGGCGCGAAGCGATATATATATATCTATTTTTTTTTTCTTTTTTAGCTGTTTCACTTCTCGTTCTAAATAATCTTTAATAATCTTTCATAATGCATAGCTTCGCGTGCTTTTCGATCGATGATGGGACCGAAGACCAAAGGCCGCGGGTCTATATTCTTTTTTTTTTTGCCGCCGCAG",mutations={["ANOAT&mit1&c_103599_104224_1"]={['-']={2,5,61,65,66,236,239,305,306,307,308,309,310,311,312,313,314,315,316,317,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,478}},["ANORU&mit1&c_103697_84_1"]={T={478},['-']={2,5,61,65,66,236,239,305,306,307,308,309,310,311,312,313,314,315,316,317,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445}},["ATRAN&mit1&c_114315_114927_1"]={A={12,31,38,187,190,242,260,266,267,373,379,381,397,398,399,401,477,480,509,511,516,529,555,585,605,644,653,655,656,657},T={16,25,33,36,211,274,380,396,400,455,459,544,546,549,551,593,604},G={30,181,227,271,387,481,482,484,486,553,568,618,622,625,652,654,658,659,661},C={9,37,199,203,257,258,263,300,367,449,463,514,534,541,542,554,611},['-']={39,244,249,404,405,406,407,408,409,410,411,412,413,414,415,416,417,476,496,497,498,499,500,501,502,503,504,505,506,507,528,574,575,576,577,578,579,580,581,582,583,628,629,630,631,632,633,634,635,641,646,647,648,649,650,651,667}},}}end)();
(function()addBlock{name="s3x632",consensus="GCCCAGGGCTCTCCGGAGAGAACCTCTTAATTGAGCAGAGATTGTTGCGATCCGCTTTGATTACGGAAAGTGAAAAAAAAGTTTATCATAGAAGATTGTTATAAAAAAAGTTCTTCCCATTTCTGTGGATTCTTTCATAGAGTACCTAAAAATATAGTAAGCTACAGAATCTTTTCGCTTCTTTTTGTCATCTTCAAAATTAGTGTAAGAATAGTTACAACGGTGTTCTTTATTTCCGGAACATCTTTTATTCATCATTGGATTTTAGAGGGTGTTCCAAAATGATTATTCTGATAGAAAAAATTGGACAGTCCATAATGAAATTACAGCATTTCCGAGATGTTTTCTTATTTAAGTATCATGGTTTTTAGATTTACTATTGTGTCTATTCAAGAGCCCGTCGGGTTGTTATGAGGTTTCGTAAAAAAGGAACCGAACTTGAATTTAATCGAAGTAGCGGGAACCTTAGCTGATAGTAATCGTACGCTGTCAGAAAAATTAGATTTCATTCAAAATGTAATAATGCATCGTTGGGTGTATCGATTGTTTCAAGGAACGCATGCAGCAGGGCCCAGCTCTCTCTCCAGAGTATTAGATGGTTCCGACGAACATCGAGCATCCAACCAAAATGA",mutations={["ANOAT&mit1&c_38959_39489_1"]={['-']={54,55,56,57,58,59,60,83,101,102,103,104,105,106,107,108,244,249,250,251,252,253,254,255,256,257,258,259,265,266,267,268,269,270,271,272,273,274,275,276,300,301,302,303,304,305,306,307,308,389,390,391,392,393,394,395,465,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,561,562,563,564,565,566,567,568,569,570,571,572,577,579,580,581,582,583,584,585,619,620,621,622,629}},["ANORU&mit1&c_39018_39547_1"]={['-']={54,55,56,57,58,59,60,83,101,102,103,104,105,106,107,108,244,249,250,251,252,253,254,255,256,257,258,259,265,266,267,268,269,270,271,272,273,274,275,276,300,301,302,303,304,305,306,307,308,331,389,390,391,392,393,394,395,465,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,561,562,563,564,565,566,567,568,569,570,571,572,577,579,580,581,582,583,584,585,619,620,621,622,629}},["ATRAN&mit1&c_43407_44008_1"]={A={71,80,116,176,213,227,336,399,404,450,458,560,603,606,609,611,616},T={52,93,115,145,165,188,194,221,236,296,326,335,376,398,401,428,440,471,525,612,615},G={135,136,155,167,175,179,225,343,371,372,422,423,441,449,506,511,590,596,604,608},C={30,133,181,182,185,193,202,231,240,294,348,380,400,559,614,618},['-']={31,32,33,34,419,420,527,529,530,531,532,533,534,535,536,537,544,546,547,548,549,550,551,552,553,554,591,592,599,600}},}}end)();
(function()addBlock{name="s3x631",consensus="AGGTATCCATATACGGGTGATGTCACGAGGCAACTCTTTTGATAGACTCAAAAGTTATCAATAACTTCATTATTATTCTAAGAAGAAGCTTGGGGTCTAGAACACGGGGCATTATGATGTCAATCCAGAGGGCATAAAAGGCATCCCGACCTTGCCGCTGAAAAAAGAATATGTTTGCTATGCCCTATAAACGCCCGTTTTTCAGAATATGCTGCAACCTGCCTTTTTTTCCAATAGCAGTCGAATGGATGAAAAACCCGTAGCTGCTTAAAAGCGACCGTTAGATTTGCGTGAGAAAAGCGAAGAAGGTGGTTGACCAACGCCGCGCGGCACGCGCGTGCTTGTCCTAGGCCGGTTTGCTTAGGGTGTTGCTTACGCAGCGCTCTGGAGAAGCCTTGTGCTGATGGTATACCAGTACCCTTTTTGTGGGAACCGAATAATAAATAGAGCTCTGCGGTCTTCTTCGTTCATTATGCGGGGGTGCGCGGCTTATGTGAGAACCCGCGCGCCCCCCTCCCCCTCCCCTTTGTCATTCGTCTGGCCCTGACCGCTTCGTTCGTAAAACGCGGCATTATGTAAAGATTATGTAAAGTTTACATACATATTCAAATAGATGGGCTAGATGCACGAA",mutations={["ANOAT&mit1&c_70675_71281_1"]={['-']={102,103,104,188,189,190,191,192,198,199,200,201,202,203,204,212,213,214,249,251,259,531,532,533}},["ANORU&mit1&c_70753_71359_1"]={['-']={102,103,104,188,189,190,191,192,198,199,200,201,202,203,204,212,213,214,249,251,259,531,532,533}},["ATRAN&mit1&c_78021_78615_1"]={A={6,26,33,35,40,92,94,108,130,242,275,290,292,301,353,365,449,507,564,567,617,628},T={25,99,149,166,194,195,222,317,349,352,359,378,380,382,384,446,517,521,522,523,524,528,537,541,542,543,548,557,566,627},G={41,62,67,83,101,142,216,221,231,248,271,281,368,391,408,440,544,582,608,618},C={14,38,39,75,89,225,245,344,347,355,356,357,379,385,450,457,467,514,538,552,555,568,581,620,626},['-']={8,9,10,11,12,233,308,309,310,311,412,414,415,416,417,418,419,583,584,585,586,587,588,589,590,591,592,593,605,610,611,612,613,614,615,616}},}}end)();
(function()addBlock{name="s3x620",consensus="AGATCTTAAAAGGAATTGAGCAAAGGCTATAAGCACTCGATAGGGAAGAGAGTTATGCCGCACAGTTCCGGGTATAATGAACCAGCATTCAATGGGAAGCAAAGAAACTACGCACGGACAAAATATTGATGATTTGATTGTCCCCGTCTATAAGTGACAGGTTTCAGGAGAAGGGAGCCGTGTGATAGGCGACTATCGCGCGCGGTTCTTTGAGAGGGAGCCGGGTTCTATATCCTGTGCTAGCGCCTAGAGATGGGTGCGAACCCTACTCTCGAGGTTCTGCGGCTCAGTCAAAAGCTATGAAACAGGTATGCGGTAGCTTGAAACTAGAATTAGCGCAATATCGTGAAGTAGCCGCTTTTGCTCAATCTGGTTCAGACCTTGATGCGGCTACTCAGTATCTATTAAATCGTGGGGCGAGGCTAACAGAGGTTCTTAAACAACCACAATATAGCCCAATTCCTATTGAAAAACAAATAGTTGTTATTTATGCAGCTGTCAAAGGTTATTTAGATCAAATTCCTATTTCGAGCATCAATCAATATGAACATGAGCTTTTGAAGTCTATAGACTCAGATATACTTTCTGCTATCGTACAACAAAAAAACATTACTGAGCAG",mutations={["ANOAT&mit1&c_83263_83868_1"]={['-']={3,9,10,11,12,13,14,15,16,17,18,33,36,72}},["ANORU&mit1&c_83343_83948_1"]={['-']={3,9,10,11,12,13,14,15,16,17,18,33,36,72}},["ATRAN&mit1&c_92117_92719_1"]={A={27,38,49,51,68,70,92,137,155,322,529},T={22,24,56,58,60,62,64,71,104,106,110,143,233,291,313,388,401,418,535},G={20,61,63,96,97,102,108,142,150,156,292,295,481,576},C={21,25,48,53,54,55,69,77,91,93,95,113,180,229,235,257,370,478,572,610},['-']={42,82,83,84,85,86,87,89,117,118,119,120,121,122,126,127,128}},}}end)();
(function()addBlock{name="s3x586",consensus="TCACTCGGAAAACTTCAATTGCTGAGATTCTTGTATCAGGTGCGACTCGAAGGATGTGTTGCTTAATAGGGGCCTAGGACTGATAGTATGATATTATCTGCATTTCCTAGCTTCTTTGCATGATACGCTTCGCGGTGAGCTTTATATAATGGAATCTGCTTTCGTTTATATGCTCTGGGCAACCATTCCTGGTGGGTAACCTTAGTTTCTTATTCGAATCTCTACTTAAACGTCTAAAACAGTCCTTACATGATTTATTTCCATATTCCTATCACCGCAGATGGCACAAATCCAACCTAACCCAGACTCGTAAAATTTTTCGGTCCACTAAACCTGCATAACCTAATTTGGAGTAGCTGTTTGGCTGTTCACCTTGTAATCATGTAGAACCTTATAGTTATTTGGAATCGTCAGGCTACTCTAAGTATTCAGGCATTGAAGCTTAGCTCCAATTTTATTGAACCCTTTTTCTTCAGTTCGGAACTTCGATTTGAAAGCCGGGCTTTGGATGCATGAGTGAACTAAGAACCATATCACTTTTTGCAGATTTCTTTCATCAACCACACCACAGTCATAATTAAGAATT",mutations={["ANOAT&mit1&c_7746_8296_1"]={T={44},['-']={184,185,186,187,188,189,190,191,192,362,363,364,365,366,367,368,369,465,466,467,468,469,470,471,472,473,501,511,512,513,514,570,571,572,580}},["ANORU&mit1&c_7858_8408_1"]={['-']={184,185,186,187,188,189,190,191,192,362,363,364,365,366,367,368,369,465,466,467,468,469,470,471,472,473,501,511,512,513,514,570,571,572,580}},["ATRAN&mit1&c_8781_9366_1"]={A={6,23,29,39,60,69,77,112,115,116,134,193,215,309,321,327,335,479,486,505,565},T={48,100,109,113,119,121,132,174,204,208,214,219,221,244,260,274,291,301,358,478,487,492,554,557,559},G={50,196,223,227,254,285,293,294,298,314,329,336,354,361,377,408,423,439,441,463,482,508,524,562,566,568,584},C={44,70,98,108,120,142,144,234,242,263,323,347,348,357,401,402,582}},}}end)();
(function()addBlock{name="s3x585",consensus="GCTAAGGCTTGAAACGCCCTGCTATTGGCCTTGTTATAATGGCTATTGGCTGCTATTGGTCGAGAGCTTTACTTGATAACGAATCGGTTAGAGCTTTACAGCAAAGCTCCCAGCTTTTAGATGACCTATCTTTTGTAATAGTAAAATATGCTTCGCCCTTTAACTTATGTTCTAATGTGTTTACTTCTTAGAAAAAAAGAGACGATTTGTGGATAACCAATCGTTTTTCAAATCTCTGATAGCTACTTTACCGAAATGGATACATCAATTTCGAAAATCAAAACATGAAAATATATTCTATACCAATCCTGATTACCTATTTCAATTATTATGGTTTTTGAAATATCATACCAATACACGTTTTCAGGTCTTAATCGATATTTGTGGAGTTGATTATCCCTCTCGAAAACAAAGATTTGAAGTAGTTTATAATTTACTAAGGGCGACCGCGAAGTAACCGAATAAAGTGCTCATTCGTACCAAACGAATGAGACGTTGTAGAAGTCTGCAACGAAACGGGCACGACTTATTTGACGGATATACCGCTAAAGACACCCAACAGGACGAACTTCCAATGGGGAACAT",mutations={["ANOAT&mit1&c_77981_78539_1"]={['-']={4,5,10,11,12,13,29,30,31,32,33,34,35,36,37,38,40,100,121,122,123,124,125,126,127,128}},["ANORU&mit1&c_78060_78618_1"]={['-']={4,5,10,11,12,13,29,30,31,32,33,34,35,36,37,38,40,100,121,122,123,124,125,126,127,128}},["ATRAN&mit1&c_85734_86311_1"]={A={14,19,20,42,45,46,55,58,59,61,65,67,73,79,83,90,93,252,271,272,297,366,532,562},T={1,21,23,47,48,60,63,81,85,147,399,447,475},G={17,24,84,91,102,166,372,438,514,560},C={22,54,64,88,89,116,130,133,140,141,145,165,187,270,326},['-']={68,69,70,71,95,96,97}},}}end)();
(function()addBlock{name="s3x567",consensus="TAGCGGGAATCAGCGAAAGCAACTACTGAAACTAACGCCAATAAAGAGCGCGGCGGACCGGTGGCGCCTCCCACGCTCTAATCTTAGCCAGATAGCATAGCCTACAGCCGGCGGAGGCTGTTTTCTACAAATTTGGTCCGAACCTGCAGATCACGGAAGAAGGGGCAGAAGGTAGCGTCAATATACTACTCATTTCCCCGAAAAATCTAGAAAAGTTTCACATAAAATCAAAGCCCCGCTTTACTTAGTGAGATAACTACACTCGAAGAACCTTATTCTAGAGTGAAGCATGGCTACAGCCGGGCAGATTACTCACAATACACGGATGGATCCAACTTGTGCAGTAGCATAAACCAGCTTGCACTACATCACTTAGGACCCAATGTTGAGGGAGGCCAAAGGGCTCTTGTCAAAGTAGCCATAGCCGAATCTAGAAAGTAGATCACACTATGCTGCAAATGCCATAGTTATGAGGTGCACAAGCAGAAGAGGGGGGATGGAATCGCATAGTAGCCGTGTGTCCCTGTGCAGAGAGGACTAGTAGTGCTTATACGGCAAGAAGCCGCA",mutations={["ANOAT&mit1&c_102149_102703_1"]={G={43},['-']={155,383,384,385,386,387,388,389,393,394,480,481}},["ANORU&mit1&c_102246_102800_1"]={['-']={155,383,384,385,386,387,388,389,393,394,480,481}},["ATRAN&mit1&c_112123_112675_1"]={A={4,5,27,45,49,51,158,161,162,170,228,264,276,277,293,301,322,328,338,360,361,375,426,437,488,490,491,530},T={3,71,82,107,137,151,190,196,198,218,299,327,380,381,410,452,485,532},G={28,29,46,50,72,105,140,147,210,243,265,266,289,296,297,305,331,333,342,374,397,413,483,506},C={40,78,81,112,120,180,189,192,204,217,227,307,349,415,453,516,518,524,544},['-']={248,249,250,251,252,253,254,255,402,495,496,497,498,499}},}}end)();
(function()addBlock{name="s3x557",consensus="TTATCCTCAGGCCCCAACGGGGCCACGAAGCTACACCCTTACTCTCCTAGTCTATGTACATTGCTTTTTCTAGGAGGTTGGCTGCCTATCCTAGATATTCCTATTTTCTATGTGATTCCGGGTTCGATTCGGTTTAGTATCAAGGTTCTTTTCTTTTTGTTTGTATATATATGGGTTCGTGCAGCATTTCCACGATATCGTTATGACCAATTGATGAGGCTTGGTTGGAAAGTATTCTTACCTTTATCATTAGCTTGGGTAGTTTTTGTATCTGGTGTTCTAGTAGCCTTTGACTGGCTCCCTTAATTCATTGAACAATTTCACTGCAGTGCAACTAAAAAATATATATTTTTTGGGGAGGTAATTAGAAAAAACTCCGTATAAATAAGGGAATCTTGGGAGAGTTAAATAGCAGCTAAAAAACCAAATGAATTGATTAGAAAGAAATAGAAAATAATATATTTTATTCGTTCTATTAACTTCGTAAATGCAGGCTTTGAGAGAAGGAGAGAGAGGCTTGGCCTCTCTCTCTCTTTGAGCGTTCCAAAACGAATAAA",mutations={["ANOAT&mit1&c_74077_74597_1"]={['-']={17,353,354,355,356,357,358,359,360,361,380,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,442}},["ANORU&mit1&c_74155_74675_1"]={['-']={17,353,354,355,356,357,358,359,360,361,380,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,442}},["ATRAN&mit1&c_81261_81776_1"]={A={212,218,367,385,543},T={4,7,12,23,45,69,81,90,107,125,129,140,236,287,293,299,334,417,449,458,460,498,544},G={14,16,27,32,239,310,314,383,418,421,546},C={47,52,65,86,108,128,156,164,176,242,481,501},['-']={18,378,438,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540}},}}end)();
(function()addBlock{name="s3x531",consensus="TATTATGTCAGATGAGTAAACGGCGACCAAGTTGTACGGCTCTATGAAGTAACTTTTGACTCTACCATTTTGCTGGCTCTAGTCTTCACCGGGTTTCAAGGAATGGAATATGTAGAAGCACCTTTCACGATTTCTGATGGTATTTATGGTTCTACCTTTTTCTTAGCCACAGGGTTTCATGGTTTTCATGTTATTATAGGTACCATTTTCCTAATAATATGCGCTATTCGTCAATATCTAGGGCATTTTACCCAAACGCATCACTTTGGCTTTGAAGCAGCTGCTTGGTACCGGCATTTTGTTGACGTGGTTTGGTTATTCCTATTCGTATCCATTTATTGGTGGGGAGGTAATCAAAAAAAGGAGAAAAAATCTGAAACAGTTTTTTTACCAACCTAATCATACTTTATTTAAAGATAGAACTTCAATTTAGTCTGCTTTCTTTTCTAAGAACTGGGCTTGTAATGATGGTGGTATTCGTGATTAATTCTGGCAGATTCTAATATGGATCTTAGTACTTTTTAGAAGGTA",mutations={["ANOAT&mit1&c_70147_70674_1"]={['-']={427,495,529}},["ANORU&mit1&c_70225_70752_1"]={['-']={427,495,529}},["ATRAN&mit1&c_77243_77769_1"]={A={10,64,458},T={78,155,203,209,320,321,326,332,354,434,441,448,450,451,456,457,478,491,494},G={28,89,367,437,443,444,445,446,449,452,493,523},C={2,12,54,84,285,312,447,455,511,522},['-']={388,424,459,488}},}}end)();
(function()addBlock{name="s3x531n1",consensus="CTTAGGCAAGCGAAGCGCAGAATCGAAACACAATAACACAATCTTTTTCTTTAACACAATCCCCATCTTTCGTTTTCCTTTTGCCATTTCATTTTATAGACATCTCCGGCTTATCCTGGCTCGGCTGAATCTGCGGCATTTTCTCAAATATTTGAAAAAATCTATAGTTTGCTGCGCCCTCTGTCTCAAGGTGTGTAGAGACTCCTTTTTTATTGATTTATACTAATCTATCTTAGATCCGAGATAGTGCCGAAAAAATGATTCAATTTGATCTAACCATGGTTGCAAAAACCTCGGCAATGGCAATGACTTTTATACAATATGCAGAATACTCCAATAAAAAAGTAAGCCTCTATTTACTTTATTCAGAACTGAAAGAAGATAATGCTTTTTTACGTTTATGGCTAGAGAAAATCAATAAAGTGCAAAGGTTGGAATAAAAAATTTTTGAGCTTTGTTTTACGTAGTTTCGCCATCTATATAATAGAATATGGTAGAAAAGAATAAGTTGGCGAGGAAGTAAAAATAGAT",mutations={["ANOAT&mit1&c_41986_42465_1"]={['-']={159,168,169,170,171,172,173,174,175,176,286,287,288,289,290,291,337,340,341,342,343,344,345,346,347,348,359,360,361,362,363,364,365,366,367,395,396,403,404,405,406,407,417,433,434,435,436,437,438,439,444}},["ANORU&mit1&c_42046_42525_1"]={['-']={159,168,169,170,171,172,173,174,175,176,286,287,288,289,290,291,337,340,341,342,343,344,345,346,347,348,359,360,361,362,363,364,365,366,367,395,396,403,404,405,406,407,417,433,434,435,436,437,438,439,444}},["ATRAN&mit1&c_47460_47964_1"]={A={6,82,235,269,280,284,373,409,492,496,515,526,528},T={77,114,142,166,186,239,294,317,394,470,480,486,501},G={21,23,50,52,127,187,225,314,318,322,357,382,399,401,414,497,499},C={34,81,102,104,116,125,129,202,207,261,283,320,390,459},['-']={35,36,37,38,39,40,41,42,43,44,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68}},}}end)();
(function()addBlock{name="s3x445",consensus="TTGCCAATAGCAAAAAAGGCCGCGGGTAACGCTAGTTGGCGAAATGGCGTTAAGCATTCCTGGCAATACGGAAAGAGAGGTCGTGATGATATCATCTACGTTCGTACTGTCCCTTGTGGAGTAAATCTCACATCCAAAAATCTAACCAGGGAACGGAATAATTCCCATTAAGTTCCAGTAAAACTGGCAGGCCAGCCGGGCCGTAAGCTAGTGGGAACAGGATTCTTCCGGCAAGACAAGACCTTTGGGGCAAACGCTCACTTTGCTCGCGTCAGTGAAAGAGATCCCGAAGAAAAGGCCGACGCGGGGACTCAGGGCGCAGCATAACGAATGGTGAAGAGTTCATATAAGCAGAATAAACGGGAAAAAAAATTTTTTTTTACCGATAGGCGAATGCCATGTAAATTTCCGCTTCATTATTTATTATTCGGTCTTCAGGCTCCCC",mutations={["ANOAT&mit1&c_19165_19599_1"]={['-']={376,377,378,379,380,381,382,383,384,385}},["ANORU&mit1&c_19277_19711_1"]={['-']={376,377,378,379,380,381,382,383,384,385}},["ATRAN&mit1&c_21303_21740_1"]={A={38,61,230,231,239,249,268,282,361,363,391},T={110,164,258,272,280,286,299,360,369,371,400,409,432,439},G={8,13,43,64,156,279,289,292,336,344,348,357,392,396,431},C={60,109,114,137,167,177,226,394,406},['-']={412,413,414,415,416,417,418}},}}end)();
(function()addBlock{name="s3x421",consensus="GGTATTGTCAGATTTAAATGTAGGTATACTTTATCTATTTGCTATATCTTCTCTAGGCGTGTATGGTATTATTACAGCAGGCTGGTCCAGTAATTCTAAATATGCTTTTCTAGGAGCATTACGATCTGCAGCTCAAATGGTTTCTTATGAAGTTTCTATTGGTCTTATTATCATTACCGTACTGATTTGTGTAGGTTCTCGTAACTTTAGTGAGATTGTAATCGCGCAAAAGCAGATATGGTTTGCTGCGCCCTTGTTTCCTGTATTCATTATGTTCTTCATTTCTTGTTTAGCAGAAACGAATCGAGCTCCTTTTGATTTACCAGAAGCAGAAGCGGAATCAGTGGCGGGCTATAATGTAGAATATTCTTCGATGGGTTTTGCTTTGTTTTTTTTAGGGGAATATGCTAATATGATCTTA",mutations={["ANOAT&mit1&c_72844_73264_1"]={},["ANORU&mit1&c_72922_73342_1"]={},["ATRAN&mit1&c_80007_80427_1"]={A={183,222,247},T={57,60,87,109,171,177,181,199,204,248,249,252,267,276,300,336,341,387},G={9,66,78,219,245,291},C={13,63,159,187,198,246,290,345,385}},}}end)();
(function()addBlock{name="s3x414",consensus="TATCTGTGAGATGTTCTTGTCGAGTTGGCTCAACTTGCGCTGCTATTGTTGTGTCCTCTCCATTGGCCCGGATTCGTTAATGTTATTGACTAGGCATTTGGTATCGTCCAGTATAGATCTGCCGCGTAGCTTTTTGAGAAAAGGCGTAGTCTGTAGGCGGGACCAAGCTTTTTTTGAAGTCCCACAAGTTGAGTGCGGTTGGGGTTTTCCAACATGCTTGTGTGCTCTTCTTGTCCTGGTTTGGACCTCCATTACTGCAGAACACCAGGAAGTAAGTAACCTCTGACCTAATTCTGGGTTTCTTTCCTTGTGGCGCTCCCGGAAAGTGATGTCGATATATCACTTCTGGAGAAGCCCTGCGGCCTCCCGTTTTAATCCGTCCCATTGTAGTTGTAAGGCGTCTGCTTTTTTTAG",mutations={["ANOAT&mit1&c_2554_2915_1"]={['-']={78,79,80,81,82,83,84,85,86,149,150,151,152,153,154,155,156,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,305,306,307,308,309,310,311,312,313,314,315,354}},["ANORU&mit1&c_2667_3028_1"]={['-']={78,79,80,81,82,83,84,85,86,149,150,151,152,153,154,155,156,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,305,306,307,308,309,310,311,312,313,314,315,354}},["ATRAN&mit1&c_3290_3693_1"]={A={40,53,54,74,130,135,137,200,203,212,242,248,272,279,284,295,318,325,332,378},T={33,36,55,60,66,75,100,122,125,210,229,234,243,246,249,254,287,321,327,330,358,359,360,361,366,376,381,382,401},G={49,72,91,140,147,204,288,301,331,339},C={11,14,29,62,63,134,211,218,228,236,239,240,294,300,370,371,386,397,406,411},['-']={41,42,43,44,45,57,266,267,268,269}},}}end)();
(function()addBlock{name="s3x402",consensus="TCTCCTGATTGAAATTTAACTCATGGGAGACGGACTCCATTAACTGCGGCTCGTTGGGTGGGTGCCTGCCCTTCCCGGCCACTGATTGGATTATCAATGGCACTGGATGTATCATCATATATAATGTATTAACATCTTGATGTTAATAGGGCGCAACAAAAAATCTAAATATATAGATATATTTGCTAGGCCCTCAAATACACGTTTTCTTTTTTGAGTGTCGGAGAGTAAAACCTGCCGGACTAGGCAGGTGCATAGACCCCTTCGCCTTTCATCCAATCCGCAAGTTTCCTGTTTACACGGTTCTTTTAGGATCAGGCAGGTACTATGGGTCCTCTGACTTCCAACTCAAACCATAGTGTATGGTTGGATCTCGCCGATATCACCTGTGAGCTATAGCGC",mutations={["ANOAT&mit1&c_29347_29718_1"]={['-']={60,61,62,63,164,165,166,167,168,169,170,171,172,173,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201}},["ANORU&mit1&c_29422_29793_1"]={['-']={60,61,62,63,164,165,166,167,168,169,170,171,172,173,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201}},["ATRAN&mit1&c_32063_32433_1"]={A={19,64,76,88,125,175,206,223,239,240,280,283,317},T={6,7,51,65,69,77,79,202,203,208,219,221,272,282,383},G={18,33,41,94,96,154,205,276,350,351,379},C={17,25,45,66,214,243,271,274,287,363},['-']={11,12,13,22,26,27,28,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313}},}}end)();
(function()addBlock{name="s3x394",consensus="AATAAAGAACTCTTAGAGAGCCATGTGATGGGCGACTATAACCGGAGAGCACTTGTGTAGTCTGCCCCAATGAATGCATTTTCGATGAATCATCATATATAATAGACTAAAAATCCACCGCTACGCGCTTCCGGGCACGTACCCTTGTTGACTCTATCCATCAATCGCTACGCGCTTCCGGGCACTATGGTAAGACATGAAAACACCCGATCCCATTCCGACCTCGAAATGTGAAATCGTCTTACGCTATATGTACTGATTTATCAATTTCGGGAGACATGGTCCAGGCCCGGACAACGTCCAATTTCAATTATTTTGAAACGCTAATAAAATAGTAGCATAGGCCTGCCAAACGACTATAATAAAAATAAAAAACAACCCATGCTCTGTCATC",mutations={["ANOAT&mit1&c_34427_34719_1"]={['-']={13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,59,61,62,63,64,65,66,67,75,138,314,315,316,317,318,319,320,321,322,323,324,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384}},["ANORU&mit1&c_34486_34778_1"]={['-']={13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,59,61,62,63,64,65,66,67,75,138,314,315,316,317,318,319,320,321,322,323,324,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384}},["ATRAN&mit1&c_38068_38420_1"]={A={9,10,117,118,129,137,142,167,264,286,307},T={7,69,131,149,157,161,326,361,386,388},G={11,40,114,115,196},C={8,39,119,146,305},['-']={78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,125,126,127,128,144}},}}end)();
(function()addBlock{name="s3x387",consensus="TATCTTCAACTGCATCCTTGAGTGTCAGTCAAATGGAAAGTATCATGAATGAGAGATGCCAGCGGAATGATCACCTGGGCGCGCTAGGCTAGAAGGAAAATAAGCTTACTCTTTATTCTTTTGGCGTTCGTTCGTAAAGATAACAAAGTAGAGGAGAAAATAAAAAAGGTGCAAAGCGAAAAAAAAATATCTAATCCCCAAACAAAATATTTTTTTTTGCTGGCTTTCAGTTTTCTGAGTGCAGTCTCCTCCTCCTACAACGTCTTTCTTCGTGTGTCGAAGATCTGAGGCGAGTACACCAGAGATAGAAACAGAAACTACGATTCAATATGAATATAGCAAAGCATCTGAAGCATAACTACACACTCATACGATCTTGTGAAAAGA",mutations={["ANOAT&mit1&c_89192_89505_1"]={C={118,119,182},['-']={107,108,109,110,111,112,113,114,115,116,125,126,127,128,129,130,131,132,133,134,135,150,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,208,215,216,244,245,246}},["ANORU&mit1&c_89272_89585_1"]={C={109,244},['-']={107,111,112,113,114,115,116,117,118,119,125,126,127,128,129,130,131,132,133,134,135,150,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,253,254,255}},["ATRAN&mit1&c_98844_99230_1"]={A={34,78,234,238,286,288,349,352,372,380},T={3,6,29,81,227,243,270},G={44,60,85,92,97,146,226,300,311,312,320,341,383},C={5,33,75,140,153,249,252,255,268,369}},}}end)();
(function()addBlock{name="s3x387n1",consensus="CTCGAATACCCAAAATAGTTAATAGATTTTTTTGCTCCGCAGGTCATTGTTGTCTTTTCCCCATTTCTCATCATTAAATTACATAATGATAAAAAAAAGGCCTCATAGATATATATTTTTTTGGGTGTATAGCTTAATTGGTAGAGCATTAGGCTTTTAACTTAATGGTCGCAGGTTCAAGTCCTGCTATACCCAAATGTTTTTCTAGAAGTTCCCTGTGATTTATTAATTATGGCAGTTCATATGCACATCAAAATATGACATTGCACGTTCGGGGAGGGCTCGTCTAGTACGAGTCATTACGTGAAACTCAAATCTATATCTATTTTTTTATGTCTCTAGAAAAAGAACCTTTTTTGTTGCGCCTTCTGTCTTCATGGCTTATGA",mutations={["ANOAT&mit1&c_270_609_1"]={C={231},['-']={98,99,100,101,102,103,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,258,272,273,274,275,276,277,278,352,353,354,355,356,357,358,359,360,369,370,371,372,373,374,375,376,377}},["ANORU&mit1&c_382_722_1"]={C={217},['-']={98,99,100,101,102,103,216,220,221,222,223,224,225,226,227,228,229,230,231,232,258,272,273,274,275,276,277,278,352,353,354,355,356,357,358,359,360,369,370,371,372,373,374,375,376,377}},["ATRAN&mit1&c_860_1223_1"]={A={61,111,204,207,245,259,297,321,323,329,337,351,368,384},T={13,17,24,25,53,59,93,95,96,252,266,269,289,305,332,350},G={1,11,16,22,27,58,60,72,113,136,324,325,330,331,335,336,338},C={12,14,19,21,23,26,28,50,57,91,94,97,115,117,119,198,202,205,318,328,334,339,366,383},['-']={4,9,10,33,34,35,36,37,38,66,67,68,107,121,310,311,312,313,314,315,316,317,347}},}}end)();
(function()addBlock{name="s3x343",consensus="ATACCCAACCGTGTCTTTAAAACGCAGTTGAACGGGGAAAAAAATTTATTTCTTTTTTTTCATTCGTAAACGTGAGGTGTAGGTGGGATATTAGCCCGGGCGCATTAGGCAAGACTCGAATGAAGTATCATAGCGTCTTCTTCGTACGACGGAGCTTAGTGACGATCGTACCAGGACAACAAAGGAACCAAGATCCCCAAAAGTCGTTTTTTTCTTTTTGCTATGCTCATGAAAATTGAAGTAAAGGGCGGAGCTTCAAAGGCACAGCACTTAATTCTCTTAAAGGCCAGGGTATCTAGAGCACCTGAAGCGCACTGCGCGAAGATGCCCAAGAGCATCCAAT",mutations={["ANOAT&mit1&c_78590_78917_1"]={['-']={274,275,276,277,278,279,280,281,282,283,284,285,286,287,288}},["ANORU&mit1&c_78669_78996_1"]={['-']={274,275,276,277,278,279,280,281,282,283,284,285,286,287,288}},["ATRAN&mit1&c_86358_86691_1"]={A={147,151,173,197,210,237,246,250,289,298},T={146,213,227,327},G={20,21,67,103,190,238,268},C={17,106,130,229,241,300},['-']={49,50,51,203,204,205,206,207,208}},}}end)();
(function()addBlock{name="s3x330",consensus="AGCCTAAGTCGGCAGACTGACGCCGCGCACTTGAGCAGTTCGGAGAAGACCGGTCAAAACCCGGAGGGGGAAAAAATATATTTTTTTCGAGCCAGCCTACTCCATACTCTCTAAAAATTAAGCCAGAATGCGCAACTTTTAAGAAACGAAGGAAGTCCGTTAATATTTGGTTCGTTCGCTATTTGTTTGTTGGCGCATAAACCAGGCAGACGCTTTATTCGAACCAGAGCTTCATCATACCCAGAAGCGAAAATACTTCTGAAGTTGAAAACTCAACCATTATGACGCTGCGCTCCTGGTTTGCTTATCTAAAATCTAAGGGTAACTCAA",mutations={["ANOAT&mit1&c_89652_89925_1"]={['-']={49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,181,182,183,184,185,186,187,188,189,190,191,237,238,270}},["ANORU&mit1&c_89732_90005_1"]={['-']={49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,181,182,183,184,185,186,187,188,189,190,191,237,238,270}},["ATRAN&mit1&c_99376_99705_1"]={A={7,18,131,150,151,157,169,220,226,243,248,266,302},T={20,22,95,178,205,232,235,258,295,308,327},G={13,39,48,112,133,141,160,176,201,216,233,249,303},C={138,139,158,177,230,265,293,299,300,309,314}},}}end)();
(function()addBlock{name="s3x328",consensus="AATAGATTTTTGTCTCTGTGGAATCAGGGGAGAAAACTGGGTGGAAAAAGACCCAAGCGGAAAAAGGGACTTGAACCCTCAACCTCAGCCTTGGCAAGGCTATACTCTACCATTAAGCTATTTCCGCCAGCTCCGACAAAACGAAACAGTAAGAAGAAAGTAAGAAGGCCTTTACTTTAAACTTATCAGATGTATTCTTTTAGTAGAATTTGATGGATAGGCTCATGCTTGGAAAGATTCGAACTCTCAACCCCCAAATCCGTAGTTTGGTGCTCTATCCGATTGAGCTACAAGCACAAATTTATTATTCTTAAGCACTGCGTGTCAT",mutations={["ANOAT&mit1&c_55261_55569_1"]={['-']={12,13,14,15,16,17,18,19,20,21,22,23,24,25,175,176,177,178,179}},["ANORU&mit1&c_55339_55647_1"]={['-']={12,13,14,15,16,17,18,19,20,21,22,23,24,25,175,176,177,178,179}},["ATRAN&mit1&c_60739_61064_1"]={A={27,28,29,42,49,148,152,155,160,166,169,319},T={52,127,133,134,159,168,186,205},G={30,45,54,139,144,151,162,164,299,302},C={7,26,38,161,167,170,198,222},['-']={4,6}},}}end)();
(function()addBlock{name="s3x312",consensus="CATATATCCATAATATTTCCTGATCAAAACAAGGGCTTCCATATAAGAATACAAAGTAACTGAGAGCGAGGTGAAGGTTAAATAGCTCAGCCCGCGTAGGTAGTTTCAACCCTGGCGGATAATTAAAATACTTTCTCTACTTACTTATACCTGTCGAAGCCGAAGAGCATAGCAGGGCGAAGCATGCGGGCTTCAATTTCATCATTAGAAAACGCATAAATGCTTTTTTCGTGGAAATAAACTAGAATATGGAGCTCAGGGCTGAGCCTTGTGTCCTCTGGCCAAAGGTTTAAAAAAGCGAGAAGGTCCAAT",mutations={["ANOAT&mit1&c_40575_40823_1"]={['-']={2,6,34,35,36,37,38,39,40,41,42,43,59,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,148,149,150,151,152,153}},["ANORU&mit1&c_40635_40883_1"]={['-']={2,6,34,35,36,37,38,39,40,41,42,43,59,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,148,149,150,151,152,153}},["ATRAN&mit1&c_45682_45985_1"]={A={21,98,133,134,182,187,227,232,244,279,299},T={130,154,160,179,180,181,275,277},G={12,18,19,47,57,90,128,157,165,168,208,238,240,243,252,257,291,292,295,306},C={96,132,135,169,184,205,224,225,231,262,290},['-']={24,26,27,28,29,142,178,255}},}}end)();
(function()addBlock{name="s3x309",consensus="TTTTATTCCTAGCCGTTGAGAAGTAAGCAAAATATATATATATATATTTTTTGGATACTTCCCAGCTCTCCTAGGCTCCTTTTCGTCTAATTCTTGGAGTCAACGAGGGCGCGAAGCGCCGCAGGTTCCGTTTGATTCGATATGCTTACTAGCATATCGAATCCAGGGCTTATAGTTTAATGGGTTCAAACGCACCGCTCATAACGGTGATATTGTAGGTTCGAGTCCTACTAAGCCTAGATTCTAGAAAACCAGAGTAAAAAAAATTGGACTGAAATAATTTACAAGGATGCGCGCGACGCTGCGGCG",mutations={["ANOAT&mit1&c_49_267_1"]={['-']={14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,55,56,57,58,59,60,61,62,63,64,65,66,67,68,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,121,122,123,124,125,126,127,257,278,279,280,281,282,283,284,285,286,298,300}},["ANORU&mit1&c_161_379_1"]={['-']={14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,55,56,57,58,59,60,61,62,63,64,65,66,67,68,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,121,122,123,124,125,126,127,257,278,279,280,281,282,283,284,285,286,298,300}},["ATRAN&mit1&c_115069_229_1"]={A={12,13,103,110,119,120,163,243,254,268,269,295,296},T={8,11,54,104,107,108,181,239,246,251,252,260,264,294},G={248,261},C={10,53,97,98,101,102,130,297},['-']={116,306}},}}end)();
(function()addBlock{name="s3x308",consensus="TGCGTCAGCAATAGAGTGGCTTAGGTTAACATCGGAGCAGGAGCAGCTACCATTGCTTTAGCGGGAGCTGCTATAGGTATTGGAAACGTATTTAGTGTGCGCCTCGCTAGAGCGCGTTTGGATCAGCGAAGGTCAATAGATTATCGCCTGGGCGGTCCCCTAACCCGTAGCGGAAACAGACCGCAGGGAACCATAGCATGGGGCCTGGTTAAGTTTCGTGGCACGGTTATCACGAGTGCGTCAGGGTCAAGCGTTACCCCTTCCAACAAAGGTGGCCCGGAAGGCTCCAAGGCCCAACTAAATTCTTG",mutations={["ANOAT&mit1&c_101531_101838_1"]={},["ANORU&mit1&c_101611_101918_1"]={},["ATRAN&mit1&c_111503_111798_1"]={A={3,138,147,166,206},T={32,101,106,133,183,203,219},G={72,177,248},C={107,205,209},['-']={261,262,263,264,265,266,267,268,269,270,271,272}},}}end)();
(function()addBlock{name="s3x305",consensus="TACAGCAAACTCGGAAAAGCAATTTAGGATAATGTCATTAAAGACTGGCTGACTAGGAAAAAAAAAGATTTTTTTCGCTGAGTGCTACTACTTTCAGTCCCATATTAATGAGACTTCCTACGTCAATATACAGACCCTGGATAAAAGACTAAGGCAATAGCTAGGTAAAACAGCGAATTTGATTAATCTACCTACAAACGTAGCCAATGAAGGAATGGAAGACAATGTAGCATAACGCCAACTCCGAACATGATCAGTGTTTTATTTTGTTCATGCAGGCCCGGCCTTAGAGGGTTTCGGTCCGT",mutations={["ANOAT&mit1&c_53127_53417_1"]={['-']={44,45,46,47,48,49,50,51,52,53,54,55,132,248}},["ANORU&mit1&c_53205_53495_1"]={['-']={44,45,46,47,48,49,50,51,52,53,54,55,132,248}},["ATRAN&mit1&c_58519_58820_1"]={A={9,12,139,172,174,180,202,208,226,268,278,282,295,299},T={2,66,99,123,153,194,204,271,297},G={15,20,43,145,151,162,169,195,196,228,290},C={34,88,97,131,157,165,261,267,269},['-']={83,84,85}},}}end)();
(function()addBlock{name="s3x276",consensus="TTGTGCTGCTTGCCTGGCAAAATTCTTCAATCTTACGCGTGAACCTAATGGGAAGTAGGAGAACCCGATGGAGATCATATCGGACTTCAACGTACTGATAGCAGCTTGAGATAAGCTGGAATCTGACTCGGATAAAATAACGTCCGGGGAGCGAAACCGACAATGAAAACACTGGAAGGTATTAGCCTATAATTGTTCCGAAAAGCCTAAGAGAGCCTTACAAGGGGATCTTATGTGTTTTAACCGTAAAAAATTTACATTTTTTTCTTTTTCTTC",mutations={["ANOAT&mit1&c_103292_103527_1"]={['-']={136,137,138,139,140,141,142,143,144,145,146,147,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,265}},["ANORU&mit1&c_103389_103624_1"]={['-']={136,137,138,139,140,141,142,143,144,145,146,147,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,265}},["ATRAN&mit1&c_113264_113539_1"]={A={24,60,75,107,109,118,124,130,173,174,199,210,257},T={27,57,64,65,135,150,156,197},G={18,41,87,123,151,183,189,200},C={26,32,155,207,254,271}},}}end)();
(function()addBlock{name="s3x266",consensus="TACCCTTGGCATAGCGAATGACAGGGCCGGGTGGAACGATGAAAGCGCCCGCGGCCCATCAAACCATCAGGCTTATGGCATTCCTACGTAATGCCATAAAAAAAGCACTAATTTCATTATGTAACGACTAACTAAAATGCATCGTTATTAAATCTTTTGAGAATGCAAACCTAGAGCACCTACTTGACACACACAAGATCGAATCGCTTAAAAGAAAGAAGGCCGAAGGCCCATTTATTAATAGCATGATCACCAGATCTTATATA",mutations={["ANOAT&mit1&c_91353_91572_1"]={['-']={61,62,63,64,65,66,67,68,212,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253}},["ANORU&mit1&c_91433_91652_1"]={['-']={61,62,63,64,65,66,67,68,212,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253}},["ATRAN&mit1&c_101078_101339_1"]={A={15,25,27,59,71,116,117,120,121,125,128},T={4,21,83,86,114,123,127,170,178,182,189,199,254,255},G={22,82,93,113,119,124,168,181,201,258,260},C={98,122,126,156,157,215,257},['-']={132,133,134,135}},}}end)();
(function()addBlock{name="s3x265",consensus="ATAAACTAGGGGGGATTATTCTCATCACAGGTTGCCGCCCTTACTTGAGTATACCGAGAATCGACGGTGAGAGGGAGCCCCTAGGGGGGGAATGAACGACCTGTGGTCGCCGACTAACGTCGGTTAGGCTTAGAAAGCACTGAACAGGCTGGGCGGGTCGACAGAGATGACAGCTACGAGAATGGTAATCCTGGTGACAGAGATATACATTCGGGGATGAATAGAAAACCTCCCACAGAAAAGGCCGCAGGTCCAGATTCTTTCT",mutations={["ANOAT&mit1&c_102966_103230_1"]={},["ANORU&mit1&c_103063_103327_1"]={},["ATRAN&mit1&c_112942_113204_1"]={A={11,36,46,65,70,163,177,201},T={22,54,117,148,158,253,255,259},G={164},C={115,124},['-']={8,90}},}}end)();
(function()addBlock{name="s3x259",consensus="AAAAAAATGAAACTAAAAAAAAATTTTCAGGCCGCAGGTTTTGTTTCCGTGCTTCCGGGTGGAGGGTGAAAGCGGCCAGGGCGCAGCCAATTTTTTTTCTTCCGCCTTCTGGCTACGCCCTTAGTAGGGTTTCGTCATACGAGCGGAGCTCGAAAACCCTCCATCCCTTCCATTTTCACATTAACAACATGTAGATTTGAAGAAAACAAAAACGCAACAAGACATTAACAAAATTGAATATATAGAACGCTTCTTTCTT",mutations={["ANOAT&mit1&c_83936_84184_1"]={['-']={167,168,169,170,171,172,173,174,175,255}},["ANORU&mit1&c_84016_84264_1"]={['-']={167,168,169,170,171,172,173,174,175,255}},["ATRAN&mit1&c_92787_93009_1"]="AAAAAAATTCAACTAAAAAAAAATTTTCAGGCCGCAAGTTTTGTTTCCGTGCTTCTAAGTGGAGGGTGAGAGCGGCCAGGGCGCAGCCAAATTTTTTTCTTATGTCCTCTGGCTACGCCTTTAGTAAGGCTTCGTCATATGGGCGGAGCTCTTCTCCCCTCCATCCCTTCCATTTTGTTTTCATTTATTTCCCTACATGAAGAAGT-AAAAAC-CT----------------------------------TTCTTTCTT",}}end)();
(function()addBlock{name="s3x246",consensus="CCGCTCCAAATATTCAAAAATTTTTTTGCTGCGAGTTTTTTCGAGAAGAACATTGATATCAGCAGAAGGGAAGGGGCCTAAGTCGGCAGATGCCGTACGCTTGAGTGGCAAAGGTAAGCGACACTATACCTTCGAATGGGACTAAGCGATAAAAAAAGAATATGCAGCGAATAAAAAAAAATCTATTTTTTGCTGCGGCCCGCTTAAACATACAATGGTTACTCCAAGCCTTAATGACAATCTCAA",mutations={["ANOAT&mit1&c_43810_44044_1"]={['-']={42,129,130,131,132,133,134,135,136,137,140}},["ANORU&mit1&c_43870_44104_1"]={['-']={42,129,130,131,132,133,134,135,136,137,140}},["ATRAN&mit1&c_49349_49593_1"]={A={1,56,64,73,147,157,182,196,216},T={5,41,200},G={7,60,120,125,144,150,183,214},C={52,204,222,235},['-']={47}},}}end)();
(function()addBlock{name="s3x237",consensus="CGCTTATTTTGTGGGAGGTTTTCTATCCATCCTCGAGCGCATTCCGCAGTATCCTGGGCACTCGCCCTCATAGCCGTCACCCCAGTTGATCTACCCGCGCGTTCTGTCTAGGATTCTCTAAGCTCGACCGGCGTGTGCCGGCGTGAACATGGTTTGTATCCTGACCCAGGGGCTTCCTTTCACCGTTTACCATCGGCTATTCGAGTAGATCAGTCCTCATATTCGTCTCCCTTCCAA",mutations={["ANOAT&mit1&c_59177_59413_1"]={},["ANORU&mit1&c_59255_59491_1"]={},["ATRAN&mit1&c_64578_64814_1"]={A={45,87,162},T={33,65,84,117,124,180,201,210},G={120,211},C={5,7,23,50,85,161}},}}end)();
(function()addBlock{name="s3x225",consensus="GATTATGATGGGATTGTCTACTCTATAATATAGAACCGTAACATAATGGAATATGAAACAAGAATAGCCCTGAAATGGAATGGAACAAAGCAGGCCGGACGAAGCTGGCCGAACGATGGGTTGGGCTTGAAACACCCGTTCAGAATCTATTATTGGTTAGGCTCGGAGCTTAGTCAAATATCTAAGGACGCAGTTCCTATGAATCATCATATATAGCAATATAGC",mutations={["ANOAT&mit1&c_40226_40374_1"]="GATTATGATGGGATTGTCTACTCTATAATATAGAA--GTAAC----TGGAATATGAAAC-AGAATAGCCCTG-AA----------------------GACGAAGCTGGCCGAACGATGGGTTGGGCTTGAAACACC----------------------------------------------TAAGGACGCAGTTCCTATGAATCATCATATATAGCAATATAGC",["ANORU&mit1&c_40285_40434_1"]="GATTATGATGGGATTGTCTACTCTATAATATAGAA--GTAAC----TGGAATATGAAAC-AGAATAGCCCTGAAA----------------------GACGAAGCTGGCCGAACGATGGGTTGGGCTTGAAACACC----------------------------------------------TAAGGACGCAGTTCCTATGAATCATCATATATAGCAATATAGC",["ATRAN&mit1&c_45043_45240_1"]={A={46,54,61,188,190,192},T={32,48,73,189},G={1,3,26,104},C={18,28,39,70,72},['-']={105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,193}},}}end)();
(function()addBlock{name="s3x215",consensus="AAGAGGACCTCAGGTCAATTCCTCTGTCGGAAAGTTATTGGCGAGGCCGCGGAATGAGTCGCTAGAACAAAAAAGGAGACCGAAATAAAAAAAGATTTTGGTTTGCCCGAAAAACTACGAGCCGAAAAAAGGCGTAAAGCCCTTTCTGCAAAAAATCTATATATTTTTTTTCTTGCTTGGTCTTTTATTCTCGGCTCATCCGCTATTTTGAGACG",mutations={["ANOAT&mit1&c_51004_51204_1"]={['-']={101,102,103,104,105,106,107,108,109,110,111,149,180,213}},["ANORU&mit1&c_51082_51282_1"]={['-']={101,102,103,104,105,106,107,108,109,110,111,149,180,213}},["ATRAN&mit1&c_56389_56600_1"]={A={4,28,50,118,123,156,193,200},T={23,59,93,99,100,186},G={6,30,35,63,72},C={24,34,71,91,182,185,208},['-']={81,171,191}},}}end)();
(function()addBlock{name="s3x210",consensus="TACCACGATAAGCAATACGAGGGCGCAGCACCTCTGGAAGCCATATATGCTGCTAGTTTCTGCTATAATGCAAGGCCACGGATGCTCCATGTACGGTGGTCTCTGGTAGAAAATAGATTATTTCTTTTTCACCTACCCTTATGCCGGAACTCTCATAAGAAAGCCCACGCTTAGAGCCATATGATTACAAACAACCTTGGTTGAACTTGA",mutations={["ANOAT&mit1&c_80155_80324_1"]={['-']={95,96,97,98,99,100,101,102,103,104,105,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,147,148,149,150,151,152,153,154,155,156,157}},["ANORU&mit1&c_80234_80403_1"]={['-']={95,96,97,98,99,100,101,102,103,104,105,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,147,148,149,150,151,152,153,154,155,156,157}},["ATRAN&mit1&c_88169_88375_1"]={A={6,8,35,60,73,108,145,146,198},T={59,78,86,115,123},G={30,81,106,159,172,186,188,200,203},C={58,63,185},['-']={46,47,49}},}}end)();
(function()addBlock{name="s3x207",consensus="TATCGCGAACAATAGACTACTACTCGCGCCTTAATTATGAGCGAATCCAATTCAGTCTAAACCAAGCAGCTTAAAATCTGACGGAAAAGAAAATTTTTCCCGCTCTGTGCTGATCATTCACACTCAGACATCCATGCGAGGCCTTCGTGATTCGAGAACCTAAGCGTAGCCTTGGTTAGAGGGGGTGAGACTCAATATTTCCAGAAC",mutations={["ANOAT&mit1&c_73818_74018_1"]={['-']={49,50,51,52,53,97}},["ANORU&mit1&c_73896_74096_1"]={['-']={49,50,51,52,53,97}},["ATRAN&mit1&c_80996_81202_1"]="TATCGCGGACGATAGACTTGCTACCGGTGTCCTATTATGAATGAATCAAATTCAAACCGAGCGGCTTAAACCCGGGCGGAGAAAAAATATATATTTTTCCCACTCTGTACCAATTATAAACACTCAGACATCCATGCGAGGCCTTCGTGGTTCGAGGACTTAAGCGCGGCGTTAGTTAGAGGGGATGAGATTCAAGATTTCCAGAAC",}}end)();
(function()addBlock{name="s3x207n1",consensus="TTTCATTCTAGATCTTGTTCACGAACGTTGTGGCTATACTCTTATGTTCTATCAACAAAGTAGAATTAGCCGTTATGCTAGTAGCTTATGAATCATCATATGATAATTCATTGTTGTAGCTCCACAAATGGGAACGCGCGCGAATGGTTCGTTGCTTGCTCGCCGGCTTGCTGCAGGAGAAATTGAAGTAGGTCTACATGGCTTGCT",mutations={["ANOAT&mit1&c_33765_33964_1"]={['-']={100,156,157,158,159,160,161}},["ANORU&mit1&c_33824_34023_1"]={['-']={100,156,157,158,159,160,161}},["ATRAN&mit1&c_37484_37649_1"]="TCTCATTTTA---------------------------------------TGTCAACAAAATATAATTAGTCGCGATGCCAGTAGCTTATGAATCATC-TATGATGATTCATTGTTGCAGCTCCGCGAATGGGAGCGCATGCAAATGTA-CGTTGCTTGCTCGCCAGCTCGTCGCAGGATAGATTTAACTAAGTCTAAATGGCTTGCT",}}end)();
(function()addBlock{name="s3x188",consensus="AGGATCCAGCCTTTGTAGTCCTCTCGTATTTTGCTCAATGCGCCAACGAAACGAATCGTATAAGTCTCCTATCTCTAATTCTTTTCTGTAACAGGTCTACCAAAATGAAATGGTCGATGTTGCCGTAGTATTTTGTTCTATGCCCTTTCAGAGCTCAGTGGTGCTTTTGCGGTCCGGTTCCGATTGAC",mutations={["ANOAT&mit1&c_3019_3197_1"]={['-']={76,77,78,79,80,86,87,88,184}},["ANORU&mit1&c_3132_3310_1"]={['-']={76,77,78,79,80,86,87,88,184}},["ATRAN&mit1&c_4175_3988_-1"]={A={1,38,93,97,111,119,120,157,175,179,181},T={20,36,37,44,45,51,67,72,96,100,106,118,137,143,148,159},G={61,109,163},C={12,23,29,31,47,154}},}}end)();
(function()addBlock{name="s3x183",consensus="CTGGATTGTTATGAAAAGGGCAGCCCATGTATGAGAAGGCTACAAACGATCAGGCTACTGGTCGGCTTCTTTTAAAGCCCTAACTAAAGTTGTAAAATGTCATAAGAATTCTGAACGTGACACCTTATTAGCCATACACGCAAAAAACACACCCACTAAGTAACTTTTCATTCTGGAAGAACC",mutations={["ANOAT&mit1&c_40434_40573_1"]={['-']={9,10,11,12,13,14,15,16,17,18,19,21,33,34,35,36,37,38,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,121,122,123,124,125,126,127,128,129}},["ANORU&mit1&c_40494_40633_1"]={['-']={9,10,11,12,13,14,15,16,17,18,19,21,33,34,35,36,37,38,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,121,122,123,124,125,126,127,128,129}},["ATRAN&mit1&c_45473_45652_1"]={A={25,83,91,139,147,168,174},T={2,4,24,57,59,60,175},G={23,39,42,43,44,55,58,84,113,135,136,140,143,163,181},C={40,45,56,105},['-']={28,49,50}},}}end)();
(function()addBlock{name="s3x171",consensus="AACACTTGGAAACTAACAAAGAACTGAAGGGCGAAGCTTGCAAGCGCGTGCTTGCACCTAAGCAGTACTCCCTCCGGGTTTTATTAAATGCAGTATGACGGAACATTAAAAAAGACTTCCTTCCGGCTAACCAAGCGAAATTTAGCCGAGTACTAAGTAAGTCCTTCGGTC",mutations={["ANOAT&mit1&c_39495_39660_1"]={['-']={12,13,14,15,16}},["ANORU&mit1&c_39553_39718_1"]={['-']={12,13,14,15,16}},["ATRAN&mit1&c_44371_44537_1"]={A={20,23,25,53,122,124,134,136},T={17,19,54,62,67,70,73,74,163},G={21,86,87,101,111,114,133},C={76,82,84,140},['-']={4,5,6,77}},}}end)();
(function()addBlock{name="s3x168",consensus="AAAAACGAAGGATGTTGCAGAGAGATGTGAAAGGAGGCACCCTTCCCTGGTTCAATCTTGCCTCTATATTTGATTAGCAATTATTTTATGCGAAGGAAGTACAGGCCATAAATAATGTTTTATTTACTTAAGTTATTTTAATCTGATTATATAAGTATAAATCATCGT",mutations={["ANOAT&mit1&c_39736_39881_1"]={['-']={27,28,29,30,31,32,33,34,35,56,57,58,59,60,61,62,63,64,65,66,67,68}},["ANORU&mit1&c_39794_39939_1"]={['-']={27,28,29,30,31,32,33,34,35,56,57,58,59,60,61,62,63,64,65,66,67,68}},["ATRAN&mit1&c_44539_44690_1"]="AAGAACGAAGGATGCTGCAGAAAGATGTGAAAGGAGGCGCCCTTCCTTAGTTCAATCTTGCCTCTATATTTGATTGGCAATTATTTTACGCGAAGGAAGTAC-GGTTGAAAAGCTTGTGTACGGATATATCGTTATTTTTCTC---------------AAATCCTTTT",}}end)();
(function()addBlock{name="s3x141",consensus="TGTATGTGGTTTTTTTATTGTGGAGGAGCCTATAAGCATTCTTTAGCGTAAGGACCATGGCAATGTTACAGTAGAAGCTTATATGGCTTCTGTTATCGCTCTAATGAAGCCTTGGGTACCAAGGAGAAAAAAGAACCGGAT",mutations={["ANOAT&mit1&c_40038_40173_1"]={['-']={50,126,127,128,129}},["ANORU&mit1&c_40096_40232_1"]={['-']={126,127,128,129}},["ATRAN&mit1&c_44691_44828_1"]="TGTACGTGGTTCTCGAGGTTAGGA-GAGCCTATAAGCATTCTGTAGCGTATGC-CTATGGCGATGTTATAGTAGAAGCTTATATGGCTTCTGTTATCGC-CTTAGAGAGCGAAGCCCTAAATAAAAAAAAAAGAACCAGAT",}}end)();
(function()addBlock{name="s3x123",consensus="TAAGCTAATGGATGATTTGTTTTTTTGGCGAATAACGGGATTTGAACCCGTGTTTTCAAATTCACAATCTGACACTTTCACCTATTAAGTTATACTCGCCCTTTTTTCCAATTCAGACATTAA",mutations={["ANOAT&mit1&c_41703_41823_1"]={['-']={1,4}},["ANORU&mit1&c_41763_41883_1"]={['-']={1,4}},["ATRAN&mit1&c_47175_47297_1"]={T={107,113},C={16,42,103}},}}end)();
(function()addBlock{name="s3x121",consensus="TCGATAGGGACCGGCTTTGATAAAAGCAGGGCGTAGCAAAAAAAAAATATTTTGCTACGATTTTCGGAAAAAAATGCTTTTGAAAATCCCTTGGAGACCAAGGCTTTAGCCAAAAATGTAC",mutations={["ANOAT&mit1&c_52860_52969_1"]={['-']={40,41,42,43,44,45,46,47,48,49,115}},["ANORU&mit1&c_52938_53047_1"]={['-']={40,41,42,43,44,45,46,47,48,49,115}},["ATRAN&mit1&c_58250_58360_1"]={A={75},T={2,36},G={14},C={99},['-']={15,16,17,18,19,20,65,66,67,68}},}}end)();
(function()addBlock{name="s3x103",consensus="TCTTCGATGTGCGGAGCTTCGCATCTGAAACCCGATGACGCTTCTGCGTTCTGCCGGGGCCTTGGGCAGTAATCCAACTTCCGCCGACTCGCGAAGAGCTGGC",mutations={["ANOAT&mit1&c_102796_102897_1"]={['-']={41}},["ANORU&mit1&c_102893_102994_1"]={['-']={41}},["ATRAN&mit1&c_112772_112873_1"]={A={85,90},T={91},G={94},C={79},['-']={43}},}}end)();
(function()addBlock{name="s3x99",consensus="GAGATAGAACTCACCGGCGGTGATGGACACTGGTCTGAAAATCAGGCGTAGCGGGCCCAAGTCACTGAGACGATAGGGCGCAAAGCGCAGCACCGATAT",mutations={["ANOAT&mit1&c_73727_73817_1"]={['-']={65,66,67,68,69,70,71,72}},["ANORU&mit1&c_73805_73895_1"]={['-']={65,66,67,68,69,70,71,72}},["ATRAN&mit1&c_80888_80986_1"]={A={18,19,24,31,53},T={14,29,57},G={22,26,40,41,43,49,58,81,97},C={35,94}},}}end)();
(function()addBlock{name="s3x91",consensus="TTCTAGGCATATCTGACAGTTTTTTGCGTTCCGCCAGTCTTATTATAGCAAGCGCGTAATCATCCGAACAGTTGTCGTCTACTGTTTCAAT",mutations={["ANOAT&mit1&c_77513_77599_1"]={['-']={11,12,13,17}},["ANORU&mit1&c_77592_77678_1"]={['-']={11,12,13,17}},["ATRAN&mit1&c_84731_84812_1"]={A={1,32,73,76},T={16,25,34,38,88},G={4,26,66},C={3,74},['-']={44,45,46,47,48,49,50,51,52}},}}end)();
(function()addBlock{name="s3x91n1",consensus="TATGATTAGGGTGCGAACACAGCAGTTCCTGATGACGAGTTTCATTTCATTCGTTAATTGGTAGAACTTATCGACGAACGAATAGTAGAAT",mutations={["ANOAT&mit1&c_2916_3004_1"]={['-']={88,89}},["ANORU&mit1&c_3029_3117_1"]={['-']={88,89}},["ATRAN&mit1&c_3825_3915_1"]={A={36,47,72,79},T={23,42},G={4,44,45,56,69},C={1,25,33,58}},}}end)();
(function()addBlock{name="s3x90",consensus="GGGCCGAAGGTTCTAGGGGACTAAGCTCGCCAAATAGTACTATGCAACACTCGGCGCCTACGGATGGATCATCATAGAGAAATCTCGCAA",mutations={["ANOAT&mit1&c_34320_34406_1"]={['-']={80,81,82}},["ANORU&mit1&c_34379_34465_1"]={['-']={80,81,82}},["ATRAN&mit1&c_39059_39146_1"]={A={16,53,66},T={14,36,60},G={3,33,38,51,58},C={9,26,42},['-']={10,11}},}}end)();
(function()addBlock{name="s3x83",consensus="TGCCCAACATCGTGCTCGAGGCACGGCCGGTGCTGTTGGTGTACCGCTCAGCGAAGAAGCTTCTCCCGGCTGAGTAATCGCTC",mutations={["ANOAT&mit1&c_77856_77930_1"]={['-']={20,21,22,23,37,38,39,40}},["ANORU&mit1&c_77935_78009_1"]={['-']={20,21,22,23,37,38,39,40}},["ATRAN&mit1&c_84813_84892_1"]={A={17,62,71},T={14,80},G={77},C={15,47,70},['-']={52,53,54}},}}end)();
(function()addBlock{name="s3x64",consensus="TCGGCCTTCGGTCTTCGTGAACTCACCAAATGCTTCCGCGTTCTTCTACGCCACTAACCTTTGA",mutations={["ANOAT&mit1&c_104225_35_1"]={['-']={7}},["ANORU&mit1&c_85_147_1"]={['-']={7}},["ATRAN&mit1&c_115006_115068_1"]={A={59},T={12,15,23,25,62},G={41,42,61},C={18,19},['-']={1}},}}end)();
(function()addBlock{name="s3x63",consensus="TCGGTAGGAATTAGTCCCCGGGGTCCCGGGACATTCGTTTCCGCCAACGGGGAACTCTACAAG",mutations={["ANOAT&mit1&c_57991_58053_1"]={},["ANORU&mit1&c_58069_58131_1"]={},["ATRAN&mit1&c_63349_63411_1"]={A={2,20,48},G={35,47},C={37}},}}end)();
(function()addBlock{name="s3x58",consensus="GGTTAACACCGTTGGGTACATGCCAGTCAAAGAGCCGAGGTATAAACTAAAAAGAAAT",mutations={["ANOAT&mit1&c_101954_102009_1"]={['-']={9,10}},["ANORU&mit1&c_102034_102089_1"]={['-']={9,10}},["ATRAN&mit1&c_111910_111967_1"]={A={6,12,33,38},G={30,32,43,47},C={2,13}},}}end)();
(function()addBlock{name="m3x39",consensus="ACTCTTTTTCGTGGAGCAACCCGTCCCCGTTACAACTTA",mutations={["ANOAT&mit1&c_3198_3208_1"]="AC-------CGTGG-GC--------------------TA",["ANORU&mit1&c_3311_3321_1"]="AC-------CGTGG-GC--------------------TA",["ATRAN&mit1&c_4176_4214_1"]={T={0,1,38},C={13}},}}end)();
(function()addBlock{name="m3x29",consensus="GTTTGAGGGATAGAAGAAAATAGCAGGGA",mutations={["ANOAT&mit1&c_40574_40574_1"]="G----------------------------",["ANORU&mit1&c_40634_40634_1"]="G----------------------------",["ATRAN&mit1&c_45653_45681_1"]={T={0}},}}end)();
(function()addBlock{name="m3x26",consensus="CTCCTATTGGCATACAGGCGCAGCAG",mutations={["ANOAT&mit1&c_58054_58055_1"]="------------------------AG",["ANORU&mit1&c_58132_58133_1"]="------------------------AG",["ATRAN&mit1&c_109042_109067_1"]={},}}end)();
(function()addBlock{name="m3x22",consensus="GAACGGCGGCATCACCTTTAGG",mutations={["ANOAT&mit1&c_33743_33764_1"]={},["ANORU&mit1&c_33802_33823_1"]={},["ATRAN&mit1&c_37483_37483_1"]="C---------------------",}}end)();
(function()addBlock{name="m3x19",consensus="AAGCGGCTGGCATAAAGGC",mutations={["ANOAT&mit1&c_33121_33126_1"]="---------GCATAA----",["ANORU&mit1&c_33180_33185_1"]="---------GCATAA----",["ATRAN&mit1&c_36796_36814_1"]={T={10}},}}end)();
(function()addBlock{name="m3x16",consensus="CTCCGCTGGAAAAAAA",mutations={["ANOAT&mit1&c_55254_55260_1"]="---------AAAAAAA",["ANORU&mit1&c_55332_55338_1"]="---------AAAAAAA",["ATRAN&mit1&c_60723_60738_1"]="CTCCGCTGGCGACCGC",}}end)();
(function()addBlock{name="m3x7",consensus="CCTTTAA",mutations={["ANOAT&mit1&c_101947_101953_1"]={},["ANORU&mit1&c_102027_102033_1"]={},["ATRAN&mit1&c_111907_111909_1"]="CCC----",}}end)();
(function()addBlock{name="m3x4",consensus="GGAT",mutations={["ANOAT&mit1&c_46527_46530_1"]={},["ANORU&mit1&c_46604_46607_1"]={},["ATRAN&mit1&c_52122_52125_1"]="GGGC",}}end)();
(function()addBlock{name="m3x3",consensus="CTG",mutations={["ANOAT&mit1&c_103231_103233_1"]={},["ANORU&mit1&c_103328_103330_1"]={},["ATRAN&mit1&c_113205_113207_1"]="TCA",}}end)();
(function()addBlock{name="m3x2",consensus="AG",mutations={["ANOAT&mit1&c_102148_102148_1"]="-G",["ANORU&mit1&c_102244_102245_1"]="GG",["ATRAN&mit1&c_112122_112122_1"]="A-",}}end)();
(function()addBlock{name="m3x1",consensus="A",mutations={["ANOAT&mit1&c_102898_102898_1"]={},["ANORU&mit1&c_102995_102995_1"]={},["ATRAN&mit1&c_112874_112874_1"]="G",}}end)();
(function()addBlock{name="m3x1n1",consensus="T",mutations={["ANOAT&mit1&c_91352_91352_1"]={},["ANORU&mit1&c_91432_91432_1"]={},["ATRAN&mit1&c_101077_101077_1"]="C",}}end)();
(function()addBlock{name="m3x1n2",consensus="C",mutations={["ANOAT&mit1&c_52751_52751_1"]={},["ANORU&mit1&c_52829_52829_1"]={},["ATRAN&mit1&c_58141_58141_1"]="G",}}end)();
(function()addBlock{name="m3x1n3",consensus="T",mutations={["ANOAT&mit1&c_19600_19600_1"]={},["ANORU&mit1&c_19712_19712_1"]={},["ATRAN&mit1&c_21741_21741_1"]="C",}}end)();
(function()addBlock{name="h2x788",consensus="TCTAAGCTCAGATAGTGAAAAACGCAAAGAGAGAAATTACAAGAAGATTTGTTGGCTTAGATTGGGCGAAGGCGCGAAGCGCAGCTTGTCCTTTTAGGATGCAGCTTTGAAAAGAGAGAAGTGTTGTAGGTGTTACCAACTACTATTCCTATTTCATTTCTCTTCATGTGAACAATCTGCGCTTCGCGCCTGACCATAGTCAAAAGTAGGGGTCGGAGTCGTTTGATAGCAACTCTGAATAACAGTATAGATATAGATATCTTCCTATTTAGCTCCCGCAAATTCATGTCCTATCTAGGATCTTTCCATCAAGAGCGGATTCCCGTTCTTTTCGAGTCCCGCCAGTAATCTACGTCACCGTCAGCATTAATTATCTATCTGTCTCTTTCATCAATTATCTAAATTATGCCAACCTATCTTATAAAACCCGGCCCGGCAATATAGTCAATACTGGCGACACGATTAAGAAGCAGTGCTCTTCATTTCTAGTCTTTTTTCTTTATACTCTTTTTTCTCCCATTGGCCATTTATCAAAAATTTTCTGTAGTTTTTGCTCGGCCCTGGTTTTTCTGTTGAAGCGAGTAGTAATTTCTGCTGTTTGTTGGACAGCTTATTGGTTCTACGCTCTTTCATGCACCGTATGCGGAGTGCTCCTTGGATAAGAACGAATACGTCAGAAGCATTGGCAACCTATACATTATTGCCATAACTGTTCGCTTTGCTCCTCGTTATTTAATCGTCTTCTTTTTCCTCAGCATAACAAATTGAGTTGCCCTATTCGTTTTGTC",mutations={["ANOAT&mit1&c_610_1397_1"]={},["ANORU&mit1&c_723_1510_1"]={},}}end)();
(function()addBlock{name="h2x451",consensus="ACAATAAAACTACTTCATGAATTCTAGGAAATGCTGCTATGTATTTTGGAAAGATGCGTAGCACTTGGTTGGTTTTGCAAACAAAGAAAAAAAAATAGATATCTATTTTTTTTTCTTTGTTTCACTAATCAGTAGAAAAATAGGCTATGCTCCGCGGCCTAGTCGATTTGACGAGGTTGTTGGCTGAAAAGCGGGTTCGAGAAATGAATGCATTCTTCTCGCCCAAGTGTTTTGTCAATGCCCAAAACCAAGGGCAAAGCTCTCTTATTAGGATGAGGGCCGAAGGCGCCAATGCTTTTGGGCAAAGCAAAAAACCATATATATAGAGAAAAGAGCCAAACAATCTATATATAGCCAAACAATCTATAGAGAGGTAGGTGTCTGTGGCACTGGCTATAGCCAATGGTGGTGGCTTCGCCCTCATCCTTAGGGCGAAGCCGCCACTTGATTC",mutations={["ANOAT&mit1&c_71282_71732_1"]={},["ANORU&mit1&c_71360_71810_1"]={},}}end)();
(function()addBlock{name="h2x415",consensus="TGTAGGTTTTTCCATTAATAAAGAGATCTATATTGTAGAAGGCTTGGCCTTTCTCTCTTCAGGAGGAGACAACAATGCTGTTAAGGAATCCTTAGGCCCGAATGGAAAGGCTTGGGTTACTAATGAACGAATTCCAGGAGTTGGTGAACTACAGAGAAAAGAAAATATGAAAAAGCCTTGTAAGTCGTGAGTACACTCCAATAGACGACTAGGATCTTAGACCTTCAGAACGTAGCCGACACTTTCTATGATATAATAGAAAAGGAGTTGTTGACGCAGTCTACTGGCCACCCCTCGTGACGGAAAACGCATTTGCTTCGGTTTACGCCTTCCATCTTTAATTCCATCAATTGGCTATTTCAGCCGAAGCGGTCTTGCGATAGAACCCAGACCCCACCGTCTATAATAAATAGTT",mutations={["ANOAT&mit1&c_62733_63147_1"]={},["ANORU&mit1&c_62811_63225_1"]={},}}end)();
(function()addBlock{name="h2x377",consensus="GAACCTACCTATTCCGATTATTCGAAAAGAGAAACGAGAGAATAAAACGCTTGCTTTTGTCAGCATCAAGGTGTCTCTGGTGTTTCCGTTTTGTGTCTCTATCGGGATTTTCTTACGATTTTGTACAATGCAAGTTTTCTATTAACAGATTCTGTAGGGAAGCAAACAGAAGGTTGAGAATCTTTTTAAAATGTCATTTTTTTGATCAAATCTATTCCAAAAAAATGAAAAAAATCTCTGAACCGAAGTCTCTAATTTCTTCATCAACAACTCGTTTAGGGCTTAGTATAATAAAGAATCTTATCCACTTCGAAGTGGGCTTTGATACGGGATCGTGAAGTACGAAAAACCGATGGCGAGATTCTATGCCAAGTTTA",mutations={["ANOAT&mit1&c_98021_98397_1"]={},["ANORU&mit1&c_98101_98477_1"]={},}}end)();
(function()addBlock{name="h2x355",consensus="GAAGAGAAGCGGTATCACCGGCGGCAAGTAGCCGACGCGTGGCCTGCGGCATCCATTATTTATGTGGAGCTAGAGGGGCGCTTCTTAGAACAACCATAACAACCATAAGGGCGCTTCTTAGAACAACCATGAACAACCATAAGGCCGCAGGGCGCAGCAAATCGAAATAAAGTCAAGTTGGCGATGGCGGCGATTCTCGCCCTGTGATTGGCGGCGCTGGCGGCGATTCTCGCCCTGTGATTATTCTCGCCGAAGAGCACCTGTGTATTCGGCGCTGGCGGCGCTTTGCGCCCTTGTTGACTCTATTCATCAATTATTCTAAAACGCGTTACAAAGTGATGAACAATCAATCGCG",mutations={["ANOAT&mit1&c_33965_34319_1"]={},["ANORU&mit1&c_34024_34378_1"]={},}}end)();
(function()addBlock{name="h2x257",consensus="GTAGGCTGCATTACTACAAAGAAAAAACATATATATATATGAAAAAAGATTTTAAGAATTAAAAAAAAGAGATATGTTTTTTTTCCCCTATTCACTTAAGCGATGGTATACTTTGAAATTAGAATAGTATTACCCTATTGCATTATTTCAAGGCGTTTATGCCTTCTGTGACCCAAGAAAGTTTATTATAGCACCGTGGTCAAATTAGTCAACATTTTGACCGCAGTTAAGGGATCTGGATGCATTATAACACGTTA",mutations={["ANOAT&mit1&c_55570_55826_1"]={},["ANORU&mit1&c_55648_55904_1"]={T={251}},}}end)();
(function()addBlock{name="h2x256",consensus="TAAATTTGATGATTTAGCACATTGCAAAATTTAATTGACTTCGTTAAGTTTTCTGGAGAAATTATCATTATATATTATGTTATGATTATGATGTTGGCACGGCGGCGGCTATTAAAAAAGTTGTTTTTGGTATTAGAACTCCAGTCATTAAGGCTTTTGTAGCTTCTACAGCAATGACGGCCTATAGCAAAATAAAGTCATAAAGGCGTCTCGAAGCTTAATAAGTACGGCAATGCCCGGCCCGGGCGACCGGTCC",mutations={["ANOAT&mit1&c_77600_77855_1"]={},["ANORU&mit1&c_77679_77934_1"]={},}}end)();
(function()addBlock{name="r2x211",consensus="GTAGTGCCTTTTTTTAGCCTGCGAAAGAAGGCTGCGCCGAAGAAGAGAAAGCAGCGCCTAAGGCGCAGATTTCGTTTCTTGATCGTCGAAAAAGTAAGAATAAAAAAGGAAATGAATATTCTGTACTAGCGATAGCATAAATACTATTTACAAAACTAACAATATTATACATAATAATAATAATACATAATAATACAATATCGAAAATGAT",mutations={["ATRAN&mit1&c_1544_1713_1"]={T={52,59},G={15,92,166},C={11,60},['-']={2,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,196,208}},["ATRAN&mit1&c_38606_38812_1"]={T={203,205},G={58,88,95,99,184},C={13},['-']={46,170,171,172}},}}end)();
(function()addBlock{name="h2x210",consensus="ATTGCGGCAGGGTCTATGGGGAATCTGAAGAAGAAGAAGAAGAAAGTAAAGATTGGAATGATAGAATAATGAATCGAAAGAGAGAAAATCAAAAAAACCATAAAACGAAAAAAAAAAATTTCGGCTTTTTTTATTCTCCTCGACCGTGACTGAGACCGTCCAGTCACGTGATTGAGGCCGTCCAGTCATAATAGCAAGCCCTAGAGCATT",mutations={["ANOAT&mit1&c_49660_49869_1"]={},["ANORU&mit1&c_49738_49947_1"]={},}}end)();
(function()addBlock{name="h2x206",consensus="ACTCTTTCTTGTATGTGAAGCTAGCTGATGACGAAATGAATGTATAGCAGTCGAAGAAGTCTTTTCCGTGGTCGGCTCTCCCATGCCCGAGCTTGGCAAGTGTAGCCAGAGAATAACGCGGCAGCAAGGTCGCAACATATATATTGCTGCGCCCCTTCAACAACTTTTTCAGTTCCATGAGCTTTTAGTCTGGGCAGCATCTCGTT",mutations={["ANOAT&mit1&c_2348_2553_1"]={},["ANORU&mit1&c_2461_2666_1"]={},}}end)();
(function()addBlock{name="h2x173",consensus="CTAATGTACTATTAGTAGGAAAAGGGCTTTACGCCTTTGTATTTGTACTATTGATATTATCTACGTATGCGTCATCTTTGCCCACTATTTGGTTTTTCACTGGATGACCCAGATTAACTATGTATTGCCGTAATGCTGCGCTTTGCGCCCACTATCTGGGCCCGCGCCTAGAT",mutations={["ANOAT&mit1&c_84185_84357_1"]={},["ANORU&mit1&c_84265_84437_1"]={},}}end)();
(function()addBlock{name="h2x167",consensus="ACGTAATCTCACAATAGTAATAACGTGATGACAAGCTATTAGTACGTCATTTCATAGTAATAATAATCACAATAATGTGATGATAAGATAGACTATTTTTTAATGTTTTTTTTTCATTCTAATCTGTCATCACGTGATCTCATAATAATAGTAACATGATGACAACA",mutations={["ANOAT&mit1&c_34720_34886_1"]={},["ANORU&mit1&c_34779_34945_1"]={},}}end)();
(function()addBlock{name="h2x156",consensus="GGGTGACAGATCAGCCATAAGTACTCCGAAGGATACACTGGACAAAGCAAGTCGTGTATACGACAATGCCCGTAACGTGAAAAATTTTAAGGGAAAGGGCTGTAAATGGTAATGTGCTACCCCTTACAGATGCGGCGTGTCCCGCATCTGTAAAAG",mutations={["ANOAT&mit1&c_102010_102147_1"]={G={19,28,41,59,88,145,154},C={56},['-']={92,122,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139}},["ATRAN&mit1&c_111968_112121_1"]={G={82,104,151,153},C={54,84,114},['-']={95,140}},}}end)();
(function()addBlock{name="h2x156n1",consensus="AGATAAAAAATTACCATAGATGATCTAAATCCCTGTAAAACACGACAGAAATTGATGATCCTAAAGGATCAAATACATTTACCTCACCATCACCCAAAAACAAAAAATATTTATTATATTCGATATATTATTGGTATCTTCCTGCTAATTTATCTT",mutations={["ANOAT&mit1&c_39882_40037_1"]={},["ANORU&mit1&c_39940_40095_1"]={},}}end)();
(function()addBlock{name="h2x154",consensus="TGCTTTGCCCTTTTCTTTATGGCAAGGGCGATATAAACCGGAACAGGCACATAGAGGACAATGAAAAAGACCATCATTAGTAACCATTTAATTACTTACTGACTTTATCCGTGACACGGCCTCTACTAGCACCAGAAAAAAATATATATATATT",mutations={["ANOAT&mit1&c_28194_28347_1"]={},["ANORU&mit1&c_28269_28422_1"]={},}}end)();
(function()addBlock{name="h2x103",consensus="ACCTATATGGACAAAACCGCGCAAGGCTCCTATGTGGAAGCCTTACGGGGTTCTACCCACTTCATCCGCTTGGCGAATGAAGTGGGCTTTGCGAGAAAAAATA",mutations={["ANOAT&mit1&c_94212_94314_1"]={},["ANORU&mit1&c_94292_94394_1"]={},}}end)();
(function()addBlock{name="h2x91",consensus="CAGAAAACAATCTGAAATGGGAATACATAAGAAAGGTTGAAGAAAAGCGCGAGAAGGGCGCAGCAACTCTAGGATCTATTCGCAGTTTAAT",mutations={["ANOAT&mit1&c_91573_91663_1"]={},["ANORU&mit1&c_91653_91743_1"]={},}}end)();
(function()addBlock{name="h2x75",consensus="CTGTTTTTTAGACTTAGCTGAACTATAATCAGTTCTGTAAGACCGTTTCCCGGAGGAGGAGGCTGGCGTCTTTGA",mutations={["ANOAT&mit1&c_39661_39735_1"]={},["ANORU&mit1&c_39719_39793_1"]={},}}end)();
(function()addBlock{name="h2x59",consensus="AGAAAAAGCCATTAAAACGAACAACAATTATTGGGGCGGTATAACGCAGCTCTGTGGCG",mutations={["ANOAT&mit1&c_40375_40433_1"]={},["ANORU&mit1&c_40435_40493_1"]={},}}end)();
(function()addBlock{name="h2x55",consensus="CTCCTCGGGACCGGCCAAAGGTCCAATAGAGGCTTTATTTTGGCAGCCATCTTCA",mutations={["ANOAT&mit1&c_59070_59124_1"]={},["ANORU&mit1&c_59148_59202_1"]={},}}end)();
(function()addBlock{name="h2x52",consensus="ACAAATAGTTAACTAACACAAATAGTTAACTATTATAGTTAACTAACACAAA",mutations={["ANOAT&mit1&c_41651_41702_1"]={},["ANORU&mit1&c_41711_41762_1"]={},}}end)();
(function()addBlock{name="h2x52n1",consensus="AAAAGGATACTAGAAATAACTCATACCATGAAGACCCCAACAATAGATACTT",mutations={["ANOAT&mit1&c_40174_40225_1"]={},["ANORU&mit1&c_40233_40284_1"]={},}}end)();
(function()addBlock{name="h2x50",consensus="GCTCCTCATGCCAGGTTTGTTATGGGTTGGCAGTAGCACGGCAGTAGCCT",mutations={["ANOAT&mit1&c_77931_77980_1"]={},["ANORU&mit1&c_78010_78059_1"]={},}}end)();
(function()addBlock{name="m2x48",consensus="GCAATTACATAGTAATTGCATTCCTCATGAAACTGAGTATGAGGCGCA",mutations={["ANOAT&mit1&c_100294_100341_1"]={},["ANORU&mit1&c_100374_100421_1"]={},}}end)();
(function()addBlock{name="m2x44",consensus="GGAGCGAGGGTACAAATACTATGCGAGGTTCAAGACCCATTGAT",mutations={["ANOAT&mit1&c_20779_20822_1"]={},["ANORU&mit1&c_20894_20937_1"]={},}}end)();
(function()addBlock{name="m2x41",consensus="CATGCTGCTTTGCCCCTCCTCAGGCCGAGGTTCGAGGTAGC",mutations={["ANOAT&mit1&c_65290_65330_1"]={},["ANORU&mit1&c_65368_65408_1"]={},}}end)();
(function()addBlock{name="m2x40",consensus="GGTATAATAAATCTGCGCATGAAAGTAGCTAATTGATACG",mutations={["ANOAT&mit1&c_77474_77512_1"]={['-']={1}},["ANORU&mit1&c_77552_77591_1"]={},}}end)();
(function()addBlock{name="m2x30",consensus="CGAAAAAATCCGCGGGGCTACCCTGCAACA",mutations={["ANOAT&mit1&c_30944_30973_1"]={},["ANORU&mit1&c_31019_31048_1"]={},}}end)();
(function()addBlock{name="m2x23",consensus="GAAATCACGTAAGATATGAAAAA",mutations={["ANOAT&mit1&c_103528_103550_1"]={},["ANORU&mit1&c_103625_103647_1"]={},}}end)();
(function()addBlock{name="m2x20",consensus="GAAAAAAATGACATATTTCT",mutations={["ANOAT&mit1&c_34407_34426_1"]={},["ANORU&mit1&c_34466_34485_1"]={},}}end)();
(function()addBlock{name="m2x19",consensus="GCGGAGTTTTGTTCCACAC",mutations={["ANOAT&mit1&c_95679_95697_1"]={},["ANORU&mit1&c_95759_95777_1"]={},}}end)();
(function()addBlock{name="m2x14",consensus="TGCATATTCCTCTT",mutations={["ANOAT&mit1&c_3005_3018_1"]={},["ANORU&mit1&c_3118_3131_1"]={},}}end)();
(function()addBlock{name="m2x13",consensus="TACATCATGATAT",mutations={["ANOAT&mit1&c_65397_65409_1"]={},["ANORU&mit1&c_65475_65487_1"]={},}}end)();
(function()addBlock{name="m2x13n1",consensus="GCGGCCTTTTTCG",mutations={["ANOAT&mit1&c_36_48_1"]={},["ANORU&mit1&c_148_160_1"]={},}}end)();
(function()addBlock{name="m2x12",consensus="GCTCACGCCACG",mutations={["ANOAT&mit1&c_83251_83262_1"]={},["ANORU&mit1&c_83331_83342_1"]={},}}end)();
(function()addBlock{name="m2x5",consensus="GAAAA",mutations={["ANOAT&mit1&c_39490_39494_1"]={},["ANORU&mit1&c_39548_39552_1"]={},}}end)();
(function()addBlock{name="m2x3",consensus="GGA",mutations={["ANOAT&mit1&c_38956_38958_1"]={},["ANORU&mit1&c_39015_39017_1"]={},}}end)();
(function()addBlock{name="m2x2",consensus="GG",mutations={["ANOAT&mit1&c_8297_8298_1"]={},["ANORU&mit1&c_8409_8410_1"]={},}}end)();
(function()addBlock{name="m2x2n1",consensus="CC",mutations={["ANOAT&mit1&c_268_269_1"]={},["ANORU&mit1&c_380_381_1"]={},}}end)();
(function()addBlock{name="m2x1",consensus="A",mutations={["ANOAT&mit1&c_51003_51003_1"]={},["ANORU&mit1&c_51081_51081_1"]={},}}end)();
(function()addBlock{name="u1x982",consensus="CTTGACCTGTGGCTTCGTCCGTAGCATGAAAAATAACCTAGAGCGATCCTAAGTGAGCAGCTCCTTTATTAGAACAATTCAGGAAGGCTCTCCTTGGCAGGCTCAATAGAGCAAAGCACTGAAGGCTCATGAAAGAAAAGCGCAGCCCCCCCGGGCTCGCTTTTTCTCCAAAAGCCCTCTTTACTTAAGGATTAAGAAAGAGAGCTTAAATTTTTTTTATATTTTTTTTCTTCGGACTTTTATTCGAGAATGAGCTATGGGAAAAAGTGGGTAAATTTGGGCCTAAAGTTTAGGCAGAGCAGGGAGCGGCTTGCGAAAATAAATAAATATATATATATATGCCGCACTCTGCGGCCTGGTGCTCTCAGTGTTATTAAAGCCATCAGCAATGGCGTCAGAGTTTCCATAGTACAATGAATCAGAAGGGAAACAATAAGTTTTTTAACCATTATACGGTCATGGTATGAACTGAGTTTTCATAAAAGCATAAAAAAAAATATTTTTTTTGCTTTATGCTGATAAAGACTATCATATTTGTTCAATTATGTTAGTTTCGGATACTGAGCAAGAGCCGTGTGTTCGGAGATCTTGCAAGCACGGTTTGAAAGGGAGCGTTTCGAAGGATTATATCATGGTGGCTTTGACTCAATAACAGCGATGTTGTAAATGAGGTTAATTTATGATGTATGACTTGCTTTCATCAAGTATCTCGCGTGATTATTGAAGCTTTCTTTGCCTAACATCATGGCCTAGAATTATTCCAAAAAGCTTACTCCATCCATTGGGTCGTTAGTTCAAATCCAGCCTATAGAGCTAAATCGACAAAAAGTAAGCTGCGTCCTGGTGTTATACTTATTATAAAGATTCGTTTAACTTGGTTGTTAAACGAGCAATAAAAGAAATTTACTAAATTGAATTGAGTTATATTTGATAATGGAAGGACGAAGCATACTGAATCGTTGATGTGGGCCTAGCATGGTGC",mutations={["ATRAN&mit1&c_68211_69192_1"]={},}}end)();
(function()addBlock{name="u1x928",consensus="CCTATAATCTTATGGGCCAGGATGGATATCTAGGTGTGATAGTCTTACTAATCCTCTTATCGCAGTTGGGTATATCATATTAATACGGTCCCTTTTTGAGAATCCCCGCGCCTTTAGTTCGAACAACAGATGTTCGATTGGAACAACAAACACCTTTATTCGGGTGTGAGCTCTCTGTTTTATTTTGTAATATTTAGCTGTATAAAATGATTTTTCTATTCCAGGGGCTTTTCTGGGAAGTTGAATCATTCGCTACTTGAATGTGTTATGGGATATCTACATTTAGCTCTAGACCACACGGAAGCTTTTGATTTCCACTCTTATTTCTTTAGCCTTATTTTGATGTCAAAATAAAAACTACAAAATCGTAAGCGTATCTTATGTAGCTTAATTGTCGGAAATTAGGATGATCCATCACATCATATTTAGGATTTTTACTTATCTCTATCAGCATAGCTCCTGGATCTGCCGGGTCATGAGAAGAATCTCTTTTCGTACGGAAGAATTTGTAAGTAGAAATTTCGCGTCTCGTAACACCTTTTTTGAATCTGTTTTCCATACTGAGCATGAATTGGCTCAGTTTATGAAAAACTATATTACATAAGAATGGGATTAAAAAGCTTTCTTAGGGAATACCCGAATGCAAATAGATGACTTGGCCACTTTCTAGATCGAAATAACCTGCTTTCGGGGTTTTCATAACAAGTTCTAGTGTCTGTTGACATTTTACCACGGCCCTAGCCCCTTCCTGATGATGCAGTGTGGTATCCCGTGGAAGCACTTGGATATGTCATCTCGAAATGGTAACTGCCTTTCAAATAAATAAATCGCAGTGCCGAGTAACATGATCTATCTGGTCTAAATCCATGGGAGCTGTCTATAAATTATCTTTCCTAGATGGCTTTTAAGACCATTTGGAGTGCTTCTT",mutations={["ATRAN&mit1&c_9367_10294_1"]={},}}end)();
(function()addBlock{name="u1x913",consensus="CTCTACTGACGCTGAGGTGCGAAAGCATAGGGAGCAAACAGGATTAGATAGATCCGGCCGGGCTCTAAATGAAACACGGTCAAAGGTGTCCCCTCCGATCGCGAGGTCAGAGTGTGCATCCAGCTATTTCGGGGAAACTTTGATATGAATGTACCATTTAACATCAGACAATCCCGAGGGAAGTGCTTTAATCTCGGATCAAGAGCACCCCGTAGAGACTATGAAAATAGGGAAATAGAAGATATAAAGAAAAATAGGCAAAGCTCAAGCTCCTAACCTGCACTTGAAGAGACTCAAGCAAATATCTTTGTCGGATTTAATGAAATCAATTATCTTAGGATAACTCCTAAGAGATGGCAAGGTTCTCCGTTCGTTATAGCCAAATGAAGGAAAATTACTTTCGGTGGATGGAAAGTAGGCTCACTGCATGAAATCTTGGCACTAAGTTCCGTGCAGGGGCAAGCCGTCGATGGCTTTGGCCAGAACAAGTGGCTACTGATGACTTCGACAAAGAATATGTTAAGCTTTTAGCCCGAGACTTAGACACTTTTCGAAAGGAAGGTTTACGGGCCTATTCGAAAAAATCGAAAGTACGGTAATTCAAGCCAAGAGTCTTACTGCCGCCTTTGGTCTGGTATTGAGGAACTTAAGAGACTGCTTTGAATGATCTTACCACATGTTCCCGTGGCGAGCATGCCCAGGAAAGCCATATTATTGGTTTACAAAGATCCTGAAATTCAACAACGCTGGATCTCTGAAATGAAGAAAGCTTTGCCTCTTTTTTCGAAGTGCATTAACCAATAGTTAGCCAATAAAAAAGAAAGCAACTGCAAAGATTGGAGTTCAGAGAATGATATAGTCCATTTTTGAAGATAATCATCACGTAGTGATCGTGATGGGATTATTTCTTTTC",mutations={["ATRAN&mit1&c_34705_35617_1"]={},}}end)();
(function()addBlock{name="u1x841",consensus="CTTATGACAGCTAAGATGACTTAGAAGTAGCACCTTCACCTTAAGTAGGAATCTTCTGCGGACTATTGGTTGAGAGCCTTACTTGATAACGAATCGGTTAGGACTTTATACTTGGTGGATGGCTTTAATTTCTTTGGATTTCATGGATCCTGCGGCTGTTCTTTCAGTTCATTTCAGTTTTTTGTATATCTCTATCTTAGTTAACTGACGGTTTATAAGATATGCTATGAAAAAGTTTCATAGCATAGTCTCAAAATACGATGTACCACGTATGAAAAAAATAAATAAATTGGGTTTCTACCAAAAAGGATCTTTTATACTTCAATCTAGATTTTGGCTGGTCGTTTATTTCAATTTTTTTCCTTTATGGTATGCTTTATCGTAGGCAGGTAAATAGTCTACTGCGGCTATATGAAAAAGCATTCATAAAAAAATCTATATTTTTTTTTGCTTTATGTTCTCCGGGTTTATTAAGTTCATTAGGTTTACAAGCTCGACTCGGTTCAATTCGTAGCAGAGCACTCTGTAACATTCTAACATTTGCACTGGATACTAAATGCTACACAACGTATTCACTGTAGGGGTTCTCACCTTTAATTTTTGCAGCCCTAATTTTGAATTTTCATATCTAGCCTCTATTCATATAGAAGAATTCTCATAGAATGAAAAAAGGTATCCCCTGCCCCATTTGAGGAAGACGAAAGCCCATTAAAGGACCTTCGGCCTTTTTAATATGTAAGCTATACATAGATTCTGACTTCGGGCCTGAGACTTTATATCCTGAGTGAGTCCTTAACTAATTAAGTCATTGAAAACGTGGCTCTTTAAATGGCTGCAGTAG",mutations={["ATRAN&mit1&c_84893_85733_1"]={},}}end)();
(function()addBlock{name="u1x808",consensus="ATTAATAAAATGAAGGACAGATCCTTTCAGTTCCAACCGACCCAAAGAAAATTTACTAAAGGAATATGCATTTTTCTGGAACACCTTCTTCCAGAAACGAGGTAGTACGAGAAGCGATTAAAATGCTTCTTGAGCTTATGTTCAAACCGAGAATGGGTGATGGAAGCTATGAATTCGGACCAGGAAGATCCATACATTTGGCACTAAGAACTATCTGCAAATGGACCGGTACTATCTGGCTGATCGAAGGAAATATTAAAGGTTACTTCGACAATATAGACTATACTATTTTGGCCTCACTTCTTATGAAGGAAGTGAAAGACCGACAGATATTAGATCTGTACTGGAAACTAGTTCGTGTCGAATTTGTAAATAACAAAAAACAAGAACCCCACAACTTAATGGGTGTCCTGCAAGGCGAAATCTTGTCACCTCTGCTATCTAACATCTACCTACATGAATTCGACGTCTGTATTAAGAACTTGGCGGCAAGTCTCCGTCCGCCCGGCAAGGTCTCGAAATAAAATCCCAACTGAATACTCCCGGATACTATAGCAAATTGTCAGCCCAGATGGAAAGAGAGCTAAGGCTCGAGGAACTACTAATCTGGAATTGAAAGAGCAAATCCCCCAGCTGGAAAAGCAGAAGCGACCTGTGGCCTTTACTTGCCCTTGTGCAGGCATTAAAATCCACTACGTAGGATACGCAGATGATTAGATAATAAAAGTGGCCGGGCCAAAAAACTTAGTTGTCGAGATCGGAGATAAAGTAAAAGAGTTCCTAACAAAGGAATTCGAACTGAAACTAG",mutations={["ATRAN&mit1&c_72639_73446_1"]={},}}end)();
(function()addBlock{name="u1x780",consensus="AAAAGGATATACGAAGCAACATTTTCGGAGGACTCGCACGGGTTCAAACTGAGTAAGTTTTAACACACGGCACTTGCAAGCGTAAAGTATGGATGGGAAGGAACGTCCTGGTTCATTGAGTTTGACATTCGGAAGTGCTACGACACCTTAAATCAGAAAAGGCCCGAAAGGCATCTTTTTGGAAAAGATACAGGATCAACACTTTTTGGATACGTGGACACAGATATTTCACGTAAGCATAATAAGCAGTAGAAGGACTTACATACATATAAGGATGAGGAGATATAGTGGTGTATTGTCCCCTTATTTTGTTTTGTGTGATATCTACCTCTACTAATCATCAAATTGTGGCTTGCTGCAGTGTGACTATAGGAATATTAAACTACTATTTATGCTATGAGAACCTCAGCAAAGTGAGGTCCATCGTCAACTACCATCTGAGGTGGTTAGCTGTATATACGCTGGCCAAGAAGCACAAATCGAGCTCACATCGGATCAGCCCGAAGTTCAGCAAAGACTTAATTAAAACGAATGAGGGCACAAGATTGGCAGCGTTACTTGATTTAAAAGAAAGAGAAATAAGTTGATTTTAGAAGTGCTTCTTAACAAGGAACCCAAATAAATAGGCTCTTTATAAAATTAAGTCGAAGTAAGGTACTCTCTCAGATCATTGCGGCGCAATTAAAGGATGCGAAGAAAATGATATAGAGCACCATCTCCGGCGACTATAAAGGGCTGGAACAACTAGGAAGCATAACGTGCGATCCGTCAGAAAGGTTA",mutations={["ATRAN&mit1&c_91337_92116_1"]={},}}end)();
(function()addBlock{name="u1x725",consensus="TCCGCTGCGCGTTAGAGAATGCATAGGGAACCCAAAGATCAGATTGTACTGAAGGCAATGCATATTACTCTTGATAAACTATATAGGCCGCTCTTTTGCAATTCCTTAGATGCATTCCGTTCCGCATAAGGGTGCCACACGGCACTTAAGGAGATCGAAAAAAACTTGGATGGGAATCTCGTAGTTACTAAAATTTGACATTAGAAAGTGTTCTGACACGATCGACCGGCACTGCTTGGTCTTCATGCCTTCGGAAGAAATCCATGATTAACGGTTTATTGAGTGGATATTGAAGTTATTTTGGGCAAAGGCCATAGGTCGCAGGTATATTTTCTTTCTTGTGCCGACCAAGTAAGACCCCTGCCCGAAGCAGGAGTCCCACAAGGTAGTGTCATATCACCCAGACTCCACAATATTTATCTGAACAAGTTAGCGCTGAAAGATCCAACGTTACTCCAAACCTCCCAAACCGAGTGTAAACGAACCCAGAGTACAAAAAAGCTATCGCTATATCGAAAGCAGAGAGACAAGCTCATTGCGGAAACAAAGCAATGCTATCGGGACTAAAAGCCTATGAAGCTGAAAAAGAGACGCAGCAAATATATATATGCTGCGCCCTTGCTCTCGCTCTATCCCCTGTGCTACATTTGCTAAGCTTACAAGAGTCTTCAGGGCGCAAATACTTTACAAAGAAAAGATCAAGGAATCACGTAAGATATGAAGAA",mutations={["ATRAN&mit1&c_113540_114264_1"]={},}}end)();
(function()addBlock{name="u1x630",consensus="TTGGATCGACTTGGTAGAACCTTTACGGACCACCCGCAGCTTGGCAGCTGGATACGTTAGAAGTTATCTCGAACTTCGTTACAATATAGTTTTCGCACCCTAACAAAACGAATGAAAGCCACAAATATAAAGTAAAACGATAAAAGCGCCTAATGCCGCAACCGCCAAAAGGCAGAAGGCCTACGGCGTAGAGTCATTGTCTGGGATGATAAAAAATATATATATTTTTTTTGTATTGTTTTATCATAGCTTCAATCCTGATATAATACTAAGCTTGGCTATAGGGTTATTTAAAGCATGTATAGGCGATAATTTAATCATACAAGAAGTTTGGGCTAAAACTGATGGCTGTGTGAAGAAGACTAAAACATGTTAGTCGTAGCTTTTTTGCTTTATTAAGAAGTTATCGATAACTTCTTTCATCATCTTGGTCGGGTTGTGCAAATTATTGACCACTTTTATTATTAAAGTGGTTGTTGACTGTGGTCGGTATTTGGCTCTCTTCAAATTATTTTTTCGTTCTTTCCAGTTTCTCTGTTTCGGTGAAAAAAGTATATATATATATTTTTTGCTGCGAAAAAAAGAATATATTTTTTTTTTCGCTACGTCTGGAGATGAGAGTGGATAAAT",mutations={["ATRAN&mit1&c_230_859_1"]={},}}end)();
(function()addBlock{name="u1x572",consensus="TCCTTTACTTCGGTTCATCAGGAGTCCACGTTAATCCCCAGTCCGAAGGCGGATTCCCATTATTTTAAAGTTCCGACAGGAATTGCTCTACGCCACCGTCTTAATTAATTTTAATTAATTTTAATTAATAGGTGGCCTTCTTACTTTTATTGATTATCGCCAAGCTGCGCCCGACCGTCCGTATAGGACACGGCCAAAGCCCAACAAAGAGAGAGAGCTAAAGCCCTGCCTACAGAGAGCGCCTGCTAAAGCCCTTTGGCTCTACAGAGAGCCTTCGGCCTGCGGCCATTAATATTTTTGTGGAGGAGTATTAGTGAGGGCCGCAGGCGCTACTGTATACAGTCCACTCGCTGCAATTGTTCAGCCTTCGTCGCCGGCCAAATATATTTGTCTTTATAAATATATTTGTTTTTATTTGATGATATTTGTTTTATTTGATGATATATATATGATTGGCAGTTATTTTGGCTATTCCGGGTAGTAATTCTTCCCCGTTTGCACAGGAACAAGAAATAAAGAAACAAGAAATAGATTTATTTTATTAGGCTTGGCAAATTGTAATTAATTGATAA",mutations={["ATRAN&mit1&c_1714_2285_1"]={},}}end)();
(function()addBlock{name="u1x457",consensus="TTACCCAATACTATACAGATTGTGACGTCTATATATTTCGGTCCAGTGCACGGTGGAATTGGCCTGAACTATATATATGTTGGATTTTATGTTTTAACGCCTTATATCGACCCAATATTGCAGAGTCTATGGTCGACTCCGCTCAAATGCATTTATTTCTAATCCTCTTCTTTCGGAACAATAGAGTAACTAAACAACAAAAAAGGTGCTTTCTTTCTTTACTCGTTTGTTGCCAACCCTACCAATTAAACTGACTAACAGTTTTTTAAATAAACAAACAAGCAATTTGGATGGAGAGCAAATTTGGATGGAGAGCAACTCTACTCTCTCTGTTTTCCAAGTCGAGAAGTCCCAAATAATCTTATTGGCGCTTTCTTCATGATACCTCTATTATTTATGCCTATCCATTTGAGCTGCGCCCTTAGGTTGCCAGTGGCCTGCGACCTGGCACAGACTG",mutations={["ATRAN&mit1&c_24435_24891_1"]={},}}end)();
(function()addBlock{name="u1x418",consensus="TTTAATTACTTTATTCATACGTAAAGGATAAGTCAGGATAGGGAGCGCAGCACCCATATTACTGAGGACGGGGCACTAAACGACATTATGACATAGGGCAGGGCGCCCAATCTTGCGATTGGACAAGCCATGTAAAAAACAAACAACGCTGAAAGCATCCCAAGAAGCGGCCGTACCTTATGTATGTAGGTTATAATCAATAATTAGATTTATTTAGGAATCTGAAGTAAATCTGCTTGTTATATATGCAGTAACTTGTAAATCCCCTAATCAGATAAAGACGTAAAATTCCATACAGCGGCGGCATCACCGGCAACAATTTGGTGCAGCCGCCGCGTGGCTCGCGGTCTTGTGGGGCCAGGCGCTCCGACGAGCAACTGACTCAAAAGAGTGGCCGGAAGGGTTTACAAGAAATCAA",mutations={["ATRAN&mit1&c_37650_38067_1"]={},}}end)();
(function()addBlock{name="u1x362",consensus="ACTTCCTACGGCCTACTAATCGAAGACTGCTGCAAATATATCGCCATTTATAATATACCGCTTTATTATGCATTTGCGCAATTTGGGTACACAAAACACTTGTTCTGTGATATTATTCCTTCTGGGCTAATTATTATTATTATCGTCTCCAAAACGGAAACCTATTTATTTTATCAAGCTTTTTAGTATAGTAGGAAAGACTATTCGCACTCACAGTTTTTGAATTGCTTTTATTACTAACCTGGTTCAAAAAACAACAGGTTCGTGCTGGGCATCGCGATATCGCAACAACGAAGATGTAAGATCCCATTTTATGACGCAAAAGCAGATATAGAATTCTATCTAAAGCGTACATAAAGCCC",mutations={["ATRAN&mit1&c_44009_44370_1"]={},}}end)();
(function()addBlock{name="u1x354",consensus="AAATATAGCTCAAAGGGCTTTTTATATAAAAAAGAAGCCTGAAAAAATAAATATCTATATACCGCTTTTTGCTGTGCCCTTTGGAAGGCGCAACTTACAATTTATTTGCAATGCGAATAAAATGATTTTAGCCTGGGAAGATGCACGAAAGAGAAGAAAATGCGTTGAGGCCGAAGGCCTCGAGTCCAAGATCATTATTTTGTTCGCGACCTCCTAGGTGAACCATGTAATAGATTAAATTGCGTAGCGTAGTTTTTTATTTATTGTCCCACACAGCGCTTTTCTTGCTTTCACGTTCTTTGCCAGGCTGGCCCAGCGAAAAAAAAGTAAGTGGCTGAACGAAGAAGAGAATAA",mutations={["ATRAN&mit1&c_105439_105792_1"]={},}}end)();
(function()addBlock{name="u1x320",consensus="GAGCTGACGCCCTTTTATATATTTTTTTTATTTTTTTCTATTCCCGTGAAAGAAGGCCGCAGGCCTCTAAGCTGGCGATAGTTCAAAATGCCTTATTGCAAGGAAGACCTCATAAAAAGGGCCTTTGGTACGAAAAGGGAAAAGTTAAGTAGGCGTCACCAACTTTATCATATCATATAAAGGGGCGTAGCCCTATTACTTTTGTGAGAAATGCCATGTTTCTGTTCGTTGGCAGTGTTCGTCGGCACTTTTCCGTCTTTGCTGTTCAGTCCAAAGTCGGTGTGAGTGCCTTCTACACTCGTTTTTGTGCTCCTGGGAAA",mutations={["ATRAN&mit1&c_1224_1543_1"]={},}}end)();
(function()addBlock{name="u1x312",consensus="GATTTGAAGGGTTATATCTTTTATAATGAGATAAAAAAAACTATTTACTGCGCCTTATTTGCTACGCCCTTATGCTATTTAATATAGCAGTTCCCCGGGACATCCGATCATGAGAACCGGGCTTTTATTATGGCAAATCGGGGAAGCATAAGCTTATAAAAGTGTTTGGCAGACCACAGGTTGAATTGTTACACTTAACTTGCCATAATAGTGTCATACATGGAACATTTTCTAGTAGCCAATAAGTCAAACATTATTCCTGTGGGTCGACATGTTGAACAGGTTGCTTGAGCCGTCTGTGGGGAAACTCAC",mutations={["ATRAN&mit1&c_96379_96690_1"]={},}}end)();
(function()addBlock{name="u1x303",consensus="GGCAAGGAGCCTTTCTTGCTTGTAAACTTATGGCAAAAAAAAATATATATATATATTTTTTGCCGCAGGTAGGTTTCTGTTTTCTGGCCATATCCTAAGGTGTCATGTCCATAATTGTTATGGCATTCCACAACTTTCTTTGGGGGGACATCATTCATTCAGGCTACTTTAAGCGGTTTAACTTTCAATCATACGTAAGGTAGCTTCACTTCGTTAGCCTGTGGTCCATAACCCCTGTTTTTCCAAAGCTATTGGAAATATATATATATATATTTTTCCAATAGCTTTTCGTATGAAATGAGA",mutations={["ATRAN&mit1&c_78616_78918_1"]={},}}end)();
(function()addBlock{name="u1x293",consensus="GGGTCCTTGGGTGAGGCTACACTCCAAAGAAATAGAGAACGGGAACGCGTATTTTGATAATCTACTATTAGATATTATTTACGTATGCAGTAATGGCATTTTAATGCCGGCAACATTTCGTATCAAAGAACGCTACAATTTCTTCACTGGGTGCCCCTATAGAGACAACAAATCAGATTTACTATGTATTGCCCAATTAGTATTTTATCAGAATCATATCACAAAGTGATGCATCAGTCTTGTCTGGAAATTTTATCGCGCTTAGAGGCTGCAGGTTATGCATATGCAAGTGA",mutations={["ATRAN&mit1&c_93010_93302_1"]={},}}end)();
(function()addBlock{name="u1x287",consensus="CCAAGGAGTTCATTCGGAACAAGTGAATGAATAGAGGATAGAACAGAAAATGGAATGCGTTGAGGCACGTAGCGAGCAAAAAAAATATATATTTTTTTTGCTCGCTATTCTCTTTTTTCCATGTCTTTCTTTCCCCTGTCCAAATTATCAAGCGAAATATTTTTAATATTTTTTTTTGCTTTATGTATGATTTTCACTTGGTAGAGAGCTGGCGCCATTCCTACGCCGCGCGCCCTTCATTCGTTATACGAGGACAGCGGAAGAGAAAAAAGAAGGAAGCTTCTTTC",mutations={["ATRAN&mit1&c_27991_28277_1"]={},}}end)();
(function()addBlock{name="u1x282",consensus="GGGATTGGGGGGGTACTCTGAGTGAGTACCTTGCAGGACTTCACTCCGCCTACTCAAGTATTGTACAAACATGCAAGAAAGGGCGCTCCTAGGCAGAGGAGAATGGAGTTTTGCGGCGAGAAAACAGTTTTCGTCAAGTCTAGGGGATGCAGACACACTTGCGCGAATCACGGATGACGGCTACAAGGGTGGCGGGGAAGGGAACAGTACCCGACGCTCAGGGATGGACGTAAACTCGTCAGCTACCTATCGGGCTGACAAGGATAATCGTCCTGGTCTTGG",mutations={["ATRAN&mit1&c_56107_56388_1"]={},}}end)();
(function()addBlock{name="u1x252",consensus="GGTTTAAAACCAATTGAGGCTAAAAACACCCGCGCCATGGCAGGAGGCACACCATTGCAAAACACGGGCCAAGACCCACTTTGTTTGCATAGCGAAGAAGGGACCGGGGTTGAACTGAATGGCCACCTCTCAGCCATTCCCTATACGCAATATGATCAAATATAGCTACCTGACAACAAAGCGCTGGCTGAGAACCGGCAACCGTGAGAGGCAAGGCCGCTCGAATCGCATAGCTCGTTCGCTTACGAAAAT",mutations={["ATRAN&mit1&c_87917_88168_1"]={},}}end)();
(function()addBlock{name="u1x251",consensus="TTATGGTCAATATCATTCTGTATAATTTTCAATGTTATAGTAATATCCCTTTCCTTTTGGTTAATTCTTCAGAATTCTAAAATAAAAAATTTATTTATGACAAAGTGGGATATGATTATGTAGTTGGTTGCATAGGTAATTTTGGTGAAACTACTTTAATTAAAGTAGTTGTACTTGTAGTAATTGTGATTGCCGCCGCCCATGTAATGTCGGAAGCGGGCCAGACGAAATTAAATCGTCACCCATGTCAC",mutations={["ATRAN&mit1&c_77770_78020_1"]={},}}end)();
(function()addBlock{name="u1x246",consensus="CGTTATACATAATAATACAAGGTGTGGCTCCAAGCGGGCGTGCGCCGTCATCATATACTGATAATGCTGAAACATATTTCATTGACCATGCGTAATAAACTGAGCCATAAAGCATCTACAAATATCCCCCAACAAAGCAGCTTCGCAGCTTATGGGCCGAAGGACCCGCTTAGTTAGCTCTACGAATGAGGAGCACACGCGACCAAGTTCCGCCAAGCACGCAGTCATGAACTAAATCGCCTAAAA",mutations={["ATRAN&mit1&c_38813_39058_1"]={},}}end)();
(function()addBlock{name="u1x232",consensus="GCGCTCTTGCCATATCCGCTATTCGAACAATAAAGAAAAAGCCATTAAAACAAGCAACATTATTAGGTTGAGTAGGGAGATTTAGTGATTATAAGGGAGGGTGCGCAGCGCCGCCTTTCTGTGCGGTATTGTGAAATATGCGCCAGAGTTAAAGCCCTGTTATTTATTGGCGAAAGTTTAAAGCTTGCCTGGATGGTGGCCGGCGCCTTCGGCCCTTTGTCGGGCCTCCTTT",mutations={["ATRAN&mit1&c_45241_45472_1"]={},}}end)();
(function()addBlock{name="u1x214",consensus="GTCCCTTTTATGCTCAATCCACTATACAAGAAGAAAGGGAAGGATCCAATGGGGTGACGTCACCACCAGAGGCTAACTACCCAGTAACGCCCCACTTTGCCAATCAAGGCCGCAGGCTTGATTGACAGAGCTGGGGCACGTAGTTTATAGCGAAACTTTTTTTTTAAAATATTTTTTGCTGCGAAAAGCAGCGCCCTCAAAGATTGTAAAGATT",mutations={["ATRAN&mit1&c_46961_47174_1"]={},}}end)();
(function()addBlock{name="u1x214n1",consensus="GTCATTCAGCCTTAATGACCCTAACTGTAGTGTAGGTTGTTGACAGCTACACCTTATTGAATGAATAGGGGAATGCATTTAAAAAATAACCTTGTAAAAGTTATAAAAAGAGCCAGATACTTGATTATAAAGATAAGCTGGCCTGGTAAAAGGCCAGCTCCTGTCTTTGCTCTTGCCGTTGCCAAAAAATTGGGCAGGTTAAACATTTCATAGC",mutations={["ATRAN&mit1&c_44829_45042_1"]={},}}end)();
(function()addBlock{name="u1x197",consensus="AGACCAGAAAAGAAAAAAAAATATATTTTTTTTCTTTTTTACAAACTCGCTTAACCACAGAGAGATTATAGCCCATAGTGCGCTGAATTTCAGGGAAGACCACAAGGTGCGCGTAGCGCCGTTACGTTTCATATTCTGTTTTGGAAAAGGGGGCAAAGCATGCTTTTTCGCCCTCCTAGGCCGAGGTTTGAGGTAGC",mutations={["ATRAN&mit1&c_71336_71532_1"]={},}}end)();
(function()addBlock{name="u1x185",consensus="GTATATAGTTTCTTGACCTCCTTTTGCCAGGGCGCTAGAGCAAATACAGAATTCAATAAATACGATCCATGAAGCGAATTCGACCAGGCAGGGCACGAAGAAAAAACTTGGTGGAATTGGAAGAATCCGGTGCAAAACGAACCGTATACTCTTTAGATTTAGGTGTAGTAGGTTATCTTGTGGGG",mutations={["ATRAN&mit1&c_38421_38605_1"]={},}}end)();
(function()addBlock{name="u1x167",consensus="CTCTTCATGACCCTTGTATGAAGAGGCCGAAGGCTCAATAGAGGCTTCATCTTGGGTAACCATCTCCAGGTTGTTTATTTCCAAACCGCATTTTTCGTATATATGAAAGAATAAAAAAAAATATTTTTTTTTACTTGGCCGAAGAGAGTCAGGACTACATTCCTCGC",mutations={["ATRAN&mit1&c_64411_64577_1"]={},}}end)();
(function()addBlock{name="u1x147",consensus="GTAGTTTTGTTTTGTGTACTTCGCAGATAGCGCATGAGTATCAGCACACCTCCTATGAATGGGGCGACCGGAGGCGGCTTTTATCAGGCAGTGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGAGTACCTGCGGCCTATTTGTC",mutations={["ATRAN&mit1&c_63202_63348_1"]={},}}end)();
(function()addBlock{name="u1x143",consensus="TAGTATGGCTGAAGATAGTAGGTTTGAATAAAAAATATTTCTCTGTTACACGGTACGCATCACCTGTAGGTCTAGGGATTCACTGAGCTTCCTCTTGGGTAGCTATTTGAGCCGATGTCTTGTCATACAATTTTTCAAACTCC",mutations={["ATRAN&mit1&c_45986_46128_1"]={},}}end)();
(function()addBlock{name="u1x131",consensus="GCGTTTCCTCAGTATTGCTCGTTGTTGTTCTGAGAGTTTTTTGTAGATGAGTTGGCCTTTTCTGAGTATTTGGCCGCGTAATCTGCGCTAAAATTTTTGTATGTTTTCAAGGTTCTTTGTCGCCGGAGTTT",mutations={["ATRAN&mit1&c_3694_3824_1"]={},}}end)();
(function()addBlock{name="u1x104",consensus="TTCTTTATGTATGTGCGAAGCGCAAAAATGTAAGATTAATACTTGTTTTCGTCAGTGGAGACCTGCCCCACACCCACACGGGTGGGGGACAAGCAAGGGAGCCC",mutations={["ATRAN&mit1&c_43303_43406_1"]={},}}end)();
(function()addBlock{name="u1x81",consensus="ATGCGCTTCGCGCCCTGTTTTTTATCAAAATTATTCACCTTTATATTGAAAGATGAAAGCTAGACAAGGCCACCTACAGTG",mutations={["ATRAN&mit1&c_33704_33784_1"]={},}}end)();
(function()addBlock{name="u1x78",consensus="AATAAACCGCAAAAAGAGAATAAGACCGAAGGTCATAGGCTGCGGGTCTATATTCGTTCTTTCTCTGCTGCGCGCCTG",mutations={["ATRAN&mit1&c_114928_115005_1"]={},}}end)();
(function()addBlock{name="u1x72",consensus="ACTATATATAAGTGATTTACGAACCAGTGCCCTTATCAAGGTTTCCGACCCTTGCATTCATTCGGCCCCACA",mutations={["ATRAN&mit1&c_3916_3987_1"]={},}}end)();
(function()addBlock{name="u1x57",consensus="GAGCCGTATGATGCGAGAGTATCACGTACGGTTCTCTGAGAAGGGAGTAGGTACCTA",mutations={["ATRAN&mit1&c_56601_56657_1"]={},}}end)();
(function()addBlock{name="m1x46",consensus="AGCATGTCGTAAAAGGAGATAACTGGGAATAGCCAACCCTTAGCCT",mutations={["ATRAN&mit1&c_98798_98843_1"]={},}}end)();
(function()addBlock{name="m1x38",consensus="AAAAATATATATATTTCTTTTACCTAAGGCCTTGTAAT",mutations={["ATRAN&mit1&c_81777_81814_1"]={},}}end)();
(function()addBlock{name="m1x37",consensus="ATATATATTTTTTTTTTTAATTCTATGGTTCCGCAAT",mutations={["ATRAN&mit1&c_47965_48001_1"]={},}}end)();
(function()addBlock{name="m1x31",consensus="TGGAAGGGGGAGGCTTACTTATCTTAATCAT",mutations={["ATRAN&mit1&c_108166_108196_1"]={},}}end)();
(function()addBlock{name="m1x14",consensus="GTTGTAATTTTGGA",mutations={["ATRAN&mit1&c_109116_109129_1"]={},}}end)();
(function()addBlock{name="m1x9",consensus="ACTCAGAAC",mutations={["ATRAN&mit1&c_80987_80995_1"]={},}}end)();
(function()addBlock{name="m1x8",consensus="TTTTATGG",mutations={["ATRAN&mit1&c_101340_101347_1"]={},}}end)();
(function()addBlock{name="m1x1",consensus="T",mutations={["ATRAN&mit1&c_110180_110180_1"]={},}}end)();
(function()addBlock{name="m1x1n1",consensus="G",mutations={["ATRAN&mit1&c_44538_44538_1"]={},}}end)();
(function()addBlock{name="m1x1n2",consensus="T",mutations={["ATRAN&mit1&c_39147_39147_1"]={},}}end)();
(function()addBlock{name="m1x1n3",consensus="A",mutations={["ATRAN&mit1&c_31051_31051_1"]={},}}end)();
if not_sandbox then local ShortForm = require 'npge.io.ShortForm' return ShortForm.finishRawLoading(...) end;
| mit |
hohoCode/treelstm | models/ChildSumTreeLSTM.lua | 10 | 5023 | --[[
A Child-Sum Tree-LSTM with input at each node.
--]]
local ChildSumTreeLSTM, parent = torch.class('treelstm.ChildSumTreeLSTM', 'treelstm.TreeLSTM')
function ChildSumTreeLSTM:__init(config)
parent.__init(self, config)
self.gate_output = config.gate_output
if self.gate_output == nil then self.gate_output = true end
-- a function that instantiates an output module that takes the hidden state h as input
self.output_module_fn = config.output_module_fn
self.criterion = config.criterion
-- composition module
self.composer = self:new_composer()
self.composers = {}
-- output module
self.output_module = self:new_output_module()
self.output_modules = {}
end
function ChildSumTreeLSTM:new_composer()
local input = nn.Identity()()
local child_c = nn.Identity()()
local child_h = nn.Identity()()
local child_h_sum = nn.Sum(1)(child_h)
local i = nn.Sigmoid()(
nn.CAddTable(){
nn.Linear(self.in_dim, self.mem_dim)(input),
nn.Linear(self.mem_dim, self.mem_dim)(child_h_sum)
})
local f = nn.Sigmoid()(
treelstm.CRowAddTable(){
nn.TemporalConvolution(self.mem_dim, self.mem_dim, 1)(child_h),
nn.Linear(self.in_dim, self.mem_dim)(input),
})
local update = nn.Tanh()(
nn.CAddTable(){
nn.Linear(self.in_dim, self.mem_dim)(input),
nn.Linear(self.mem_dim, self.mem_dim)(child_h_sum)
})
local c = nn.CAddTable(){
nn.CMulTable(){i, update},
nn.Sum(1)(nn.CMulTable(){f, child_c})
}
local h
if self.gate_output then
local o = nn.Sigmoid()(
nn.CAddTable(){
nn.Linear(self.in_dim, self.mem_dim)(input),
nn.Linear(self.mem_dim, self.mem_dim)(child_h_sum)
})
h = nn.CMulTable(){o, nn.Tanh()(c)}
else
h = nn.Tanh()(c)
end
local composer = nn.gModule({input, child_c, child_h}, {c, h})
if self.composer ~= nil then
share_params(composer, self.composer)
end
return composer
end
function ChildSumTreeLSTM:new_output_module()
if self.output_module_fn == nil then return nil end
local output_module = self.output_module_fn()
if self.output_module ~= nil then
share_params(output_module, self.output_module)
end
return output_module
end
function ChildSumTreeLSTM:forward(tree, inputs)
local loss = 0
for i = 1, tree.num_children do
local _, child_loss = self:forward(tree.children[i], inputs)
loss = loss + child_loss
end
local child_c, child_h = self:get_child_states(tree)
self:allocate_module(tree, 'composer')
tree.state = tree.composer:forward{inputs[tree.idx], child_c, child_h}
if self.output_module ~= nil then
self:allocate_module(tree, 'output_module')
tree.output = tree.output_module:forward(tree.state[2])
if self.train and tree.gold_label ~= nil then
loss = loss + self.criterion:forward(tree.output, tree.gold_label)
end
end
return tree.state, loss
end
function ChildSumTreeLSTM:backward(tree, inputs, grad)
local grad_inputs = torch.Tensor(inputs:size())
self:_backward(tree, inputs, grad, grad_inputs)
return grad_inputs
end
function ChildSumTreeLSTM:_backward(tree, inputs, grad, grad_inputs)
local output_grad = self.mem_zeros
if tree.output ~= nil and tree.gold_label ~= nil then
output_grad = tree.output_module:backward(
tree.state[2], self.criterion:backward(tree.output, tree.gold_label))
end
self:free_module(tree, 'output_module')
tree.output = nil
local child_c, child_h = self:get_child_states(tree)
local composer_grad = tree.composer:backward(
{inputs[tree.idx], child_c, child_h},
{grad[1], grad[2] + output_grad})
self:free_module(tree, 'composer')
tree.state = nil
grad_inputs[tree.idx] = composer_grad[1]
local child_c_grads, child_h_grads = composer_grad[2], composer_grad[3]
for i = 1, tree.num_children do
self:_backward(tree.children[i], inputs, {child_c_grads[i], child_h_grads[i]}, grad_inputs)
end
end
function ChildSumTreeLSTM:clean(tree)
self:free_module(tree, 'composer')
self:free_module(tree, 'output_module')
tree.state = nil
tree.output = nil
for i = 1, tree.num_children do
self:clean(tree.children[i])
end
end
function ChildSumTreeLSTM:parameters()
local params, grad_params = {}, {}
local cp, cg = self.composer:parameters()
tablex.insertvalues(params, cp)
tablex.insertvalues(grad_params, cg)
if self.output_module ~= nil then
local op, og = self.output_module:parameters()
tablex.insertvalues(params, op)
tablex.insertvalues(grad_params, og)
end
return params, grad_params
end
function ChildSumTreeLSTM:get_child_states(tree)
local child_c, child_h
if tree.num_children == 0 then
child_c = torch.zeros(1, self.mem_dim)
child_h = torch.zeros(1, self.mem_dim)
else
child_c = torch.Tensor(tree.num_children, self.mem_dim)
child_h = torch.Tensor(tree.num_children, self.mem_dim)
for i = 1, tree.num_children do
child_c[i], child_h[i] = unpack(tree.children[i].state)
end
end
return child_c, child_h
end
| gpl-2.0 |
wintersandroid/RF24Network | premake4.lua | 1 | 1289 | local GCC_ARM_CC_PATH = "/usr/bin/arm-linux-gnueabi-gcc"
local GCC_ARM_CPP_PATH = "/usr/bin/arm-linux-gnueabi-g++"
local GCC_ARM_AR_PATH = "/usr/bin/arm-linux-gnueabi-ar"
table.insert(premake.option.list["platform"].allowed, { "arm" })
premake.platforms.arm = {
cfgsuffix = "arm",
iscrosscompiler = true
}
table.insert(premake.fields.platforms.allowed, "arm")
if(_OPTIONS.platform == 'arm') then
premake.gcc.cc = GCC_AVR_CC_PATH
premake.gcc.cxx = GCC_AVR_CPP_PATH
premake.gcc.ar = GCC_AVR_AR_PATH
end
solution "RadioReceiver"
configurations {"debug","release"}
platforms {"arm", "native"}
project "RadioReceiver"
targetname "radioreceiver"
language "C++"
kind "ConsoleApp"
local includeFiles = {
"**.h",
"**.c",
"**.cc",
"rapidjson/**.h"
}
files(includeFiles)
defines { "RPI" }
buildoptions{"-O2"," -Wformat=2", "-Wall", "-pipe", "-fPIC" }
links {
"pthread","rt","curl","wiringPi"
}
configuration "debug"
defines { "DEBUG","SERIAL_DEBUG" }
targetdir "build/debug/"
objdir "build/debug/obj"
configuration "release"
defines { "NDEBUG" }
targetdir "build/release"
objdir "build/release/obj"
postbuildcommands {
"scp -p build/release/radioreceiver pi@pi:RadioReceiver/"
}
| gpl-2.0 |
Mackan90096/Factorio_Mod | prototypes/entity/pig.lua | 1 | 2643 | require("prototypes.entity.particle")
require("prototypes.entity.noise")
data:extend({
{
type = "autoplace-control",
name = "bacon-ore",
richness = true,
order = "b-f-g"
},
{
type = "resource",
name = "bacon-ore",
icon = "__Factorio_Mod__/graphics/icons/bacon-ore.png",
flags = {"placeable-neutral"},
order="a-b-a",
minable =
{
hardness = 0.9,
mining_particle = "bacon-ore-particle",
mining_time = 2,
result = "raw-bacon"
},
collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
autoplace =
{
control = "bacon-ore",
sharpness = 1,
richness_multiplier = 13000,
richness_base = 350,
size_control_multiplier = 0.06,
peaks = {
{
influence = 0.2,
starting_area_weight_optimal = 0,
starting_area_weight_range = 0,
starting_area_weight_max_range = 2,
},
{
influence = 0.65,
noise_layer = "bacon-ore",
noise_octaves_difference = -1.9,
noise_persistence = 0.3,
starting_area_weight_optimal = 0,
starting_area_weight_range = 0,
starting_area_weight_max_range = 2,
},
{
influence = 0.3,
starting_area_weight_optimal = 1,
starting_area_weight_range = 0,
starting_area_weight_max_range = 2,
},
{
influence = 0.55,
noise_layer = "copper-ore",
noise_octaves_difference = -2.3,
noise_persistence = 0.4,
starting_area_weight_optimal = 1,
starting_area_weight_range = 0,
starting_area_weight_max_range = 2,
},
{
influence = -0.2,
max_influence = 0,
noise_layer = "iron-ore",
noise_octaves_difference = -2.3,
noise_persistence = 0.45,
},
{
influence = -0.2,
max_influence = 0,
noise_layer = "coal",
noise_octaves_difference = -2.3,
noise_persistence = 0.45,
},
{
influence = -0.2,
max_influence = 0,
noise_layer = "stone",
noise_octaves_difference = -3,
noise_persistence = 0.45,
},
},
},
stage_counts = {1000, 600, 400, 200, 100, 50, 20, 1},
stages = { filename = "__Factorio_Mod__/graphics/bacon-ore.png",
priority = "extra-high",
width = 38,
height = 38,
frame_count = 4,
direction_count = 8
},
map_color = {r=0.858, g=0.662, b=0.694}
}
}) | mit |
geldoronie/DuneRace | Scripts/AnimationManager.lua | 1 | 4776 | --[[
This script provides a programming interface to easily manage animation transitions.
Just call the SetAnimationSequence() function from any other script and the entity's animation
will be automatically blended from the previous sequence. It's okay to call this repeatedly with
the same sequence. A new sequence will only be added in the animation stack when it is different
from the previous sequence.
]]--
if AnimationManager~=nil then return end
AnimationManager={}
function AnimationManager:Create(entity)
if entity==nil then Debug:Error("Entity cannot be nil.") end
local animationmanager = {}
animationmanager.entity = entity
animationmanager.animations={}
animationmanager.frameoffset = math.random(0,1000)
local k,v
for k,v in pairs(AnimationManager) do
animationmanager[k] = v
end
return animationmanager
end
function AnimationManager:SetAnimationSequence(sequence, speed, blendtime, mode, endHookScript, endHook, endFrame)
--Handle default parameters
if speed==nil then speed=1.0 end
if blendtime==nil then blendtime=500 end
if mode==nil then mode=0 end
--Check for redundant animation descriptor
if mode==0 then
if #self.animations>0 then
if self.animations[#self.animations].sequence==sequence then
if self.animations[#self.animations].speed==speed then
--No change to blend time, so don't alter this?
self.animations[#self.animations].blendtime=blendtime
return
end
end
end
end
--Create new animation descriptor and add to animation stack
local animation={}
animation.blendstart=Time:GetCurrent()
animation.blendfinish=animation.blendstart+blendtime
animation.sequence=sequence
animation.speed=speed
animation.mode=mode
animation.starttime=animation.blendstart
animation.endHookScript=endHookScript
animation.endHook=endHook
animation.endOfSequenceReached=false
animation.endFrame = endFrame
--Add a random offset to looped animations so they're not all identical
--if mode==0 then
-- animation.frameoffset = math.random(0,(self.entity:GetAnimationLength(sequence)))
--end
table.insert(self.animations,animation)
end
function AnimationManager:ClearAnimations()
self.animations = {}
end
--[[
function Script:GetFrame(seq)
local i,animation
currenttime=Time:GetCurrent()
for i,animation in ipairs(self.animations) do
if animation.sequence == seq then
return (currenttime-animation.blendstart) * animation.speed
end
end
return -1
end
]]--
function AnimationManager:Update()
local i,animation,blend,frame,n,completedanimation
local doanimation=false
local currenttime=Time:GetCurrent()
local maxanim=-1
for i,animation in ipairs(self.animations) do
--Lock the matrix before the first sequence is applied
if doanimation==false then
doanimation=true
self.entity:LockMatrix()
end
--Calculate blend value
blend = (currenttime-animation.blendstart)/(animation.blendfinish-animation.blendstart)
blend = math.min(1.0,blend)
if animation.mode==0 then
frame = currenttime * animation.speed + self.frameoffset--animation.frameoffset
else
frame = (currenttime-animation.blendstart) * animation.speed
local length = self.entity:GetAnimationLength(animation.sequence,true)
--If a certain frame was specified, call the hook early and remove it
if animation.endFrame~=nil then
if frame>animation.endFrame then
animation.endHook(animation.endHookScript)
animation.endFrame=nil
animation.endHook=nil
animation.endHookScript=nil
end
end
if frame>=length-1 then
frame=length-1
maxanim = i+1--clears all animations up to this one, and then this one
if (not animation.endOfSequenceReached) then
animation.endOfSequenceReached=true
if animation.endHookScript then
if animation.endHook then
animation.endHook(animation.endHookScript)
end
end
end
end
end
--Apply the animation
self.entity:SetAnimationFrame(frame, blend, animation.sequence, true)
--If this animation is blended in 100%, all previous looping animation sequences can be dropped
if blend>=1.0 then
maxanim = math.max(maxanim,i)
end
end
--Unlock entity matrix if any animations were applied
if doanimation==true then
self.entity:UnlockMatrix()
end
--Clear blended out animation - moved this out of the loop to prevent jittering
if maxanim>-1 then
local index=1
for n,completedanimation in ipairs(self.animations) do
if n<maxanim then
if completedanimation.mode==0 or completedanimation.endOfSequenceReached==true then
table.remove(self.animations,index)
else
index=index+1
end
else
break
end
end
end
end
function AnimationManager:GetAnimationStackSize()
return #self.animations
end
| mit |
Abedzadeh5928/khodam3 | plugins/Help_en.lua | 3 | 3809 | do
function run(msg, matches)
return 'QuickTeam Command List'.. [[
________________________________
--------------------------------
_______In the name of Allah_______
--------------------------------
kick [آیدی،کد،ریپلای]
شخص مورد نظر از گروه اخراج ميشود.
ban [آیدی،کد،ریپلای]
شخص مورد نظر از گروه تحریم میشود
unban [کد]
شخص مورد نظر از تحریم خارج ميشود
banlist
لیست افرادی که از گروه تحریم شده اند
~~~~~~~~~~~~~~~~~~~~~
filterlist : لیست کلمه های فیلتر شده
filter + kalame فیلتر کردن کلمه
filter ? kalame کلمه فیلتره یا نه؟
filter - kalame آزاد کردن از فیلتر
~~~~~~~~~~~~~~~~~~~~~
owner : نمایش آیدی مدیر گروه
modlist : لیست کمک مدیرها
promote اضافه کردن کمک مدیر
demote حذف کردن کمک مدیر
wai : نمایش مقام شما در گروه
~~~~~~~~~~~~~~~~~~~~~
lock tag قفل کردن تگ (#@)
lock link قفل کردن تبلیغ
lock member قفل کردن عضو گیری
lock name قفل کردن اسم گروه
lock arabic حرف زدن به زبان فاسی ممنوع
lock chat چت ممنوع
lock leave کسانی که لفت میدهند بن خواهند شد
lock eng حرف زدن به زبان لاتین ممنوع
setflood 2-30 محدودیت اسپم
lock bots ورود ربات ها ممنوع
~~~~~~~~~~~~~~~~~~~~
تمام دستورت با unlockازاد خواهند شد
~~~~~~~~~~~~~~~~~~~~~
setphoto : عوض و قفل کردن عکس
setname *** تعویض نام گروه
~~~~~~~~~~~~~~~~~~~~~
about
rules قوانین
set rules <متن>
set about <متن>
~~~~~~~~~~~~~~~~~~~~~
newlink : تعویض لینک
link : لینک گروه
linkpv : ارسال لینک در چت خصوصی
~~~~~~~~~~~~~~~~~~~~~
clean modlist پاکردن لیست مدیران
clean rules پاک کردن قانون
clean about پاک کردن توضیحات
~~~~~~~~~~~~~~~~~~~~~
info مشخصات کامل فرد
id : آیدی فردمورد نظر
~~~~~~~~~~~~~~~~~~~~
on smaker استیکر ساز برایه ممبر ها روشن
off smaker خاموش
sticker تبدیل عکس به استیکر
photo تبدیل استیکر به عکس
text matn تبدیل متن به عکس
~~~~~~~~~~~~~~~~~~~~~
!map karaj نقشه کشور یا شهر مورد نظر
!google metn سرچ متن در گوگل
!echo matn تکرار کلمه
________________________________
1شما میتونید از /! استفاده کنید
2.تمام دستوارت با اسلش و علامت تعجب و بدون ان ها کار میکنند
3.ربات فوق پیشرفته ما امکانات بسیار بیشتر دارد که با ارسال Helpبدون علامت متوجه خوهید شد
4.برایه ارسال نظر از دستور Feedbackاستفاده کنید
5.برایه عضویت در گروه پشتیبانی کلمه !supportرا ارسال کنید
6.!share شماره ربات سیو کنید و یک پیام پی وی ارسال کنید
________________________________
V 2.7 en
channel @QuickGuardTEAM
other bot @QuickGuardw_bot
for PM @QuickGuardBOT]]
end
return {
description = "Robot About",
usage = "help: View Robot About",
patterns = {
"^[#!/]help$"
},
run = run
}
end | gpl-2.0 |
Enhex/Urho3D-CEF3 | Bin_Debug/Data/LuaScripts/Utilities/Touch.lua | 32 | 2209 | -- Mobile framework for Android/iOS
-- Gamepad from Ninja Snow War
-- Touches patterns:
-- - 1 finger touch = pick object through raycast
-- - 1 or 2 fingers drag = rotate camera
-- - 2 fingers sliding in opposite direction (up/down) = zoom in/out
-- Setup: Call the update function 'UpdateTouches()' from HandleUpdate or equivalent update handler function
local GYROSCOPE_THRESHOLD = 0.1
CAMERA_MIN_DIST = 1.0
CAMERA_MAX_DIST = 20.0
local zoom = false
useGyroscope = false
cameraDistance = 5.0
function UpdateTouches(controls) -- Called from HandleUpdate
zoom = false -- reset bool
-- Zoom in/out
if input.numTouches == 2 then
local touch1 = input:GetTouch(0)
local touch2 = input:GetTouch(1)
-- Check for zoom pattern (touches moving in opposite directions and on empty space)
if not touch1.touchedElement and not touch2.touchedElement and ((touch1.delta.y > 0 and touch2.delta.y < 0) or (touch1.delta.y < 0 and touch2.delta.y > 0)) then zoom = true else zoom = false end
-- Check for zoom direction (in/out)
if zoom then
if Abs(touch1.position.y - touch2.position.y) > Abs(touch1.lastPosition.y - touch2.lastPosition.y) then sens = -1 else sens = 1 end
cameraDistance = cameraDistance + Abs(touch1.delta.y - touch2.delta.y) * sens * TOUCH_SENSITIVITY / 50
cameraDistance = Clamp(cameraDistance, CAMERA_MIN_DIST, CAMERA_MAX_DIST) -- Restrict zoom range to [1;20]
end
end
-- Gyroscope (emulated by SDL through a virtual joystick)
if useGyroscope and input.numJoysticks > 0 then -- numJoysticks = 1 on iOS & Android
local joystick = input:GetJoystickByIndex(0) -- JoystickState
if joystick.numAxes >= 2 then
if joystick:GetAxisPosition(0) < -GYROSCOPE_THRESHOLD then controls:Set(CTRL_LEFT, true) end
if joystick:GetAxisPosition(0) > GYROSCOPE_THRESHOLD then controls:Set(CTRL_RIGHT, true) end
if joystick:GetAxisPosition(1) < -GYROSCOPE_THRESHOLD then controls:Set(CTRL_FORWARD, true) end
if joystick:GetAxisPosition(1) > GYROSCOPE_THRESHOLD then controls:Set(CTRL_BACK, true) end
end
end
end
| mit |
adde88/Probably | interface/interface.lua | 1 | 27063 | -- ProbablyEngine Rotations
-- Released under modified BSD, see attached LICENSE.
local L = ProbablyEngine.locale.get
ProbablyEngine.interface = {}
local DiesalTools = LibStub("DiesalTools-1.0")
local DiesalStyle = LibStub("DiesalStyle-1.0")
local DiesalGUI = LibStub("DiesalGUI-1.0")
local DiesalMenu = LibStub("DiesalMenu-1.0")
local SharedMedia = LibStub("LibSharedMedia-3.0")
DiesalGUI:RegisterObjectConstructor("FontString", function()
local self = DiesalGUI:CreateObjectBase(Type)
local frame = CreateFrame('Frame',nil,UIParent)
local fontString = frame:CreateFontString(nil, "OVERLAY", 'DiesalFontNormal')
self.frame = frame
self.fontString = fontString
self.SetParent = function(self, parent)
self.frame:SetParent(parent)
end
self.OnRelease = function(self)
self.fontString:SetText('')
end
self.OnAcquire = function(self)
self:Show()
end
self.type = "FontString"
return self
end, 1)
DiesalGUI:RegisterObjectConstructor("Rule", function()
local self = DiesalGUI:CreateObjectBase(Type)
local frame = CreateFrame('Frame',nil,UIParent)
self.frame = frame
frame:SetHeight(1)
frame.texture = frame:CreateTexture()
frame.texture:SetTexture(0,0,0,0.5)
frame.texture:SetAllPoints(frame)
self.SetParent = function(self, parent)
self.frame:SetParent(parent)
end
self.OnRelease = function(self)
self:Hide()
end
self.OnAcquire = function(self)
self:Show()
end
self.type = "Rule"
return self
end, 1)
local buttonStyleSheet = {
['frame-color'] = {
type = 'texture',
layer = 'BACKGROUND',
color = '2f353b',
offset = 0,
},
['frame-highlight'] = {
type = 'texture',
layer = 'BORDER',
gradient = 'VERTICAL',
color = 'FFFFFF',
alpha = 0,
alphaEnd = .1,
offset = -1,
},
['frame-outline'] = {
type = 'outline',
layer = 'BORDER',
color = '000000',
offset = 0,
},
['frame-inline'] = {
type = 'outline',
layer = 'BORDER',
gradient = 'VERTICAL',
color = 'ffffff',
alpha = .02,
alphaEnd = .09,
offset = -1,
},
['frame-hover'] = {
type = 'texture',
layer = 'HIGHLIGHT',
color = 'ffffff',
alpha = .1,
offset = 0,
},
['text-color'] = {
type = 'Font',
color = 'b8c2cc',
},
}
local spinnerStyleSheet = {
['bar-background'] = {
type = 'texture',
layer = 'BORDER',
color = 'ee2200',
},
}
local createButtonStyle = {
type = 'texture',
texFile = 'DiesalGUIcons',
texCoord = {1,6,16,256,128},
alpha = .7,
offset = {-2,nil,-2,nil},
width = 16,
height = 16,
}
local deleteButtonStyle = {
type = 'texture',
texFile ='DiesalGUIcons',
texCoord = {2,6,16,256,128},
alpha = .7,
offset = {-2,nil,-2,nil},
width = 16,
height = 16,
}
local ButtonNormal = {
type = 'texture',
texColor = 'ffffff',
alpha = .7,
}
local ButtonOver = {
type = 'texture',
alpha = 1,
}
local ButtonClicked = {
type = 'texture',
alpha = .3,
}
function buildElements(table, parent)
local offset = -5
for _, element in ipairs(table.config) do
local push, pull = 0, 0
if element.type == 'header' then
local tmp = DiesalGUI:Create("FontString")
tmp:SetParent(parent.content)
parent:AddChild(tmp)
tmp = tmp.fontString
tmp:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset)
tmp:SetText(element.text)
if element.justify then
tmp:SetJustifyH(element.justify)
else
tmp:SetJustifyH('LEFT')
end
tmp:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 13)
tmp:SetWidth(parent.content:GetWidth()-10)
if element.align then
tmp:SetJustifyH(strupper(element.align))
end
if element.key then
table.window.elements[element.key] = tmp
end
elseif element.type == 'text' then
local tmp = DiesalGUI:Create("FontString")
tmp:SetParent(parent.content)
parent:AddChild(tmp)
tmp = tmp.fontString
tmp:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset)
tmp:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset)
tmp:SetText(element.text)
tmp:SetJustifyH('LEFT')
tmp:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), element.size or 10)
tmp:SetWidth(parent.content:GetWidth()-10)
if not element.offset then
element.offset = tmp:GetStringHeight()
end
if element.align then
tmp:SetJustifyH(strupper(element.align))
end
if element.key then
table.window.elements[element.key] = tmp
end
elseif element.type == 'rule' then
local tmp = DiesalGUI:Create('Rule')
parent:AddChild(tmp)
tmp:SetParent(parent.content)
tmp.frame:SetPoint('TOPLEFT', parent.content, 'TOPLEFT', 5, offset-3)
tmp.frame:SetPoint('BOTTOMRIGHT', parent.content, 'BOTTOMRIGHT', -5, offset-3)
if element.key then
table.window.elements[element.key] = tmp
end
elseif element.type == 'texture' then
local tmp = CreateFrame('Frame')
tmp:SetParent(parent.content)
if element.center then
tmp:SetPoint('CENTER', parent.content, 'CENTER', (element.x or 0), offset-(element.y or 0))
else
tmp:SetPoint('TOPLEFT', parent.content, 'TOPLEFT', 5+(element.x or 0), offset-3+(element.y or 0))
end
tmp:SetWidth(parent:GetWidth()-10)
tmp:SetHeight(element.height)
tmp:SetWidth(element.width)
tmp.texture = tmp:CreateTexture()
tmp.texture:SetTexture(element.texture)
tmp.texture:SetAllPoints(tmp)
if element.key then
table.window.elements[element.key] = tmp
end
elseif element.type == 'checkbox' then
local tmp = DiesalGUI:Create('CheckBox')
parent:AddChild(tmp)
tmp:SetParent(parent.content)
tmp:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset)
tmp:SetEventListener('OnValueChanged', function(this, event, checked)
ProbablyEngine.config.write(table.key .. '_' .. element.key, checked)
end)
tmp:SetChecked(ProbablyEngine.config.read(table.key .. '_' .. element.key, element.default or false))
local tmp_text = DiesalGUI:Create("FontString")
tmp_text:SetParent(parent.content)
parent:AddChild(tmp_text)
tmp_text = tmp_text.fontString
tmp_text:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 20, offset-1)
tmp_text:SetText(element.text)
tmp_text:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 10)
if element.desc then
local tmp_desc = DiesalGUI:Create("FontString")
tmp_desc:SetParent(parent.content)
parent:AddChild(tmp_desc)
tmp_desc = tmp_desc.fontString
tmp_desc:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-15)
tmp_desc:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset-15)
tmp_desc:SetText(element.desc)
tmp_desc:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 9)
tmp_desc:SetWidth(parent.content:GetWidth()-10)
tmp_desc:SetJustifyH('LEFT')
push = tmp_desc:GetStringHeight() + 5
end
if element.key then
table.window.elements[element.key..'Text'] = tmp_text
table.window.elements[element.key] = tmp
end
elseif element.type == 'spinner' then
local tmp_spin = DiesalGUI:Create('Spinner')
parent:AddChild(tmp_spin)
tmp_spin:SetParent(parent.content)
tmp_spin:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset)
tmp_spin:SetNumber(
ProbablyEngine.config.read(table.key .. '_' .. element.key, element.default)
)
if element.width then
tmp_spin.settings.width = element.width
end
if element.min then
tmp_spin.settings.min = element.min
end
if element.max then
tmp_spin.settings.max = element.max
end
if element.step then
tmp_spin.settings.step = element.step
end
if element.shiftStep then
tmp_spin.settings.shiftStep = element.shiftStep
end
tmp_spin:ApplySettings()
tmp_spin:AddStyleSheet(spinnerStyleSheet)
tmp_spin:SetEventListener('OnValueChanged', function(this, event, userInput, number)
if not userInput then return end
ProbablyEngine.config.write(table.key .. '_' .. element.key, number)
end)
local tmp_text = DiesalGUI:Create("FontString")
tmp_text:SetParent(parent.content)
parent:AddChild(tmp_text)
tmp_text = tmp_text.fontString
tmp_text:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-4)
tmp_text:SetText(element.text)
tmp_text:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 10)
tmp_text:SetJustifyH('LEFT')
tmp_text:SetWidth(parent.content:GetWidth()-10)
if element.desc then
local tmp_desc = DiesalGUI:Create("FontString")
tmp_desc:SetParent(parent.content)
parent:AddChild(tmp_desc)
tmp_desc = tmp_desc.fontString
tmp_desc:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-18)
tmp_desc:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset-18)
tmp_desc:SetText(element.desc)
tmp_desc:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 9)
tmp_desc:SetWidth(parent.content:GetWidth()-10)
tmp_desc:SetJustifyH('LEFT')
push = tmp_desc:GetStringHeight() + 5
end
if element.key then
table.window.elements[element.key..'Text'] = tmp_text
table.window.elements[element.key] = tmp_spin
end
elseif element.type == 'checkspin' then
local tmp_spin = DiesalGUI:Create('Spinner')
parent:AddChild(tmp_spin)
tmp_spin:SetParent(parent.content)
tmp_spin:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset)
if element.width then
tmp_spin.settings.width = element.width
end
if element.min then
tmp_spin.settings.min = element.min
end
if element.max then
tmp_spin.settings.max = element.max
end
if element.step then
tmp_spin.settings.step = element.step
end
if element.shiftStep then
tmp_spin.settings.shiftStep = element.shiftStep
end
tmp_spin:SetNumber(
ProbablyEngine.config.read(table.key .. '_' .. element.key .. '_spin', element.default_spin or 0)
)
tmp_spin:AddStyleSheet(spinnerStyleSheet)
tmp_spin:ApplySettings()
tmp_spin:SetEventListener('OnValueChanged', function(this, event, userInput, number)
if not userInput then return end
ProbablyEngine.config.write(table.key .. '_' .. element.key .. '_spin', number)
end)
local tmp_check = DiesalGUI:Create('CheckBox')
parent:AddChild(tmp_check)
tmp_check:SetParent(parent.content)
tmp_check:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-2)
tmp_check:SetEventListener('OnValueChanged', function(this, event, checked)
ProbablyEngine.config.write(table.key .. '_' .. element.key .. '_check', checked)
end)
tmp_check:SetChecked(ProbablyEngine.config.read(table.key .. '_' .. element.key .. '_check', element.default_check or false))
local tmp_text = DiesalGUI:Create("FontString")
tmp_text:SetParent(parent.content)
parent:AddChild(tmp_text)
tmp_text = tmp_text.fontString
tmp_text:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 20, offset-4)
tmp_text:SetText(element.text)
tmp_text:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 10)
tmp_text:SetJustifyH('LEFT')
tmp_text:SetWidth(parent.content:GetWidth()-10)
if element.desc then
local tmp_desc = DiesalGUI:Create("FontString")
tmp_desc:SetParent(parent.content)
parent:AddChild(tmp_desc)
tmp_desc = tmp_desc.fontString
tmp_desc:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-18)
tmp_desc:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset-18)
tmp_desc:SetText(element.desc)
tmp_desc:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 9)
tmp_desc:SetWidth(parent.content:GetWidth()-10)
tmp_desc:SetJustifyH('LEFT')
push = tmp_desc:GetStringHeight() + 5
end
if element.key then
table.window.elements[element.key..'Text'] = tmp_text
table.window.elements[element.key..'Check'] = tmp_check
table.window.elements[element.key..'Spin'] = tmp_spin
end
elseif element.type == 'combo' or element.type == 'dropdown' then
local tmp_list = DiesalGUI:Create('Dropdown')
parent:AddChild(tmp_list)
tmp_list:SetParent(parent.content)
tmp_list:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset)
local orderdKeys = { }
local list = { }
for i, value in pairs(element.list) do
orderdKeys[i] = value.key
list[value.key] = value.text
end
tmp_list:SetList(list, orderdKeys)
tmp_list:SetEventListener('OnValueChanged', function(this, event, value)
ProbablyEngine.config.write(table.key .. '_' .. element.key, value)
end)
tmp_list:SetValue(ProbablyEngine.config.read(table.key .. '_' .. element.key, element.default))
local tmp_text = DiesalGUI:Create("FontString")
tmp_text:SetParent(parent.content)
parent:AddChild(tmp_text)
tmp_text = tmp_text.fontString
tmp_text:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-3)
tmp_text:SetText(element.text)
tmp_text:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 10)
tmp_text:SetJustifyH('LEFT')
tmp_text:SetWidth(parent.content:GetWidth()-10)
if element.desc then
local tmp_desc = DiesalGUI:Create("FontString")
tmp_desc:SetParent(parent.content)
parent:AddChild(tmp_desc)
tmp_desc = tmp_desc.fontString
tmp_desc:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-18)
tmp_desc:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset-18)
tmp_desc:SetText(element.desc)
tmp_desc:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 9)
tmp_desc:SetWidth(parent.content:GetWidth()-10)
tmp_desc:SetJustifyH('LEFT')
push = tmp_desc:GetStringHeight() + 5
end
if element.key then
table.window.elements[element.key..'Text'] = tmp_text
table.window.elements[element.key] = tmp_list
end
elseif element.type == 'button' then
local tmp = DiesalGUI:Create("Button")
parent:AddChild(tmp)
tmp:SetParent(parent.content)
tmp:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset)
tmp:SetText(element.text)
tmp:SetWidth(element.width)
tmp:SetHeight(element.height)
tmp:AddStyleSheet(buttonStyleSheet)
tmp:SetEventListener("OnClick", element.callback)
if element.desc then
local tmp_desc = DiesalGUI:Create("FontString")
tmp_desc:SetParent(parent.content)
parent:AddChild(tmp_desc)
tmp_desc = tmp_desc.fontString
tmp_desc:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-element.height-3)
tmp_desc:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset-element.height-3)
tmp_desc:SetText(element.desc)
tmp_desc:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 9)
tmp_desc:SetWidth(parent.content:GetWidth()-10)
tmp_desc:SetJustifyH('LEFT')
push = tmp_desc:GetStringHeight() + 5
end
if element.align then
tmp:SetJustifyH(strupper(element.align))
end
if element.key then
table.window.elements[element.key] = tmp
end
elseif element.type == "input" then
local tmp_input = DiesalGUI:Create('Input')
parent:AddChild(tmp_input)
tmp_input:SetParent(parent.content)
tmp_input:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset)
if element.width then
tmp_input:SetWidth(element.width)
end
tmp_input:SetText(ProbablyEngine.config.read(table.key .. '_' .. element.key, element.default or ''))
tmp_input:SetEventListener('OnEditFocusLost', function(this)
ProbablyEngine.config.write(table.key .. '_' .. element.key, this:GetText())
end)
local tmp_text = DiesalGUI:Create("FontString")
tmp_text:SetParent(parent.content)
parent:AddChild(tmp_text)
tmp_text = tmp_text.fontString
tmp_text:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-3)
tmp_text:SetText(element.text)
tmp_text:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 10)
tmp_text:SetJustifyH('LEFT')
if element.desc then
local tmp_desc = DiesalGUI:Create("FontString")
tmp_desc:SetParent(parent.content)
parent:AddChild(tmp_desc)
tmp_desc = tmp_desc.fontString
tmp_desc:SetPoint("TOPLEFT", parent.content, "TOPLEFT", 5, offset-18)
tmp_desc:SetPoint("TOPRIGHT", parent.content, "TOPRIGHT", -5, offset-18)
tmp_desc:SetText(element.desc)
tmp_desc:SetFont(SharedMedia:Fetch('font', 'Calibri Bold'), 9)
tmp_desc:SetWidth(parent.content:GetWidth()-10)
tmp_desc:SetJustifyH('LEFT')
push = tmp_desc:GetStringHeight() + 5
end
if element.key then
table.window.elements[element.key..'Text'] = tmp_text
table.window.elements[element.key] = tmp_input
end
elseif element.type == 'spacer' then
-- NOTHING!
end
if element.type == 'rule' then
offset = offset + -10
elseif element.type == 'spinner' or element.type == 'checkspin' then
offset = offset + -19
elseif element.type == 'combo' or element.type == 'dropdown' then
offset = offset + -20
elseif element.type == 'texture' then
offset = offset + -(element.offset or 0)
elseif element.type == "text" then
offset = offset + -(element.offset) - (element.size or 10)
elseif element.type == 'button' then
offset = offset + -20
elseif element.type == 'spacer' then
offset = offset + -(element.size or 10)
else
offset = offset + -16
end
if element.push then
push = push + element.push
end
if element.pull then
pull = pull + element.pull
end
offset = offset + -(push)
offset = offset + pull
end
end
function ProbablyEngine.interface.fetchKey(keyA, keyB, default)
local selectedProfile = ProbablyEngine.config.read(keyA .. '_profile', 'Default Profile')
if selectedProfile then
return ProbablyEngine.config.read(keyA .. selectedProfile .. '_' .. keyB, default)
else
return ProbablyEngine.config.read(keyA .. '_' .. keyB, default)
end
end
function ProbablyEngine.interface.writeKey(keyA, keyB, value)
local selectedProfile = ProbablyEngine.config.read(keyA .. '_profile', 'Default Profile')
if selectedProfile then
return ProbablyEngine.config.write(keyA .. selectedProfile .. '_' .. keyB, value)
else
return ProbablyEngine.config.write(keyA .. '_' .. keyB, value)
end
end
function ProbablyEngine.interface.buildGUI(config)
local parent = DiesalGUI:Create('Window')
parent:SetWidth(config.width or 200)
parent:SetHeight(config.height or 300)
if not config.key_orig then
config.key_orig = config.key
end
if config.profiles == true and config.key_orig then
parent.settings.footer = true
local createButton = DiesalGUI:Create('Button')
parent:AddChild(createButton)
createButton:SetParent(parent.footer)
createButton:SetPoint('TOPLEFT',17,-1)
createButton:SetSettings({
width = 20,
height = 20,
}, true)
createButton:SetText('')
createButton:SetStyle('frame',createButtonStyle)
createButton:SetEventListener('OnClick', function()
local newWindow = DiesalGUI:Create('Window')
parent:AddChild(newWindow)
newWindow:SetTitle("Create Profile")
newWindow.settings.width = 200
newWindow.settings.height = 75
newWindow.settings.minWidth = newWindow.settings.width
newWindow.settings.minHeight = newWindow.settings.height
newWindow.settings.maxWidth = newWindow.settings.width
newWindow.settings.maxHeight = newWindow.settings.height
newWindow:ApplySettings()
local profileInput = DiesalGUI:Create('Input')
newWindow:AddChild(profileInput)
profileInput:SetParent(newWindow.content)
profileInput:SetPoint("TOPLEFT", newWindow.content, "TOPLEFT", 5, -5)
profileInput:SetPoint("BOTTOMRIGHT", newWindow.content, "TOPRIGHT", -5, -25)
profileInput:SetText("New Profile Name")
local profileButton = DiesalGUI:Create('Button')
newWindow:AddChild(profileButton)
profileButton:SetParent(newWindow.content)
profileButton:SetPoint("TOPLEFT", newWindow.content, "TOPLEFT", 5, -30)
profileButton:SetPoint("BOTTOMRIGHT", newWindow.content, "TOPRIGHT", -5, -50)
profileButton:AddStyleSheet(buttonStyleSheet)
profileButton:SetText("Create New Profile")
profileButton:SetEventListener('OnClick', function()
local profiles = ProbablyEngine.config.read(config.key_orig .. '_profiles', {{key='default',text='Default'}})
local profileName = profileInput:GetText()
local pkey = string.gsub(profileName, "%s+", "")
if profileName ~= '' then
for _,p in ipairs(profiles) do
if p.key == profileName then
profileButton:SetText('|cffff3300Profile with that name exists!|r')
C_Timer.NewTicker(2, function()
profileButton:SetText("Create New Profile")
end, 1)
return false
end
end
table.insert(profiles, { key = pkey, text = profileName })
ProbablyEngine.config.write(config.key_orig .. '_profiles', profiles)
ProbablyEngine.config.write(config.key_orig .. '_profile', pkey)
newWindow:Hide()
parent:Hide()
parent:Release()
ProbablyEngine.interface.buildGUI(config)
end
end)
end)
createButton:SetEventListener('OnEnter', function()
createButton:SetStyle('frame', ButtonOver)
end)
createButton:SetEventListener('OnLeave', function()
createButton:SetStyle('frame', ButtonNormal)
end)
createButton.frame:SetScript('OnMouseDown', function()
createButton:SetStyle('frame', ButtonNormal)
end)
createButton.frame:SetScript('OnMouseUp', function()
createButton:SetStyle('frame', ButtonOver)
end)
local deleteButton = DiesalGUI:Create('Button')
parent:AddChild(deleteButton)
deleteButton:SetParent(parent.footer)
deleteButton:SetPoint('TOPLEFT',0,-1)
deleteButton:SetSettings({
width = 20,
height = 20,
}, true)
deleteButton:SetText('')
deleteButton:SetStyle('frame',deleteButtonStyle)
deleteButton:SetEventListener('OnEnter', function()
deleteButton:SetStyle('frame', ButtonOver)
end)
deleteButton:SetEventListener('OnLeave', function()
deleteButton:SetStyle('frame', ButtonNormal)
end)
deleteButton.frame:SetScript('OnMouseDown', function()
deleteButton:SetStyle('frame', ButtonNormal)
end)
deleteButton.frame:SetScript('OnMouseUp', function()
deleteButton:SetStyle('frame', ButtonOver)
end)
deleteButton:SetEventListener('OnClick', function()
local selectedProfile = ProbablyEngine.config.read(config.key_orig .. '_profile', 'Default Profile')
local profiles = ProbablyEngine.config.read(config.key_orig .. '_profiles', {{key='default',text='Default'}})
if selectedProfile ~= 'default' then
for i,p in ipairs(profiles) do
if p.key == selectedProfile then
profiles[i] = nil
ProbablyEngine.config.write(config.key_orig .. '_profiles', profiles)
ProbablyEngine.config.write(config.key_orig .. '_profile', 'default')
parent:Hide()
parent:Release()
ProbablyEngine.interface.buildGUI(config)
end
end
end
end)
local profiles = ProbablyEngine.config.read(config.key_orig .. '_profiles', {{key='default',text='Default'}})
local selectedProfile = ProbablyEngine.config.read(config.key_orig .. '_profile', 'default')
local profile_dropdown = DiesalGUI:Create('Dropdown')
parent:AddChild(profile_dropdown)
profile_dropdown:SetParent(parent.footer)
profile_dropdown:SetPoint("TOPRIGHT", parent.footer, "TOPRIGHT", 1, 0)
profile_dropdown:SetPoint("BOTTOMLEFT", parent.footer, "BOTTOMLEFT", 37, -1)
local orderdKeys = { }
local list = { }
for i, value in pairs(profiles) do
orderdKeys[i] = value.key
list[value.key] = value.text
end
profile_dropdown:SetList(list, orderdKeys)
profile_dropdown:SetEventListener('OnValueChanged', function(this, event, value)
if selectedProfile ~= value then
ProbablyEngine.config.write(config.key_orig .. '_profile', value)
parent:Hide()
parent:Release()
ProbablyEngine.interface.buildGUI(config)
end
end)
profile_dropdown:SetValue(ProbablyEngine.config.read(config.key_orig .. '_profile', 'Default Profile'))
if selectedProfile then
config.key = config.key_orig .. selectedProfile
end
else
ProbablyEngine.config.write(config.key_orig .. '_profile', false)
end
if config.key_orig then
parent:SetEventListener('OnDragStop', function(self, event, left, top)
ProbablyEngine.config.write(config.key_orig .. '_window', {left, top})
end)
local left, top = unpack(ProbablyEngine.config.read(config.key_orig .. '_window', {false, false}))
if left and top then
parent.settings.left = left
parent.settings.top = top
parent:UpdatePosition()
end
end
local window = DiesalGUI:Create('ScrollFrame')
parent:AddChild(window)
window:SetParent(parent.content)
window:SetAllPoints(parent.content)
window.parent = parent
if not config.color then config.color = "ee2200" end
spinnerStyleSheet['bar-background']['color'] = config.color
if config.title then
parent:SetTitle("|cff"..config.color..config.title.."|r", config.subtitle)
end
if config.width then
parent:SetWidth(config.width)
end
if config.height then
parent:SetHeight(config.height)
end
if config.minWidth then
parent.settings.minWidth = config.minWidth
end
if config.minHeight then
parent.settings.minHeight = config.minHeight
end
if config.maxWidth then
parent.settings.maxWidth = config.maxWidth
end
if config.maxHeight then
parent.settings.maxHeight = config.maxHeight
end
if config.resize == false then
parent.settings.minHeight = config.height
parent.settings.minWidth = config.width
parent.settings.maxHeight = config.height
parent.settings.maxWidth = config.width
end
parent:ApplySettings()
config.window = window
window.elements = { }
buildElements(config, window)
return window
end
ProbablyEngine.interface.init = function()
ProbablyEngine.interface.minimap.create()
end
local corePEconfig = {
key = "corePEconfig",
title = "ProbablyEngine",
subtitle = "Configuration",
profiles = false,
width = 250,
height = 400,
resize = false,
config = {
{ type = "header", justify = 'LEFT', text = ProbablyEngine.addonName },
{ type = "spacer", size = 0, pull = 16 },
{ type = "header", justify = 'RIGHT', text = "v" .. ProbablyEngine.version },
{ type = "rule" },
{ type = "button", text = "Unlock Buttons", width = 233, height = 20, push = 2, callback = function(self, button)
if not self.button_moving then
ProbablyEngine.buttons.frame:Show()
self:SetText("Lock Buttons")
self.button_moving = true
else
ProbablyEngine.buttons.frame:Hide()
self:SetText("Unlock Buttons")
self.button_moving = false
end
end},
{ type = "rule" },
}
}
ProbablyEngine.interface.corePEconfigFrame = ProbablyEngine.interface.buildGUI(corePEconfig)
ProbablyEngine.interface.corePEconfigFrame.parent:Hide()
ProbablyEngine.interface.corePEconfigFrame.parent:SetEventListener('OnClose', function(self)
ProbablyEngine.interface.corePEconfigFrame.parent:Hide()
end)
ProbablyEngine.interface.showProbablyConfig = function()
if ProbablyEngine.interface.corePEconfigFrame.parent:IsShown() then
ProbablyEngine.interface.corePEconfigFrame.parent:Hide()
else
ProbablyEngine.interface.corePEconfigFrame.parent:Show()
end
end | bsd-3-clause |
jcrom/emp-doc | doc/info_center/ewp_demo/redis/lua/redis_cache/set_user_obj.lua | 2 | 2337 | -- KEYS只指定客户号
-- ARGV[]格式为:用户信息数据个数N,
-- 用户信息数据1键,用户信息数据1值,......,用户信息数据N键,用户信息数据N值,
-- 账户1,账户1信息数据个数M1,
-- 账户1信息数据1键,账户1信息数据1值,......,账户1信息数据M1键,账户1信息数据M1值,
-- 账户2,账户2信息数据个数M2,
-- 账户2信息数据1键,账户2信息数据1值,......,账户2信息数据M2键,账户2信息数据M2值,
-- ......
local user_info_key = 'HXRC_USER_OBJ:' .. KEYS[1] .. ':USER_INFO'
local user_accts_list_key = 'HXRC_USER_OBJ:' .. KEYS[1] .. ':ACCTS_LIST'
-- 设置数据有效期(秒)
local timeout = 300
-- 第一个参数为用户信息数据个数
if ARGV[1] == nil then
return redis.status_reply('ok')
end
local data_num = ARGV[1]
local hmset_tab = {}
local k = 1
-- 遍历用户信息数据,使用redis hashes保存数据
for j = 2, data_num * 2 + 1, 2 do
hmset_tab[k] = ARGV[j]
hmset_tab[k + 1] = ARGV[j + 1]
k = k + 2
-- redis.call('hset', user_info_key, ARGV[j], ARGV[j + 1])
end
--利用unpack将hmset_tab转换成可变参数列表
redis.call('hmset', user_info_key, unpack(hmset_tab))
redis.call('expire', user_info_key, timeout)
-- 遍历账户信息列表
local i = data_num * 2 + 2
while ARGV[i] ~= nil do
-- 获取账户
local acct = ARGV[i]
-- 获取账户信息数据个数
data_num = ARGV[i + 1]
-- 生成账户信息主键
local user_acct_info_key = 'HXRC_USER_OBJ:' .. KEYS[1] .. ':ACCT_INFO:' .. acct
i = i + 2
k = 1
-- 遍历data_num对数据
hmset_tab = {}
for j = i, i + data_num * 2 - 1, 2 do
hmset_tab[k] = ARGV[j]
hmset_tab[k + 1] = ARGV[j + 1]
k = k + 2
-- 用redis hashes存储卡信息
-- redis.call('hset', user_acct_info_key, ARGV[j], ARGV[j + 1])
i = i + 2
end
redis.call('hmset', user_acct_info_key, unpack(hmset_tab))
redis.call('expire', user_acct_info_key, timeout)
-- 用redis sets存储卡列表
redis.call('sadd', user_accts_list_key, acct)
end
redis.call('expire', user_accts_list_key, timeout)
return redis.status_reply('ok') | mit |
mkjung/ivi-media-player | share/lua/meta/art/01_googleimage.lua | 74 | 1764 | --[[
Gets an artwork from images.google.com
$Id$
Copyright © 2007 the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]]
function descriptor()
return { scope="network" }
end
-- Return the artwork
function fetch_art()
if vlc.item == nil then return nil end
local meta = vlc.item:metas()
-- Radio Entries
if meta["Listing Type"] == "radio"
then
title = meta["title"] .. " radio logo"
-- TV Entries
elseif meta["Listing Type"] == "tv"
then
title = meta["title"] .. " tv logo"
-- Album entries
elseif meta["artist"] and meta["album"] then
title = meta["artist"].." "..meta["album"].." cover"
elseif meta["artist"] and meta["title"] then
title = meta["artist"].." "..meta["title"].." cover"
else
return nil
end
fd = vlc.stream( "http://images.google.com/images?q="..vlc.strings.encode_uri_component( title ) )
if not fd then return nil end
page = fd:read( 65653 )
fd = nil
_, _, _, arturl = string.find( page, "<img height=\"([0-9]+)\" src=\"([^\"]+gstatic.com[^\"]+)\"" )
return arturl
end
| gpl-3.0 |
ryanwmoore/fceux | output/luaScripts/FRKfunctions.lua | 9 | 20772 | _FRK_Fn= {}
_FRK_Fn.version= 1
--FatRatKnight
-- Various little functions for use.
-- Shortly, I will list out functions and keywords that the script provides
-- access to. But first, I feel a need to explain a few things...
-- Option keywords are simply global variables that this auxillary script looks
-- for. If they are anything other than false or nil by the time your script
-- calls requrie("FRKfunctions"), this script will react accordingly.
-- Reserved variable names are those the script uses, but allows access for
-- other scripts. Sorry about taking valuble names away from you, but I figure
-- you might want direct access to them.
-- Functions are just that. Functions that do stuff, the whole point of this
-- auxillary script. I copied down their line numbers for your convenience.
-- If the quick description isn't enough, then perhaps the more detailed
-- comments and actual code might be.
-- Options for individual functions can be changed by altering its number
-- after the require("FRKfunctions") line.
--List of option keywords:
-- _FRK_SkipRename Convenient names aren't used for these functions
-- _FRK_NoAutoReg Will not automatically fill registers
--List of reserved variable names:
-- keys For checking current keys.
-- lastkeys For checking previous keys.
--List of functions:
-- 82 UpdateKeys() Updates this script's key tables
-- 97 Press(button) Checks for a key hit
-- 109 PressRepeater(button) Like Press, but if held for long
-- 133 Release(button) Checks for when a key is released
-- 144 MouseMoved() Returns how far the mouse moved
-- 166 FBoxOldFast(x1, y1, x2, y2, color) Faster at drawing, but stupid
-- 180 FBoxOld(x1, y1, x2, y2, color) Border-only box; corners fix
-- 210 FakeBox(x1, y1, x2, y2, Fill, Border) Fill-and-Border box; corners fix
-- 230 Draw[digit](Left,Top,color) Paints tiny digit on screen
-- 354 _FRK_Fn._DN_AnyBase(right, top, Number, color, bkgnd, div)
-- Paints a right-aligned number using any base from 2 to 16.
-- 405 DrawNum(right, top, Number, color, bkgnd) Paints a beautiful number
-- 413 DrawNumx(right, top, Number, color, bkgnd) Hexidecimal version
-- 504 ProcessReg() Removes functions in registers and stores 'em
-- 521 ApplyReg() Sets registers
-- 534 AddReg(name, function)
-- 543 RemoveReg(name, pos)
-- 564 limits(value,low,high) Returns value or specified limits
-- 575 within(value,low,high) Returns T/F; Is it within range?
--List of options for individual functions:
_FRK_Fn.RepeaterDelay= 5 --How long should PressRepeater wait?
-- input.get family
--*****************************************************************************
function _FRK_Fn.UpdateKeys()
--*****************************************************************************
-- Moves keys into lastkeys, then puts fresh keyboard input into keys.
-- Meant to simplify the process of registering keyhits.
-- Stick this thing at the beginning of a gui.register function or main loop.
lastkeys= keys
keys= input.get()
end
keys= input.get() -- Sanity. Want xmouse and ymouse to exist.
lastkeys= keys -- Otherwise, MouseMoved pings an error at me.
--*****************************************************************************
function _FRK_Fn.Press(button) -- Expects a key
--*****************************************************************************
-- Returns true or false. It's true at the moment the user hits the button.
-- Generally, if keys is pressed, the next loop around will set lastkeys,
-- and thus prevent returning true more than once if held.
return (keys[button] and not lastkeys[button])
end
local repeater= 0
--*****************************************************************************
function _FRK_Fn.PressRepeater(button) -- Expects a key
--*****************************************************************************
--DarkKobold & FatRatKnight
-- Returns true or false.
-- Acts much like press if you don't hold the key down. Once held long enough,
-- it will repeatedly return true.
-- It works fine if there are multiple calls to different buttons. Not so fine
-- if there's multiple calls to the same button. Only one repeater variable...
if keys[button] then
if not lastkeys[button] or repeater >= _FRK_Fn.RepeaterDelay then
return true
else
repeater = repeater + 1
end
elseif lastkeys[button] then -- To allow more calls for other buttons
repeater= 0
end
return false
end
--*****************************************************************************
function _FRK_Fn.Release(button) -- Expects a key
--*****************************************************************************
-- Returns true or false. It's true at the moment the user releases the button.
-- Might be a good idea to know when the user ain't holding it anymore.
-- Eh, I don't see any obvious application, but may as well have it.
return ((not keys[button]) and lastkeys[button])
end
--*****************************************************************************
function _FRK_Fn.MouseMoved()
--*****************************************************************************
-- Returns two values: x,y
-- This function tells you how far the mouse moved since the last update.
-- It's simply the difference of what position it is now and what it once was.
return (keys.xmouse - lastkeys.xmouse) , (keys.ymouse - lastkeys.ymouse)
end
-- Display family
-- For helping you see
--*****************************************************************************
function _FRK_Fn.FBoxOldFast(x1, y1, x2, y2, color)
--*****************************************************************************
-- Gets around FCEUX's problem of double-painting the corners.
-- This particular function doesn't make sure the x and y are good.
-- Call this instead if you need processing speed and know its fine
gui.line(x1 ,y1 ,x2-1,y1 ,color) -- top
gui.line(x2 ,y1 ,x2 ,y2-1,color) -- right
gui.line(x1+1,y2 ,x2 ,y2 ,color) -- bottom
gui.line(x1 ,y1+1,x1 ,y2 ,color) -- left
end
--*****************************************************************************
function _FRK_Fn.FBoxOld(x1, y1, x2, y2, color)
--*****************************************************************************
-- Gets around FCEUX's problem of double-painting the corners.
-- This has several sanity checks to ensure a properly drawn box.
-- It acts like the old-style border-only box.
if (x1 == x2) and (y1 == y2) then -- Sanity: Is it a single dot?
gui.pixel(x1,y1,color)
elseif (x1 == x2) or (y1 == y2) then -- Sanity: A straight line?
gui.line(x1,y1,x2,y2,color)
else --(x1 ~= x2) and (y1 ~= y2)
local temp
if x1 > x2 then
temp= x1; x1= x2; x2= temp -- Sanity: Without these checks,
end -- This function may end up putting
if y1 > y2 then -- two or four out-of-place pixels
temp= y1; y1= y2; y2= temp -- near the corners.
end
gui.line(x1 ,y1 ,x2-1,y1 ,color) -- top
gui.line(x2 ,y1 ,x2 ,y2-1,color) -- right
gui.line(x1+1,y2 ,x2 ,y2 ,color) -- bottom
gui.line(x1 ,y1+1,x1 ,y2 ,color) -- left
end
end
--*****************************************************************************
function _FRK_Fn.FakeBox(x1, y1, x2, y2, Fill, Border)
--*****************************************************************************
-- Gets around FCEUX's problem of double-painting the corners.
-- It acts like the new-style fill-and-border box. Not quite perfectly...
-- One "problem" is that, if you specify Fill only, it won't successfully
-- mimic the actual gui.box fill.
if not Border then Border= Fill end
gui.box(x1,y1,x2,y2,Fill,0)
FBoxOld(x1,y1,x2,y2,Border)
end
--### # ### ### # # ### ### ### ### ### # ## # ## ### ###
--# # ## # # # # # # # # # # # # # # # # # # # # #
--# # # ### ### ### ### ### ## ### ### # # ## # # # ## ##
--# # # # # # # # # # # # # ### # # # # # # # #
--### ### ### ### # ### ### # ### ### # # ## # ## ### #
--*****************************************************************************
_FRK_Fn.Draw= {} --Draw[button]( Left , Top , color )
--*****************************************************************************
--Coordinates is the top-left pixel of the 3x5 digit.
--Used for drawing compact, colored numbers.
local d= _FRK_Fn.Draw
function d.D0(left, top, color)
gui.line(left ,top ,left ,top+4,color)
gui.line(left+2,top ,left+2,top+4,color)
gui.pixel(left+1,top ,color)
gui.pixel(left+1,top+4,color)
end
function d.D1(left, top, color)
gui.line(left ,top+4,left+2,top+4,color)
gui.line(left+1,top ,left+1,top+3,color)
gui.pixel(left ,top+1,color)
end
function d.D2(left, top, color)
gui.line(left ,top ,left+2,top ,color)
gui.line(left ,top+3,left+2,top+1,color)
gui.line(left ,top+4,left+2,top+4,color)
gui.pixel(left ,top+2,color)
gui.pixel(left+2,top+2,color)
end
function d.D3(left, top, color)
gui.line(left ,top ,left+1,top ,color)
gui.line(left ,top+2,left+1,top+2,color)
gui.line(left ,top+4,left+1,top+4,color)
gui.line(left+2,top ,left+2,top+4,color)
end
function d.D4(left, top, color)
gui.line(left ,top ,left ,top+2,color)
gui.line(left+2,top ,left+2,top+4,color)
gui.pixel(left+1,top+2,color)
end
function d.D5(left, top, color)
gui.line(left ,top ,left+2,top ,color)
gui.line(left ,top+1,left+2,top+3,color)
gui.line(left ,top+4,left+2,top+4,color)
gui.pixel(left ,top+2,color)
gui.pixel(left+2,top+2,color)
end
function d.D6(left, top, color)
gui.line(left ,top ,left+2,top ,color)
gui.line(left ,top+1,left ,top+4,color)
gui.line(left+2,top+2,left+2,top+4,color)
gui.pixel(left+1,top+2,color)
gui.pixel(left+1,top+4,color)
end
function d.D7(left, top, color)
gui.line(left ,top ,left+1,top ,color)
gui.line(left+2,top ,left+1,top+4,color)
end
function d.D8(left, top, color)
gui.line(left ,top ,left ,top+4,color)
gui.line(left+2,top ,left+2,top+4,color)
gui.pixel(left+1,top ,color)
gui.pixel(left+1,top+2,color)
gui.pixel(left+1,top+4,color)
end
function d.D9(left, top, color)
gui.line(left ,top ,left ,top+2,color)
gui.line(left+2,top ,left+2,top+3,color)
gui.line(left ,top+4,left+2,top+4,color)
gui.pixel(left+1,top ,color)
gui.pixel(left+1,top+2,color)
end
function d.DA(left, top, color)
gui.line(left ,top+1,left ,top+4,color)
gui.line(left+2,top+1,left+2,top+4,color)
gui.pixel(left+1,top ,color)
gui.pixel(left+1,top+3,color)
end
function d.DB(left, top, color)
gui.line(left ,top ,left ,top+4,color)
gui.line(left+1,top ,left+2,top+1,color)
gui.line(left+1,top+4,left+2,top+3,color)
gui.pixel(left+1,top+2,color)
end
function d.DC(left, top, color)
gui.line(left ,top+1,left ,top+3,color)
gui.line(left+1,top ,left+2,top+1,color)
gui.line(left+1,top+4,left+2,top+3,color)
end
function d.DD(left, top, color)
gui.line(left ,top ,left ,top+4,color)
gui.line(left+2,top+1,left+2,top+3,color)
gui.pixel(left+1,top ,color)
gui.pixel(left+1,top+4,color)
end
function d.DE(left, top, color)
gui.line(left ,top ,left ,top+4,color)
gui.line(left+1,top ,left+2,top ,color)
gui.line(left+1,top+4,left+2,top+4,color)
gui.pixel(left+1,top+2,color)
end
function d.DF(left, top, color)
gui.line(left ,top ,left ,top+4,color)
gui.line(left+1,top ,left+2,top ,color)
gui.pixel(left+1,top+2,color)
end
d[0],d[1],d[2],d[3],d[4]= d.D0, d.D1, d.D2, d.D3, d.D4
d[5],d[6],d[7],d[8],d[9]= d.D5, d.D6, d.D7, d.D8, d.D9
d[10],d[11],d[12],d[13],d[14],d[15]= d.DA, d.DB, d.DC, d.DD, d.DE, d.DF
--*****************************************************************************
function _FRK_Fn._DN_AnyBase(right, top, Number, color, bkgnd, div)
--*****************************************************************************
-- Works with any base from 2 to 16. Paints the input number.
-- Returns the x position where it would paint another digit.
-- It only works with integers. Rounds fractions toward zero.
if div < 2 then return end -- Prevents the function from never returning.
local Digit= {}
local Negative= false
if Number < 0 then
Number= -Number
Negative= true
end
Number= math.floor(Number)
if not color then color= "white" end
if not bkgnd then bkgnd= "clear" end
local i= 0
if Number < 1 then
Digit[1]= 0
i= 1
end
while (Number >= 1) do
i= i+1
Digit[i]= Number % div
Number= math.floor(Number/div)
end
if Negative then i= i+1 end
local left= right - i*4
FakeBox(left+1, top-1, right+1, top+5,bkgnd,bkgnd)
i= 1
while _FRK_Fn.Draw[Digit[i]] do
_FRK_Fn.Draw[Digit[i]](right-2,top,color)
right= right-4
i=i+1
end
if Negative then
gui.line(right, top+2,right-2,top+2,color)
right= right-4
end
return right
end
--*****************************************************************************
function _FRK_Fn.DrawNum(right, top, Number, color, bkgnd)
--*****************************************************************************
-- Paints the input number as right-aligned. Decimal version.
return _FRK_Fn._DN_AnyBase(right, top, Number, color, bkgnd, 10)
end
--*****************************************************************************
function _FRK_Fn.DrawNumx(right, top, Number, color, bkgnd)
--*****************************************************************************
-- Paints the input number as right-aligned. Hexadecimal version.
return _FRK_Fn._DN_AnyBase(right, top, Number, color, bkgnd, 16)
end
-- Registry family
-- For overloading the usual registers with multiple separate functions.
local RegNames= {"Before", "After", "Exit", "Gui", "Save", "Load"}
_FRK_Fn.RegList= {}
_FRK_Fn.RegList.Before={}
_FRK_Fn.RegList.After= {}
_FRK_Fn.RegList.Exit= {}
_FRK_Fn.RegList.Gui= {}
_FRK_Fn.RegList.Save= {}
_FRK_Fn.RegList.Load= {}
--*****************************************************************************
_FRK_Fn.RegFn= {} --RegFn[name]() For various registers
--*****************************************************************************
function _FRK_Fn.RegFn.Before()
local i= 1
while (_FRK_Fn.RegList.Before[i]) do
_FRK_Fn.RegList.Before[i]()
i= i+1
end
end
function _FRK_Fn.RegFn.After()
local i= 1
while (_FRK_Fn.RegList.After[i]) do
_FRK_Fn.RegList.After[i]()
i= i+1
end
end
function _FRK_Fn.RegFn.Exit()
local i= 1
while (_FRK_Fn.RegList.Exit[i]) do
_FRK_Fn.RegList.Exit[i]()
i= i+1
end
end
function _FRK_Fn.RegFn.Gui()
local i= 1
while (_FRK_Fn.RegList.Gui[i]) do
_FRK_Fn.RegList.Gui[i]()
i= i+1
end
end
function _FRK_Fn.RegFn.Save()
local i= 1
while (_FRK_Fn.RegList.Save[i]) do
_FRK_Fn.RegList.Save[i]()
i= i+1
end
end
function _FRK_Fn.RegFn.Load()
local i= 1
while (_FRK_Fn.RegList.Load[i]) do
_FRK_Fn.RegList.Load[i]()
i= i+1
end
end
local EmuRegisters={
emu.registerbefore,
emu.registerafter,
emu.registerexit,
gui.register,
savestate.registersave,
savestate.registerload
}
--*****************************************************************************
function _FRK_Fn.ProcessRegisters()
--*****************************************************************************
-- Any functions in registers, such as those that might be inserted by
-- auxillary files, are removed from their registers and inserted into my
-- table of functions to execute.
-- All registers will be empty after excecution of this function.
for i= 1, 6 do
local test= EmuRegisters[i]()
-- Make sure the function exists. Also, make sure it isn't ourselves...
if test and (test ~= _FRK_Fn.RegFn[ RegNames[i] ]) then
table.insert(_FRK_Fn.RegList[ RegNames[i] ],1,test)
end
end
end
--*****************************************************************************
function _FRK_Fn.ApplyRegisters()
--*****************************************************************************
-- Fills the registers with functions that will excecute functions stored in
-- my tables.
for i= 1, 6 do
if _FRK_Fn.RegList[ RegNames[i] ][ 1 ] then
EmuRegisters[i](_FRK_Fn.RegFn[ RegNames[i] ])
end
end
end
--*****************************************************************************
function _FRK_Fn.AddRegister(name, fn)
--*****************************************************************************
-- Name should be "Before", "After", "Exit", "Gui", "Save", or "Load".
-- Recommended for use if you plan to add functions to the register.
table.insert(_FRK_Fn.RegList[name],fn)
end
--*****************************************************************************
function _FRK_Fn.RemoveRegister(name, pos)
--*****************************************************************************
-- Name should be "Before", "After", "Exit", "Gui", "Save", or "Load".
-- You may omit pos. Doing so will remove and return the first function that's
-- been inserted into my table.
return table.remove(_FRK_Fn.RegList[name],pos)
end
-- Miscellaneous family
--*****************************************************************************
function _FRK_Fn.limits( value , low , high ) -- Expects numbers
--*****************************************************************************
-- Returns value, low, or high. high is returned if value exceeds high,
-- and low is returned if value is beneath low.
-- Sometimes, you'd rather crop the number to some specific limits.
return math.max(math.min(value,high),low)
end
--*****************************************************************************
function _FRK_Fn.within( value , low , high ) -- Expects numbers
--*****************************************************************************
-- Returns true if value is between low and high, inclusive. False otherwise.
-- Sometimes, you just want to know if the number is within a certain range.
return ( value >= low ) and ( value <= high )
end
--=============================================================================
if not _FRK_SkipRename then
--=============================================================================
UpdateKeys= _FRK_Fn.UpdateKeys
Press= _FRK_Fn.Press
PressRepeater= _FRK_Fn.PressRepeater
Release= _FRK_Fn.Release
MouseMoved= _FRK_Fn.MouseMoved
FBoxOldFast= _FRK_Fn.FBoxOldFast
FBoxOld= _FRK_Fn.FBoxOld
FakeBox= _FRK_Fn.FakeBox
Draw= _FRK_Fn.Draw
DrawNum= _FRK_Fn.DrawNum
DrawNumx= _FRK_Fn.DrawNumx
ProcessReg= _FRK_Fn.ProcessRegisters
ApplyReg= _FRK_Fn.ApplyRegisters
AddReg= _FRK_Fn.AddRegister
RemoveReg= _FRK_Fn.RemoveRegister
limits= _FRK_Fn.limits
within= _FRK_Fn.within
end
--=============================================================================
if not _FRK_NoAutoReg then
--=============================================================================
emu.registerbefore( _FRK_Fn.RegFn.Before)
emu.registerafter( _FRK_Fn.RegFn.After )
emu.registerexit( _FRK_Fn.RegFn.Exit )
gui.register( _FRK_Fn.RegFn.Gui )
savestate.registersave(_FRK_Fn.RegFn.Save )
savestate.registerload(_FRK_Fn.RegFn.Load )
end | gpl-2.0 |
MOSAVI17/Freebot | plugins/quotes.lua | 651 | 1630 | local quotes_file = './data/quotes.lua'
local quotes_table
function read_quotes_file()
local f = io.open(quotes_file, "r+")
if f == nil then
print ('Created a new quotes file on '..quotes_file)
serialize_to_file({}, quotes_file)
else
print ('Quotes loaded: '..quotes_file)
f:close()
end
return loadfile (quotes_file)()
end
function save_quote(msg)
local to_id = tostring(msg.to.id)
if msg.text:sub(11):isempty() then
return "Usage: !addquote quote"
end
if quotes_table == nil then
quotes_table = {}
end
if quotes_table[to_id] == nil then
print ('New quote key to_id: '..to_id)
quotes_table[to_id] = {}
end
local quotes = quotes_table[to_id]
quotes[#quotes+1] = msg.text:sub(11)
serialize_to_file(quotes_table, quotes_file)
return "done!"
end
function get_quote(msg)
local to_id = tostring(msg.to.id)
local quotes_phrases
quotes_table = read_quotes_file()
quotes_phrases = quotes_table[to_id]
return quotes_phrases[math.random(1,#quotes_phrases)]
end
function run(msg, matches)
if string.match(msg.text, "!quote$") then
return get_quote(msg)
elseif string.match(msg.text, "!addquote (.+)$") then
quotes_table = read_quotes_file()
return save_quote(msg)
end
end
return {
description = "Save quote",
description = "Quote plugin, you can create and retrieve random quotes",
usage = {
"!addquote [msg]",
"!quote",
},
patterns = {
"^!addquote (.+)$",
"^!quote$",
},
run = run
}
| gpl-2.0 |
Elkazan/darkstar | scripts/zones/Norg/npcs/Muzaffar.lua | 14 | 3298 | -----------------------------------
-- Area: Norg
-- NPC: Muzaffar
-- Standard Info NPC
-- Quests: Black Market
-- @zone 252
-- @pos 16.678, -2.044, -14.600
-----------------------------------
require("scripts/zones/Norg/TextIDs");
require("scripts/globals/titles");
require("scripts/globals/quests");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
local count = trade:getItemCount();
local NorthernFurs = trade:hasItemQty(1199,4);
local EasternPottery = trade:hasItemQty(1200,4);
local SouthernMummies = trade:hasItemQty(1201,4);
if (player:getQuestStatus(NORG,BLACK_MARKET) == QUEST_ACCEPTED or player:getQuestStatus(NORG,BLACK_MARKET) == QUEST_COMPLETED) then
if (NorthernFurs == true and count == 4) then
player:tradeComplete();
player:startEvent(0x0011, 1199, 1199);
elseif (EasternPottery == true and count == 4) then
player:tradeComplete();
player:startEvent(0x0012, 1200, 1200);
elseif (SouthernMummies == true and count == 4) then
player:tradeComplete();
player:startEvent(0x0013, 1201, 1201);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:getQuestStatus(NORG,BLACK_MARKET) == QUEST_ACCEPTED or player:getQuestStatus(NORG,BLACK_MARKET) == QUEST_COMPLETED) then
player:startEvent(0x0010);
else
player:startEvent(0x000F);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x000F and option == 1) then
player:addQuest(NORG,BLACK_MARKET);
elseif (csid == 0x0011) then
player:addGil(GIL_RATE*1500);
player:messageSpecial(GIL_OBTAINED,GIL_RATE*1500);
if (player:getQuestStatus(NORG,BLACK_MARKET) == QUEST_ACCEPTED) then
player:completeQuest(NORG,BLACK_MARKET);
end
player:addFame(NORG,40*NORG_FAME);
player:addTitle(BLACK_MARKETEER);
player:startEvent(0x0014);
elseif (csid == 0x0012) then
player:addGil(GIL_RATE*2000);
player:messageSpecial(GIL_OBTAINED,GIL_RATE*2000);
if (player:getQuestStatus(NORG,BLACK_MARKET) == QUEST_ACCEPTED) then
player:completeQuest(NORG,BLACK_MARKET);
end
player:addFame(NORG,50*NORG_FAME);
player:addTitle(BLACK_MARKETEER);
player:startEvent(0x0014);
elseif (csid == 0x0013) then
player:addGil(GIL_RATE*3000);
player:messageSpecial(GIL_OBTAINED,GIL_RATE*3000);
if (player:getQuestStatus(NORG,BLACK_MARKET) == QUEST_ACCEPTED) then
player:completeQuest(NORG,BLACK_MARKET);
end
player:addFame(NORG,80*NORG_FAME);
player:addTitle(BLACK_MARKETEER);
player:startEvent(0x0014);
end
end;
| gpl-3.0 |
Vadavim/test | scripts/zones/PsoXja/npcs/HomePoint#1.lua | 12 | 1170 | -----------------------------------
-- Area: PsoXja
-- NPC: HomePoint#1
-- @pos -58 40 14 10
-----------------------------------
package.loaded["scripts/zones/FeiYin/TextIDs"] = nil;
require("scripts/globals/settings");
require("scripts/zones/FeiYin/TextIDs");
require("scripts/globals/homepoint");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
homepointMenu( player, 0x21fc, 82);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if(csid == 0x21fc) then
if (option == 1) then
player:setHomePoint();
player:messageSpecial(HOMEPOINT_SET);
else
hpTeleport( player, option);
end
end
end; | gpl-3.0 |
Elkazan/darkstar | scripts/zones/Northern_San_dOria/npcs/Danngogg.lua | 36 | 1427 | -----------------------------------
-- Area: Northern San d'Oria
-- NPC: Danngogg
-- Standard Info NPC
-----------------------------------
package.loaded["scripts/zones/Northern_San_dOria/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Northern_San_dOria/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
-- "Flyers for Regine" conditional script
FlyerForRegine = player:getQuestStatus(SANDORIA,FLYERS_FOR_REGINE);
if (FlyerForRegine == 1) then
count = trade:getItemCount();
MagicFlyer = trade:hasItemQty(532,1);
if (MagicFlyer == true and count == 1) then
player:messageSpecial(FLYER_REFUSED);
end
end
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x021c);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
CommandPost/CommandPost | src/extensions/cp/apple/finalcutpro/timeline/VideoRole.lua | 2 | 2058 | --- === cp.apple.finalcutpro.timeline.VideoRole ==
---
--- *Extends [Role](cp.apple.finalcutpro.timeline.Role.md)*
---
--- A [Role](cp.apple.finalcutpro.timeline.Role.md) representing Video clips.
-- local log = require "hs.logger" .new "VideoRole"
local axutils = require "cp.ui.axutils"
local Button = require "cp.ui.Button"
local CheckBox = require "cp.ui.CheckBox"
local Role = require "cp.apple.finalcutpro.timeline.Role"
local valueOf = axutils.valueOf
local childrenMatching = axutils.childrenMatching
local childFromLeft = axutils.childFromLeft
local VideoRole = Role:subclass("cp.apple.finalcutpro.timeline.VideoRole")
--- cp.apple.finalcutpro.timeline.VideoRole.matches(element) -> boolean
--- Function
--- Checks if the element is a "Video" Role.
---
--- Parameters:
--- * element - An element to check
---
--- Returns:
--- * A boolean
function VideoRole.static.matches(element)
return Role.matches(element)
and valueOf(element, "AXDisclosureLevel") == 0
and #childrenMatching(element[1], CheckBox.matches) == 1
end
--- cp.apple.finalcutpro.timeline.VideoRole(parent, uiFinder)
--- Constructor
--- Creates a new instance with the specified `parent` and `uiFinder`.
---
--- Parameters:
--- * parent - the parent `Element`.
--- * uiFinder - a `function` or `cp.prop` containing the `axuielement`
---
--- Returns:
--- * The new `Row`.
function VideoRole:initialize(parent, uiFinder)
Role.initialize(self, parent, uiFinder, Role.TYPE.VIDEO)
end
--- cp.apple.finalcutpro.timeline.VideoRole.subrolesExpanded <cp.ui.Button>
--- Field
--- A [Button](cp.ui.Button.md) that toggles whether the sub-captions are visible.
---
--- Note:
--- * This [Button](cp.ui.Button.md) is only visible when the pointer is hovering over the Role.
function VideoRole.lazy.value:subrolesExpanded()
return Button(self, self.cellUI:mutate(function(original)
return childFromLeft(original(), 1, Button.matches)
end))
end
return VideoRole | mit |
Elkazan/darkstar | scripts/zones/Bastok_Mines/npcs/Eulaphe.lua | 28 | 2055 | -----------------------------------
-- Area: Bastok Mines
-- NPC: Eulaphe
-- Type: Chocobo Renter
-----------------------------------
require("scripts/globals/chocobo");
require("scripts/globals/keyitems");
require("scripts/globals/settings");
require("scripts/globals/status");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
local level = player:getMainLvl();
local gil = player:getGil();
if (player:hasKeyItem(CHOCOBO_LICENSE) and level >= 15) then
local price = getChocoboPrice(player);
player:setLocalVar("chocoboPriceOffer",price);
if (level >= 20) then
level = 0;
end
player:startEvent(0x003E,price,gil,level);
else
player:startEvent(0x0041);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish Action
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
local price = player:getLocalVar("chocoboPriceOffer");
if (csid == 0x003E and option == 0) then
if (player:delGil(price)) then
updateChocoboPrice(player, price);
if (player:getMainLvl() >= 20) then
local duration = 1800 + (player:getMod(MOD_CHOCOBO_RIDING_TIME) * 60)
player:addStatusEffectEx(EFFECT_CHOCOBO,EFFECT_CHOCOBO,1,0,duration,true);
else
player:addStatusEffectEx(EFFECT_CHOCOBO,EFFECT_CHOCOBO,1,0,900,true);
end
player:setPos(580,0,-305,0x40,0x6B);
end
end
end; | gpl-3.0 |
davweb/hammerspoon-config | init.lua | 1 | 2444 | -- luacheck: globals hs
-- configure Hammerspoon console
hs.console.consoleFont("Source Code Pro")
require('config-watcher')
local windows = require('windows')
local text = require('text')
require('keyboard')
require('power')
require('network')
-- require('do-not-disturb')
windows.addCategory('terminals', {
'iTerm2',
'System Preferences',
'App Store',
'Finder',
'Preview',
'PDF Expert',
'Hazel'
})
windows.addCategory('browsers', {
'Google Chrome',
'Firefox',
'Safari',
'1Password'
})
windows.addCategory('personal', {
'Spark',
'Messages',
'Deliveries',
'WhatsApp',
'Signal',
'Parcel',
'Reeder'
})
windows.addCategory('social', {
'Tweetbot',
'Board Game Arena'
})
windows.addCategory('messages', {
'Contacts',
'Slack',
'GoodNotes'
})
windows.addCategory('calendars', {
'Calendar',
'Fantastical',
'Microsoft Outlook',
'Things'
})
windows.addCategory('devtools', {
'Hammerspoon',
'Tower',
'Dash'
})
windows.addCategory('editors', {
'Code',
'Soulver 3',
'Tot',
'MacDown',
'Dictionary',
'Text Edit'
})
windows.addCategory('media', {
'Spotify',
'Overcast',
'VLC',
'iPlayer Radio'
})
windows.addCategory('conferencing', {
'Microsoft Teams'
})
-- Work Monitors
-- windows.addMonitor('DELL U2715H', {
-- terminals = 1,
-- editors = 2,
-- social = -3,
-- personal = -2,
-- media = -1
-- })
-- windows.addMonitor('LG Ultra HD', {
-- messages = 1,
-- calendars = 2,
-- devtools = 4,
-- browsers = 5,
-- conferencing = 6
-- })
-- Home Monitor
windows.addMonitor('Studio Display', {
terminals = 1,
browsers = 2,
messages = 3,
devtools = 4,
editors = 5,
calendars = 6,
conferencing = 7,
social = 3,
personal = -2,
media = -1
})
-- Laptop
windows.addMonitor('Color LCD', {
terminals = 1,
browsers = 2,
messages = 3,
devtools = 4,
editors = 5,
calendars = 6,
conferencing = 7,
social = 3,
personal = -2,
media = -1
})
local keymap = {
C = hs.toggleConsole,
W = windows.tidy(false),
F = windows.tidy(true),
I = windows.identify,
S = windows.identifyScreens,
T = text.type('▶'),
A = text.paste('➝'),
U = text.type('↑'),
X = text.type('×'),
H = text.type('½'),
Y = text.type('✔'),
J = windows.moveWindowLeftOneSpace,
K = windows.moveWindowRightOneSpace,
G = windows.gatherWindows
}
for key, func in pairs(keymap) do
hs.hotkey.bind({"ctrl", "alt", "cmd"}, key, func)
end
| unlicense |
Elkazan/darkstar | scripts/globals/items/marron_glace.lua | 35 | 1337 | -----------------------------------------
-- ID: 4502
-- Item: Marron Glace
-- Food Effect: 180Min, All Races
-----------------------------------------
-- Magic % 13
-- Magic Cap 85
-- Magic Regen While Healing 1
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,10800,4502);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_FOOD_MPP, 13);
target:addMod(MOD_FOOD_MP_CAP, 85);
target:addMod(MOD_MPHEAL, 1);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_FOOD_MPP, 13);
target:delMod(MOD_FOOD_MP_CAP, 85);
target:delMod(MOD_MPHEAL, 1);
end;
| gpl-3.0 |
Elkazan/darkstar | scripts/zones/Attohwa_Chasm/mobs/Sekhmet.lua | 13 | 1828 | -----------------------------------
-- Area: Attohwa Chasm
-- NPC: Sekhmet
-- ID: 16805962
-----------------------------------
require("scripts/globals/titles");
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------
-- onMobInitialize Action
-----------------------------------
function onMobInitialize(mob)
mob:setMobMod(MOBMOD_ADD_EFFECT,mob:getShortID());
mob:setMod(MOD_DOUBLE_ATTACK, 10);
mob:setMod(MOD_FASTCAST, 15);
end;
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobFight Action
-----------------------------------
function onMobFight(mob,target)
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob, killer)
mob:setRespawnTime(math.random(5400,7200)); -- 1.5 to 2 hours.
UpdateNMSpawnPoint(mob:getID());
end;
-----------------------------------
-- onMobDespawn
-----------------------------------
function onMobDespawn(mob, killer)
end;
-----------------------------------
-- onAdditionalEffect
-----------------------------------
function onAdditionalEffect(mob, player)
local chance = 100;
local resist = applyResistanceAddEffect(mob,player,ELE_DARK,EFFECT_ENASPIR);
if (math.random(0,99) >= chance or resist <= 0.5) then
return 0,0,0;
else
local mp = math.random(1,10);
if (player:getMP() < mp) then
mp = player:getMP();
end
if (mp == 0) then
return 0,0,0;
else
player:delMP(mp);
mob:addMP(mp);
return SUBEFFECT_MP_DRAIN, 162, mp;
end
end
end; | gpl-3.0 |
Vadavim/test | scripts/zones/Attohwa_Chasm/mobs/Sekhmet.lua | 13 | 1828 | -----------------------------------
-- Area: Attohwa Chasm
-- NPC: Sekhmet
-- ID: 16805962
-----------------------------------
require("scripts/globals/titles");
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------
-- onMobInitialize Action
-----------------------------------
function onMobInitialize(mob)
mob:setMobMod(MOBMOD_ADD_EFFECT,mob:getShortID());
mob:setMod(MOD_DOUBLE_ATTACK, 10);
mob:setMod(MOD_FASTCAST, 15);
end;
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobFight Action
-----------------------------------
function onMobFight(mob,target)
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob, killer)
mob:setRespawnTime(math.random(5400,7200)); -- 1.5 to 2 hours.
UpdateNMSpawnPoint(mob:getID());
end;
-----------------------------------
-- onMobDespawn
-----------------------------------
function onMobDespawn(mob, killer)
end;
-----------------------------------
-- onAdditionalEffect
-----------------------------------
function onAdditionalEffect(mob, player)
local chance = 100;
local resist = applyResistanceAddEffect(mob,player,ELE_DARK,EFFECT_ENASPIR);
if (math.random(0,99) >= chance or resist <= 0.5) then
return 0,0,0;
else
local mp = math.random(1,10);
if (player:getMP() < mp) then
mp = player:getMP();
end
if (mp == 0) then
return 0,0,0;
else
player:delMP(mp);
mob:addMP(mp);
return SUBEFFECT_MP_DRAIN, 162, mp;
end
end
end; | gpl-3.0 |
grimmsdottir/DSTmod-Orion_Castilio | scripts/prefabs/up_sanity.lua | 1 | 1024 | local assets=
{
Asset("ANIM", "anim/up_sanity.zip"),
Asset("IMAGE", "images/inventoryimages/up_sanity.tex"),
Asset("ATLAS", "images/inventoryimages/up_sanity.xml"),
}
local function fn(Sim)
local inst = CreateEntity()
inst.entity:AddTransform()
inst.entity:AddAnimState()
inst.entity:AddSoundEmitter()
inst.entity:AddNetwork()
inst.entity:AddLight()
MakeInventoryPhysics(inst)
inst.AnimState:SetBank("up_sanity")
inst.AnimState:SetBuild("up_sanity")
inst.AnimState:PlayAnimation("idle")
if not TheWorld.ismastersim then
return inst
end
inst.entity:SetPristine()
inst:AddComponent("inspectable")
inst:AddComponent("inventoryitem")
inst.components.inventoryitem.atlasname = "images/inventoryimages/up_sanity.xml"
inst:AddComponent("stackable")
inst.components.stackable.maxsize = TUNING.ORION.BATTERYSTACKSIZE
inst:AddComponent("edible")
inst.components.edible.foodtype = "ORIONUPSANITY"
return inst
end
return Prefab("common/inventory/up_sanity", fn, assets) | agpl-3.0 |
ff94315/luci-1 | protocols/luci-proto-3g/luasrc/model/cbi/admin_network/proto_3g.lua | 52 | 4346 | -- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
local map, section, net = ...
local device, apn, service, pincode, username, password, dialnumber
local ipv6, maxwait, defaultroute, metric, peerdns, dns,
keepalive_failure, keepalive_interval, demand
device = section:taboption("general", Value, "device", translate("Modem device"))
device.rmempty = false
local device_suggestions = nixio.fs.glob("/dev/tty[A-Z]*")
or nixio.fs.glob("/dev/tts/*")
if device_suggestions then
local node
for node in device_suggestions do
device:value(node)
end
end
service = section:taboption("general", Value, "service", translate("Service Type"))
service:value("", translate("-- Please choose --"))
service:value("umts", "UMTS/GPRS")
service:value("umts_only", translate("UMTS only"))
service:value("gprs_only", translate("GPRS only"))
service:value("evdo", "CDMA/EV-DO")
apn = section:taboption("general", Value, "apn", translate("APN"))
pincode = section:taboption("general", Value, "pincode", translate("PIN"))
username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
password.password = true
dialnumber = section:taboption("general", Value, "dialnumber", translate("Dial number"))
dialnumber.placeholder = "*99***1#"
if luci.model.network:has_ipv6() then
ipv6 = section:taboption("advanced", ListValue, "ipv6")
ipv6:value("auto", translate("Automatic"))
ipv6:value("0", translate("Disabled"))
ipv6:value("1", translate("Manual"))
ipv6.default = "auto"
end
maxwait = section:taboption("advanced", Value, "maxwait",
translate("Modem init timeout"),
translate("Maximum amount of seconds to wait for the modem to become ready"))
maxwait.placeholder = "20"
maxwait.datatype = "min(1)"
defaultroute = section:taboption("advanced", Flag, "defaultroute",
translate("Use default gateway"),
translate("If unchecked, no default route is configured"))
defaultroute.default = defaultroute.enabled
metric = section:taboption("advanced", Value, "metric",
translate("Use gateway metric"))
metric.placeholder = "0"
metric.datatype = "uinteger"
metric:depends("defaultroute", defaultroute.enabled)
peerdns = section:taboption("advanced", Flag, "peerdns",
translate("Use DNS servers advertised by peer"),
translate("If unchecked, the advertised DNS server addresses are ignored"))
peerdns.default = peerdns.enabled
dns = section:taboption("advanced", DynamicList, "dns",
translate("Use custom DNS servers"))
dns:depends("peerdns", "")
dns.datatype = "ipaddr"
dns.cast = "string"
keepalive_failure = section:taboption("advanced", Value, "_keepalive_failure",
translate("LCP echo failure threshold"),
translate("Presume peer to be dead after given amount of LCP echo failures, use 0 to ignore failures"))
function keepalive_failure.cfgvalue(self, section)
local v = m:get(section, "keepalive")
if v and #v > 0 then
return tonumber(v:match("^(%d+)[ ,]+%d+") or v)
end
end
function keepalive_failure.write() end
function keepalive_failure.remove() end
keepalive_failure.placeholder = "0"
keepalive_failure.datatype = "uinteger"
keepalive_interval = section:taboption("advanced", Value, "_keepalive_interval",
translate("LCP echo interval"),
translate("Send LCP echo requests at the given interval in seconds, only effective in conjunction with failure threshold"))
function keepalive_interval.cfgvalue(self, section)
local v = m:get(section, "keepalive")
if v and #v > 0 then
return tonumber(v:match("^%d+[ ,]+(%d+)"))
end
end
function keepalive_interval.write(self, section, value)
local f = tonumber(keepalive_failure:formvalue(section)) or 0
local i = tonumber(value) or 5
if i < 1 then i = 1 end
if f > 0 then
m:set(section, "keepalive", "%d %d" %{ f, i })
else
m:del(section, "keepalive")
end
end
keepalive_interval.remove = keepalive_interval.write
keepalive_interval.placeholder = "5"
keepalive_interval.datatype = "min(1)"
demand = section:taboption("advanced", Value, "demand",
translate("Inactivity timeout"),
translate("Close inactive connection after the given amount of seconds, use 0 to persist connection"))
demand.placeholder = "0"
demand.datatype = "uinteger"
| apache-2.0 |
Vadavim/test | scripts/zones/Xarcabard/npcs/Heavy_Bear_IM.lua | 30 | 3041 | -----------------------------------
-- Area: Xarcabard
-- NPC: Heavy Bear, I.M.
-- Type: Border Conquest Guards
-- @pos -133.678 -22.517 112.224 112
-----------------------------------
package.loaded["scripts/zones/Xarcabard/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/conquest");
require("scripts/zones/Xarcabard/TextIDs");
local guardnation = BASTOK; -- SANDORIA, BASTOK, WINDURST, 4 = jeuno
local guardtype = 4; -- 1: city, 2: foreign, 3: outpost, 4: border
local region = VALDEAUNIA;
local csid = 0x7ff8;
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
tradeConquestGuard(player,npc,trade,guardnation,guardtype);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(getSupplyKey(region)) and player:getNation() == guardnation) then
if (supplyRunFresh(player) == 1) then
player:startEvent(csid,16,0,0,0,1,0,0,255); -- you have brought us supplies !
else
player:showText(npc, CONQUEST - 1); -- "Hmm... These supplies you have brought us are too old to be of any use."
player:delKeyItem(getSupplyKey(region));
player:messageSpecial(KEYITEM_OBTAINED + 1, getSupplyKey(region));
player:setVar("supplyQuest_region",0);
end
else
local arg1 = getArg1(guardnation, player) - 1;
if (arg1 >= 1792) then -- foreign, non-allied
player:startEvent(csid,1808,0,0,0,0,player:getRank(),0,0);
else -- citizen or allied
player:startEvent(csid,arg1,0,0x3F0000,0,0,getArg6(player),0,0);
end
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("OPTION: %u",option);
if (option == 1) then
local duration = (player:getRank() + getNationRank(player:getNation()) + 3) * 3600;
player:delStatusEffect(EFFECT_SIGIL);
player:delStatusEffect(EFFECT_SANCTION);
player:delStatusEffect(EFFECT_SIGNET);
player:addStatusEffect(EFFECT_SIGNET,0,0,duration); -- Grant Signet
elseif (option == 2) then
player:delKeyItem(getSupplyKey(region));
player:addCP(supplyReward[region + 1])
player:messageSpecial(CONQUEST); -- "You've earned conquest points!"
if (hasOutpost(player, region+5) == 0) then
local supply_quests = 2^(region+5);
player:addNationTeleport(guardnation,supply_quests);
player:setVar("supplyQuest_region",0);
end
elseif (option == 4) then
if (player:delGil(giltosetHP(guardnation,player))) then
player:setHomePoint();
player:messageSpecial(CONQUEST + 94); -- "Your home point has been set."
else
player:messageSpecial(CONQUEST + 95); -- "You do not have enough gil to set your home point here."
end
end
end; | gpl-3.0 |
hoku586/darkstar | scripts/globals/items/porcupine_pie.lua | 12 | 2061 | -----------------------------------------
-- ID: 5156
-- Item: porcupine_pie
-- Food Effect: 30Min, All Races
-----------------------------------------
-- HP 55
-- Strength 6
-- Vitality 2
-- Intelligence -3
-- Mind 3
-- HP recovered while healing 2
-- MP recovered while healing 2
-- Accuracy 5
-- Attack % 18 (cap 95)
-- Ranged Attack % 18 (cap 95)
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,5156);
end;
-----------------------------------
-- onEffectGain Action
-----------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_HP, 55);
target:addMod(MOD_STR, 6);
target:addMod(MOD_VIT, 2);
target:addMod(MOD_INT, -3);
target:addMod(MOD_MND, 3);
target:addMod(MOD_HPHEAL, 2);
target:addMod(MOD_MPHEAL, 2);
target:addMod(MOD_ACC, 5);
target:addMod(MOD_FOOD_ATTP, 18);
target:addMod(MOD_FOOD_ATT_CAP, 95);
target:addMod(MOD_FOOD_RATTP, 18);
target:addMod(MOD_FOOD_RATT_CAP, 95);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_HP, 55);
target:delMod(MOD_STR, 6);
target:delMod(MOD_VIT, 2);
target:delMod(MOD_INT, -3);
target:delMod(MOD_MND, 3);
target:delMod(MOD_HPHEAL, 2);
target:delMod(MOD_MPHEAL, 2);
target:delMod(MOD_ACC, 5);
target:delMod(MOD_FOOD_ATTP, 18);
target:delMod(MOD_FOOD_ATT_CAP, 95);
target:delMod(MOD_FOOD_RATTP, 18);
target:delMod(MOD_FOOD_RATT_CAP, 95);
end;
| gpl-3.0 |
hoku586/darkstar | scripts/zones/Qufim_Island/npcs/Giant_Footprint.lua | 14 | 1059 | -----------------------------------
-- Area: Qufim Island
-- NPC: Giant Footprint
-- Involved in quest: Regaining Trust
-- @pos 501 -11 354 126
-----------------------------------
package.loaded["scripts/zones/Qufim_Island/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Qufim_Island/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:messageSpecial(GIGANTIC_FOOTPRINT);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("updateRESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("finishRESULT: %u",option);
end; | gpl-3.0 |
Elkazan/darkstar | scripts/zones/Temenos/mobs/Goblin_Slaughterman.lua | 16 | 1072 | -----------------------------------
-- Area: Temenos N T
-- NPC: Goblin_Slaughterman
-----------------------------------
package.loaded["scripts/zones/Temenos/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/limbus");
require("scripts/zones/Temenos/TextIDs");
-----------------------------------
-- onMobSpawn Action
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobEngaged
-----------------------------------
function onMobEngaged(mob,target)
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
local mobID = mob:getID();
-- print(mobID);
local mobX = mob:getXPos();
local mobY = mob:getYPos();
local mobZ = mob:getZPos();
if (mobID ==16928773) then
GetNPCByID(16928768+18):setPos(330,70,468);
GetNPCByID(16928768+18):setStatus(STATUS_NORMAL);
elseif (mobID ==16928772) then
GetNPCByID(16928770+450):setStatus(STATUS_NORMAL);
end
end;
| gpl-3.0 |
linushsao/sky_islands_game-linus | mods/bitchange/shop.lua | 2 | 10922 | --Created by Krock for the BitChange mod
--Parts of codes, images and ideas from Dan Duncombe's exchange shop
-- https://forum.minetest.net/viewtopic.php?id=7002
--License: WTFPL
local exchange_shop = {}
local function has_exchange_shop_privilege(meta, player)
local player_name = player:get_player_name()
return ((player_name == meta:get_string("owner")) or minetest.get_player_privs(player_name).server)
end
local function get_exchange_shop_formspec(number,pos,title)
local formspec = ""
local name = "nodemeta:"..pos.x..","..pos.y..","..pos.z
if(number == 1) then
-- customer
formspec = ("size[8,9;]"..
"label[0,0;Exchange shop]"..
"label[1,0.5;Owner needs:]"..
"list["..name..";cust_ow;1,1;2,2;]"..
"button[3,2.5;2,1;exchange;Exchange]"..
"label[5,0.5;Owner gives:]"..
"list["..name..";cust_og;5,1;2,2;]"..
"label[1,3.5;Ejected items:]"..
"list["..name..";cust_ej;3,3.5;4,1;]"..
"list[current_player;main;0,5;8,4;]")
elseif(number == 2 or number == 3) then
-- owner
formspec = ("size[11,10;]"..
"label[0,0;Exchange shop]"..
"field[2.5,0.5;3,0.2;title;;"..title.."]"..
"label[0,0.7;You need:]"..
"list["..name..";cust_ow;0,1.2;2,2;]"..
"label[3,0.7;You give:]"..
"list["..name..";cust_og;3,1.2;2,2;]"..
"label[1,3.5;Ejected items:]"..
"list["..name..";custm_ej;0,4;4,1;]"..
"label[6,0;You are viewing:]")
if(number == 2) then
formspec = (formspec.."button[8.5,0;2.5,1;vstock;Customers stock]"..
"list["..name..";custm;6,1;5,4;]")
else
formspec = (formspec.."button[8.5,0;2.5,1;vcustm;Your stock]"..
"list["..name..";stock;6,1;5,4;]")
end
formspec = (formspec..
"label[1,5;Use (E) + (Right click) for customer interface]"..
"list[current_player;main;1,6;8,4;]")
end
return formspec
end
local function get_exchange_shop_tube_config(mode)
if(bitchange_exchangeshop_pipeworks) then
if(mode == 1) then
return {choppy=2, oddly_breakable_by_hand=2, tubedevice=1, tubedevice_receiver=1}
else
return {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:add_item("stock",stack)
end,
can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
return inv:room_for_item("stock",stack)
end,
input_inventory="custm",
connect_sides = {left=1, right=1, back=1, top=1, bottom=1}
}
end
else
if(mode == 1) then
return {choppy=2,oddly_breakable_by_hand=2}
else
return {
insert_object = function(pos, node, stack, direction)
return false
end,
can_insert = function(pos, node, stack, direction)
return false
end,
connect_sides = {}
}
end
end
end
minetest.register_on_player_receive_fields(function(sender, formname, fields)
if (formname == "bitchange:shop_formspec") then
local player_name = sender:get_player_name()
local pos = exchange_shop[player_name]
local meta = minetest.get_meta(pos)
local title = meta:get_string("title") or ""
if(fields.exchange) then
local player_inv = sender:get_inventory()
local shop_inv = meta:get_inventory()
local err_msg = ""
local cust_ow = shop_inv:get_list("cust_ow")
local cust_og = shop_inv:get_list("cust_og")
local cust_ow_legal = true
local cust_og_legal = true
--?shop configured well
for i1, item1 in pairs(cust_ow) do
for i2, item2 in pairs(cust_ow) do
if (item1:get_name() == item2:get_name() and i1 ~= i2 and item1:get_name() ~= "") then
cust_ow_legal = false
--break
end
end
if(not cust_ow_legal) then
break
end
end
if(not cust_ow_legal) then
err_msg = "The 'Owner needs' field can not contain multiple times the same items, contact the shop owner."
end
if(err_msg == "") then --?shop configured well
for i1, item1 in pairs(cust_og) do
for i2, item2 in pairs(cust_og) do
if (item1:get_name() == item2:get_name() and i1 ~= i2 and item1:get_name() ~= "") then
cust_og_legal = false
break
end
end
if(not cust_og_legal) then
break
end
end
if(not cust_og_legal) then
err_msg = "The 'Owner gives' field can not contain multiple times the same items, contact the shop owner."
end
end
if(err_msg == "") then --?player has space
local player_has_space = true
for i, item in pairs(cust_og) do
if (not player_inv:room_for_item("main",item)) then
player_has_space = false
break
end
end
if(not player_has_space) then
err_msg = "You do not have the space in your inventory."
end
end
if(err_msg == "") then --?player has items
local player_has_items = true
for i, item in pairs(cust_ow) do
if (not player_inv:contains_item("main",item)) then
player_has_items = false
break
end
end
if(not player_has_items) then
err_msg = "You do not have the needed items."
end
end
if(err_msg == "") then --?shop has space
local shop_has_space = true
for i, item in pairs(cust_ow) do
if (not shop_inv:room_for_item("custm",item)) then
shop_has_space = false
break
end
end
if(not shop_has_space) then
err_msg = "Exchange shop: The stock in the shop is full."
end
end
if(err_msg == "") then --?shop has items
local shop_has_items = true
for i, item in pairs(cust_og) do
if (not shop_inv:contains_item("stock",item)) then
shop_has_items = false
break
end
end
if(not shop_has_items) then
err_msg = "The shop is empty and can not give you anything."
end
end
if(err_msg == "") then --?exchange
local fully_exchanged = true
for i, item in pairs(cust_ow) do
player_inv:remove_item("main", item) --player inv. to stock else to eject fields
if (shop_inv:room_for_item("custm",item)) then
shop_inv:add_item("custm", item)
else
shop_inv:add_item("custm_ej", item)
fully_exchanged = false
end
end
for i, item in pairs(cust_og) do
shop_inv:remove_item("stock", item) --stock to player inv. else to eject fields
if (player_inv:room_for_item("main",item)) then
player_inv:add_item("main", item)
else
shop_inv:add_item("cust_ej", item)
fully_exchanged = false
end
end
if(not fully_exchanged) then
err_msg = "Fatal error! Stocks are overflowing somewhere!"
end
end
if(err_msg ~= "") then
minetest.chat_send_player(player_name, "Exchange shop: "..err_msg)
end
elseif(fields.vstock and has_exchange_shop_privilege(meta, sender) and not fields.quit) then
minetest.show_formspec(sender:get_player_name(),"bitchange:shop_formspec",get_exchange_shop_formspec(3, pos, title))
elseif(fields.vcustm and has_exchange_shop_privilege(meta, sender) and not fields.quit) then
minetest.show_formspec(sender:get_player_name(),"bitchange:shop_formspec",get_exchange_shop_formspec(2, pos, title))
elseif(fields.quit and has_exchange_shop_privilege(meta, sender)) then
if(fields.title and title ~= fields.title) then
if(fields.title ~= "") then
meta:set_string("infotext", "Exchange shop \""..fields.title.."\" (owned by "..
meta:get_string("owner")..")")
else
meta:set_string("infotext", "Exchange shop (owned by "..
meta:get_string("owner")..")")
end
meta:set_string("title", fields.title)
end
end
end
end)
minetest.register_node("bitchange:shop", {
description = "Shop",
tiles = {"bitchange_shop_top.png", "bitchange_shop_top.png",
"bitchange_shop_side.png", "bitchange_shop_side.png",
"bitchange_shop_side.png", "bitchange_shop_front.png"},
paramtype2 = "facedir",
groups = get_exchange_shop_tube_config(1),
tube = get_exchange_shop_tube_config(2),
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name())
meta:set_string("infotext", "Exchange shop (owned by "..
meta:get_string("owner")..")")
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", "Exchange shop (constructing)")
meta:set_string("formspec", "")
meta:set_string("owner", "")
local inv = meta:get_inventory()
inv:set_size("stock", 5*4) -- needed stock for exchanges
inv:set_size("custm", 5*4) -- stock of the customers exchanges
inv:set_size("custm_ej", 4) -- ejected items if shop has no inventory room
inv:set_size("cust_ow", 2*2) -- owner wants
inv:set_size("cust_og", 2*2) -- owner gives
inv:set_size("cust_ej", 4) -- ejected items if player has no inventory room
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
if(inv:is_empty("stock") and inv:is_empty("custm") and inv:is_empty("custm_ej") and inv:is_empty("cust_ow") and inv:is_empty("cust_og") and inv:is_empty("cust_ej")) then
return true
else
minetest.chat_send_player(player:get_player_name(), "Can not dig exchange shop, one or multiple stocks are in use.")
return false
end
end,
on_rightclick = function(pos, node, clicker, itemstack)
local meta = minetest.get_meta(pos)
local player_name = clicker:get_player_name()
local view = 0
exchange_shop[player_name] = pos
if player_name == meta:get_string("owner") then
if(clicker:get_player_control().aux1) then
view = 1
else
view = 2
end
else
view = 1
end
minetest.show_formspec(player_name,"bitchange:shop_formspec",get_exchange_shop_formspec(view, pos, meta:get_string("title")))
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if (not has_exchange_shop_privilege(meta, player)) then
return 0
end
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if (has_exchange_shop_privilege(meta, player) and (listname ~= "cust_ej") and (listname ~= "custm_ej")) then
return stack:get_count()
end
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if (has_exchange_shop_privilege(meta, player) or (listname == "cust_ej")) then
return stack:get_count()
end
return 0
end,
})
minetest.register_craft({
output = 'bitchange:shop',
recipe = {
{'default:sign_wall'},
{'default:chest_locked'},
}
}) | gpl-3.0 |
27629678/cinderella | huiguniang/scripts/app/views/BubbleButton.lua | 1 | 1675 |
local BubbleButton = {}
-- create bubble button
function BubbleButton.new(params)
local button -- pre-reference
--button = ui.newImageMenuItem(params)
button = display.newSprite(params.image, params.x, params.y)
button.bubble = function()
local function zoom1(offset, time, onComplete)
local x, y = button:getPosition()
local size = button:getContentSize()
local scaleX = button:getScaleX() * (size.width + offset) / size.width
local scaleY = button:getScaleY() * (size.height - offset) / size.height
transition.moveTo(button, {y = y - offset, time = time})
transition.scaleTo(button, {
scaleX = scaleX,
scaleY = scaleY,
time = time,
onComplete = onComplete,
})
end
local function zoom2(offset, time, onComplete)
local x, y = button:getPosition()
local size = button:getContentSize()
transition.moveTo(button, {y = y + offset, time = time / 2})
transition.scaleTo(button, {
scaleX = 1.0,
scaleY = 1.0,
time = time,
onComplete = onComplete,
})
end
zoom1(40, 0.08, function()
zoom2(40, 0.09, function()
zoom1(20, 0.10, function()
zoom2(20, 0.11, function()
end)
end)
end)
end)
end
return button
end
return BubbleButton
| apache-2.0 |
prineside/mtaw | resources/MTAW/server/account.lua | 1 | 16210 | --------------------------------------------------------------------------------
--<[ Общие события ]>-----------------------------------------------------------
--------------------------------------------------------------------------------
addEvent( "Account.onPlayerLogIn", false ) -- Игрок вошел в аккаунт ( player playerElement, number accountID )
addEvent( "Account.onPlayerLogOut", false ) -- Игрок вышел из аккаунта ( player playerElement, number accountID )
--------------------------------------------------------------------------------
--<[ Внутренние события ]>------------------------------------------------------
--------------------------------------------------------------------------------
addEvent( "Account.onClientLogInAttempt", true ) -- Попытка войти на сервер ( string login, string password )
addEvent( "Account.onClientLogOutAttempt", true ) -- Попытка выйти из сервера ()
--------------------------------------------------------------------------------
--<[ Модуль Account ]>----------------------------------------------------------
--------------------------------------------------------------------------------
Account = {
idInstances = {}; -- ID аккаунта => данные аккаунта (+idInstances[id].playerElement)
accountPermissions = {}; -- ID аккаунта => права
accountPermissionsKeys = {}; -- ID аккаунта => таблица с ключами прав
idByPlayerElement = {}; -- playerElement => ID аккаунта
init = function()
addEventHandler( "Main.onServerLoad", root, Account.onServerLoad )
addEventHandler( "onPlayerJoin", root, Account.onPlayerJoin )
addEventHandler( "onPlayerQuit", root, Account.onPlayerQuit )
addEventHandler( "Main.onClientLoad", root, Account.onClientLoad )
addEventHandler( "Account.onClientLogInAttempt", root, Account.onClientLogInAttempt )
addEventHandler( "Account.onClientLogOutAttempt", root, Account.onClientLogOutAttempt )
Main.setModuleLoaded( "Account", 1 )
end;
onServerLoad = function()
end;
----------------------------------------------------------------------------
-- Возвращает true, если игрок вошел в аккаунт
-- > playerElement player
-- = bool isLogined
isLogined = function( playerElement )
if not validVar( playerElement, "playerElement", "player" ) then return nil end
return ( Account.idByPlayerElement[ playerElement ] ~= nil )
end;
-- Есть ли игрок с таким ID аккаунта на сервере
-- > accountID number
-- = bool accountIdLogined
isAccountIdLogined = function( accountID )
return Account.idInstances[ accountID ] ~= nil
end;
-- Установить аккаунт игроку (авторизация игрока). Возвращает false, если аккаунт не существует
-- > playerElement player
-- > accountID number - ID аккаунта сети Prineside
-- = bool loginResult
setLoggedIn = function( playerElement, accountID )
if not validVar( playerElement, "playerElement", "player" ) then return nil end
if not validVar( accountID, "accountID", "number" ) then return nil end
if ( Account.isLogined( playerElement ) ) then
Account.destroyAuthData( playerElement, true )
end
local accountData = Account.getDataFromDB( accountID )
if ( accountData ~= nil ) then
if ( Account.idInstances[ accountData.id ] ~= nil ) then
Debug.error( "Account " .. accountID .. " already logged in" )
return false
end
setPlayerName( playerElement, accountData.login )
local accountPermissions = Account.getPermissionsFromDB( accountID )
accountData.playerElement = playerElement
Account.idByPlayerElement[ playerElement ] = accountData.id
Account.idInstances[ accountData.id ] = accountData
Account.accountPermissions[ accountData.id ] = accountPermissions
Account.accountPermissionsKeys[ accountData.id ] = {}
for k, v in pairs( accountPermissions ) do
Account.accountPermissionsKeys[ accountData.id ][ v ] = true
end
triggerEvent( "Account.onPlayerLogIn", resourceRoot, playerElement, accountID )
Account.updateClientData( playerElement )
-- Сохранение сессии
DB.syncQuery( "DELETE FROM mtaw.session WHERE ip = '" .. getPlayerIP( playerElement ) .. "' AND serial = '" .. getPlayerSerial( playerElement ) .. "';" )
DB.syncQuery( "INSERT INTO mtaw.session (account, login, ip, serial, date) VALUES (" .. accountID .. ", '" .. DB.escapeString( accountData.login ) .. "', '" .. getPlayerIP( playerElement ) .. "', '" .. getPlayerSerial( playerElement ) .. "', " .. Time.getServerTimestamp() .. ");" )
return true
else
Debug.error( "Account " .. accountID .. " not exists" )
return false
end
end;
-- Имеет ли игрок право (если не вошел, не имеет ни одного). Возвращает true, если игрок вошел в аккаунт и аккаунт имеет указанное право
-- > playerElement player
-- > perm string - алиас права из таблицы permission
-- = bool hasPermission
hasPermission = function( playerElement, perm )
if ( Account.isLogined( playerElement ) ) then
if ( perm == "none" ) then
return true
else
return Account.accountPermissionsKeys[ Account.idByPlayerElement[ playerElement ] ][ perm ] ~= nil
end
else
return false
end
end;
-- Получить данные аккаунта игрока. Если key не указан, возвращает таблицу со всеми данными. Если игрок не вошел или таких данных нет, возвращает nil
-- > playerElement player
-- > key string / nil - название данных (например, login). Если не указано, возвращает таблицу со всеми данными
-- = string / table / nil accountData
getData = function( playerElement, key )
if not validVar( playerElement, "playerElement", "player" ) then return nil end
if not validVar( key, "key", { "string", "nil" } ) then return nil end
if ( not Account.isLogined( playerElement ) ) then
return nil
else
if ( key == nil ) then
return Account.idInstances[ Account.idByPlayerElement[ playerElement ] ]
else
return Account.idInstances[ Account.idByPlayerElement[ playerElement ] ][ key ]
end
end
end;
-- Получить все данные аккаунта по ID из базы или nil, если такого аккаунта нет
-- > accountID number
-- = table / nil accountData
getDataFromDB = function( accountID )
if not validVar( accountID, "accountID", "number" ) then return nil end
local isSuccess, result = DB.syncQuery( "SELECT * FROM mtaw.accounts WHERE id = " .. tonumber( accountID ) )
if ( not isSuccess ) then return nil end
if ( result[1] ~= nil ) then
local data = {}
for k, v in pairs( result[1] ) do
data[ k ] = v
end
return data
else
return nil
end
end;
-- Получить права аккаунта по ID из базы
-- > accountID number
-- = table accountPermissions
getPermissionsFromDB = function( accountID )
if not validVar( accountID, "accountID", "number" ) then return nil end
local isSuccess, result = DB.syncQuery( "SELECT permission FROM mtaw.account_permission WHERE account = " .. accountID )
if ( not isSuccess ) then return nil end
if ( result[1] ~= nil ) then
local data = {}
for k, v in pairs( result ) do
table.insert( data, v.permission )
end
return data
else
return {}
end
end;
-- Удалить данные об аутентификации и сделать игрока гостем
-- > playerElement player
-- > destroySession bool / nil - удалить сессию (игрок не войдет автоматически при входе), по умолчанию false
-- = void
destroyAuthData = function( playerElement, destroySession )
if not validVar( playerElement, "playerElement", "player" ) then return nil end
if ( destroySession == nil ) then destroySession = false end
if ( Account.isLogined( playerElement ) ) then
local accountID = Account.idByPlayerElement[ playerElement ]
Account.idInstances[ accountID ] = nil
Account.idByPlayerElement[ playerElement ] = nil
triggerEvent( "Account.onPlayerLogOut", resourceRoot, playerElement, accountID )
if ( destroySession ) then
Account.removeLoginSession( playerElement )
end
Account.updateClientData( playerElement )
setPlayerName( playerElement, "Mystery-ID-" .. tostring( Playerid.getID( playerElement ) ) )
Account.unload( playerElement ) -- Сохраняем и выгружаем из памяти
end
end;
-- Выгрузить данные об аккаунте и освободить память. Возвращает false, если игрок не входил в аккаунт
-- Ничего не сохраняется в базу!
-- > playerElement player
-- = bool isUnloaded
unload = function( playerElement )
if not validVar( playerElement, "playerElement", "player" ) then return nil end
if ( Account.isLogined( playerElement ) ) then
-- Вошел в аккаунт
Account.idInstances[ Account.idByPlayerElement[ playerElement ] ] = nil
Account.accountPermissions[ Account.idByPlayerElement[ playerElement ] ] = nil
Account.accountPermissionsKeys[ Account.idByPlayerElement[ playerElement ] ] = nil
Account.idByPlayerElement[ playerElement ] = nil
return true
else
return false
end
end;
-- Получить ID аккаунта игрока или nil
-- > playerElement player
-- = number / nil accountID
getAccountID = function( playerElement )
if not validVar( playerElement, "playerElement", "player" ) then return nil end
if ( Account.isLogined( playerElement ) ) then
return Account.idByPlayerElement[ playerElement ]
else
return nil
end
end;
-- Получить права аккаунта (таблица)
-- > playerElement player
-- = table / nil accountPermissions
getPermissions = function( playerElement )
if not validVar( playerElement, "playerElement", "player" ) then return nil end
if ( Account.isLogined ) then
return Account.accountPermissions[ Account.idByPlayerElement[ playerElement ] ]
else
return nil
end
end;
-- Обновить все данные об аккаунте на клиенте (данные аккаунта и права)
-- > playerElement player
-- = void
updateClientData = function( playerElement )
triggerClientEvent( playerElement, "Account.onServerUpdateData", resourceRoot, Account.getData( playerElement ), Account.getPermissions( playerElement ) )
end;
-- Проверка логина и пароля на правильность. Возвращает false и ошибку или true и ID аккаунта
-- > login string
-- > password string
-- = bool isValid, string / number accountIdOrError
isValidCredentials = function( login, password )
local isSuccess, result = DB.syncQuery( "SELECT id, hash, blowfish FROM mtaw.accounts WHERE login LIKE '" .. DB.escapeString( login ) .. "'" )
if ( not isSuccess ) then return nil end
if ( result[1] ~= nil ) then
local hash = md5( string.lower( md5( password ) ) .. result[1].blowfish )
Debug.info( hash .. " " .. result[1].hash )
if ( string.upper( result[1].hash ) == hash ) then
return true, result[1].id
else
return false, "Неправильный пароль"
end
else
return false, "Аккаунт не найден"
end
end;
-- Получить сессию входа (по IP и серийному номеру)
-- > playerElement player
-- = table / nil sessionData
getLoginSession = function( playerElement )
local isSuccess, result = DB.syncQuery( "SELECT * FROM mtaw.session WHERE ip = '" .. getPlayerIP( playerElement ) .. "' AND serial = '" .. getPlayerSerial( playerElement ) .. "';" )
if ( not isSuccess ) then return nil end
if ( result[1] ~= nil ) then
local data = {}
for k, v in pairs( result[1] ) do
data[ k ] = v
end
return data
else
return nil
end
end;
-- Удалить сессию входа
-- > playerElement player
-- = void
removeLoginSession = function( playerElement )
DB.syncQuery( "DELETE FROM mtaw.session WHERE ip = '" .. getPlayerIP( playerElement ) .. "' AND serial = '" .. getPlayerSerial( playerElement ) .. "';" )
end;
----------------------------------------------------------------------------
--<[ Обработчики событий ]>-------------------------------------------------
----------------------------------------------------------------------------
-- Игрок вошел на сервер
onPlayerJoin = function()
-- Убираем никнейм
setPlayerName( source, "Mystery-ID-" .. Playerid.getID( source ) )
-- Скрываем неймтег
setPlayerNametagShowing( source, false )
end;
-- Игрок вышел из сервера
onPlayerQuit = function()
-- Удаляем данные аккаунта, но не удаляем сессию
Account.destroyAuthData( source, false )
end;
-- Клиент загрузился
onClientLoad = function( loadedClient )
-- Проверяем сессию входа. Продолжаем ее или показываем форму входа (за это отвечает клиент)
local loginSession = Account.getLoginSession( loadedClient )
if ( loginSession ~= nil ) then
-- Есть сессия, возможно, будет автоматический вход
if ( not Account.isAccountIdLogined( loginSession.account ) ) then
-- Автоматический вход
Popup.show( loadedClient, "Вы автоматически вошли в аккаунт " .. loginSession.login, "success" )
Account.setLoggedIn( loadedClient, loginSession.account )
else
-- Игрок с таким логином уже вошел на сервер, вход отменен
Popup.show( loadedClient, "Игрок с логином " .. loginSession.login .. " уже вошел на сервер, автоматический вход отменен", "warning" )
end
end
end;
-- Игрок client сделал попытку войти в аккаунт
onClientLogInAttempt = function( login, password )
Debug.info( "Client " .. tostring( login ) .. " made attempt to log in with password " .. password )
if ( not Account.isLogined( client ) ) then
local isValid, accountIDorError = Account.isValidCredentials( login, password )
if ( isValid ) then
local accountID = accountIDorError
local accountData = Account.getDataFromDB( accountID )
if ( accountData.tester == 1 ) then
if ( not Account.isAccountIdLogined( accountID ) ) then
Popup.show( client, "Вы вошли в аккаунт " .. login, "success" )
Account.setLoggedIn( client, accountID )
else
Popup.show( client, "Игрок с таким логином уже играет на сервере", "error" )
end
else
Popup.show( client, "У вас нет доступа на ЗБТ", "error" )
end
else
Popup.show( client, accountIDorError, "error" )
end
else
Popup.show( client, "Вы уже вошли в аккаунт", "error" )
end
end;
-- Игрок client сделал попытку выйти из аккаунта
onClientLogOutAttempt = function()
if ( Account.isLogined( client ) ) then
Account.destroyAuthData( client, true )
Popup.show( client, "Вы вышли из сервера", "success" )
else
Popup.show( client, "Вы еще не вошли в аккаунт", "error" )
end
end;
};
addEventHandler( "onResourceStart", resourceRoot, Account.init ) | mit |
ctakemoto/Human-Controlled-Naos | Player/Motion/keyframes/km_Nao_KickForwardRight_old.lua | 19 | 5537 | local mot = {};
mot.servos = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22};
mot.keyframes = {
{
angles = {-0.052, 0.051, 0.911, 0.661, -0.512, -0.827, -0.232, -0.011, -0.387, 1.355, -0.779, 0.048, -0.232, -0.023, -0.357, 1.338, -0.792, 0.003, 1.226, -0.457, 1.300, 0.391, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.800;
},
{
angles = {-0.048, 0.043, 0.924, 1.000, -0.514, -0.833, 0.000, -0.387, -0.425, 0.851, -0.419, 0.420, 0.000, -0.327, -0.400, 1.000, -0.570, 0.300, 1.239, -0.600, 0.015, 0.405, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 1.000;
},
{
angles = {-0.048, 0.043, 0.924, 1.000, -0.514, -0.833, 0.000, -0.387, -0.425, 0.851, -0.419, 0.420, 0.000, -0.327, -0.300, 0.900, -0.600, 0.340, 1.239, -0.600, 0.015, 0.405, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.400;
},
{
angles = {-0.052, 0.051, 0.911, 1.000, -0.512, -0.827, 0.020, -0.391, -0.423, 0.842, -0.416, 0.420, 0.020, -0.396, -0.150, 1.594, -1.094, 0.051, 1.226, -0.600, 0.017, 0.391, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.900;
},
{
angles = {-0.052, 0.051, 0.911, 1.000, -0.512, -0.827, 0.020, -0.391, -0.423, 0.842, -0.416, 0.420, 0.020, -0.396, -0.150, 1.594, -1.094, 0.051, 1.226, -0.600, 0.017, 0.391, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.600;
},
{
angles = {-0.043, 0.041, 0.908, 1.000, -0.512, -0.827, 0.023, -0.393, -0.420, 0.838, -0.420, 0.420, 0.023, -0.399, -1.000, 1.300, -0.450, 0.296, 1.855, -0.600, 0.020, 0.393, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.120;
},
{
angles = {-0.043, 0.041, 0.908, 1.000, -0.512, -0.827, 0.023, -0.393, -0.420, 0.838, -0.420, 0.420, 0.023, -0.399, -0.960, 1.106, -0.589, 0.296, 1.855, -0.600, 0.020, 0.393, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.140;
},
{
angles = {-0.044, 0.041, 0.908, 1.000, -0.512, -0.827, 0.014, -0.393, -0.423, 0.841, -0.423, 0.420, 0.014, -0.393, -0.957, 1.483, -0.578, 0.296, 1.853, -0.600, 0.020, 0.393, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.180;
},
{
angles = {-0.044, 0.041, 0.908, 1.000, -0.512, -0.828, 0.015, -0.393, -0.423, 0.839, -0.423, 0.420, 0.015, -0.394, -0.957, 1.483, -0.578, 0.296, 1.853, -0.600, 0.020, 0.393, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.200;
},
{
angles = {-0.048, 0.043, 0.924, 1.000, -0.514, -0.833, 0.000, -0.387, -0.425, 0.851, -0.419, 0.420, 0.000, -0.327, -0.400, 1.000, -0.570, 0.300, 1.239, -0.600, 0.015, 0.405, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.700;
},
{
angles = {-0.051, 0.043, 0.911, 0.669, -0.512, -0.816, -0.232, -0.006, -0.377, 1.356, -0.776, 0.048, -0.232, -0.022, -0.354, 1.342, -0.792, -0.002, 1.227, -0.459, 0.017, 0.393, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.600;
},
{
angles = {-0.000, -0.436, 2.094, 0.349, -1.789, -1.396, -0.000, 0.017, -0.757, 1.491, -0.734, -0.017, 0.000, -0.017, -0.757, 1.491, -0.734, 0.017, 2.094, -0.349, 1.300, 1.396, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.700;
},
{
angles = {-0.000, -0.436, 2.094, 0.349, -1.789, -1.396, -0.000, 0.017, -0.757, 1.491, -0.734, -0.017, 0.000, -0.017, -0.757, 1.491, -0.734, 0.017, 2.094, -0.349, 1.300, 1.396, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 0.300;
},
{
angles = {-0.066, -0.678, 1.468, 0.229, -1.273, -0.305, 0.000, -0.003, -0.396, 0.946, -0.548, 0.002, 0.000, 0.026, -0.397, 0.945, -0.548, -0.025, 1.494, -0.253, 1.216, 0.502, },
stiffness = {0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 1.000, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, },
duration = 1.000;
},
};
return mot;
| gpl-3.0 |
mgooty/kong | spec/plugins/ratelimiting/access_spec.lua | 13 | 7363 | local spec_helper = require "spec.spec_helpers"
local http_client = require "kong.tools.http_client"
local cjson = require "cjson"
local STUB_GET_URL = spec_helper.STUB_GET_URL
local function wait()
-- Wait til the beginning of a new second before starting the test
-- to avoid ending up in an edge case when the second is about to end
local now = os.time()
while os.time() < now + 1 do
-- Nothing
end
end
describe("RateLimiting Plugin", function()
setup(function()
spec_helper.prepare_db()
spec_helper.insert_fixtures {
api = {
{ name = "tests ratelimiting 1", public_dns = "test3.com", target_url = "http://mockbin.com" },
{ name = "tests ratelimiting 2", public_dns = "test4.com", target_url = "http://mockbin.com" },
{ name = "tests ratelimiting 3", public_dns = "test5.com", target_url = "http://mockbin.com" },
{ name = "tests ratelimiting 4", public_dns = "test6.com", target_url = "http://mockbin.com" }
},
consumer = {
{ custom_id = "provider_123" },
{ custom_id = "provider_124" }
},
plugin_configuration = {
{ name = "keyauth", value = {key_names = {"apikey"}, hide_credentials = true}, __api = 1 },
{ name = "ratelimiting", value = { minute = 6 }, __api = 1 },
{ name = "ratelimiting", value = { minute = 8 }, __api = 1, __consumer = 1 },
{ name = "ratelimiting", value = { minute = 6 }, __api = 2 },
{ name = "ratelimiting", value = { minute = 3, hour = 5 }, __api = 3 },
{ name = "ratelimiting", value = { minute = 33 }, __api = 4 }
},
keyauth_credential = {
{ key = "apikey122", __consumer = 1 },
{ key = "apikey123", __consumer = 2 }
}
}
-- Updating API test6.com with old plugin value, to check retrocompatibility
local dao_factory = spec_helper.get_env().dao_factory
-- Find API
local res, err = dao_factory.apis:find_by_keys({public_dns = 'test6.com'})
if err then error(err) end
-- Find Plugin Configuration
local res, err = dao_factory.plugins_configurations:find_by_keys({api_id = res[1].id})
if err then error(err) end
-- Set old value
local plugin_configuration = res[1]
plugin_configuration.value = {
period = "minute",
limit = 6
}
-- Update plugin configuration
local _, err = dao_factory.plugins_configurations:execute(
"update plugins_configurations SET value = '{\"limit\":6, \"period\":\"minute\"}' WHERE id = "..plugin_configuration.id.." and name = 'ratelimiting'")
if err then error(err) end
spec_helper.start_kong()
end)
teardown(function()
spec_helper.stop_kong()
end)
describe("Without authentication (IP address)", function()
it("should get blocked if exceeding limit", function()
wait()
-- Default ratelimiting plugin for this API says 6/minute
local limit = 6
for i = 1, limit do
local _, status, headers = http_client.get(STUB_GET_URL, {}, {host = "test4.com"})
assert.are.equal(200, status)
assert.are.same(tostring(limit), headers["x-ratelimit-limit-minute"])
assert.are.same(tostring(limit - i), headers["x-ratelimit-remaining-minute"])
end
-- Additonal request, while limit is 6/minute
local response, status = http_client.get(STUB_GET_URL, {}, {host = "test4.com"})
local body = cjson.decode(response)
assert.are.equal(429, status)
assert.are.equal("API rate limit exceeded", body.message)
end)
it("should handle multiple limits", function()
local limits = {
minute = 3,
hour = 5
}
wait()
for i = 1, 3 do
local _, status, headers = http_client.get(STUB_GET_URL, {}, {host = "test5.com"})
assert.are.equal(200, status)
assert.are.same(tostring(limits.minute), headers["x-ratelimit-limit-minute"])
assert.are.same(tostring(limits.minute - i), headers["x-ratelimit-remaining-minute"])
assert.are.same(tostring(limits.hour), headers["x-ratelimit-limit-hour"])
assert.are.same(tostring(limits.hour - i), headers["x-ratelimit-remaining-hour"])
end
local response, status, headers = http_client.get(STUB_GET_URL, {}, {host = "test5.com"})
assert.are.equal("2", headers["x-ratelimit-remaining-hour"])
assert.are.equal("0", headers["x-ratelimit-remaining-minute"])
local body = cjson.decode(response)
assert.are.equal(429, status)
assert.are.equal("API rate limit exceeded", body.message)
end)
end)
describe("With authentication", function()
describe("Old plugin format", function()
it("should get blocked if exceeding limit", function()
wait()
-- Default ratelimiting plugin for this API says 6/minute
local limit = 6
for i = 1, limit do
local _, status, headers = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host = "test6.com"})
assert.are.equal(200, status)
assert.are.same(tostring(limit), headers["x-ratelimit-limit"])
assert.are.same(tostring(limit - i), headers["x-ratelimit-remaining"])
end
-- Third query, while limit is 2/minute
local response, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host = "test6.com"})
local body = cjson.decode(response)
assert.are.equal(429, status)
assert.are.equal("API rate limit exceeded", body.message)
end)
end)
describe("Default plugin", function()
it("should get blocked if exceeding limit", function()
wait()
-- Default ratelimiting plugin for this API says 6/minute
local limit = 6
for i = 1, limit do
local _, status, headers = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host = "test3.com"})
assert.are.equal(200, status)
assert.are.same(tostring(limit), headers["x-ratelimit-limit-minute"])
assert.are.same(tostring(limit - i), headers["x-ratelimit-remaining-minute"])
end
-- Third query, while limit is 2/minute
local response, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host = "test3.com"})
local body = cjson.decode(response)
assert.are.equal(429, status)
assert.are.equal("API rate limit exceeded", body.message)
end)
end)
describe("Plugin customized for specific consumer", function()
it("should get blocked if exceeding limit", function()
wait()
-- This plugin says this consumer can make 4 requests/minute, not 6 like the default
local limit = 8
for i = 1, limit do
local _, status, headers = http_client.get(STUB_GET_URL, {apikey = "apikey122"}, {host = "test3.com"})
assert.are.equal(200, status)
assert.are.same(tostring(limit), headers["x-ratelimit-limit-minute"])
assert.are.same(tostring(limit - i), headers["x-ratelimit-remaining-minute"])
end
local response, status = http_client.get(STUB_GET_URL, {apikey = "apikey122"}, {host = "test3.com"})
local body = cjson.decode(response)
assert.are.equal(429, status)
assert.are.equal("API rate limit exceeded", body.message)
end)
end)
end)
end)
| mit |
prineside/mtaw | resources/hedit/client/gui/guievents.lua | 2 | 13733 | local abs = math.abs
local scrollbarColor = tocolor(255, 255, 255, 50)
local SCROLLBAR_THRESHOLD = 10 -- in pixels
function onMove ( _, _, cX, cY )
if not (pressedButton and scrollbar and tobool(getUserConfig("dragmeterEnabled"))) then return end
if not scrollbar.thresholdReached then
if not( abs(scrollbar.clickX - cX) > SCROLLBAR_THRESHOLD )then return end
-- execute belowif outside threshold...
scrollbar.thresholdReached = true
showScrollbar = true
-- Calculate virtual scrollbar x value (is the originX-(width/2)
scrollbar.virtualX = cX - (scrollbar.size[1]*scrollbar.position)
scrollbar.virtualX2 = scrollbar.virtualX + scrollbar.size[1]
end
local progress = (cX-scrollbar.virtualX)/(scrollbar.virtualX2-scrollbar.virtualX)
if (progress >= 0) and (progress <= 1) then
scrollbar.position = progress
local a, b = scrollbar.min, scrollbar.max
local propertyValue = progress*(b-a)+a
guiSetText(pressedButton, math.round(propertyValue, 0))
else
-- Allow overflows to snap to nearest boundary
guiSetText(pressedButton, (progress < 0) and scrollbar.min or scrollbar.max)
end
end
function onRender()
if showScrollbar and scrollbar then
local x, y = unpack(pressedButtonPosition)
local width = scrollbar.position * scrollbar.size[1]
-- Draw scroll box
dxDrawRectangle(x, y, width, scrollbar.size[2], scrollbarColor, true)
-- Draw pin point
dxDrawLine(x+width, y, x+width, y-5, tocolor(255, 0, 0, 255), 3, true)
-- DEBUG: Draw bounding box
Debug.dxDrawRectangle(scrollbar.virtualX, y+20, scrollbar.size[1], scrollbar.size[2], scrollbar.color, true)
else
showScrollbar = false
end
end
function onClick ( button, state )
if pressedButton then
local buttonText, abort = guiGetText(pressedButton)
if scrollbar and (scrollbar.old ~= buttonText) and isElement(pVehicle) then
prepareHandlingValue(pVehicle, guiGetElementProperty(pressedButton), buttonText)
abort = true
end
scrollbar = nil
pressedButton = nil
pressedButtonPosition = nil
if abort then return end
end
if not pointedButton then return end
local source = pointedButton
local parent = guiGetElementParent ( source )
local event = guiGetElementEvents ( source )
local info = guiGetElementInfo ( source )
local state = (state == "down") and true or false
if state and (button == "left") and (parent == "viewItem") and tobool(getUserConfig("dragmeterEnabled")) then
local inputType = guiGetElementInputType ( source )
local property = guiGetElementProperty ( source )
if not property then return end
local propertyType = getHandlingPropertyValueType ( property )
-- Limit propertyType to float/integer
if (inputType == "config") and (propertyType == "Float") or (propertyType == "Integer") then
local mx, my = getCursorPosition()
pressedButton = source
pressedButtonPosition = {guiGetPosition(source, false)}
element = source
while getElementType(getElementParent(element)) ~= "guiroot" do
element = getElementParent(element)
local x, y = guiGetPosition(element, false)
pressedButtonPosition[1], pressedButtonPosition[2] = pressedButtonPosition[1] + x, pressedButtonPosition[2] + y
end
local a, b = getHandlingLimits( guiGetElementProperty(pressedButton) )
local x = guiGetText(pressedButton)
scrollbar = {
clickX = mx * scrX,
position = (x-a)/(b-a),
size = {guiGetSize(pressedButton, false)},
old = guiGetText(pressedButton),
min = a,
max = b,
thresholdReached = false,
}
end
return
elseif state then
-- I was going to change everything to do a check to see if its up or down..
-- Too much hassle. Just going to kill the function here.
return
end
if (button == "left") then
if parent == "menuButton" then
guiToggleUtilityDropDown ( info )
elseif parent == "menuItem" then
guiShowView ( info )
elseif parent == "viewButton" then
if (info == "undo") or (info == "redo") then
outputChatBox(info)
else
guiShowView ( info )
end
elseif parent == "viewItem" then
local inputType = guiGetElementInputType ( source )
local property = guiGetElementProperty ( source )
if property then
if (inputType == "config") and (getElementType(source) == "gui-button") then
destroyEditBox ( )
local x,y = guiGetPosition ( source, false )
local w,h = guiGetSize ( source, false )
local text = guiGetText ( source )
guiSetVisible ( source, false )
hiddenEditBox = source
openedEditBox = guiCreateEdit ( x, y, w, h, text, false, heditGUI.window )
guiSetFont ( openedEditBox, guiGetFont ( source ) )
guiBringToFront ( openedEditBox )
guiEditSetCaretIndex ( openedEditBox, string.len ( text ) )
local min,max = getHandlingLimits ( property )
local propType = getHandlingPropertyValueType ( property ) .. ( min and ": " .. tostring ( min ) .. " - " .. tostring ( max ) or "" )
local propInfo = getHandlingPropertyValueInformation ( property )
guiSetStaticInfoText ( propType, propInfo )
elseif inputType == "infolabel" and isHandlingPropertyHexadecimal ( property ) then
if pVehicle then
guiSetEnabled ( source, false ) -- Spam prevention, stop players to click the button till wierd stuff happens. Need a better spam protection.
setTimer ( guiSetEnabled, 500, 1, source, true )
local enabled = guiCheckBoxGetSelected ( source )
local config = getVehicleHandling ( pVehicle )[property]
local reversedHex = string.reverse ( config )..string.rep ( "0", 8 - string.len ( config ) )
local byte = 1
local str = ""
for value in string.gmatch ( reversedHex, "." ) do
if byte == info.byte then
local curValue = tonumber ( "0x"..value )
local addValue = tonumber ( info.value )
local calc
if enabled then
calc = curValue + addValue
else
calc = curValue - addValue
end
if calc < 0 then
calc = 0
end
local newValue = string.format ( "%X", calc )
value = newValue
end
str = str..value
byte = byte + 1
end
setVehicleHandling ( pVehicle, property, string.reverse ( str ) )
else
-- No vehicle
end
end
end
end
elseif (button == "right") then
if pressedKey then -- Check whether CTRL or SHIFT is valid pressed with a right-mouse-click
local property = guiGetElementProperty ( source )
local value = guiGetText ( pointedButton )
prepareHandlingValue ( pVehicle, property, value )
end
end
if (parent ~= "menuButton") then
guiToggleUtilityDropDown ( currentUtil )
end
if event and event.onClick then
event.onClick ( source, button )
end
return true
end
function onDoubleClick ( )
local event = guiGetElementEvents ( source )
if event and event.onDoubleClick then
event.onDoubleClick ( source, button )
end
return true
end
-- mouse enter, not edit enter!
function onEnter ( )
local parent = guiGetElementParent ( source )
local event = guiGetElementEvents ( source )
local inputType = guiGetElementInputType ( source )
local elementInfo = guiGetElementInfo ( source )
setPointedElement ( source, true )
if parent == "menuButton" and currentUtil then
local util = guiGetElementInfo ( source )
if util ~= currentUtil then
guiToggleUtilityDropDown ( util )
end
elseif parent == "viewButton" or parent == "menuItem" then
guiSetInfoText ( getViewLongName(elementInfo), "" )
elseif parent == "viewItem" then
if inputType == "infolabel" then
local property,name,info = guiGetElementProperty ( source ),nil,nil
if isHandlingPropertyHexadecimal ( property ) then
local byte, value = elementInfo.byte, elementInfo.value
name = getHandlingPropertyByteName ( property, byte, value )
info = getHandlingPropertyByteInformation ( property, byte, value )
else
name = getHandlingPropertyFriendlyName ( property )
info = getHandlingPropertyInformationText ( property )
end
guiSetInfoText ( name, info )
elseif inputType == "config" then
guiSetInfoText ( getText ( "clickToEdit" ), getText ( "enterToSubmit" ) )
elseif inputType == "special" then
end
elseif parent == "special" then
if elementInfo == "minilog" and guiGetText ( source ) ~= "" then
guiSetInfoText ( getText ( "clickToViewFullLog" ), "" )
end
end
if event and event.onEnter then
event.onEnter ( source )
end
return true
end
function onLeave ( )
local parent = guiGetElementParent ( source )
local event = guiGetElementEvents ( source )
setPointedElement ( source, false )
guiResetInfoText ( )
if event and event.onLeave then
event.onLeave ( source )
end
return true
end
function onFocus ( )
local parent = guiGetElementParent ( source )
local event = guiGetElementEvents ( source )
if event and event.onFocus then
event.onFocus ( source )
end
return true
end
function onBlur ( )
local parent = guiGetElementParent ( source )
local event = guiGetElementEvents ( source )
if event and event.onBlur then
event.onBlur ( source )
end
return true
end
function onEditBoxAccept ( box )
local parent = guiGetElementParent ( source )
local event = guiGetElementEvents ( box )
if box == openedEditBox then
if isElement ( pVehicle ) then
local content = guiGetText ( box )
destroyEditBox ( )
local property = guiGetElementProperty ( hiddenEditBox )
prepareHandlingValue ( pVehicle, property, content )
else
-- when not vehicle
end
end
if event and event.onEditBoxAccept then
event.onEditBoxAccept ( box )
end
return true
end
function onComboBoxAccept ( )
local parent = guiGetElementParent ( source )
local event = guiGetElementEvents ( source )
local property = guiGetElementProperty ( source )
if parent == "viewItem" and property then
if pVehicle then
local selected = guiComboBoxGetSelected ( source )
if selected > -1 then
local text = guiComboBoxGetItemText ( source, selected )
local value = nil
if handlingLimits[property] and handlingLimits[property].options then
value = handlingLimits[property].options[selected+1]
end
prepareHandlingValue ( pVehicle, property, value )
end
end
end
if event and event.onComboBoxAccept then
event.onComboBoxAccept ( source )
end
return true
end | mit |
moteus/xlsxwriter.lua | test/unit/sharedstrings/sharedstrings01.lua | 2 | 1771 | ----
-- Tests for the xlsxwriter.lua sharedstrings class.
--
-- Copyright 2014-2015, John McNamara, jmcnamara@cpan.org
--
require "Test.More"
require "Test.LongString"
plan(8)
----
-- Tests setup.
--
local expected
local got
local caption
local Sharedstrings = require "xlsxwriter.sharedstrings"
local sharedstrings
local index
-- Remove extra whitespace in the formatted XML strings.
function _clean_xml_string(s)
return (string.gsub(s, ">%s+<", "><"))
end
----
-- Test the sharedstrings _assemble_xml_file() method.
--
caption = " \tSharedstrings:"
expected = _clean_xml_string([[
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="7" uniqueCount="3">
<si>
<t>neptune</t>
</si>
<si>
<t>mars</t>
</si>
<si>
<t>venus</t>
</si>
</sst>]])
sharedstrings = Sharedstrings:new()
sharedstrings:_set_filehandle(io.tmpfile())
index = sharedstrings:_get_string_index("neptune")
is(index, 0, caption .. " _get_string_index()")
index = sharedstrings:_get_string_index("mars")
is(index, 1, caption .. " _get_string_index()")
index = sharedstrings:_get_string_index("venus")
is(index, 2, caption .. " _get_string_index()")
index = sharedstrings:_get_string_index("neptune")
is(index, 0, caption .. " _get_string_index()")
index = sharedstrings:_get_string_index("mars")
is(index, 1, caption .. " _get_string_index()")
index = sharedstrings:_get_string_index("venus")
is(index, 2, caption .. " _get_string_index()")
index = sharedstrings:_get_string_index("venus")
is(index, 2, caption .. " _get_string_index()")
sharedstrings:_assemble_xml_file()
got = _clean_xml_string(sharedstrings:_get_data())
is_string(got, expected, caption .. " _assemble_xml_file()")
| mit |
newfies-dialer/newfies-dialer | lua/libs/uuid4.lua | 12 | 3046 | --[[
The MIT License (MIT)
Copyright (c) 2012 Toby Jennings
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--]]
local M = {}
-----
math.randomseed( os.time() )
math.random()
-----
local function num2bs(num)
local _mod = math.fmod or math.mod
local _floor = math.floor
--
local result = ""
if(num == 0) then return "0" end
while(num > 0) do
result = _mod(num,2) .. result
num = _floor(num*0.5)
end
return result
end
--
local function bs2num(num)
local _sub = string.sub
local index, result = 0, 0
if(num == "0") then return 0; end
for p=#num,1,-1 do
local this_val = _sub( num, p,p )
if this_val == "1" then
result = result + ( 2^index )
end
index=index+1
end
return result
end
--
local function padbits(num,bits)
if #num == bits then return num end
if #num > bits then print("too many bits") end
local pad = bits - #num
for i=1,pad do
num = "0" .. num
end
return num
end
--
local function getUUID()
local _rnd = math.random
local _fmt = string.format
--
_rnd()
--
local time_low_a = _rnd(0, 65535)
local time_low_b = _rnd(0, 65535)
--
local time_mid = _rnd(0, 65535)
--
local time_hi = _rnd(0, 4095 )
time_hi = padbits( num2bs(time_hi), 12 )
local time_hi_and_version = bs2num( "0100" .. time_hi )
--
local clock_seq_hi_res = _rnd(0,63)
clock_seq_hi_res = padbits( num2bs(clock_seq_hi_res), 6 )
clock_seq_hi_res = "10" .. clock_seq_hi_res
--
local clock_seq_low = _rnd(0,255)
clock_seq_low = padbits( num2bs(clock_seq_low), 8 )
--
local clock_seq = bs2num(clock_seq_hi_res .. clock_seq_low)
--
local node = {}
for i=1,6 do
node[i] = _rnd(0,255)
end
--
local guid = ""
guid = guid .. padbits(_fmt("%X",time_low_a), 4)
guid = guid .. padbits(_fmt("%X",time_low_b), 4) .. "-"
guid = guid .. padbits(_fmt("%X",time_mid), 4) .. "-"
guid = guid .. padbits(_fmt("%X",time_hi_and_version), 4) .. "-"
guid = guid .. padbits(_fmt("%X",clock_seq), 4) .. "-"
--
for i=1,6 do
guid = guid .. padbits(_fmt("%X",node[i]), 2)
end
--
return guid
end
--
M.getUUID = getUUID
return M | mpl-2.0 |
huahang/thrift | lib/lua/TMemoryBuffer.lua | 100 | 2266 | --
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
require 'TTransport'
TMemoryBuffer = TTransportBase:new{
__type = 'TMemoryBuffer',
buffer = '',
bufferSize = 1024,
wPos = 0,
rPos = 0
}
function TMemoryBuffer:isOpen()
return 1
end
function TMemoryBuffer:open() end
function TMemoryBuffer:close() end
function TMemoryBuffer:peak()
return self.rPos < self.wPos
end
function TMemoryBuffer:getBuffer()
return self.buffer
end
function TMemoryBuffer:resetBuffer(buf)
if buf then
self.buffer = buf
self.bufferSize = string.len(buf)
else
self.buffer = ''
self.bufferSize = 1024
end
self.wPos = string.len(buf)
self.rPos = 0
end
function TMemoryBuffer:available()
return self.wPos - self.rPos
end
function TMemoryBuffer:read(len)
local avail = self:available()
if avail == 0 then
return ''
end
if avail < len then
len = avail
end
local val = string.sub(self.buffer, self.rPos + 1, self.rPos + len)
self.rPos = self.rPos + len
return val
end
function TMemoryBuffer:readAll(len)
local avail = self:available()
if avail < len then
local msg = string.format('Attempt to readAll(%d) found only %d available',
len, avail)
terror(TTransportException:new{message = msg})
end
-- read should block so we don't need a loop here
return self:read(len)
end
function TMemoryBuffer:write(buf)
self.buffer = self.buffer .. buf
self.wPos = self.wPos + string.len(buf)
end
function TMemoryBuffer:flush() end
| apache-2.0 |
mtesseracttech/CustomEngine | lib/bullet/src/build3/bin2cpp.lua | 15 | 1309 | function convertFile(filenameIn, filenameOut, stringname)
print("\nfilenameOut = " .. filenameOut)
local f = assert(io.open(filenameIn, "rb"))
local fw = io.open(filenameOut,"w")
fw:write(string.format("char %s[]={", stringname))
local block = 10
while true do
local bytes = f:read(block)
if not bytes then break end
for b in string.gfind(bytes, ".") do
fw:write(string.format("%u,", string.byte(b)))
end
--io.write(string.rep(" ", block - string.len(bytes) + 1))
--io.write(string.gsub(bytes, "%c", "."), "\n")
fw:write(string.format("\n"))
end
fw:write(string.format("\n};"))
end
newoption {
trigger = "binfile",
value = "binpath",
description = "full path to the binary input file"
}
newoption {
trigger = "cppfile",
value = "path",
description = "full path to the cpp output file"
}
newoption {
trigger = "stringname",
value = "var",
description = "name of the variable name in the cppfile that contains the binary data"
}
newaction {
trigger = "bin2cpp",
description = "convert binary file into cpp source",
execute = function ()
convertFile( _OPTIONS["binfile"] , _OPTIONS["cppfile"], _OPTIONS["stringname"])
end
} | apache-2.0 |
dualface/easycocos-lua-framework | src/framework/string.lua | 3 | 2524 | --[[
Copyright (c) 2015 gameboxcloud.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
]]
local string_find = string.find
local string_gsub = string.gsub
local string_len = string.len
local string_sub = string.sub
local string_upper = string.upper
local table_insert = table.insert
local tostring = tostring
function string.split(input, delimiter)
input = tostring(input)
delimiter = tostring(delimiter)
if (delimiter == "") then return false end
local pos,arr = 1, {}
for st, sp in function() return string_find(input, delimiter, pos, true) end do
local str = string_sub(input, pos, st - 1)
if str ~= "" then
table_insert(arr, str)
end
pos = sp + 1
end
if pos <= string_len(input) then
table_insert(arr, string_sub(input, pos))
end
return arr
end
local _TRIM_CHARS = " \t\n\r"
function string.ltrim(input, chars)
chars = chars or _TRIM_CHARS
local pattern = "^[" .. chars .. "]+"
return string_gsub(input, pattern, "")
end
function string.rtrim(input, chars)
chars = chars or _TRIM_CHARS
local pattern = "[" .. chars .. "]+$"
return string_gsub(input, pattern, "")
end
function string.trim(input, chars)
chars = chars or _TRIM_CHARS
local pattern = "^[" .. chars .. "]+"
input = string_gsub(input, pattern, "")
pattern = "[" .. chars .. "]+$"
return string_gsub(input, pattern, "")
end
function string.ucfirst(input)
return string_upper(string_sub(input, 1, 1)) .. string_sub(input, 2)
end
| mit |
ninnghazad/dronetest | dronetest/rom/apis/term.lua | 1 | 6300 | -- TERM API
-- APIs have minetest and so on available in scope
local term = {}
term.cursorPos = {1,1}
function term.clear()
dronetest.console_histories[dronetest.current_id] = ""
end
function term.write(msg)
dronetest.print(dronetest.current_id,msg,true)
return string.len(msg)
end
term.keyNames = {
"Left Button",
"Right Button",
"Cancel",
"Middle Button",
"X Button 1",
"X Button 2",
"-",
"Back",
"Tab",
"-",
"-",
"Clear",
"Return",
"-",
"-",
"Shift",
"Control",
"Menu",
"Pause",
"Capital",
"Kana",
"-",
"Junja",
"Final",
"Kanji",
"-",
"Escape",
"Convert",
"Nonconvert",
"Accept",
"Mode Change",
"Space",
"Priot",
"Next",
"End",
"Home",
"Left",
"Up",
"Right",
"Down",
"Select",
"Print",
"Execute",
"Snapshot",
"Insert",
"Delete",
"Help",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
"Left Windows",
"Right Windows",
"Apps",
"-",
"Sleep",
"Numpad 0",
"Numpad 1",
"Numpad 2",
"Numpad 3",
"Numpad 4",
"Numpad 5",
"Numpad 6",
"Numpad 7",
"Numpad 8",
"Numpad 9",
"Numpad *",
"Numpad +",
"Numpad /",
"Numpad -",
"Numpad .",
"Numpad /",
"F1",
"F2",
"F3",
"F4",
"F5",
"F6",
"F7",
"F8",
"F9",
"F10",
"F11",
"F12",
"F13",
"F14",
"F15",
"F16",
"F17",
"F18",
"F19",
"F20",
"F21",
"F22",
"F23",
"F24",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"Num Lock",
"Scroll Lock",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"Left Shift",
"Right Shift",
"Left Control",
"Right Control",
"Left Menu",
"Right Menu",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"Plus",
"Comma",
"Minus",
"Period",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"-",
"Attn",
"CrSel",
"ExSel",
"Erase OEF",
"Play",
"Zoom",
"PA1",
"OEM Clear",
"-"
}
term.keyChars = {
["13:0:0"] = "\n",
["13:0:1"] = "\n",
["32:0:0"] = " ",
["32:0:1"] = " ",
["8:0:0"] = "\b",
["8:0:1"] = "\b",
--[[
["32:0:0"] = " ",
["33:0:0"] = "!",
["34:0:0"] = "\"",
["35:0:0"] = "#",
["36:0:0"] = "$",
["37:0:0"] = "%",
["38:0:0"] = "&",
["39:0:0"] = "'",
["40:0:0"] = "(",
["41:0:0"] = ")",
["42:0:0"] = "*",
["43:0:0"] = "+",
["44:0:0"] = ",",
["45:0:0"] = "-",
["46:0:0"] = ".",
["47:0:0"] = "/",
--]]
["48:0:0"] = "0",
["49:0:0"] = "1",
["50:0:0"] = "2",
["51:0:0"] = "3",
["52:0:0"] = "4",
["53:0:0"] = "5",
["54:0:0"] = "6",
["55:0:0"] = "7",
["56:0:0"] = "8",
["57:0:0"] = "9",
["49:0:1"] = "!",
["50:0:1"] = "@",
["51:0:1"] = "#",
["52:0:1"] = "$",
["53:0:1"] = "%",
["54:0:1"] = "^",
["55:0:1"] = "&",
["56:0:1"] = "*",
["57:0:1"] = "(",
["48:0:1"] = ")",
["58:0:0"] = ":",
["59:0:0"] = ";",
["60:0:0"] = "<",
["61:0:0"] = "=",
["62:0:0"] = ">",
["63:0:0"] = "?",
["64:0:0"] = "@",
["65:0:0"] = "a",
["66:0:0"] = "b",
["67:0:0"] = "c",
["68:0:0"] = "d",
["69:0:0"] = "e",
["70:0:0"] = "f",
["71:0:0"] = "g",
["72:0:0"] = "h",
["73:0:0"] = "i",
["74:0:0"] = "j",
["75:0:0"] = "k",
["76:0:0"] = "l",
["77:0:0"] = "m",
["78:0:0"] = "n",
["79:0:0"] = "o",
["80:0:0"] = "p",
["81:0:0"] = "q",
["82:0:0"] = "r",
["83:0:0"] = "s",
["84:0:0"] = "t",
["85:0:0"] = "u",
["86:0:0"] = "v",
["87:0:0"] = "w",
["88:0:0"] = "x",
["89:0:0"] = "y",
["90:0:0"] = "z",
["65:0:1"] = "A",
["66:0:1"] = "B",
["67:0:1"] = "C",
["68:0:1"] = "D",
["69:0:1"] = "E",
["70:0:1"] = "F",
["71:0:1"] = "G",
["72:0:1"] = "H",
["73:0:1"] = "I",
["74:0:1"] = "J",
["75:0:1"] = "K",
["76:0:1"] = "L",
["77:0:1"] = "M",
["78:0:1"] = "N",
["79:0:1"] = "O",
["80:0:1"] = "P",
["81:0:1"] = "Q",
["82:0:1"] = "R",
["83:0:1"] = "S",
["84:0:1"] = "T",
["85:0:1"] = "U",
["86:0:1"] = "V",
["87:0:1"] = "W",
["88:0:1"] = "X",
["89:0:1"] = "Y",
["90:0:1"] = "Z",
["187:0:0"] = "=",
["188:0:0"] = ",",
["189:0:0"] = "-",
["190:0:0"] = ".",
["191:0:0"] = "/",
["186:0:0"] = ";",
["186:0:1"] = ":",
["187:0:1"] = "+",
["188:0:1"] = "<",
["189:0:1"] = "_",
["190:0:1"] = ">",
["191:0:1"] = "?",
["192:0:0"] = "`",
["192:0:1"] = "~",
["222:0:0"] = "'",
["222:0:1"] = "\"",
["220:0:0"] = "\\",
["220:0:1"] = "|",
["226:0:0"] = "<", --?? \\
["226:0:1"] = ">", --?? |
}
function term.getChar()
local e = dronetest.events.wait_for_receive(dronetest.current_id,{"key"},minetest.get_meta(dronetest.active_systems[dronetest.current_id].pos):get_string("channel"),0,0)
if term.keyChars[e.msg] then
return term.keyChars[e.msg]
end
return ""
end
return term
| mit |
furkiak/TBTKO | Map Guest Client Paketi/Quests/24424_beda.lua | 1 | 12963 | local Ret = 0;
local NPC = 24424;
if (EVENT == 190) then
QuestNum = SearchQuest(UID, NPC);
if (QuestNum == 0) then
SelectMsg(UID, 2, -1, 4513, NPC, 10, 193);
elseif (QuestNum > 1 and QuestNum < 100) then
NpcMsg(UID, 4514, NPC)
else
EVENT = QuestNum
end
end
if (EVENT == 193) then
Ret = 1;
end
if (EVENT == 9540) then -- 61 Level Doom Soldier
SaveEvent(UID, 9723);
end
if (EVENT == 9542) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 923, 8772, NPC, 22, 9543, 23, 9544);
else
SelectMsg(UID, 2, 923, 8772, NPC, 10, 193);
end
end
if (EVENT == 9543) then
SaveEvent(UID, 9724);
end
if (EVENT == 9544) then
SaveEvent(UID, 9727);
end
if (EVENT == 9546) then
SaveEvent(UID, 9726);
end
if (EVENT == 9547) then
MonsterCount = CountMonsterQuestSub(UID, 923, 1);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 923, 8772, NPC, 18, 9548);
else
SelectMsg(UID, 4, 923, 8772, NPC, 41, 9549, 27, 9548);
end
end
if (EVENT == 9548) then
ShowMap(UID, 627);
end
if (EVENT == 9549) then
ExpChange(UID, 19000000)
SaveEvent(UID, 9725);
end
local savenum = 430;
if (EVENT == 530) then -- 62 Level 7 Certificate of Suffering
SaveEvent(UID, 4266);
SelectMsg(UID, 2, savenum, 4503, NPC, 4080, 193);
end
if (EVENT == 532) then
SelectMsg(UID, 4, savenum, 4505, NPC, 22, 533, 23, 534);
end
if (EVENT == 533) then
Check = isRoomForItem(UID, 910127000);
if (Check == -1) then
SelectMsg(UID, 2, savenum, 832, NPC, 27, 193);
else
GiveItem(UID, 910127000, 1);
SaveEvent(UID, 4267);
end
end
if (EVENT == 534) then
SaveEvent(UID, 4270);
end
if (EVENT == 536) then
ItemA = HowmuchItem(UID, 910134000);
ItemB = HowmuchItem(UID, 910127000);
if (ItemA < 1) then
if (ItemB < 1) then
Check = isRoomForItem(UID, 910127000);
if (Check == -1) then
SelectMsg(UID, 2, savenum, 832, NPC, 27 , 193);
else
GiveItem(UID, 910127000, 1)
SelectMsg(UID, 2, savenum, 4507, NPC, 18, 538);
end
else
SelectMsg(UID, 2, savenum, 4508, NPC, 18, 538);
end
else
SelectMsg(UID, 4, savenum, 4506, NPC, 4172, 537, 4173, 193);
end
end
if (EVENT == 538) then
ShowMap(UID, 454);
end
if (EVENT == 537) then
RobItem(UID, 910134000, 1)
RobItem(UID, 910127000, 1)
GiveItem(UID, 910139000, 1)
GiveItem(UID, 910140000, 1)
GiveItem(UID, 910141000, 1)
GiveItem(UID, 910142000, 1)
SaveEvent(UID, 4268);
end
if (EVENT == 9370) then -- 62 Level Brahman
SaveEvent(UID, 9399);
end
if (EVENT == 9372) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 901, 8686, NPC, 22, 9373, 23, 9374);
else
SelectMsg(UID, 2, 901, 8686, NPC, 10, 193);
end
end
if (EVENT == 9373) then
SaveEvent(UID, 9400);
end
if (EVENT == 9374) then
SaveEvent(UID, 9403);
end
if (EVENT == 9376) then
SaveEvent(UID, 9402);
end
if (EVENT == 9377) then
MonsterCount = CountMonsterQuestSub(UID, 901);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 901, 8686, NPC, 18, 9378);
else
SelectMsg(UID, 4, 901, 8686, NPC, 41, 9379, 27, 9378);
end
end
if (EVENT == 9378) then
ShowMap(UID, 607);
end
if (EVENT == 9379) then
ExpChange(UID, 21000000)
SaveEvent(UID, 9401);
end
if (EVENT == 9380) then -- 63 Level Crimson Wing
SaveEvent(UID, 9411);
end
if (EVENT == 9382) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 903, 8688, NPC, 22, 9383, 23, 9384);
else
SelectMsg(UID, 2, 903, 8688, NPC, 10, 193);
end
end
if (EVENT == 9383) then
SaveEvent(UID, 9412);
end
if (EVENT == 9384) then
SaveEvent(UID, 9415);
end
if (EVENT == 9386) then
SaveEvent(UID, 9414);
end
if (EVENT == 9387) then
MonsterCount = CountMonsterQuestSub(UID, 903, 1);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 903, 8688, NPC, 18, 9388);
else
SelectMsg(UID, 4, 903, 8688, NPC, 41, 9389, 27, 9388);
end
end
if (EVENT == 9388) then
ShowMap(UID, 609);
end
if (EVENT == 9389) then
ExpChange(UID, 20000000)
SaveEvent(UID, 9413);
end
if (EVENT == 9390) then -- 64 Level Gargoyle
SaveEvent(UID, 9423);
end
if (EVENT == 9392) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 905, 8690, NPC, 22, 9393, 23, 9394);
else
SelectMsg(UID, 2, 905, 8690, NPC, 10, 193);
end
end
if (EVENT == 9393) then
SaveEvent(UID, 9424);
end
if (EVENT == 9394) then
SaveEvent(UID, 9427);
end
if (EVENT == 9396) then
SaveEvent(UID, 9426);
end
if (EVENT == 9397) then
MonsterCount = CountMonsterQuestSub(UID, 905, 1);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 905, 8690, NPC, 18, 9398);
else
SelectMsg(UID, 4, 905, 8690, NPC, 41, 9399, 27, 9398);
end
end
if (EVENT == 9398) then
ShowMap(UID, 611);
end
if (EVENT == 9399) then
ExpChange(UID, 21000000)
SaveEvent(UID, 9425);
end
if (EVENT == 9410) then -- 67 Level Apostle Piercing Cold
SaveEvent(UID, 9447);
end
if (EVENT == 9412) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 908, 8694, NPC, 22, 9413, 23, 9414);
else
SelectMsg(UID, 2, 908, 8694, NPC, 10, 193);
end
end
if (EVENT == 9413) then
SaveEvent(UID, 9448);
end
if (EVENT == 9414) then
SaveEvent(UID, 9451);
end
if (EVENT == 9416) then
SaveEvent(UID, 9450);
end
if (EVENT == 9417) then
MonsterCount = CountMonsterQuestSub(UID, 908, 1);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 908, 8694, NPC, 18, 9418);
else
SelectMsg(UID, 4, 908, 8694, NPC, 41, 9419, 27, 9418);
end
end
if (EVENT == 9418) then
ShowMap(UID, 616);
end
if (EVENT == 9419) then
ExpChange(UID, 33000000)
SaveEvent(UID, 9449);
end
if (EVENT == 9420) then -- 69 Level Apostle of Flames
SaveEvent(UID, 9459);
end
if (EVENT == 9422) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 909, 8696, NPC, 22, 9423, 23, 9424);
else
SelectMsg(UID, 2, 909, 8696, NPC, 10, 193);
end
end
if (EVENT == 9423) then
SaveEvent(UID, 9460);
end
if (EVENT == 9424) then
SaveEvent(UID, 9463);
end
if (EVENT == 9426) then
SaveEvent(UID, 9462);
end
if (EVENT == 9427) then
MonsterCount = CountMonsterQuestSub(UID, 909, 1);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 909, 8696, NPC, 18, 9428);
else
SelectMsg(UID, 4, 909, 8696, NPC, 41, 9429, 27, 9428);
end
end
if (EVENT == 9428) then
ShowMap(UID, 618);
end
if (EVENT == 9429) then
ExpChange(UID, 40000000)
SaveEvent(UID, 9461);
end
local savenum = 440;
if (EVENT == 630) then -- 70 Level Selfname Quest
Class = CheckClass(UID);
if (Class == 1 or Class == 5 or Class == 6) then
SaveEvent(UID, 4333);
EVENT = 631
elseif (Class == 2 or Class == 7 or Class == 8) then
SaveEvent(UID, 4338);
EVENT = 631
elseif (Class == 3 or Class == 9 or Class == 10) then
SaveEvent(UID, 4343);
EVENT = 631
elseif (Class == 4 or Class == 11 or Class == 12) then
SaveEvent(UID, 4348);
EVENT = 631
end
end
if (EVENT == 631) then
SelectMsg(UID, 2, savenum, 4613, NPC, 4080, 193);
end
if (EVENT == 632) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, savenum, 4614, NPC, 22, 633, 23, 634);
else
SelectMsg(UID, 2, savenum, 4615, NPC, 10, 193);
end
end
if (EVENT == 633) then
Class = CheckClass(UID);
if (Class == 1 or Class == 5 or Class == 6) then
SaveEvent(UID, 4334);
elseif (Class == 2 or Class == 7 or Class == 8) then
SaveEvent(UID, 4339);
elseif (Class == 3 or Class == 9 or Class == 10) then
SaveEvent(UID, 4344);
elseif (Class == 4 or Class == 11 or Class == 12) then
SaveEvent(UID, 4349);
end
end
if (EVENT == 634) then
SaveEvent(UID, 4337);
end
if (EVENT == 280) then
Class = CheckClass(UID);
if (Class == 1 or Class == 5 or Class == 6) then
SaveEvent(UID, 4336);
EVENT = 281
elseif (Class == 2 or Class == 7 or Class == 8) then
SaveEvent(UID, 4341);
EVENT = 281
elseif (Class == 3 or Class == 9 or Class == 10) then
SaveEvent(UID, 4346);
EVENT = 281
elseif (Class == 4 or Class == 11 or Class == 12) then
SaveEvent(UID, 4351);
EVENT = 281
end
end
if (EVENT == 281) then
SelectMsg(UID, 2, savenum, 4616, NPC, 14, 193);
end
if (EVENT == 636) then
MonsterCount01 = CountMonsterQuestSub(UID, 32001); --Quest Uruk Hai
MonsterCount02 = CountMonsterQuestSub(UID, 32002); --Quest Stone Golem
MonsterCount03 = CountMonsterQuestSub(UID, 32003); --Quest Troll Berserker
MonsterCount04 = CountMonsterQuestSub(UID, 32004); --Quest Apostles
if (MonsterCount01 > 0 and MonsterCount02 > 0 and MonsterCount03 > 0 and MonsterCount04 > 0) then
SelectMsg(UID, 4, savenum, 4621, NPC, 4161, 637, 4162, 193);
else
if (MonsterCount01 < 1) then
SelectMsg(UID, 2, savenum, 4617, NPC, 18, 638);
elseif ( MonsterCount02 < 1) then
SelectMsg(UID, 2, savenum, 4618, NPC, 18, 639);
elseif ( MonsterCount03 < 1) then
SelectMsg(UID, 2, savenum, 4619, NPC, 18, 640);
elseif ( MonsterCount04 < 1) then
SelectMsg(UID, 2, savenum, 4620, NPC, 18, 641);
end
end
end
if (EVENT == 638) then
ShowMap(UID, 474);
end
if (EVENT == 639) then
ShowMap(UID, 475);
end
if (EVENT == 640) then
ShowMap(UID, 476);
end
if (EVENT == 641) then
ShowMap(UID, 477);
end
if (EVENT == 637) then
Class = CheckClass(UID);
if (Class == 1 or Class == 5 or Class == 6) then
GiveItem(UID, 910120350, 1)
GiveItem(UID, 910126544, 1)
GiveItem(UID, 910121300, 1)
SaveEvent(UID, 4335);
ShowEffect(UID, 300391)
elseif (Class == 2 or Class == 7 or Class == 8) then
GiveItem(UID, 910119300, 1)
GiveItem(UID, 910122350, 1)
SaveEvent(UID, 4340);
ShowEffect(UID, 300391)
elseif (Class == 3 or Class == 9 or Class == 10) then
GiveItem(UID, 910123355, 1)
GiveItem(UID, 910124351, 1)
SaveEvent(UID, 4345);
ShowEffect(UID, 300391)
elseif (Class == 4 or Class == 11 or Class == 12) then
GiveItem(UID, 910125324, 1)
GiveItem(UID, 910126544, 1)
SaveEvent(UID, 4350);
ShowEffect(UID, 300391)
end
end
if (EVENT == 200) then -- 71 Level Troll Berserker
SaveEvent(UID, 917);
end
if (EVENT == 202) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 1030, 1401, NPC, 22, 203, 23, 204);
else
SelectMsg(UID, 2, 1030, 1401, NPC, 10, 193);
end
end
if (EVENT == 203) then
SaveEvent(UID, 918);
end
if (EVENT == 204) then
SaveEvent(UID, 921);
end
if (EVENT == 205) then
SaveEvent(UID, 920);
end
if (EVENT == 206) then
MonsterCount = CountMonsterQuestSub(UID, 1030, 1);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 1030, 1401, NPC, 18, 207);
else
SelectMsg(UID, 4, 1030, 1401, NPC, 41, 208, 27, 207);
end
end
if (EVENT == 207) then
ShowMap(UID, 130);
end
if (EVENT == 208) then
ExpChange(UID, 55000000)
SaveEvent(UID, 919);
end
if (EVENT == 210) then -- 71 Level Troll Captain
SaveEvent(UID, 929);
end
if (EVENT == 212) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 1032, 1414, NPC, 22, 213, 23, 214);
else
SelectMsg(UID, 2, 1032, 1414, NPC, 10, 193);
end
end
if (EVENT == 213) then
SaveEvent(UID, 930);
end
if (EVENT == 214) then
SaveEvent(UID, 933);
end
if (EVENT == 215) then
SaveEvent(UID, 932);
end
if (EVENT == 216) then
MonsterCount = CountMonsterQuestSub(UID, 1032, 1);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 1032, 1414, NPC, 18, 217);
else
SelectMsg(UID, 4, 1032, 1414, NPC, 41, 218, 27, 217);
end
end
if (EVENT == 217) then
ShowMap(UID, 171);
end
if (EVENT == 218) then
ExpChange(UID, 55000000)
SaveEvent(UID, 931);
end
if (EVENT == 220) then -- 72 Level Booro
SaveEvent(UID, 941);
end
if (EVENT == 222) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 1034, 1427, NPC, 22, 223, 23, 224);
else
SelectMsg(UID, 2, 1034, 1427, NPC, 10, 193);
end
end
if (EVENT == 223) then
SaveEvent(UID, 942);
end
if (EVENT == 224) then
SaveEvent(UID, 945);
end
if (EVENT == 225) then
SaveEvent(UID, 944);
end
if (EVENT == 226) then
MonsterCount = CountMonsterQuestSub(UID, 1034, 1);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 1034, 1427, NPC, 18, 227);
else
SelectMsg(UID, 4, 1034, 1427, NPC, 41, 228, 27, 227);
end
end
if (EVENT == 227) then
ShowMap(UID, 172);
end
if (EVENT == 228) then
ExpChange(UID, 67000000)
SaveEvent(UID, 943);
end
if (EVENT == 230) then -- 72 Level Dark Stone
SaveEvent(UID, 953);
end
if (EVENT == 232) then
MonsterSub = ExistMonsterQuestSub(UID);
if (MonsterSub == 0) then
SelectMsg(UID, 4, 1036, 1440, NPC, 22, 233, 23, 234);
else
SelectMsg(UID, 2, 1036, 1440, NPC, 10, 193);
end
end
if (EVENT == 233) then
SaveEvent(UID, 954);
end
if (EVENT == 234) then
SaveEvent(UID, 957);
end
if (EVENT == 235) then
SaveEvent(UID, 956);
end
if (EVENT == 236) then
MonsterCount = CountMonsterQuestSub(UID, 1036, 1);
if (MonsterCount < 40) then
SelectMsg(UID, 2, 1036, 1440, NPC, 18, 237);
else
SelectMsg(UID, 4, 1036, 1440, NPC, 41, 238, 27, 237);
end
end
if (EVENT == 237) then
ShowMap(UID, 174);
end
if (EVENT == 238) then
ExpChange(UID, 67000000)
SaveEvent(UID, 955);
end
| gpl-3.0 |
luarocks/luarocks | src/luarocks/upload/api.lua | 2 | 8032 |
local api = {}
local cfg = require("luarocks.core.cfg")
local fs = require("luarocks.fs")
local dir = require("luarocks.dir")
local util = require("luarocks.util")
local persist = require("luarocks.persist")
local multipart = require("luarocks.upload.multipart")
local Api = {}
local function upload_config_file()
if not cfg.config_files.user.file then
return nil
end
return (cfg.config_files.user.file:gsub("/[^/]+$", "/upload_config.lua"))
end
function Api:load_config()
local upload_conf = upload_config_file()
if not upload_conf then return nil end
local config, err = persist.load_into_table(upload_conf)
return config
end
function Api:save_config()
-- Test configuration before saving it.
local res, err = self:raw_method("status")
if not res then
return nil, err
end
if res.errors then
util.printerr("Server says: " .. tostring(res.errors[1]))
return
end
local upload_conf = upload_config_file()
if not upload_conf then return nil end
local ok, err = fs.make_dir(dir.dir_name(upload_conf))
if not ok then
return nil, err
end
persist.save_from_table(upload_conf, self.config)
fs.set_permissions(upload_conf, "read", "user")
end
function Api:check_version()
if not self._server_tool_version then
local tool_version = cfg.upload.tool_version
local res, err = self:request(tostring(self.config.server) .. "/api/tool_version", {
current = tool_version
})
if not res then
return nil, err
end
if not res.version then
return nil, "failed to fetch tool version"
end
self._server_tool_version = res.version
if res.force_update then
return nil, "Your upload client is too out of date to continue, please upgrade LuaRocks."
end
if res.version ~= tool_version then
util.warning("your LuaRocks is out of date, consider upgrading.")
end
end
return true
end
function Api:method(...)
local res, err = self:raw_method(...)
if not res then
return nil, err
end
if res.errors then
if res.errors[1] == "Invalid key" then
return nil, res.errors[1] .. " (use the --api-key flag to change)"
end
local msg = table.concat(res.errors, ", ")
return nil, "API Failed: " .. msg
end
return res
end
function Api:raw_method(path, ...)
self:check_version()
local url = tostring(self.config.server) .. "/api/" .. tostring(cfg.upload.api_version) .. "/" .. tostring(self.config.key) .. "/" .. tostring(path)
return self:request(url, ...)
end
local function encode_query_string(t, sep)
if sep == nil then
sep = "&"
end
local i = 0
local buf = { }
for k, v in pairs(t) do
if type(k) == "number" and type(v) == "table" then
k, v = v[1], v[2]
end
buf[i + 1] = multipart.url_escape(k)
buf[i + 2] = "="
buf[i + 3] = multipart.url_escape(v)
buf[i + 4] = sep
i = i + 4
end
buf[i] = nil
return table.concat(buf)
end
local function redact_api_url(url)
url = tostring(url)
return (url:gsub(".*/api/[^/]+/[^/]+", "")) or ""
end
local ltn12_ok, ltn12 = pcall(require, "ltn12")
if not ltn12_ok then -- If not using LuaSocket and/or LuaSec...
function Api:request(url, params, post_params)
local vars = cfg.variables
local json_ok, json = util.require_json()
if not json_ok then return nil, "A JSON library is required for this command. "..json end
if fs.which_tool("downloader") == "wget" then
local curl_ok, err = fs.is_tool_available(vars.CURL, "curl")
if not curl_ok then
return nil, err
end
end
if not self.config.key then
return nil, "Must have API key before performing any actions."
end
if params and next(params) then
url = url .. ("?" .. encode_query_string(params))
end
local method = "GET"
local out
local tmpfile = fs.tmpname()
if post_params then
method = "POST"
local curl_cmd = vars.CURL.." -f -k -L --silent --user-agent \""..cfg.user_agent.." via curl\" "
for k,v in pairs(post_params) do
local var = v
if type(v) == "table" then
var = "@"..v.fname
end
curl_cmd = curl_cmd .. "--form \""..k.."="..var.."\" "
end
if cfg.connection_timeout and cfg.connection_timeout > 0 then
curl_cmd = curl_cmd .. "--connect-timeout "..tonumber(cfg.connection_timeout).." "
end
local ok = fs.execute_string(curl_cmd..fs.Q(url).." -o "..fs.Q(tmpfile))
if not ok then
return nil, "API failure: " .. redact_api_url(url)
end
else
local ok, err = fs.download(url, tmpfile)
if not ok then
return nil, "API failure: " .. tostring(err) .. " - " .. redact_api_url(url)
end
end
local tmpfd = io.open(tmpfile)
if not tmpfd then
os.remove(tmpfile)
return nil, "API failure reading temporary file - " .. redact_api_url(url)
end
out = tmpfd:read("*a")
tmpfd:close()
os.remove(tmpfile)
if self.debug then
util.printout("[" .. tostring(method) .. " via curl] " .. redact_api_url(url) .. " ... ")
end
return json.decode(out)
end
else -- use LuaSocket and LuaSec
local warned_luasec = false
function Api:request(url, params, post_params)
local json_ok, json = util.require_json()
if not json_ok then return nil, "A JSON library is required for this command. "..json end
local server = tostring(self.config.server)
local http_ok, http
local via = "luasocket"
if server:match("^https://") then
http_ok, http = pcall(require, "ssl.https")
if http_ok then
via = "luasec"
else
if not warned_luasec then
util.printerr("LuaSec is not available; using plain HTTP. Install 'luasec' to enable HTTPS.")
warned_luasec = true
end
http_ok, http = pcall(require, "socket.http")
url = url:gsub("^https", "http")
via = "luasocket"
end
else
http_ok, http = pcall(require, "socket.http")
end
if not http_ok then
return nil, "Failed loading socket library!"
end
if not self.config.key then
return nil, "Must have API key before performing any actions."
end
local body
local headers = {}
if params and next(params) then
url = url .. ("?" .. encode_query_string(params))
end
if post_params then
local boundary
body, boundary = multipart.encode(post_params)
headers["Content-length"] = #body
headers["Content-type"] = "multipart/form-data; boundary=" .. tostring(boundary)
end
local method = post_params and "POST" or "GET"
if self.debug then
util.printout("[" .. tostring(method) .. " via "..via.."] " .. redact_api_url(url) .. " ... ")
end
local out = {}
local _, status = http.request({
url = url,
headers = headers,
method = method,
sink = ltn12.sink.table(out),
source = body and ltn12.source.string(body)
})
if self.debug then
util.printout(tostring(status))
end
local pok, ret, err = pcall(json.decode, table.concat(out))
if pok and ret then
return ret
end
return nil, "API returned " .. tostring(status) .. " - " .. redact_api_url(url)
end
end
function api.new(args)
local self = {}
setmetatable(self, { __index = Api })
self.config = self:load_config() or {}
self.config.server = args.server or self.config.server or cfg.upload.server
self.config.version = self.config.version or cfg.upload.version
self.config.key = args.temp_key or args.api_key or self.config.key
self.debug = args.debug
if not self.config.key then
return nil, "You need an API key to upload rocks.\n" ..
"Navigate to "..self.config.server.."/settings to get a key\n" ..
"and then pass it through the --api-key=<key> flag."
end
if args.api_key then
self:save_config()
end
return self
end
return api
| mit |
jeremyosborne/lua | game_letters_in_space/example/lib/class.lua | 4 | 1726 | --[[
Simple class builder.
--]]
--- Class constructor.
-- @param [constructor] {function} Optional constructor. Passed instance
-- reference followed by any arguments.
-- @param [baseClass] {table} A parent class. Inheritance set
-- prototypically.
-- @return {table} A callable table will be returned, one that can
-- be used to construct instances of this class.
local Class = function(constructor, baseClass)
-- Constructor is always callable.
constructor = constructor or function(self) end
-- Normalize our baseClass.
baseClass = baseClass or {}
-- Classes themselves are tables in Lua.
local class = {
-- Keep a reference to our constructor.
_constructor = constructor,
-- Lua has no concept of super, so we make one up.
super = function()
return baseClass
end,
}
-- Our class is it's own prototype. This allows us to add
-- methods to our class after construction.
class.__index = class
-- Construct our class...
setmetatable(class, {
-- We inherit anything we don't supply from our baseClass...
__index = baseClass,
-- When we call our class table, we construct an instance.
__call = function(_, ...)
-- This is our instance...
local inst = {}
-- ...that inherits all methods on our class...
setmetatable(inst, class)
-- ...that can initialize itself...
constructor(inst, ...)
-- ... we make our instance available to the program...
return inst
end,
})
-- Return the class itself to our application for use.
return class
end
return Class
| mit |
Gameover20/TeleSeed | plugins/admin.lua | 95 | 10643 | local function set_bot_photo(msg, success, result)
local receiver = get_receiver(msg)
if success then
local file = 'data/photos/bot.jpg'
print('File downloaded to:', result)
os.rename(result, file)
print('File moved to:', file)
set_profile_photo(file, ok_cb, false)
send_large_msg(receiver, 'Photo changed!', ok_cb, false)
redis:del("bot:photo")
else
print('Error downloading: '..msg.id)
send_large_msg(receiver, 'Failed, please try again!', ok_cb, false)
end
end
--Function to add log supergroup
local function logadd(msg)
local data = load_data(_config.moderation.data)
local receiver = get_receiver(msg)
local GBan_log = 'GBan_log'
if not data[tostring(GBan_log)] then
data[tostring(GBan_log)] = {}
save_data(_config.moderation.data, data)
end
data[tostring(GBan_log)][tostring(msg.to.id)] = msg.to.peer_id
save_data(_config.moderation.data, data)
local text = 'Log_SuperGroup has has been set!'
reply_msg(msg.id,text,ok_cb,false)
return
end
--Function to remove log supergroup
local function logrem(msg)
local data = load_data(_config.moderation.data)
local receiver = get_receiver(msg)
local GBan_log = 'GBan_log'
if not data[tostring(GBan_log)] then
data[tostring(GBan_log)] = nil
save_data(_config.moderation.data, data)
end
data[tostring(GBan_log)][tostring(msg.to.id)] = nil
save_data(_config.moderation.data, data)
local text = 'Log_SuperGroup has has been removed!'
reply_msg(msg.id,text,ok_cb,false)
return
end
local function parsed_url(link)
local parsed_link = URL.parse(link)
local parsed_path = URL.parse_path(parsed_link.path)
return parsed_path[2]
end
local function get_contact_list_callback (cb_extra, success, result)
local text = " "
for k,v in pairs(result) do
if v.print_name and v.id and v.phone then
text = text..string.gsub(v.print_name , "_" , " ").." ["..v.id.."] = "..v.phone.."\n"
end
end
local file = io.open("contact_list.txt", "w")
file:write(text)
file:flush()
file:close()
send_document("user#id"..cb_extra.target,"contact_list.txt", ok_cb, false)--.txt format
local file = io.open("contact_list.json", "w")
file:write(json:encode_pretty(result))
file:flush()
file:close()
send_document("user#id"..cb_extra.target,"contact_list.json", ok_cb, false)--json format
end
local function get_dialog_list_callback(cb_extra, success, result)
local text = ""
for k,v in pairsByKeys(result) do
if v.peer then
if v.peer.type == "chat" then
text = text.."group{"..v.peer.title.."}["..v.peer.id.."]("..v.peer.members_num..")"
else
if v.peer.print_name and v.peer.id then
text = text.."user{"..v.peer.print_name.."}["..v.peer.id.."]"
end
if v.peer.username then
text = text.."("..v.peer.username..")"
end
if v.peer.phone then
text = text.."'"..v.peer.phone.."'"
end
end
end
if v.message then
text = text..'\nlast msg >\nmsg id = '..v.message.id
if v.message.text then
text = text .. "\n text = "..v.message.text
end
if v.message.action then
text = text.."\n"..serpent.block(v.message.action, {comment=false})
end
if v.message.from then
if v.message.from.print_name then
text = text.."\n From > \n"..string.gsub(v.message.from.print_name, "_"," ").."["..v.message.from.id.."]"
end
if v.message.from.username then
text = text.."( "..v.message.from.username.." )"
end
if v.message.from.phone then
text = text.."' "..v.message.from.phone.." '"
end
end
end
text = text.."\n\n"
end
local file = io.open("dialog_list.txt", "w")
file:write(text)
file:flush()
file:close()
send_document("user#id"..cb_extra.target,"dialog_list.txt", ok_cb, false)--.txt format
local file = io.open("dialog_list.json", "w")
file:write(json:encode_pretty(result))
file:flush()
file:close()
send_document("user#id"..cb_extra.target,"dialog_list.json", ok_cb, false)--json format
end
-- Returns the key (index) in the config.enabled_plugins table
local function plugin_enabled( name )
for k,v in pairs(_config.enabled_plugins) do
if name == v then
return k
end
end
-- If not found
return false
end
-- Returns true if file exists in plugins folder
local function plugin_exists( name )
for k,v in pairs(plugins_names()) do
if name..'.lua' == v then
return true
end
end
return false
end
local function reload_plugins( )
plugins = {}
return load_plugins()
end
local function run(msg,matches)
local receiver = get_receiver(msg)
local group = msg.to.id
local print_name = user_print_name(msg.from):gsub("", "")
local name_log = print_name:gsub("_", " ")
if not is_admin1(msg) then
return
end
if msg.media then
if msg.media.type == 'photo' and redis:get("bot:photo") then
if redis:get("bot:photo") == 'waiting' then
load_photo(msg.id, set_bot_photo, msg)
end
end
end
if matches[1] == "setbotphoto" then
redis:set("bot:photo", "waiting")
return 'Please send me bot photo now'
end
if matches[1] == "markread" then
if matches[2] == "on" then
redis:set("bot:markread", "on")
return "Mark read > on"
end
if matches[2] == "off" then
redis:del("bot:markread")
return "Mark read > off"
end
return
end
if matches[1] == "pm" then
local text = "Message From "..(msg.from.username or msg.from.last_name).."\n\nMessage : "..matches[3]
send_large_msg("user#id"..matches[2],text)
return "Message has been sent"
end
if matches[1] == "pmblock" then
if is_admin2(matches[2]) then
return "You can't block admins"
end
block_user("user#id"..matches[2],ok_cb,false)
return "User blocked"
end
if matches[1] == "pmunblock" then
unblock_user("user#id"..matches[2],ok_cb,false)
return "User unblocked"
end
if matches[1] == "import" then--join by group link
local hash = parsed_url(matches[2])
import_chat_link(hash,ok_cb,false)
end
if matches[1] == "contactlist" then
if not is_sudo(msg) then-- Sudo only
return
end
get_contact_list(get_contact_list_callback, {target = msg.from.id})
return "I've sent contact list with both json and text format to your private"
end
if matches[1] == "delcontact" then
if not is_sudo(msg) then-- Sudo only
return
end
del_contact("user#id"..matches[2],ok_cb,false)
return "User "..matches[2].." removed from contact list"
end
if matches[1] == "addcontact" and is_sudo(msg) then
phone = matches[2]
first_name = matches[3]
last_name = matches[4]
add_contact(phone, first_name, last_name, ok_cb, false)
return "User With Phone +"..matches[2].." has been added"
end
if matches[1] == "sendcontact" and is_sudo(msg) then
phone = matches[2]
first_name = matches[3]
last_name = matches[4]
send_contact(get_receiver(msg), phone, first_name, last_name, ok_cb, false)
end
if matches[1] == "mycontact" and is_sudo(msg) then
if not msg.from.phone then
return "I must Have Your Phone Number!"
end
phone = msg.from.phone
first_name = (msg.from.first_name or msg.from.phone)
last_name = (msg.from.last_name or msg.from.id)
send_contact(get_receiver(msg), phone, first_name, last_name, ok_cb, false)
end
if matches[1] == "dialoglist" then
get_dialog_list(get_dialog_list_callback, {target = msg.from.id})
return "I've sent a group dialog list with both json and text format to your private messages"
end
if matches[1] == "whois" then
user_info("user#id"..matches[2],user_info_callback,{msg=msg})
end
if matches[1] == "sync_gbans" then
if not is_sudo(msg) then-- Sudo only
return
end
local url = "http://seedteam.org/Teleseed/Global_bans.json"
local SEED_gbans = http.request(url)
local jdat = json:decode(SEED_gbans)
for k,v in pairs(jdat) do
redis:hset('user:'..v, 'print_name', k)
banall_user(v)
print(k, v.." Globally banned")
end
end
if matches[1] == 'reload' then
receiver = get_receiver(msg)
reload_plugins(true)
post_msg(receiver, "Reloaded!", ok_cb, false)
return "Reloaded!"
end
--[[*For Debug*
if matches[1] == "vardumpmsg" and is_admin1(msg) then
local text = serpent.block(msg, {comment=false})
send_large_msg("channel#id"..msg.to.id, text)
end]]
if matches[1] == 'updateid' then
local data = load_data(_config.moderation.data)
local long_id = data[tostring(msg.to.id)]['long_id']
if not long_id then
data[tostring(msg.to.id)]['long_id'] = msg.to.peer_id
save_data(_config.moderation.data, data)
return "Updated ID"
end
end
if matches[1] == 'addlog' and not matches[2] then
if is_log_group(msg) then
return "Already a Log_SuperGroup"
end
print("Log_SuperGroup "..msg.to.title.."("..msg.to.id..") added")
savelog(msg.to.id, name_log.." ["..msg.from.id.."] added Log_SuperGroup")
logadd(msg)
end
if matches[1] == 'remlog' and not matches[2] then
if not is_log_group(msg) then
return "Not a Log_SuperGroup"
end
print("Log_SuperGroup "..msg.to.title.."("..msg.to.id..") removed")
savelog(msg.to.id, name_log.." ["..msg.from.id.."] added Log_SuperGroup")
logrem(msg)
end
return
end
local function pre_process(msg)
if not msg.text and msg.media then
msg.text = '['..msg.media.type..']'
end
return msg
end
return {
patterns = {
"^[#!/](pm) (%d+) (.*)$",
"^[#!/](import) (.*)$",
"^[#!/](pmunblock) (%d+)$",
"^[#!/](pmblock) (%d+)$",
"^[#!/](markread) (on)$",
"^[#!/](markread) (off)$",
"^[#!/](setbotphoto)$",
"^[#!/](contactlist)$",
"^[#!/](dialoglist)$",
"^[#!/](delcontact) (%d+)$",
"^[#!/](addcontact) (.*) (.*) (.*)$",
"^[#!/](sendcontact) (.*) (.*) (.*)$",
"^[#!/](mycontact)$",
"^[#/!](reload)$",
"^[#/!](updateid)$",
"^[#/!](sync_gbans)$",
"^[#/!](addlog)$",
"^[#/!](remlog)$",
"%[(photo)%]",
},
run = run,
pre_process = pre_process
}
--By @imandaneshi :)
--https://github.com/SEEDTEAM/TeleSeed/blob/test/plugins/admin.lua
---Modified by @Rondoozle for supergroups
| gpl-2.0 |
SolidWallOfCode/trafficserver | plugins/lua/example/sethost.lua | 17 | 1188 | -- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
local HOSTNAME = ''
function __init__(argtb)
if (#argtb) < 1 then
print(argtb[0], 'hostname parameter required!!')
return -1
end
HOSTNAME = argtb[1]
end
function do_remap()
local req_host = ts.client_request.header.Host
if req_host == nil then
return 0
end
ts.client_request.header['Host'] = HOSTNAME
return 0
end
| apache-2.0 |
Temeez/eso-grouploot | GroupLoot/GroupLootHighscore.lua | 1 | 12719 | GroupLootHighscore = ZO_Object:Subclass()
local highscoreSettings = nil
local highscoreWindowIsHidden = true
function GroupLootHighscore:New()
local obj = ZO_Object.New(self)
obj:Initialize()
return obj
end
function GroupLootHighscore:Initialize()
highscoreSettings = ZO_SavedVars:New("GroupLootHighscore_db", 1, nil, { members = {}, memberCount = 0, positionLeft = 0, positionTop = 0, })
EVENT_MANAGER:RegisterForEvent(ADDON_NAME, EVENT_GROUP_MEMBER_JOINED, function(...) self:OnMemberJoined(...) end)
EVENT_MANAGER:RegisterForEvent(ADDON_NAME, EVENT_GROUP_MEMBER_LEFT, function(...) self:OnMemberLeft(...) end)
GroupLootHighscoreWindow:SetHidden(true)
GroupLootHighscoreWindow:ClearAnchors()
GroupLootHighscoreWindow:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, highscoreSettings.positionLeft, highscoreSettings.positionTop)
self:ConsoleCommands()
self:UpdateHighscoreWindow()
end
-- EVENT_GROUP_MEMBER_JOINED
function GroupLootHighscore:OnMemberJoined(event, memberName)
self:AddAllMembersInGroup()
end
-- EVENT_GROUP_MEMBER_LEFT
function GroupLootHighscore:OnMemberLeft(event, memberName, reason, wasLocalPlayer)
self:RemoveMember(memberName)
end
--[[
Member functions
]]--
function GroupLootHighscore:NewMember(name)
name = zo_strformat(SI_UNIT_NAME, name)
if not highscoreSettings.members[name] then
highscoreSettings.members[name] = {
trash = 0,
normal = 0,
magic = 0,
arcane = 0,
artifact = 0,
legendary = 0,
bestLoot = "None (0g)",
deaths = 0,
totalValue = 0,
isRowHidden = false,
rowPosition = 0, -- maybe useless
}
highscoreSettings.memberCount = highscoreSettings.memberCount + 1
highscoreSettings.members[name].rowPosition = highscoreSettings.memberCount
end
return highscoreSettings.members[name]
end
function GroupLootHighscore:RemoveMember(name)
name = zo_strformat(SI_UNIT_NAME, name)
highscoreSettings.members[name] = nil
highscoreSettings.memberCount = highscoreSettings.memberCount - 1
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:DeleteMembers()
ZO_ClearTable(highscoreSettings.members)
highscoreSettings.memberCount = 0
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:MemberExists(name)
name = zo_strformat(SI_UNIT_NAME, name)
return highscoreSettings.members[name] ~= nil
end
function GroupLootHighscore:ResetMembers()
for k, v in pairs(highscoreSettings.members) do
highscoreSettings.members[k] = {
trash = 0,
normal = 0,
magic = 0,
arcane = 0,
artifact = 0,
legendary = 0,
bestLoot = "None (0g)",
deaths = 0,
totalValue = 0,
isRowHidden = false,
rowPosition = 0,
}
end
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:AddAllMembersInGroup()
local countMembers = GetGroupSize()
-- Get list of member names in current group
local members = {}
for i = 1, countMembers do
local unitTag = GetGroupUnitTagByIndex(i)
if unitTag then
local name = zo_strformat(SI_UNIT_NAME, GetUnitName(unitTag))
members[name] = true
end
end
-- Add all missing members
for name in pairs(members) do
if not self:MemberExists(name) then self:NewMember(name) end
end
-- Check memberCount, if it's not equal to countMembers, it must be more then that
-- (each call self:NewMember adds one to the counter). So we have to remove invalid
-- items from the master list
if highscoreSettings.memberCount ~= countMembers then
for name in pairs(highscoreSettings.members) do
if members[name] == nil then
highscoreSettings.members[name] = nil
highscoreSettings.memberCount = highscoreSettings.memberCount - 1
if highscoreSettings.memberCount == countMembers then break end
end
end
end
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:UpdateWindowSize()
GroupLootHighscoreWindow:SetDimensions(1000, 122 + (highscoreSettings.memberCount * 26))
end
function GroupLootHighscore:UpdateHighscoreWindow()
self:UpdateWindowSize()
local count = 0
for k, v in pairs(highscoreSettings.members) do
count = count + 1
if count > 24 then break end
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "NAME"):SetText(k)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "TRASH"):SetText(v.trash)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "NORMAL"):SetText(v.normal)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "MAGIC"):SetText(v.magic)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "ARCANE"):SetText(v.arcane)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "ARTIFACT"):SetText(v.artifact)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "LEGENDARY"):SetText(v.legendary)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "BESTLOOT"):SetText(v.bestLoot)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "DEATHS"):SetText(v.deaths)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "TOTALVALUE"):SetText(v.totalValue)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "NAME"):SetHidden(false)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "TRASH"):SetHidden(false)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "NORMAL"):SetHidden(false)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "MAGIC"):SetHidden(false)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "ARCANE"):SetHidden(false)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "ARTIFACT"):SetHidden(false)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "LEGENDARY"):SetHidden(false)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "BESTLOOT"):SetHidden(false)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "DEATHS"):SetHidden(false)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "TOTALVALUE"):SetHidden(false)
end
-- Make sure that the memberCount is correct
highscoreSettings.memberCount = count
-- Hide all the rest lines that are not needed
-- 24 is the max amount of rows
while count < 24 do
count = count + 1
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "NAME"):SetHidden(true)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "TRASH"):SetHidden(true)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "NORMAL"):SetHidden(true)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "MAGIC"):SetHidden(true)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "ARCANE"):SetHidden(true)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "ARTIFACT"):SetHidden(true)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "LEGENDARY"):SetHidden(true)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "BESTLOOT"):SetHidden(true)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "DEATHS"):SetHidden(true)
GroupLootHighscoreWindow:GetNamedChild("ROW" .. count .. "TOTALVALUE"):SetHidden(true)
end
end
function GroupLootHighscore:MoveStop()
highscoreSettings.positionLeft = math.floor(GroupLootHighscoreWindow:GetLeft())
highscoreSettings.positionTop = math.floor(GroupLootHighscoreWindow:GetTop())
end
--[[
Update functions
]]--
function GroupLootHighscore:IsBestLoot(name, newLootValue)
name = zo_strformat(SI_UNIT_NAME, name)
local currentBestLootValue = tonumber(string.match(highscoreSettings.members[name].bestLoot, "%d+"))
return newLootValue > currentBestLootValue
end
function GroupLootHighscore:UpdateBestLoot(name, itemLink)
name = zo_strformat(SI_UNIT_NAME, name)
local oldValue = tonumber(string.match(highscoreSettings.members[name].bestLoot, "%d+"))
highscoreSettings.members[name].bestLoot = zo_strformat("<<t:1>> (<<2>>g)", GetItemLinkName(itemLink), GetItemLinkValue(itemLink, true))
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:UpdateTotalValue(name, newValue)
name = zo_strformat(SI_UNIT_NAME, name)
local oldValue = highscoreSettings.members[name].totalValue
newValue = oldValue + newValue
highscoreSettings.members[name].totalValue = newValue
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:UpdateDeath(name, newValue)
name = zo_strformat(SI_UNIT_NAME, name)
local oldValue = highscoreSettings.members[name].deaths
newValue = oldValue + newValue
highscoreSettings.members[name].deaths = newValue
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:UpdateTrash(name, newValue)
name = zo_strformat(SI_UNIT_NAME, name)
local oldValue = highscoreSettings.members[name].trash
newValue = oldValue + newValue
highscoreSettings.members[name].trash = newValue
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:UpdateNormal(name, newValue)
name = zo_strformat(SI_UNIT_NAME, name)
local oldValue = highscoreSettings.members[name].normal
newValue = oldValue + newValue
highscoreSettings.members[name].normal = newValue
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:UpdateMagic(name, newValue)
name = zo_strformat(SI_UNIT_NAME, name)
local oldValue = highscoreSettings.members[name].magic
newValue = oldValue + newValue
highscoreSettings.members[name].magic = newValue
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:UpdateArcane(name, newValue)
name = zo_strformat(SI_UNIT_NAME, name)
local oldValue = highscoreSettings.members[name].arcane
newValue = oldValue + newValue
highscoreSettings.members[name].arcane = newValue
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:UpdateArtifact(name, newValue)
name = zo_strformat(SI_UNIT_NAME, name)
local oldValue = highscoreSettings.members[name].artifact
newValue = oldValue + newValue
highscoreSettings.members[name].artifact = newValue
self:UpdateHighscoreWindow()
end
function GroupLootHighscore:UpdateLegendary(name, newValue)
name = zo_strformat(SI_UNIT_NAME, name)
local oldValue = highscoreSettings.members[name].legendary
newValue = oldValue + newValue
highscoreSettings.members[name].legendary = newValue
self:UpdateHighscoreWindow()
end
--[[
Console commands
]]--
function GroupLootHighscore:ConsoleCommands()
-- Print all available commands to chat
SLASH_COMMANDS["/glhelp"] = function ()
d("-- Group Loot commands --")
d("/glh Show or hide the highscore window.")
d("/glhc Print highscores to the chat.")
d("/glhreset Reset all highscore values (doesn't remove).")
d("/glhdelete Remove everything from highscores.")
end
-- Toggle the highscore window
SLASH_COMMANDS["/glh"] = function ()
if highscoreWindowIsHidden then
GroupLootHighscoreWindow:SetHidden(false)
highscoreWindowIsHidden = false
else
GroupLootHighscoreWindow:SetHidden(true)
highscoreWindowIsHidden = true
end
end
-- Print highscores to the chat
SLASH_COMMANDS["/glhc"] = function ()
local next = next
if next(highscoreSettings.members) ~= nil then
d("Name: Trash | Normal | Magic | Arcane | Artifact | Legendary | Best Loot | Deaths | Total Value")
for k, v in pairs(highscoreSettings.members) do
d(k .. ": " .. v.trash .. " | " .. v.normal .. " | " .. v.magic .. " | " .. v.arcane .. " | " .. v.artifact .. " | " .. v.legendary .. " | " .. v.bestLoot .. " | " .. v.deaths .. " | " .. v.totalValue)
end
else
d("Nothing recorded yet.")
end
end
-- Reset all stats from the .member table
SLASH_COMMANDS["/glhreset"] = function ()
GroupLootHighscore:ResetMembers()
d("Group Loot highscores have been reset")
end
-- Clear all members from the .member table
SLASH_COMMANDS["/glhdelete"] = function ()
GroupLootHighscore:DeleteMembers()
d("Group Loot highscores have been deleted")
end
end | mit |
gentooliano/nodemcu-firmware | examples/fragment.lua | 55 | 19918 | pwm.setup(0,500,50) pwm.setup(1,500,50) pwm.setup(2,500,50)
pwm.start(0) pwm.start(1) pwm.start(2)
function led(r,g,b) pwm.setduty(0,g) pwm.setduty(1,b) pwm.setduty(2,r) end
wifi.sta.autoconnect(1)
a=0
tmr.alarm( 1000,1,function() if a==0 then a=1 led(50,50,50) else a=0 led(0,0,0) end end)
sv:on("receive", function(s,c) s:send("<h1> Hello, world.</h1>") print(c) end )
sk=net.createConnection(net.TCP, 0)
sk:on("receive", function(sck, c) print(c) end )
sk:connect(80,"115.239.210.27")
sk:send("GET / HTTP/1.1\r\nHost: 115.239.210.27\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk:connect(80,"192.168.0.66")
sk:send("GET / HTTP/1.1\r\nHost: 192.168.0.66\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
i2c.setup(0,1,0,i2c.SLOW)
function read_bmp(addr) i2c.start(0) i2c.address(0,119,i2c.RECEIVER) c=i2c.read(0,1) i2c.stop(0) print(string.byte(c)) end
function read_bmp(addr) i2c.start(0) i2c.address(0,119,i2c.TRANSMITTER) i2c.write(0,addr) i2c.stop(0) i2c.start(0) i2c.address(0,119,i2c.RECEIVER) c=i2c.read(0,2) i2c.stop(0) return c end
s=net.createServer(net.TCP) s:listen(80,function(c) end)
ss=net.createServer(net.TCP) ss:listen(80,function(c) end)
s=net.createServer(net.TCP) s:listen(80,function(c) c:on("receive",function(s,c) print(c) end) end)
s=net.createServer(net.UDP)
s:on("receive",function(s,c) print(c) end)
s:listen(5683)
su=net.createConnection(net.UDP)
su:on("receive",function(su,c) print(c) end)
su:connect(5683,"192.168.18.101")
su:send("hello")
mm=node.list()
for k, v in pairs(mm) do print('file:'..k..' len:'..v) end
for k,v in pairs(d) do print("n:"..k..", s:"..v) end
gpio.mode(0,gpio.INT) gpio.trig(0,"down",function(l) print("level="..l) end)
t0 = 0;
function tr0(l) print(tmr.now() - t0) t0 = tmr.now()
if l==1 then gpio.trig(0,"down") else gpio.trig(0,"up") end end
gpio.mode(0,gpio.INT)
gpio.trig(0,"down",tr0)
su=net.createConnection(net.UDP)
su:on("receive",function(su,c) print(c) end)
su:connect(5001,"114.215.154.114")
su:send([[{"type":"signin","name":"nodemcu","password":"123456"}]])
su:send([[{"type":"signout","name":"nodemcu","password":"123456"}]])
su:send([[{"type":"connect","from":"nodemcu","to":"JYP","password":"123456"}]])
su:send("hello world")
s=net.createServer(net.TCP) s:listen(8008,function(c) c:on("receive",function(s,c) print(c) pcall(loadstring(c)) end) end)
s=net.createServer(net.TCP) s:listen(8008,function(c) con_std = c function s_output(str) if(con_std~=nil) then con_std:send(str) end end
node.output(s_output, 0) c:on("receive",function(c,l) node.input(l) end) c:on("disconnection",function(c) con_std = nil node.output(nil) end) end)
s=net.createServer(net.TCP)
s:listen(23,function(c)
con_std = c
function s_output(str)
if(con_std~=nil)
then con_std:send(str)
end
end
node.output(s_output, 0)
c:on("receive",function(c,l) node.input(l) end)
c:on("disconnection",function(c)
con_std = nil
node.output(nil)
end)
end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
print(node.heap()) door="open" if gpio.read(8)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>") conn:close() end) end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
print(node.heap()) print(adc.read(0)) door="open" if gpio.read(0)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>") end) conn:on("sent",function(conn) conn:close() end) end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(node.heap())
door="open"
if gpio.read(0)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>")
end)
conn:on("sent",function(conn) conn:close() end)
end)
port = 9999
hostip = "192.168.1.99"
sk=net.createConnection(net.TCP, false)
sk:on("receive", function(conn, pl) print(pl) end )
sk:connect(port, hostip)
file.remove("init.lua")
file.open("init.lua","w")
file.writeline([[print("Petes Tester 4")]])
file.writeline([[tmr.alarm(5000, 0, function() dofile("thelot.lua") end )]])
file.close()
file.remove("thelot.lua")
file.open("thelot.lua","w")
file.writeline([[tmr.stop()]])
file.writeline([[connecttoap = function (ssid,pw)]])
file.writeline([[print(wifi.sta.getip())]])
file.writeline([[wifi.setmode(wifi.STATION)]])
file.writeline([[tmr.delay(1000000)]])
file.writeline([[wifi.sta.config(ssid,pw)]])
file.writeline([[tmr.delay(5000000)]])
file.writeline([[print("Connected to ",ssid," as ",wifi.sta.getip())]])
file.writeline([[end]])
file.writeline([[connecttoap("MyHub","0011223344")]])
file.close()
s=net.createServer(net.UDP) s:listen(5683) s:on("receive",function(s,c) print(c) s:send("echo:"..c) end)
s:on("sent",function(s) print("echo donn") end)
sk=net.createConnection(net.UDP, 0) sk:on("receive", function(sck, c) print(c) end ) sk:connect(8080,"192.168.0.88")
sk:send("GET / HTTP/1.1\r\nHost: 192.168.0.88\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
srv=net.createServer(net.TCP, 5) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
print(node.heap()) print(adc.read(0)) door="open" if gpio.read(0)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>") end) end)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(payload) print(node.heap())
conn:send("<h1> Hello, NodeMcu.</h1>")
end)
conn:on("sent",function(conn) conn:close() end)
end)
function startServer()
print("WIFI AP connected. Wicon IP:")
print(wifi.sta.getip())
sv=net.createServer(net.TCP,180)
sv:listen(8080,function(conn)
print("Wifi console connected.")
function s_output(str)
if(conn~=nil) then
conn:send(str)
end
end
node.output(s_output,0)
conn:on("receive",function(conn,pl)
node.input(pl)
if (conn==nil) then
print("conn is nil")
end
print("hello")
mycounter=0 srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
if string.find(payload,"?myarg=") then mycounter=mycounter+1
m="<br/>Value= " .. string.sub(payload,string.find(payload,"?myarg=")+7,string.find(payload,"HTTP")-2) else m="" end
conn:send("<h1> Hello, this is Pete's web page.</h1>How are you today.<br/> Count=" .. mycounter .. m .. "Heap=".. node.heap())
end) conn:on("sent",function(conn) conn:close() conn = nil end) end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n") conn:send("Connection: close\r\n\r\n") conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap()) conn:close() end) end)
conn=net.createConnection(net.TCP)
conn:dns("www.nodemcu.com",function(conn,ip) print(ip) print("hell") end)
function connected(conn) conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n") conn:send("Connection: close\r\n\r\n") conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap()) conn:close() end) end
srv=net.createServer(net.TCP)
srv:on("connection",function(conn) conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n") conn:send("Connection: close\r\n\r\n") conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap()) conn:close() end) end)
srv:listen(80)
-- sieve.lua
-- the sieve of Eratosthenes programmed with coroutines
-- typical usage: lua -e N=500 sieve.lua | column
-- generate all the numbers from 2 to n
function gen (n) return coroutine.wrap(function () for i=2,n do coroutine.yield(i) end end) end
-- filter the numbers generated by `g', removing multiples of `p'
function filter (p, g) return coroutine.wrap(function () for n in g do if n%p ~= 0 then coroutine.yield(n) end end end) end
N=N or 500 -- from command line
x = gen(N) -- generate primes up to N
while 1 do
local n = x() -- pick a number until done
if n == nil then break end
print(n) -- must be a prime number
x = filter(n, x) -- now remove its multiples
end
file.remove("mylistener.lua")
file.open("mylistener.lua","w")
file.writeline([[gpio2 = 9]])
file.writeline([[gpio0 = 8]])
file.writeline([[gpio.mode(gpio2,gpio.OUTPUT)]])
file.writeline([[gpio.write(gpio2,gpio.LOW)]])
file.writeline([[gpio.mode(gpio0,gpio.OUTPUT)]])
file.writeline([[gpio.write(gpio0,gpio.LOW)]])
file.writeline([[l1="0\n"]])
file.writeline([[l2="0\n"]])
file.writeline([[l3="0\n"]])
file.writeline([[l4="0\n"]])
file.writeline([[sv=net.createServer(net.TCP, 5) ]])
file.writeline([[sv:listen(4000,function(c)]])
file.writeline([[c:on("disconnection", function(c) print("Bye") end )]])
file.writeline([[c:on("receive", function(sck, pl) ]])
-- file.writeline([[print(pl) ]])
file.writeline([[if (pl=="GO1\n") then c:send(l1) ]])
file.writeline([[elseif pl=="GO2\n" then c:send(l2) ]])
file.writeline([[elseif pl=="GO3\n" then c:send(l3) ]])
file.writeline([[elseif pl=="GO4\n" then c:send(l4) ]])
file.writeline([[elseif pl=="YES1\n" then l1="1\n" c:send("OK\n") gpio.write(gpio2,gpio.HIGH) ]])
file.writeline([[elseif pl=="NO1\n" then l1="0\n" c:send("OK\n") gpio.write(gpio2,gpio.LOW) ]])
file.writeline([[elseif pl=="YES2\n" then l2="1\n" c:send("OK\n") gpio.write(gpio0,gpio.HIGH) ]])
file.writeline([[elseif pl=="NO2\n" then l2="0\n" c:send("OK\n") gpio.write(gpio0,gpio.LOW) ]])
file.writeline([[elseif pl=="YES3\n" then l3="1\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[elseif pl=="NO3\n" then l3="0\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[elseif pl=="YES4\n" then l4="1\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[elseif pl=="NO4\n" then l4="0\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[else c:send("0\n") print(node.heap()) ]])
file.writeline([[end]])
file.writeline([[end)]])
file.writeline([[end)]])
file.close()
file.remove("myli.lua") file.open("myli.lua","w")
file.writeline([[sv=net.createServer(net.TCP, 5) ]])
file.writeline([[sv:listen(4000,function(c)]])
file.writeline([[c:on("disconnection", function(c) print("Bye") end )]])
--file.writeline([[c:on("sent", function(c) c:close() end )]])
file.writeline([[c:on("receive", function(sck, pl) ]])
file.writeline([[sck:send("0\n") print(node.heap()) ]])
file.writeline([[end)]]) file.writeline([[end)]]) file.close()
sv=net.createServer(net.TCP, 50) sv:listen(4000,function(c) c:on("disconnection",function(c) print("Bye") end)
c:on("receive", function(sck, pl) sck:send("0\n") print(node.heap()) end) end)
sv=net.createServer(net.TCP, 5) sv:listen(4000,function(c) c:on("disconnection",function(c) print("Bye") end)
c:on("receive", function(sck, pl) sck:send("0\n") print(node.heap()) end) c:on("sent", function(sck) sck:close() end) end)
s=net.createServer(net.UDP)
s:on("receive",function(s,c) print(c) end)
s:listen(8888)
print("This is a long long long line to test the memory limit of nodemcu firmware\n")
collectgarbage("setmemlimit",8)
print(collectgarbage("getmemlimit"))
tmr.alarm(1,5000,1,function() print("alarm 1") end)
tmr.stop(1)
tmr.alarm(0,1000,1,function() print("alarm 0") end)
tmr.stop(0)
tmr.alarm(2,2000,1,function() print("alarm 2") end)
tmr.stop(2)
tmr.alarm(6,2000,1,function() print("alarm 6") end)
tmr.stop(6)
for k,v in pairs(_G.package.loaded) do print(k) end
for k,v in pairs(_G) do print(k) end
for k,v in pairs(d) do print("n:"..k..", s:"..v) end
a="pin=9"
t={}
for k, v in string.gmatch(a, "(%w+)=(%w+)") do t[k]=v end
print(t["pin"])
function switch() gpio.mode(4,gpio.OUTPUT) gpio.mode(5,gpio.OUTPUT) tmr.delay(1000000) print("hello world") end
tmr.alarm(0,10000,0,function () uart.setup(0,9600,8,0,1) end) switch()
sk=net.createConnection(net.TCP, 0) sk:on("receive", function(sck, c) print(c) end ) sk:connect(80,"www.nodemcu.com") sk:send("GET / HTTP/1.1\r\nHost: www.nodemcu.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk=net.createConnection(net.TCP, 0) sk:on("receive", function(sck, c) print(c) end )
sk:on("connection", function(sck) sck:send("GET / HTTP/1.1\r\nHost: www.nodemcu.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n") end ) sk:connect(80,"www.nodemcu.com")
sk=net.createConnection(net.TCP, 0) sk:on("receive", function(sck, c) print(c) end ) sk:connect(80,"115.239.210.27")
sk:send("GET / HTTP/1.1\r\nHost: 115.239.210.27\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk=net.createConnection(net.TCP, 1) sk:on("receive", function(sck, c) print(c) end )
sk:on("connection", function(sck) sck:send("GET / HTTPS/1.1\r\nHost: www.google.com.hk\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n") end ) sk:connect(443,"173.194.72.199")
wifi.sta.setip({ip="192.168.18.119",netmask="255.255.255.0",gateway="192.168.18.1"})
uart.on("data","\r",function(input) if input=="quit\r" then uart.on("data") else print(input) end end, 0)
uart.on("data","\n",function(input) if input=="quit\n" then uart.on("data") else print(input) end end, 0)
uart.on("data", 5 ,function(input) if input=="quit\r" then uart.on("data") else print(input) end end, 0)
uart.on("data", 0 ,function(input) if input=="q" then uart.on("data") else print(input) end end, 0)
uart.on("data","\r",function(input) if input=="quit" then uart.on("data") else print(input) end end, 1)
for k, v in pairs(file.list()) do print('file:'..k..' len:'..v) end
m=mqtt.Client()
m:connect("192.168.18.101",1883)
m:subscribe("/topic",0,function(m) print("sub done") end)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:publish("/topic","hello",0,0)
uart.setup(0,9600,8,0,1,0)
sv=net.createServer(net.TCP, 60)
global_c = nil
sv:listen(9999, function(c)
if global_c~=nil then
global_c:close()
end
global_c=c
c:on("receive",function(sck,pl) uart.write(0,pl) end)
end)
uart.on("data",4, function(data)
if global_c~=nil then
global_c:send(data)
end
end, 0)
file.open("hello.lua","w+")
file.writeline([[print("hello nodemcu")]])
file.writeline([[print(node.heap())]])
file.close()
node.compile("hello.lua")
dofile("hello.lua")
dofile("hello.lc")
-- use copper addon for firefox
cs=coap.Server()
cs:listen(5683)
myvar=1
cs:var("myvar") -- get coap://192.168.18.103:5683/v1/v/myvar will return the value of myvar: 1
-- function should tack one string, return one string.
function myfun(payload)
print("myfun called")
respond = "hello"
return respond
end
cs:func("myfun") -- post coap://192.168.18.103:5683/v1/f/myfun will call myfun
cc = coap.Client()
cc:get(coap.CON, "coap://192.168.18.100:5683/.well-known/core")
cc:post(coap.NON, "coap://192.168.18.100:5683/", "Hello")
file.open("test1.txt", "a+") for i = 1, 100*1000 do file.write("x") end file.close() print("Done.")
for n,s in pairs(file.list()) do print(n.." size: "..s) end
file.remove("test1.txt")
for n,s in pairs(file.list()) do print(n.." size: "..s) end
file.open("test2.txt", "a+") for i = 1, 1*1000 do file.write("x") end file.close() print("Done.")
function TestDNSLeak()
c=net.createConnection(net.TCP, 0)
c:connect(80, "bad-name.tlddfdf")
tmr.alarm(1, 3000, 0, function() print("hack socket close, MEM: "..node.heap()) c:close() end) -- socket timeout hack
print("MEM: "..node.heap())
end
v="abc%0D%0Adef"
print(string.gsub(v, "%%(%x%x)", function(x) return string.char(tonumber(x, 16)) end))
function ex(x) string.find("abc%0Ddef","bc") return 's' end
string.gsub("abc%0Ddef", "%%(%x%x)", ex)
function ex(x) string.char(35) return 's' end
string.gsub("abc%0Ddef", "%%(%x%x)", ex) print("hello")
function ex(x) string.lower('Ab') return 's' end
string.gsub("abc%0Ddef", "%%(%x%x)", ex) print("hello")
v="abc%0D%0Adef"
pcall(function() print(string.gsub(v, "%%(%x%x)", function(x) return string.char(tonumber(x, 16)) end)) end)
mosca -v | bunyan
m=mqtt.Client()
m:connect("192.168.18.88",1883)
topic={}
topic["/topic1"]=0
topic["/topic2"]=0
m:subscribe(topic,function(m) print("sub done") end)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:publish("/topic1","hello",0,0)
m:publish("/topic3","hello",0,0) m:publish("/topic4","hello",0,0)
m=mqtt.Client()
m:connect("192.168.18.88",1883)
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:subscribe("/topic2",0,function(m) print("sub done") end)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:publish("/topic1","hello",0,0)
m:publish("/topic3","hello",0,0) m:publish("/topic4","hello",0,0)
m:publish("/topic1","hello1",0,0) m:publish("/topic2","hello2",0,0)
m:publish("/topic1","hello",1,0)
m:subscribe("/topic3",0,function(m) print("sub done") end)
m:publish("/topic3","hello3",2,0)
m=mqtt.Client()
m:connect("192.168.18.88",1883, function(con) print("connected hello") end)
m=mqtt.Client()
m:on("connect",function(m) print("connection") end )
m:connect("192.168.18.88",1883)
m:on("offline",function(m) print("disconnection") end )
m=mqtt.Client()
m:on("connect",function(m) print("connection "..node.heap()) end )
m:on("offline", function(conn)
if conn == nil then print("conn is nil") end
print("Reconnect to broker...")
print(node.heap())
conn:connect("192.168.18.88",1883,0,1)
end)
m:connect("192.168.18.88",1883,0,1)
m=mqtt.Client()
m:on("connect",function(m) print("connection "..node.heap()) end )
m:on("offline", function(conn)
if conn == nil then print("conn is nil") end
print("Reconnect to broker...")
print(node.heap())
conn:connect("192.168.18.88",1883)
end)
m:connect("192.168.18.88",1883)
m:close()
m=mqtt.Client()
m:connect("192.168.18.88",1883)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:publish("/topic1","hello3",2,0) m:publish("/topic1","hello2",2,0)
m:publish("/topic1","hello3",0,0) m:publish("/topic1","hello2",2,0)
m:subscribe("/topic2",2,function(m) print("sub done") end)
m:publish("/topic2","hello3",0,0) m:publish("/topic2","hello2",2,0)
m=mqtt.Client()
m:on("connect",function(m)
print("connection "..node.heap())
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:publish("/topic1","hello3",0,0) m:publish("/topic1","hello2",2,0)
end )
m:on("offline", function(conn)
print("disconnect to broker...")
print(node.heap())
end)
m:connect("192.168.18.88",1883,0,1)
-- serout( pin, firstLevel, delay_table, [repeatNum] )
gpio.mode(1,gpio.OUTPUT,gpio.PULLUP)
gpio.serout(1,1,{30,30,60,60,30,30}) -- serial one byte, b10110010
gpio.serout(1,1,{30,70},8) -- serial 30% pwm 10k, lasts 8 cycles
gpio.serout(1,1,{3,7},8) -- serial 30% pwm 100k, lasts 8 cycles
gpio.serout(1,1,{0,0},8) -- serial 50% pwm as fast as possible, lasts 8 cycles
gpio.mode(1,gpio.OUTPUT,gpio.PULLUP)
gpio.serout(1,0,{20,10,10,20,10,10,10,100}) -- sim uart one byte 0x5A at about 100kbps
gpio.serout(1,1,{8,18},8) -- serial 30% pwm 38k, lasts 8 cycles
-- Lua: mqtt.Client(clientid, keepalive, user, pass)
-- test with cloudmqtt.com
m_dis={}
function dispatch(m,t,pl)
if pl~=nil and m_dis[t] then
m_dis[t](pl)
end
end
function topic1func(pl)
print("get1: "..pl)
end
function topic2func(pl)
print("get2: "..pl)
end
m_dis["/topic1"]=topic1func
m_dis["/topic2"]=topic2func
m=mqtt.Client("nodemcu1",60,"test","test123")
m:on("connect",function(m)
print("connection "..node.heap())
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:subscribe("/topic2",0,function(m) print("sub done") end)
m:publish("/topic1","hello",0,0) m:publish("/topic2","world",0,0)
end )
m:on("offline", function(conn)
print("disconnect to broker...")
print(node.heap())
end)
m:on("message",dispatch )
m:connect("m11.cloudmqtt.com",11214,0,1)
-- Lua: mqtt:connect( host, port, secure, auto_reconnect, function(client) )
tmr.alarm(0,10000,1,function() local pl = "time: "..tmr.time()
m:publish("/topic1",pl,0,0)
end)
| mit |
gentooliano/nodemcu-firmware | nodemcu_0.9.6-dev/nodemcu-firmware-0.9.6-dev_20150704/examples/fragment.lua | 55 | 19918 | pwm.setup(0,500,50) pwm.setup(1,500,50) pwm.setup(2,500,50)
pwm.start(0) pwm.start(1) pwm.start(2)
function led(r,g,b) pwm.setduty(0,g) pwm.setduty(1,b) pwm.setduty(2,r) end
wifi.sta.autoconnect(1)
a=0
tmr.alarm( 1000,1,function() if a==0 then a=1 led(50,50,50) else a=0 led(0,0,0) end end)
sv:on("receive", function(s,c) s:send("<h1> Hello, world.</h1>") print(c) end )
sk=net.createConnection(net.TCP, 0)
sk:on("receive", function(sck, c) print(c) end )
sk:connect(80,"115.239.210.27")
sk:send("GET / HTTP/1.1\r\nHost: 115.239.210.27\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk:connect(80,"192.168.0.66")
sk:send("GET / HTTP/1.1\r\nHost: 192.168.0.66\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
i2c.setup(0,1,0,i2c.SLOW)
function read_bmp(addr) i2c.start(0) i2c.address(0,119,i2c.RECEIVER) c=i2c.read(0,1) i2c.stop(0) print(string.byte(c)) end
function read_bmp(addr) i2c.start(0) i2c.address(0,119,i2c.TRANSMITTER) i2c.write(0,addr) i2c.stop(0) i2c.start(0) i2c.address(0,119,i2c.RECEIVER) c=i2c.read(0,2) i2c.stop(0) return c end
s=net.createServer(net.TCP) s:listen(80,function(c) end)
ss=net.createServer(net.TCP) ss:listen(80,function(c) end)
s=net.createServer(net.TCP) s:listen(80,function(c) c:on("receive",function(s,c) print(c) end) end)
s=net.createServer(net.UDP)
s:on("receive",function(s,c) print(c) end)
s:listen(5683)
su=net.createConnection(net.UDP)
su:on("receive",function(su,c) print(c) end)
su:connect(5683,"192.168.18.101")
su:send("hello")
mm=node.list()
for k, v in pairs(mm) do print('file:'..k..' len:'..v) end
for k,v in pairs(d) do print("n:"..k..", s:"..v) end
gpio.mode(0,gpio.INT) gpio.trig(0,"down",function(l) print("level="..l) end)
t0 = 0;
function tr0(l) print(tmr.now() - t0) t0 = tmr.now()
if l==1 then gpio.trig(0,"down") else gpio.trig(0,"up") end end
gpio.mode(0,gpio.INT)
gpio.trig(0,"down",tr0)
su=net.createConnection(net.UDP)
su:on("receive",function(su,c) print(c) end)
su:connect(5001,"114.215.154.114")
su:send([[{"type":"signin","name":"nodemcu","password":"123456"}]])
su:send([[{"type":"signout","name":"nodemcu","password":"123456"}]])
su:send([[{"type":"connect","from":"nodemcu","to":"JYP","password":"123456"}]])
su:send("hello world")
s=net.createServer(net.TCP) s:listen(8008,function(c) c:on("receive",function(s,c) print(c) pcall(loadstring(c)) end) end)
s=net.createServer(net.TCP) s:listen(8008,function(c) con_std = c function s_output(str) if(con_std~=nil) then con_std:send(str) end end
node.output(s_output, 0) c:on("receive",function(c,l) node.input(l) end) c:on("disconnection",function(c) con_std = nil node.output(nil) end) end)
s=net.createServer(net.TCP)
s:listen(23,function(c)
con_std = c
function s_output(str)
if(con_std~=nil)
then con_std:send(str)
end
end
node.output(s_output, 0)
c:on("receive",function(c,l) node.input(l) end)
c:on("disconnection",function(c)
con_std = nil
node.output(nil)
end)
end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
print(node.heap()) door="open" if gpio.read(8)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>") conn:close() end) end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
print(node.heap()) print(adc.read(0)) door="open" if gpio.read(0)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>") end) conn:on("sent",function(conn) conn:close() end) end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(node.heap())
door="open"
if gpio.read(0)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>")
end)
conn:on("sent",function(conn) conn:close() end)
end)
port = 9999
hostip = "192.168.1.99"
sk=net.createConnection(net.TCP, false)
sk:on("receive", function(conn, pl) print(pl) end )
sk:connect(port, hostip)
file.remove("init.lua")
file.open("init.lua","w")
file.writeline([[print("Petes Tester 4")]])
file.writeline([[tmr.alarm(5000, 0, function() dofile("thelot.lua") end )]])
file.close()
file.remove("thelot.lua")
file.open("thelot.lua","w")
file.writeline([[tmr.stop()]])
file.writeline([[connecttoap = function (ssid,pw)]])
file.writeline([[print(wifi.sta.getip())]])
file.writeline([[wifi.setmode(wifi.STATION)]])
file.writeline([[tmr.delay(1000000)]])
file.writeline([[wifi.sta.config(ssid,pw)]])
file.writeline([[tmr.delay(5000000)]])
file.writeline([[print("Connected to ",ssid," as ",wifi.sta.getip())]])
file.writeline([[end]])
file.writeline([[connecttoap("MyHub","0011223344")]])
file.close()
s=net.createServer(net.UDP) s:listen(5683) s:on("receive",function(s,c) print(c) s:send("echo:"..c) end)
s:on("sent",function(s) print("echo donn") end)
sk=net.createConnection(net.UDP, 0) sk:on("receive", function(sck, c) print(c) end ) sk:connect(8080,"192.168.0.88")
sk:send("GET / HTTP/1.1\r\nHost: 192.168.0.88\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
srv=net.createServer(net.TCP, 5) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
print(node.heap()) print(adc.read(0)) door="open" if gpio.read(0)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>") end) end)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(payload) print(node.heap())
conn:send("<h1> Hello, NodeMcu.</h1>")
end)
conn:on("sent",function(conn) conn:close() end)
end)
function startServer()
print("WIFI AP connected. Wicon IP:")
print(wifi.sta.getip())
sv=net.createServer(net.TCP,180)
sv:listen(8080,function(conn)
print("Wifi console connected.")
function s_output(str)
if(conn~=nil) then
conn:send(str)
end
end
node.output(s_output,0)
conn:on("receive",function(conn,pl)
node.input(pl)
if (conn==nil) then
print("conn is nil")
end
print("hello")
mycounter=0 srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
if string.find(payload,"?myarg=") then mycounter=mycounter+1
m="<br/>Value= " .. string.sub(payload,string.find(payload,"?myarg=")+7,string.find(payload,"HTTP")-2) else m="" end
conn:send("<h1> Hello, this is Pete's web page.</h1>How are you today.<br/> Count=" .. mycounter .. m .. "Heap=".. node.heap())
end) conn:on("sent",function(conn) conn:close() conn = nil end) end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n") conn:send("Connection: close\r\n\r\n") conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap()) conn:close() end) end)
conn=net.createConnection(net.TCP)
conn:dns("www.nodemcu.com",function(conn,ip) print(ip) print("hell") end)
function connected(conn) conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n") conn:send("Connection: close\r\n\r\n") conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap()) conn:close() end) end
srv=net.createServer(net.TCP)
srv:on("connection",function(conn) conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n") conn:send("Connection: close\r\n\r\n") conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap()) conn:close() end) end)
srv:listen(80)
-- sieve.lua
-- the sieve of Eratosthenes programmed with coroutines
-- typical usage: lua -e N=500 sieve.lua | column
-- generate all the numbers from 2 to n
function gen (n) return coroutine.wrap(function () for i=2,n do coroutine.yield(i) end end) end
-- filter the numbers generated by `g', removing multiples of `p'
function filter (p, g) return coroutine.wrap(function () for n in g do if n%p ~= 0 then coroutine.yield(n) end end end) end
N=N or 500 -- from command line
x = gen(N) -- generate primes up to N
while 1 do
local n = x() -- pick a number until done
if n == nil then break end
print(n) -- must be a prime number
x = filter(n, x) -- now remove its multiples
end
file.remove("mylistener.lua")
file.open("mylistener.lua","w")
file.writeline([[gpio2 = 9]])
file.writeline([[gpio0 = 8]])
file.writeline([[gpio.mode(gpio2,gpio.OUTPUT)]])
file.writeline([[gpio.write(gpio2,gpio.LOW)]])
file.writeline([[gpio.mode(gpio0,gpio.OUTPUT)]])
file.writeline([[gpio.write(gpio0,gpio.LOW)]])
file.writeline([[l1="0\n"]])
file.writeline([[l2="0\n"]])
file.writeline([[l3="0\n"]])
file.writeline([[l4="0\n"]])
file.writeline([[sv=net.createServer(net.TCP, 5) ]])
file.writeline([[sv:listen(4000,function(c)]])
file.writeline([[c:on("disconnection", function(c) print("Bye") end )]])
file.writeline([[c:on("receive", function(sck, pl) ]])
-- file.writeline([[print(pl) ]])
file.writeline([[if (pl=="GO1\n") then c:send(l1) ]])
file.writeline([[elseif pl=="GO2\n" then c:send(l2) ]])
file.writeline([[elseif pl=="GO3\n" then c:send(l3) ]])
file.writeline([[elseif pl=="GO4\n" then c:send(l4) ]])
file.writeline([[elseif pl=="YES1\n" then l1="1\n" c:send("OK\n") gpio.write(gpio2,gpio.HIGH) ]])
file.writeline([[elseif pl=="NO1\n" then l1="0\n" c:send("OK\n") gpio.write(gpio2,gpio.LOW) ]])
file.writeline([[elseif pl=="YES2\n" then l2="1\n" c:send("OK\n") gpio.write(gpio0,gpio.HIGH) ]])
file.writeline([[elseif pl=="NO2\n" then l2="0\n" c:send("OK\n") gpio.write(gpio0,gpio.LOW) ]])
file.writeline([[elseif pl=="YES3\n" then l3="1\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[elseif pl=="NO3\n" then l3="0\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[elseif pl=="YES4\n" then l4="1\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[elseif pl=="NO4\n" then l4="0\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[else c:send("0\n") print(node.heap()) ]])
file.writeline([[end]])
file.writeline([[end)]])
file.writeline([[end)]])
file.close()
file.remove("myli.lua") file.open("myli.lua","w")
file.writeline([[sv=net.createServer(net.TCP, 5) ]])
file.writeline([[sv:listen(4000,function(c)]])
file.writeline([[c:on("disconnection", function(c) print("Bye") end )]])
--file.writeline([[c:on("sent", function(c) c:close() end )]])
file.writeline([[c:on("receive", function(sck, pl) ]])
file.writeline([[sck:send("0\n") print(node.heap()) ]])
file.writeline([[end)]]) file.writeline([[end)]]) file.close()
sv=net.createServer(net.TCP, 50) sv:listen(4000,function(c) c:on("disconnection",function(c) print("Bye") end)
c:on("receive", function(sck, pl) sck:send("0\n") print(node.heap()) end) end)
sv=net.createServer(net.TCP, 5) sv:listen(4000,function(c) c:on("disconnection",function(c) print("Bye") end)
c:on("receive", function(sck, pl) sck:send("0\n") print(node.heap()) end) c:on("sent", function(sck) sck:close() end) end)
s=net.createServer(net.UDP)
s:on("receive",function(s,c) print(c) end)
s:listen(8888)
print("This is a long long long line to test the memory limit of nodemcu firmware\n")
collectgarbage("setmemlimit",8)
print(collectgarbage("getmemlimit"))
tmr.alarm(1,5000,1,function() print("alarm 1") end)
tmr.stop(1)
tmr.alarm(0,1000,1,function() print("alarm 0") end)
tmr.stop(0)
tmr.alarm(2,2000,1,function() print("alarm 2") end)
tmr.stop(2)
tmr.alarm(6,2000,1,function() print("alarm 6") end)
tmr.stop(6)
for k,v in pairs(_G.package.loaded) do print(k) end
for k,v in pairs(_G) do print(k) end
for k,v in pairs(d) do print("n:"..k..", s:"..v) end
a="pin=9"
t={}
for k, v in string.gmatch(a, "(%w+)=(%w+)") do t[k]=v end
print(t["pin"])
function switch() gpio.mode(4,gpio.OUTPUT) gpio.mode(5,gpio.OUTPUT) tmr.delay(1000000) print("hello world") end
tmr.alarm(0,10000,0,function () uart.setup(0,9600,8,0,1) end) switch()
sk=net.createConnection(net.TCP, 0) sk:on("receive", function(sck, c) print(c) end ) sk:connect(80,"www.nodemcu.com") sk:send("GET / HTTP/1.1\r\nHost: www.nodemcu.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk=net.createConnection(net.TCP, 0) sk:on("receive", function(sck, c) print(c) end )
sk:on("connection", function(sck) sck:send("GET / HTTP/1.1\r\nHost: www.nodemcu.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n") end ) sk:connect(80,"www.nodemcu.com")
sk=net.createConnection(net.TCP, 0) sk:on("receive", function(sck, c) print(c) end ) sk:connect(80,"115.239.210.27")
sk:send("GET / HTTP/1.1\r\nHost: 115.239.210.27\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk=net.createConnection(net.TCP, 1) sk:on("receive", function(sck, c) print(c) end )
sk:on("connection", function(sck) sck:send("GET / HTTPS/1.1\r\nHost: www.google.com.hk\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n") end ) sk:connect(443,"173.194.72.199")
wifi.sta.setip({ip="192.168.18.119",netmask="255.255.255.0",gateway="192.168.18.1"})
uart.on("data","\r",function(input) if input=="quit\r" then uart.on("data") else print(input) end end, 0)
uart.on("data","\n",function(input) if input=="quit\n" then uart.on("data") else print(input) end end, 0)
uart.on("data", 5 ,function(input) if input=="quit\r" then uart.on("data") else print(input) end end, 0)
uart.on("data", 0 ,function(input) if input=="q" then uart.on("data") else print(input) end end, 0)
uart.on("data","\r",function(input) if input=="quit" then uart.on("data") else print(input) end end, 1)
for k, v in pairs(file.list()) do print('file:'..k..' len:'..v) end
m=mqtt.Client()
m:connect("192.168.18.101",1883)
m:subscribe("/topic",0,function(m) print("sub done") end)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:publish("/topic","hello",0,0)
uart.setup(0,9600,8,0,1,0)
sv=net.createServer(net.TCP, 60)
global_c = nil
sv:listen(9999, function(c)
if global_c~=nil then
global_c:close()
end
global_c=c
c:on("receive",function(sck,pl) uart.write(0,pl) end)
end)
uart.on("data",4, function(data)
if global_c~=nil then
global_c:send(data)
end
end, 0)
file.open("hello.lua","w+")
file.writeline([[print("hello nodemcu")]])
file.writeline([[print(node.heap())]])
file.close()
node.compile("hello.lua")
dofile("hello.lua")
dofile("hello.lc")
-- use copper addon for firefox
cs=coap.Server()
cs:listen(5683)
myvar=1
cs:var("myvar") -- get coap://192.168.18.103:5683/v1/v/myvar will return the value of myvar: 1
-- function should tack one string, return one string.
function myfun(payload)
print("myfun called")
respond = "hello"
return respond
end
cs:func("myfun") -- post coap://192.168.18.103:5683/v1/f/myfun will call myfun
cc = coap.Client()
cc:get(coap.CON, "coap://192.168.18.100:5683/.well-known/core")
cc:post(coap.NON, "coap://192.168.18.100:5683/", "Hello")
file.open("test1.txt", "a+") for i = 1, 100*1000 do file.write("x") end file.close() print("Done.")
for n,s in pairs(file.list()) do print(n.." size: "..s) end
file.remove("test1.txt")
for n,s in pairs(file.list()) do print(n.." size: "..s) end
file.open("test2.txt", "a+") for i = 1, 1*1000 do file.write("x") end file.close() print("Done.")
function TestDNSLeak()
c=net.createConnection(net.TCP, 0)
c:connect(80, "bad-name.tlddfdf")
tmr.alarm(1, 3000, 0, function() print("hack socket close, MEM: "..node.heap()) c:close() end) -- socket timeout hack
print("MEM: "..node.heap())
end
v="abc%0D%0Adef"
print(string.gsub(v, "%%(%x%x)", function(x) return string.char(tonumber(x, 16)) end))
function ex(x) string.find("abc%0Ddef","bc") return 's' end
string.gsub("abc%0Ddef", "%%(%x%x)", ex)
function ex(x) string.char(35) return 's' end
string.gsub("abc%0Ddef", "%%(%x%x)", ex) print("hello")
function ex(x) string.lower('Ab') return 's' end
string.gsub("abc%0Ddef", "%%(%x%x)", ex) print("hello")
v="abc%0D%0Adef"
pcall(function() print(string.gsub(v, "%%(%x%x)", function(x) return string.char(tonumber(x, 16)) end)) end)
mosca -v | bunyan
m=mqtt.Client()
m:connect("192.168.18.88",1883)
topic={}
topic["/topic1"]=0
topic["/topic2"]=0
m:subscribe(topic,function(m) print("sub done") end)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:publish("/topic1","hello",0,0)
m:publish("/topic3","hello",0,0) m:publish("/topic4","hello",0,0)
m=mqtt.Client()
m:connect("192.168.18.88",1883)
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:subscribe("/topic2",0,function(m) print("sub done") end)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:publish("/topic1","hello",0,0)
m:publish("/topic3","hello",0,0) m:publish("/topic4","hello",0,0)
m:publish("/topic1","hello1",0,0) m:publish("/topic2","hello2",0,0)
m:publish("/topic1","hello",1,0)
m:subscribe("/topic3",0,function(m) print("sub done") end)
m:publish("/topic3","hello3",2,0)
m=mqtt.Client()
m:connect("192.168.18.88",1883, function(con) print("connected hello") end)
m=mqtt.Client()
m:on("connect",function(m) print("connection") end )
m:connect("192.168.18.88",1883)
m:on("offline",function(m) print("disconnection") end )
m=mqtt.Client()
m:on("connect",function(m) print("connection "..node.heap()) end )
m:on("offline", function(conn)
if conn == nil then print("conn is nil") end
print("Reconnect to broker...")
print(node.heap())
conn:connect("192.168.18.88",1883,0,1)
end)
m:connect("192.168.18.88",1883,0,1)
m=mqtt.Client()
m:on("connect",function(m) print("connection "..node.heap()) end )
m:on("offline", function(conn)
if conn == nil then print("conn is nil") end
print("Reconnect to broker...")
print(node.heap())
conn:connect("192.168.18.88",1883)
end)
m:connect("192.168.18.88",1883)
m:close()
m=mqtt.Client()
m:connect("192.168.18.88",1883)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:publish("/topic1","hello3",2,0) m:publish("/topic1","hello2",2,0)
m:publish("/topic1","hello3",0,0) m:publish("/topic1","hello2",2,0)
m:subscribe("/topic2",2,function(m) print("sub done") end)
m:publish("/topic2","hello3",0,0) m:publish("/topic2","hello2",2,0)
m=mqtt.Client()
m:on("connect",function(m)
print("connection "..node.heap())
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:publish("/topic1","hello3",0,0) m:publish("/topic1","hello2",2,0)
end )
m:on("offline", function(conn)
print("disconnect to broker...")
print(node.heap())
end)
m:connect("192.168.18.88",1883,0,1)
-- serout( pin, firstLevel, delay_table, [repeatNum] )
gpio.mode(1,gpio.OUTPUT,gpio.PULLUP)
gpio.serout(1,1,{30,30,60,60,30,30}) -- serial one byte, b10110010
gpio.serout(1,1,{30,70},8) -- serial 30% pwm 10k, lasts 8 cycles
gpio.serout(1,1,{3,7},8) -- serial 30% pwm 100k, lasts 8 cycles
gpio.serout(1,1,{0,0},8) -- serial 50% pwm as fast as possible, lasts 8 cycles
gpio.mode(1,gpio.OUTPUT,gpio.PULLUP)
gpio.serout(1,0,{20,10,10,20,10,10,10,100}) -- sim uart one byte 0x5A at about 100kbps
gpio.serout(1,1,{8,18},8) -- serial 30% pwm 38k, lasts 8 cycles
-- Lua: mqtt.Client(clientid, keepalive, user, pass)
-- test with cloudmqtt.com
m_dis={}
function dispatch(m,t,pl)
if pl~=nil and m_dis[t] then
m_dis[t](pl)
end
end
function topic1func(pl)
print("get1: "..pl)
end
function topic2func(pl)
print("get2: "..pl)
end
m_dis["/topic1"]=topic1func
m_dis["/topic2"]=topic2func
m=mqtt.Client("nodemcu1",60,"test","test123")
m:on("connect",function(m)
print("connection "..node.heap())
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:subscribe("/topic2",0,function(m) print("sub done") end)
m:publish("/topic1","hello",0,0) m:publish("/topic2","world",0,0)
end )
m:on("offline", function(conn)
print("disconnect to broker...")
print(node.heap())
end)
m:on("message",dispatch )
m:connect("m11.cloudmqtt.com",11214,0,1)
-- Lua: mqtt:connect( host, port, secure, auto_reconnect, function(client) )
tmr.alarm(0,10000,1,function() local pl = "time: "..tmr.time()
m:publish("/topic1",pl,0,0)
end)
| mit |
zerog2k/nodemcu-firmware | examples/fragment.lua | 55 | 19918 | pwm.setup(0,500,50) pwm.setup(1,500,50) pwm.setup(2,500,50)
pwm.start(0) pwm.start(1) pwm.start(2)
function led(r,g,b) pwm.setduty(0,g) pwm.setduty(1,b) pwm.setduty(2,r) end
wifi.sta.autoconnect(1)
a=0
tmr.alarm( 1000,1,function() if a==0 then a=1 led(50,50,50) else a=0 led(0,0,0) end end)
sv:on("receive", function(s,c) s:send("<h1> Hello, world.</h1>") print(c) end )
sk=net.createConnection(net.TCP, 0)
sk:on("receive", function(sck, c) print(c) end )
sk:connect(80,"115.239.210.27")
sk:send("GET / HTTP/1.1\r\nHost: 115.239.210.27\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk:connect(80,"192.168.0.66")
sk:send("GET / HTTP/1.1\r\nHost: 192.168.0.66\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
i2c.setup(0,1,0,i2c.SLOW)
function read_bmp(addr) i2c.start(0) i2c.address(0,119,i2c.RECEIVER) c=i2c.read(0,1) i2c.stop(0) print(string.byte(c)) end
function read_bmp(addr) i2c.start(0) i2c.address(0,119,i2c.TRANSMITTER) i2c.write(0,addr) i2c.stop(0) i2c.start(0) i2c.address(0,119,i2c.RECEIVER) c=i2c.read(0,2) i2c.stop(0) return c end
s=net.createServer(net.TCP) s:listen(80,function(c) end)
ss=net.createServer(net.TCP) ss:listen(80,function(c) end)
s=net.createServer(net.TCP) s:listen(80,function(c) c:on("receive",function(s,c) print(c) end) end)
s=net.createServer(net.UDP)
s:on("receive",function(s,c) print(c) end)
s:listen(5683)
su=net.createConnection(net.UDP)
su:on("receive",function(su,c) print(c) end)
su:connect(5683,"192.168.18.101")
su:send("hello")
mm=node.list()
for k, v in pairs(mm) do print('file:'..k..' len:'..v) end
for k,v in pairs(d) do print("n:"..k..", s:"..v) end
gpio.mode(0,gpio.INT) gpio.trig(0,"down",function(l) print("level="..l) end)
t0 = 0;
function tr0(l) print(tmr.now() - t0) t0 = tmr.now()
if l==1 then gpio.trig(0,"down") else gpio.trig(0,"up") end end
gpio.mode(0,gpio.INT)
gpio.trig(0,"down",tr0)
su=net.createConnection(net.UDP)
su:on("receive",function(su,c) print(c) end)
su:connect(5001,"114.215.154.114")
su:send([[{"type":"signin","name":"nodemcu","password":"123456"}]])
su:send([[{"type":"signout","name":"nodemcu","password":"123456"}]])
su:send([[{"type":"connect","from":"nodemcu","to":"JYP","password":"123456"}]])
su:send("hello world")
s=net.createServer(net.TCP) s:listen(8008,function(c) c:on("receive",function(s,c) print(c) pcall(loadstring(c)) end) end)
s=net.createServer(net.TCP) s:listen(8008,function(c) con_std = c function s_output(str) if(con_std~=nil) then con_std:send(str) end end
node.output(s_output, 0) c:on("receive",function(c,l) node.input(l) end) c:on("disconnection",function(c) con_std = nil node.output(nil) end) end)
s=net.createServer(net.TCP)
s:listen(23,function(c)
con_std = c
function s_output(str)
if(con_std~=nil)
then con_std:send(str)
end
end
node.output(s_output, 0)
c:on("receive",function(c,l) node.input(l) end)
c:on("disconnection",function(c)
con_std = nil
node.output(nil)
end)
end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
print(node.heap()) door="open" if gpio.read(8)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>") conn:close() end) end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
print(node.heap()) print(adc.read(0)) door="open" if gpio.read(0)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>") end) conn:on("sent",function(conn) conn:close() end) end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(node.heap())
door="open"
if gpio.read(0)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>")
end)
conn:on("sent",function(conn) conn:close() end)
end)
port = 9999
hostip = "192.168.1.99"
sk=net.createConnection(net.TCP, false)
sk:on("receive", function(conn, pl) print(pl) end )
sk:connect(port, hostip)
file.remove("init.lua")
file.open("init.lua","w")
file.writeline([[print("Petes Tester 4")]])
file.writeline([[tmr.alarm(5000, 0, function() dofile("thelot.lua") end )]])
file.close()
file.remove("thelot.lua")
file.open("thelot.lua","w")
file.writeline([[tmr.stop()]])
file.writeline([[connecttoap = function (ssid,pw)]])
file.writeline([[print(wifi.sta.getip())]])
file.writeline([[wifi.setmode(wifi.STATION)]])
file.writeline([[tmr.delay(1000000)]])
file.writeline([[wifi.sta.config(ssid,pw)]])
file.writeline([[tmr.delay(5000000)]])
file.writeline([[print("Connected to ",ssid," as ",wifi.sta.getip())]])
file.writeline([[end]])
file.writeline([[connecttoap("MyHub","0011223344")]])
file.close()
s=net.createServer(net.UDP) s:listen(5683) s:on("receive",function(s,c) print(c) s:send("echo:"..c) end)
s:on("sent",function(s) print("echo donn") end)
sk=net.createConnection(net.UDP, 0) sk:on("receive", function(sck, c) print(c) end ) sk:connect(8080,"192.168.0.88")
sk:send("GET / HTTP/1.1\r\nHost: 192.168.0.88\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
srv=net.createServer(net.TCP, 5) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
print(node.heap()) print(adc.read(0)) door="open" if gpio.read(0)==1 then door="open" else door="closed" end
conn:send("<h1> Door Sensor. The door is " .. door ..".</h1>") end) end)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(payload) print(node.heap())
conn:send("<h1> Hello, NodeMcu.</h1>")
end)
conn:on("sent",function(conn) conn:close() end)
end)
function startServer()
print("WIFI AP connected. Wicon IP:")
print(wifi.sta.getip())
sv=net.createServer(net.TCP,180)
sv:listen(8080,function(conn)
print("Wifi console connected.")
function s_output(str)
if(conn~=nil) then
conn:send(str)
end
end
node.output(s_output,0)
conn:on("receive",function(conn,pl)
node.input(pl)
if (conn==nil) then
print("conn is nil")
end
print("hello")
mycounter=0 srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
if string.find(payload,"?myarg=") then mycounter=mycounter+1
m="<br/>Value= " .. string.sub(payload,string.find(payload,"?myarg=")+7,string.find(payload,"HTTP")-2) else m="" end
conn:send("<h1> Hello, this is Pete's web page.</h1>How are you today.<br/> Count=" .. mycounter .. m .. "Heap=".. node.heap())
end) conn:on("sent",function(conn) conn:close() conn = nil end) end)
srv=net.createServer(net.TCP) srv:listen(80,function(conn) conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n") conn:send("Connection: close\r\n\r\n") conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap()) conn:close() end) end)
conn=net.createConnection(net.TCP)
conn:dns("www.nodemcu.com",function(conn,ip) print(ip) print("hell") end)
function connected(conn) conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n") conn:send("Connection: close\r\n\r\n") conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap()) conn:close() end) end
srv=net.createServer(net.TCP)
srv:on("connection",function(conn) conn:on("receive",function(conn,payload)
conn:send("HTTP/1.1 200 OK\r\n") conn:send("Connection: close\r\n\r\n") conn:send("<h1> Hello, NodeMcu.</h1>")
print(node.heap()) conn:close() end) end)
srv:listen(80)
-- sieve.lua
-- the sieve of Eratosthenes programmed with coroutines
-- typical usage: lua -e N=500 sieve.lua | column
-- generate all the numbers from 2 to n
function gen (n) return coroutine.wrap(function () for i=2,n do coroutine.yield(i) end end) end
-- filter the numbers generated by `g', removing multiples of `p'
function filter (p, g) return coroutine.wrap(function () for n in g do if n%p ~= 0 then coroutine.yield(n) end end end) end
N=N or 500 -- from command line
x = gen(N) -- generate primes up to N
while 1 do
local n = x() -- pick a number until done
if n == nil then break end
print(n) -- must be a prime number
x = filter(n, x) -- now remove its multiples
end
file.remove("mylistener.lua")
file.open("mylistener.lua","w")
file.writeline([[gpio2 = 9]])
file.writeline([[gpio0 = 8]])
file.writeline([[gpio.mode(gpio2,gpio.OUTPUT)]])
file.writeline([[gpio.write(gpio2,gpio.LOW)]])
file.writeline([[gpio.mode(gpio0,gpio.OUTPUT)]])
file.writeline([[gpio.write(gpio0,gpio.LOW)]])
file.writeline([[l1="0\n"]])
file.writeline([[l2="0\n"]])
file.writeline([[l3="0\n"]])
file.writeline([[l4="0\n"]])
file.writeline([[sv=net.createServer(net.TCP, 5) ]])
file.writeline([[sv:listen(4000,function(c)]])
file.writeline([[c:on("disconnection", function(c) print("Bye") end )]])
file.writeline([[c:on("receive", function(sck, pl) ]])
-- file.writeline([[print(pl) ]])
file.writeline([[if (pl=="GO1\n") then c:send(l1) ]])
file.writeline([[elseif pl=="GO2\n" then c:send(l2) ]])
file.writeline([[elseif pl=="GO3\n" then c:send(l3) ]])
file.writeline([[elseif pl=="GO4\n" then c:send(l4) ]])
file.writeline([[elseif pl=="YES1\n" then l1="1\n" c:send("OK\n") gpio.write(gpio2,gpio.HIGH) ]])
file.writeline([[elseif pl=="NO1\n" then l1="0\n" c:send("OK\n") gpio.write(gpio2,gpio.LOW) ]])
file.writeline([[elseif pl=="YES2\n" then l2="1\n" c:send("OK\n") gpio.write(gpio0,gpio.HIGH) ]])
file.writeline([[elseif pl=="NO2\n" then l2="0\n" c:send("OK\n") gpio.write(gpio0,gpio.LOW) ]])
file.writeline([[elseif pl=="YES3\n" then l3="1\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[elseif pl=="NO3\n" then l3="0\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[elseif pl=="YES4\n" then l4="1\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[elseif pl=="NO4\n" then l4="0\n" c:send("OK\n") print(node.heap()) ]])
file.writeline([[else c:send("0\n") print(node.heap()) ]])
file.writeline([[end]])
file.writeline([[end)]])
file.writeline([[end)]])
file.close()
file.remove("myli.lua") file.open("myli.lua","w")
file.writeline([[sv=net.createServer(net.TCP, 5) ]])
file.writeline([[sv:listen(4000,function(c)]])
file.writeline([[c:on("disconnection", function(c) print("Bye") end )]])
--file.writeline([[c:on("sent", function(c) c:close() end )]])
file.writeline([[c:on("receive", function(sck, pl) ]])
file.writeline([[sck:send("0\n") print(node.heap()) ]])
file.writeline([[end)]]) file.writeline([[end)]]) file.close()
sv=net.createServer(net.TCP, 50) sv:listen(4000,function(c) c:on("disconnection",function(c) print("Bye") end)
c:on("receive", function(sck, pl) sck:send("0\n") print(node.heap()) end) end)
sv=net.createServer(net.TCP, 5) sv:listen(4000,function(c) c:on("disconnection",function(c) print("Bye") end)
c:on("receive", function(sck, pl) sck:send("0\n") print(node.heap()) end) c:on("sent", function(sck) sck:close() end) end)
s=net.createServer(net.UDP)
s:on("receive",function(s,c) print(c) end)
s:listen(8888)
print("This is a long long long line to test the memory limit of nodemcu firmware\n")
collectgarbage("setmemlimit",8)
print(collectgarbage("getmemlimit"))
tmr.alarm(1,5000,1,function() print("alarm 1") end)
tmr.stop(1)
tmr.alarm(0,1000,1,function() print("alarm 0") end)
tmr.stop(0)
tmr.alarm(2,2000,1,function() print("alarm 2") end)
tmr.stop(2)
tmr.alarm(6,2000,1,function() print("alarm 6") end)
tmr.stop(6)
for k,v in pairs(_G.package.loaded) do print(k) end
for k,v in pairs(_G) do print(k) end
for k,v in pairs(d) do print("n:"..k..", s:"..v) end
a="pin=9"
t={}
for k, v in string.gmatch(a, "(%w+)=(%w+)") do t[k]=v end
print(t["pin"])
function switch() gpio.mode(4,gpio.OUTPUT) gpio.mode(5,gpio.OUTPUT) tmr.delay(1000000) print("hello world") end
tmr.alarm(0,10000,0,function () uart.setup(0,9600,8,0,1) end) switch()
sk=net.createConnection(net.TCP, 0) sk:on("receive", function(sck, c) print(c) end ) sk:connect(80,"www.nodemcu.com") sk:send("GET / HTTP/1.1\r\nHost: www.nodemcu.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk=net.createConnection(net.TCP, 0) sk:on("receive", function(sck, c) print(c) end )
sk:on("connection", function(sck) sck:send("GET / HTTP/1.1\r\nHost: www.nodemcu.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n") end ) sk:connect(80,"www.nodemcu.com")
sk=net.createConnection(net.TCP, 0) sk:on("receive", function(sck, c) print(c) end ) sk:connect(80,"115.239.210.27")
sk:send("GET / HTTP/1.1\r\nHost: 115.239.210.27\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")
sk=net.createConnection(net.TCP, 1) sk:on("receive", function(sck, c) print(c) end )
sk:on("connection", function(sck) sck:send("GET / HTTPS/1.1\r\nHost: www.google.com.hk\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n") end ) sk:connect(443,"173.194.72.199")
wifi.sta.setip({ip="192.168.18.119",netmask="255.255.255.0",gateway="192.168.18.1"})
uart.on("data","\r",function(input) if input=="quit\r" then uart.on("data") else print(input) end end, 0)
uart.on("data","\n",function(input) if input=="quit\n" then uart.on("data") else print(input) end end, 0)
uart.on("data", 5 ,function(input) if input=="quit\r" then uart.on("data") else print(input) end end, 0)
uart.on("data", 0 ,function(input) if input=="q" then uart.on("data") else print(input) end end, 0)
uart.on("data","\r",function(input) if input=="quit" then uart.on("data") else print(input) end end, 1)
for k, v in pairs(file.list()) do print('file:'..k..' len:'..v) end
m=mqtt.Client()
m:connect("192.168.18.101",1883)
m:subscribe("/topic",0,function(m) print("sub done") end)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:publish("/topic","hello",0,0)
uart.setup(0,9600,8,0,1,0)
sv=net.createServer(net.TCP, 60)
global_c = nil
sv:listen(9999, function(c)
if global_c~=nil then
global_c:close()
end
global_c=c
c:on("receive",function(sck,pl) uart.write(0,pl) end)
end)
uart.on("data",4, function(data)
if global_c~=nil then
global_c:send(data)
end
end, 0)
file.open("hello.lua","w+")
file.writeline([[print("hello nodemcu")]])
file.writeline([[print(node.heap())]])
file.close()
node.compile("hello.lua")
dofile("hello.lua")
dofile("hello.lc")
-- use copper addon for firefox
cs=coap.Server()
cs:listen(5683)
myvar=1
cs:var("myvar") -- get coap://192.168.18.103:5683/v1/v/myvar will return the value of myvar: 1
-- function should tack one string, return one string.
function myfun(payload)
print("myfun called")
respond = "hello"
return respond
end
cs:func("myfun") -- post coap://192.168.18.103:5683/v1/f/myfun will call myfun
cc = coap.Client()
cc:get(coap.CON, "coap://192.168.18.100:5683/.well-known/core")
cc:post(coap.NON, "coap://192.168.18.100:5683/", "Hello")
file.open("test1.txt", "a+") for i = 1, 100*1000 do file.write("x") end file.close() print("Done.")
for n,s in pairs(file.list()) do print(n.." size: "..s) end
file.remove("test1.txt")
for n,s in pairs(file.list()) do print(n.." size: "..s) end
file.open("test2.txt", "a+") for i = 1, 1*1000 do file.write("x") end file.close() print("Done.")
function TestDNSLeak()
c=net.createConnection(net.TCP, 0)
c:connect(80, "bad-name.tlddfdf")
tmr.alarm(1, 3000, 0, function() print("hack socket close, MEM: "..node.heap()) c:close() end) -- socket timeout hack
print("MEM: "..node.heap())
end
v="abc%0D%0Adef"
print(string.gsub(v, "%%(%x%x)", function(x) return string.char(tonumber(x, 16)) end))
function ex(x) string.find("abc%0Ddef","bc") return 's' end
string.gsub("abc%0Ddef", "%%(%x%x)", ex)
function ex(x) string.char(35) return 's' end
string.gsub("abc%0Ddef", "%%(%x%x)", ex) print("hello")
function ex(x) string.lower('Ab') return 's' end
string.gsub("abc%0Ddef", "%%(%x%x)", ex) print("hello")
v="abc%0D%0Adef"
pcall(function() print(string.gsub(v, "%%(%x%x)", function(x) return string.char(tonumber(x, 16)) end)) end)
mosca -v | bunyan
m=mqtt.Client()
m:connect("192.168.18.88",1883)
topic={}
topic["/topic1"]=0
topic["/topic2"]=0
m:subscribe(topic,function(m) print("sub done") end)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:publish("/topic1","hello",0,0)
m:publish("/topic3","hello",0,0) m:publish("/topic4","hello",0,0)
m=mqtt.Client()
m:connect("192.168.18.88",1883)
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:subscribe("/topic2",0,function(m) print("sub done") end)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:publish("/topic1","hello",0,0)
m:publish("/topic3","hello",0,0) m:publish("/topic4","hello",0,0)
m:publish("/topic1","hello1",0,0) m:publish("/topic2","hello2",0,0)
m:publish("/topic1","hello",1,0)
m:subscribe("/topic3",0,function(m) print("sub done") end)
m:publish("/topic3","hello3",2,0)
m=mqtt.Client()
m:connect("192.168.18.88",1883, function(con) print("connected hello") end)
m=mqtt.Client()
m:on("connect",function(m) print("connection") end )
m:connect("192.168.18.88",1883)
m:on("offline",function(m) print("disconnection") end )
m=mqtt.Client()
m:on("connect",function(m) print("connection "..node.heap()) end )
m:on("offline", function(conn)
if conn == nil then print("conn is nil") end
print("Reconnect to broker...")
print(node.heap())
conn:connect("192.168.18.88",1883,0,1)
end)
m:connect("192.168.18.88",1883,0,1)
m=mqtt.Client()
m:on("connect",function(m) print("connection "..node.heap()) end )
m:on("offline", function(conn)
if conn == nil then print("conn is nil") end
print("Reconnect to broker...")
print(node.heap())
conn:connect("192.168.18.88",1883)
end)
m:connect("192.168.18.88",1883)
m:close()
m=mqtt.Client()
m:connect("192.168.18.88",1883)
m:on("message",function(m,t,pl) print(t..":") if pl~=nil then print(pl) end end )
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:publish("/topic1","hello3",2,0) m:publish("/topic1","hello2",2,0)
m:publish("/topic1","hello3",0,0) m:publish("/topic1","hello2",2,0)
m:subscribe("/topic2",2,function(m) print("sub done") end)
m:publish("/topic2","hello3",0,0) m:publish("/topic2","hello2",2,0)
m=mqtt.Client()
m:on("connect",function(m)
print("connection "..node.heap())
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:publish("/topic1","hello3",0,0) m:publish("/topic1","hello2",2,0)
end )
m:on("offline", function(conn)
print("disconnect to broker...")
print(node.heap())
end)
m:connect("192.168.18.88",1883,0,1)
-- serout( pin, firstLevel, delay_table, [repeatNum] )
gpio.mode(1,gpio.OUTPUT,gpio.PULLUP)
gpio.serout(1,1,{30,30,60,60,30,30}) -- serial one byte, b10110010
gpio.serout(1,1,{30,70},8) -- serial 30% pwm 10k, lasts 8 cycles
gpio.serout(1,1,{3,7},8) -- serial 30% pwm 100k, lasts 8 cycles
gpio.serout(1,1,{0,0},8) -- serial 50% pwm as fast as possible, lasts 8 cycles
gpio.mode(1,gpio.OUTPUT,gpio.PULLUP)
gpio.serout(1,0,{20,10,10,20,10,10,10,100}) -- sim uart one byte 0x5A at about 100kbps
gpio.serout(1,1,{8,18},8) -- serial 30% pwm 38k, lasts 8 cycles
-- Lua: mqtt.Client(clientid, keepalive, user, pass)
-- test with cloudmqtt.com
m_dis={}
function dispatch(m,t,pl)
if pl~=nil and m_dis[t] then
m_dis[t](pl)
end
end
function topic1func(pl)
print("get1: "..pl)
end
function topic2func(pl)
print("get2: "..pl)
end
m_dis["/topic1"]=topic1func
m_dis["/topic2"]=topic2func
m=mqtt.Client("nodemcu1",60,"test","test123")
m:on("connect",function(m)
print("connection "..node.heap())
m:subscribe("/topic1",0,function(m) print("sub done") end)
m:subscribe("/topic2",0,function(m) print("sub done") end)
m:publish("/topic1","hello",0,0) m:publish("/topic2","world",0,0)
end )
m:on("offline", function(conn)
print("disconnect to broker...")
print(node.heap())
end)
m:on("message",dispatch )
m:connect("m11.cloudmqtt.com",11214,0,1)
-- Lua: mqtt:connect( host, port, secure, auto_reconnect, function(client) )
tmr.alarm(0,10000,1,function() local pl = "time: "..tmr.time()
m:publish("/topic1",pl,0,0)
end)
| mit |
wzydhek/Automato-ATITD | scripts/wood.lua | 2 | 2791 | -- Updated by Manon for T8 beta
-- Updated by Huggz for T8 proper
--
dofile("screen_reader_common.inc");
dofile("ui_utils.inc");
delay_time = 3000;
total_delay_time = 300000;
carrot_delay_time = 10*60*1000;
function doit()
carrot_timer = lsGetTimer();
askForWindow("Pin 5-10 tree windows, will click them VERTICALLY (left to right if there is a tie - multiple columns are fine). Additionally, optionally, pin a Bonfire and Consume window for stashing wood and eating grilled carrots (first carrot will be consumed after 10 minutes).");
-- Find windows
srReadScreen();
xyWindowSize = srGetWindowSize();
buttons = findAllImages("GatherWood.png");
harvestIndex = 1
while true do
winPosX = buttons[harvestIndex][0] - 1
winPosY = buttons[harvestIndex][1] - 1
srClickMouseNoMove(winPosX, winPosY)
lsSleep(500)
srReadScreen()
hasWood = srFindImageInRange("GatherWood.png", winPosX, winPosY, 80, 15)
if hasWood == nil then
statusScreen("Tree " .. harvestIndex .. "/" .. #buttons .. " has no wood. Waiting...")
else
statusScreen("Grabbing Wood " .. harvestIndex .. "/" .. #buttons);
srClickMouseNoMove(hasWood[0] + 2, hasWood[1] + 2)
harvestIndex = harvestIndex + 1
if harvestIndex > #buttons then
harvestIndex = 1
lsSleep(delay_time)
-- stash to bonfire
-- add logic to stash to warehouse
srReadScreen()
bonfire = srFindImage("Bonfire.png");
if bonfire then
statusScreen("Found bonfire...");
add_wood = srFindImage("AddSomeWood.png");
if add_wood then
-- add it
statusScreen("Adding wood to bonfire");
srClickMouseNoMove(add_wood[0]+5, add_wood[1]+5);
lsSleep(500);
-- click Max
click_max = srFindImage("maxButton.png");
if(not click_max) then
click_max = srFindImage("maxButton2.png");
srClickMouseNoMove(xyWindowSize[0]/2, xyWindowSize[1]/2 + 5);
end
else
statusScreen("No add wood button, refreshing bonfire");
-- refresh bonfire window
srClickMouseNoMove(bonfire[0]+5, bonfire[1]+5);
end
end
end
end
carrots = srFindImage("EatSomeGrilledCarrots.png");
carrot_note = "";
eat_carrots = nil;
if carrots then
carrot_time_left = carrot_timer + carrot_delay_time - lsGetTimer();
if carrot_time_left < 0 then
carrot_time_left = 0;
eat_carrots = 1;
end
carrot_note = " " .. math.floor(carrot_time_left / 1000) .. "s until eating carrots.";
else
carrot_note = "";
end
if eat_carrots then
srReadScreen();
carrots = srFindImage("EatSomeGrilledCarrots.png");
if carrots then
srClickMouseNoMove(carrots[0]+5, carrots[1]+5);
carrot_timer = lsGetTimer();
end
end
lsSleep(delay_time)
checkBreak()
end
end
| mit |
yongkangchen/poker-client | Assets/Runtime/Lua/dismiss.lua | 1 | 1093 | --[[
https://github.com/yongkangchen/poker-server
Copyright (C) 2016 Yongkang Chen lx1988cyk#gmail.com
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
--]]
local Destroy = UnityEngine.Object.Destroy
return function(transform, is_out, on_ok)
transform = UI.InitWindow("dismiss", transform)
local out_trans = transform:Find("title/quit")
local dimiss_trans = transform:Find("title/dismiss")
UI.Active(out_trans, is_out)
UI.Active(dimiss_trans, not is_out)
UI.OnClick(transform, "yes", function()
Destroy(transform.gameObject)
on_ok()
end)
UI.OnClick(transform, "no", function()
Destroy(transform.gameObject)
return true
end)
local close = transform:Find("close")
if close then
UI.OnClick(close, nil, function()
Destroy(transform.gameObject)
end)
end
end
| gpl-3.0 |
luarocks/luarocks | src/luarocks/manif.lua | 2 | 8239 | --- Module for handling manifest files and tables.
-- Manifest files describe the contents of a LuaRocks tree or server.
-- They are loaded into manifest tables, which are then used for
-- performing searches, matching dependencies, etc.
local manif = {}
local core = require("luarocks.core.manif")
local persist = require("luarocks.persist")
local fetch = require("luarocks.fetch")
local dir = require("luarocks.dir")
local fs = require("luarocks.fs")
local cfg = require("luarocks.core.cfg")
local path = require("luarocks.path")
local util = require("luarocks.util")
local queries = require("luarocks.queries")
local type_manifest = require("luarocks.type.manifest")
manif.cache_manifest = core.cache_manifest
manif.load_rocks_tree_manifests = core.load_rocks_tree_manifests
manif.scan_dependencies = core.scan_dependencies
manif.rock_manifest_cache = {}
local function check_manifest(repo_url, manifest, globals)
local ok, err = type_manifest.check(manifest, globals)
if not ok then
core.cache_manifest(repo_url, cfg.lua_version, nil)
return nil, "Error checking manifest: "..err, "type"
end
return manifest
end
local postprocess_dependencies
do
local postprocess_check = setmetatable({}, { __mode = "k" })
postprocess_dependencies = function(manifest)
if postprocess_check[manifest] then
return
end
if manifest.dependencies then
for name, versions in pairs(manifest.dependencies) do
for version, entries in pairs(versions) do
for k, v in pairs(entries) do
entries[k] = queries.from_persisted_table(v)
end
end
end
end
postprocess_check[manifest] = true
end
end
function manif.load_rock_manifest(name, version, root)
assert(type(name) == "string" and not name:match("/"))
assert(type(version) == "string")
local name_version = name.."/"..version
if manif.rock_manifest_cache[name_version] then
return manif.rock_manifest_cache[name_version].rock_manifest
end
local pathname = path.rock_manifest_file(name, version, root)
local rock_manifest = persist.load_into_table(pathname)
if not rock_manifest then
return nil, "rock_manifest file not found for "..name.." "..version.." - not a LuaRocks tree?"
end
manif.rock_manifest_cache[name_version] = rock_manifest
return rock_manifest.rock_manifest
end
--- Load a local or remote manifest describing a repository.
-- All functions that use manifest tables assume they were obtained
-- through this function.
-- @param repo_url string: URL or pathname for the repository.
-- @param lua_version string: Lua version in "5.x" format, defaults to installed version.
-- @param versioned_only boolean: If true, do not fall back to the main manifest
-- if a versioned manifest was not found.
-- @return table or (nil, string, [string]): A table representing the manifest,
-- or nil followed by an error message and an optional error code.
function manif.load_manifest(repo_url, lua_version, versioned_only)
assert(type(repo_url) == "string")
assert(type(lua_version) == "string" or not lua_version)
lua_version = lua_version or cfg.lua_version
local cached_manifest = core.get_cached_manifest(repo_url, lua_version)
if cached_manifest then
postprocess_dependencies(cached_manifest)
return cached_manifest
end
local filenames = {
"manifest-"..lua_version..".zip",
"manifest-"..lua_version,
not versioned_only and "manifest" or nil,
}
local protocol, repodir = dir.split_url(repo_url)
local pathname, from_cache
if protocol == "file" then
for _, filename in ipairs(filenames) do
pathname = dir.path(repodir, filename)
if fs.exists(pathname) then
break
end
end
else
local err, errcode
for _, filename in ipairs(filenames) do
pathname, err, errcode, from_cache = fetch.fetch_caching(dir.path(repo_url, filename), "no_mirror")
if pathname then
break
end
end
if not pathname then
return nil, err, errcode
end
end
if pathname:match(".*%.zip$") then
pathname = fs.absolute_name(pathname)
local nozip = pathname:match("(.*)%.zip$")
if not from_cache then
local dirname = dir.dir_name(pathname)
fs.change_dir(dirname)
fs.delete(nozip)
local ok, err = fs.unzip(pathname)
fs.pop_dir()
if not ok then
fs.delete(pathname)
fs.delete(pathname..".timestamp")
return nil, "Failed extracting manifest file: " .. err
end
end
pathname = nozip
end
local manifest, err, errcode = core.manifest_loader(pathname, repo_url, lua_version)
if not manifest then
return nil, err, errcode
end
postprocess_dependencies(manifest)
return check_manifest(repo_url, manifest, err)
end
--- Get type and name of an item (a module or a command) provided by a file.
-- @param deploy_type string: rock manifest subtree the file comes from ("bin", "lua", or "lib").
-- @param file_path string: path to the file relatively to deploy_type subdirectory.
-- @return (string, string): item type ("module" or "command") and name.
function manif.get_provided_item(deploy_type, file_path)
assert(type(deploy_type) == "string")
assert(type(file_path) == "string")
local item_type = deploy_type == "bin" and "command" or "module"
local item_name = item_type == "command" and file_path or path.path_to_module(file_path)
return item_type, item_name
end
local function get_providers(item_type, item_name, repo)
assert(type(item_type) == "string")
assert(type(item_name) == "string")
local rocks_dir = path.rocks_dir(repo or cfg.root_dir)
local manifest = manif.load_manifest(rocks_dir)
return manifest and manifest[item_type .. "s"][item_name]
end
--- Given a name of a module or a command, figure out which rock name and version
-- correspond to it in the rock tree manifest.
-- @param item_type string: "module" or "command".
-- @param item_name string: module or command name.
-- @param root string or nil: A local root dir for a rocks tree. If not given, the default is used.
-- @return (string, string) or nil: name and version of the provider rock or nil if there
-- is no provider.
function manif.get_current_provider(item_type, item_name, repo)
local providers = get_providers(item_type, item_name, repo)
if providers then
return providers[1]:match("([^/]*)/([^/]*)")
end
end
function manif.get_next_provider(item_type, item_name, repo)
local providers = get_providers(item_type, item_name, repo)
if providers and providers[2] then
return providers[2]:match("([^/]*)/([^/]*)")
end
end
--- Get all versions of a package listed in a manifest file.
-- @param name string: a package name.
-- @param deps_mode string: "one", to use only the currently
-- configured tree; "order" to select trees based on order
-- (use the current tree and all trees below it on the list)
-- or "all", to use all trees.
-- @return table: An array of strings listing installed
-- versions of a package, and a table indicating where they are found.
function manif.get_versions(dep, deps_mode)
assert(type(dep) == "table")
assert(type(deps_mode) == "string")
local name = dep.name
local namespace = dep.namespace
local version_set = {}
path.map_trees(deps_mode, function(tree)
local manifest = manif.load_manifest(path.rocks_dir(tree))
if manifest and manifest.repository[name] then
for version in pairs(manifest.repository[name]) do
if dep.namespace then
local ns_file = path.rock_namespace_file(name, version, tree)
local fd = io.open(ns_file, "r")
if fd then
local ns = fd:read("*a")
fd:close()
if ns == namespace then
version_set[version] = tree
end
end
else
version_set[version] = tree
end
end
end
end)
return util.keys(version_set), version_set
end
return manif
| mit |
ajaragoneses/GTI_VLC | share/lua/playlist/katsomo.lua | 97 | 2906 | --[[
Translate www.katsomo.fi video webpages URLs to the corresponding
movie URL
$Id$
Copyright © 2009 the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]]
-- Probe function.
function probe()
return vlc.access == "http"
and string.match( vlc.path, "www.katsomo.fi" )
and ( string.match( vlc.path, "treeId" ) or string.match( vlc.path, "progId" ) )
end
function find( haystack, needle )
local _,_,r = string.find( haystack, needle )
return r
end
-- Parse function.
function parse()
p = {}
if string.match( vlc.path, "progId" )
then
programid = string.match( vlc.path, "progId=(%d+)")
path = "http://www.katsomo.fi/metafile.asx?p="..programid.."&bw=800"
table.insert(p, { path = path; } )
return p
end
title=""
arturl="http://www.katsomo.fi/multimedia/template/logos/katsomo_logo_2.gif"
while true
do
line = vlc.readline()
if not line then break end
if string.match( line, "<title>" )
then
title = vlc.strings.decode_uri( find( line, "<title>(.-)<" ) )
title = vlc.strings.from_charset( "ISO_8859-1", title )
end
if( find( line, "img class=\"pngImg\" src=\"/multimedia/template/logos" ) )
then
arturl = "http://www.katsomo.fi"..find( line, " src=\"(.-)\" alt=" )
end
for treeid,name in string.gmatch( line, '/%?treeId=(%d+)">([^<]+)</a') do
name = vlc.strings.resolve_xml_special_chars( name )
name = vlc.strings.from_charset( "ISO_8859-1", name )
path = "http://www.katsomo.fi/?treeId="..treeid
table.insert( p, { path = path; name = name; url = vlc.path; arturl=arturl; } )
end
for programid in string.gmatch( line, "<li class=\"program.*\" id=\"program(%d+)\" title=\".+\"" ) do
description = vlc.strings.resolve_xml_special_chars( find( line, "title=\"(.+)\"" ) )
description = vlc.strings.from_charset( "ISO_8859-1", description )
path = "http://www.katsomo.fi/metafile.asx?p="..programid.."&bw=800"
table.insert( p, { path = path; name = description; url = vlc.path; arturl=arturl; } )
end
end
return p
end
| gpl-2.0 |
ramin1998/ramin22 | plugins/azan.lua | 2 | 3161 | --[[
#
# @GPMOD
# @Dragon_Born
#
]]
do
function run_bash(str)
local cmd = io.popen(str)
local result = cmd:read('*all')
return result
end
local api_key = nil
local base_api = "https://maps.googleapis.com/maps/api"
function get_latlong(area)
local api = base_api .. "/geocode/json?"
local parameters = "address=".. (URL.escape(area) or "")
if api_key ~= nil then
parameters = parameters .. "&key="..api_key
end
local res, code = https.request(api..parameters)
if code ~=200 then return nil end
local data = json:decode(res)
if (data.status == "ZERO_RESULTS") then
return nil
end
if (data.status == "OK") then
lat = data.results[1].geometry.location.lat
lng = data.results[1].geometry.location.lng
acc = data.results[1].geometry.location_type
types= data.results[1].types
return lat,lng,acc,types
end
end
function get_staticmap(area)
local api = base_api .. "/staticmap?"
local lat,lng,acc,types = get_latlong(area)
local scale = types[1]
if scale=="locality" then zoom=8
elseif scale=="country" then zoom=4
else zoom = 13 end
local parameters =
"size=600x300" ..
"&zoom=" .. zoom ..
"¢er=" .. URL.escape(area) ..
"&markers=color:red"..URL.escape("|"..area)
if api_key ~=nil and api_key ~= "" then
parameters = parameters .. "&key="..api_key
end
return lat, lng, api..parameters
end
function run(msg, matches)
local hash = 'usecommands:'..msg.from.id..':'..msg.to.id
redis:incr(hash)
local receiver = get_receiver(msg)
local city = matches[1]
if matches[1] == 'praytime' then
city = 'Tehran'
end
local lat,lng,url = get_staticmap(city)
local dumptime = run_bash('date +%s')
local code = http.request('http://api.aladhan.com/timings/'..dumptime..'?latitude='..lat..'&longitude='..lng..'&timezonestring=Asia/Tehran&method=7')
local jdat = json:decode(code)
local data = jdat.data.timings
local text = 'شهر: '..city
text = text..'\nاذان صبح: '..data.Fajr
text = text..'\nطلوع آفتاب: '..data.Sunrise
text = text..'\nاذان ظهر: '..data.Dhuhr
text = text..'\nغروب آفتاب: '..data.Sunset
text = text..'\nاذان مغرب: '..data.Maghrib
text = text..'\nعشاء : '..data.Isha
text = text..'\n\n@GPMod Team'
if string.match(text, '0') then text = string.gsub(text, '0', '۰') end
if string.match(text, '1') then text = string.gsub(text, '1', '۱') end
if string.match(text, '2') then text = string.gsub(text, '2', '۲') end
if string.match(text, '3') then text = string.gsub(text, '3', '۳') end
if string.match(text, '4') then text = string.gsub(text, '4', '۴') end
if string.match(text, '5') then text = string.gsub(text, '5', '۵') end
if string.match(text, '6') then text = string.gsub(text, '6', '۶') end
if string.match(text, '7') then text = string.gsub(text, '7', '۷') end
if string.match(text, '8') then text = string.gsub(text, '8', '۸') end
if string.match(text, '9') then text = string.gsub(text, '9', '۹') end
return text
end
return {
patterns = {"^[/!][Pp]raytime (.*)$","^[/!](praytime)$"},
run = run
}
end
| gpl-2.0 |
ctakemoto/Human-Controlled-Naos | Player/Motion/stance.lua | 4 | 3560 | module(..., package.seeall);
require('Body')
require('Kinematics')
require('walk')
require('vector')
active = true;
t0 = 0;
bodyHeight = Config.walk.bodyHeight;
footY = walk.footY;
supportX = walk.supportX;
qLArm = walk.qLArm;
qRArm = walk.qRArm;
bodyTilt=walk.bodyTilt;
--qLArm = math.pi/180*vector.new({105, 12, -85, -30});
--qRArm = math.pi/180*vector.new({105, -12, 85, 30});
--time to wait before beginning to move--
delay = Config.stance.delay or 70;
--[[
-- pTorso fixed for stance:
pTorso = vector.new({supportX, 0, bodyHeight, 0,0,0});
-- Final stance foot position6D
pLLegStance = vector.new({0, footY, 0, 0,0,0});
pRLegStance = vector.new({0, -footY, 0, 0,0,0});
--]]
-- Final stance foot position6D
--pTorso = vector.new({0, 0, bodyHeight, 0,bodyTilt,0});--TODO: fix bug with inital stance jump
pTorso = vector.new({0, 0, bodyHeight, 0,0,0});
pLLegStance = vector.new({-supportX, footY, 0, 0,0,0});
pRLegStance = vector.new({-supportX, -footY, 0, 0,0,0});
-- Max change in position6D to reach stance:
dpLimit = vector.new({.03, .03, .04, .05, .4, .1}); --OP specific
function entry()
print(_NAME.." entry");
-- Added by SJ
-- enable joint encoder reading during getup
Body.set_syncread_enable(1);
started=false;
local qSensor = Body.get_sensor_position();
Body.set_actuator_command(qSensor);
Body.set_head_hardness(.8);
Body.set_larm_hardness(.1);
Body.set_rarm_hardness(.1);
Body.set_lleg_hardness(1);
Body.set_rleg_hardness(1);
-- Fix the waist, for now
-- THIS IS NOT IN THE OP FROM SJ, but I think it will be ok
-- Body.set_waist_hardness(1);
-- Body.set_waist_command(.7);
t0 = Body.get_time();
end
function update()
local t = Body.get_time();
local dt = t - t0;
if not started then --these init codes are moved here for OP
if dt>0.2 then
started=true;
local qSensor = Body.get_sensor_position();
local dpLLeg = Kinematics.lleg_torso(Body.get_lleg_position());
local dpRLeg = Kinematics.rleg_torso(Body.get_rleg_position());
pLLeg = pTorso + dpLLeg;
pRLeg = pTorso + dpRLeg;
Body.set_actuator_command(qSensor);
Body.set_syncread_enable(0);
else return; end
end
t0 = t;
local tol = true;
local tolLimit = 1e-6;
dpDeltaMax = dt*dpLimit;
dpLeft = pLLegStance - pLLeg;
for i = 1,6 do
if (math.abs(dpLeft[i]) > tolLimit) then
tol = false;
if (dpLeft[i] > dpDeltaMax[i]) then
dpLeft[i] = dpDeltaMax[i];
elseif (dpLeft[i] < -dpDeltaMax[i]) then
dpLeft[i] = -dpDeltaMax[i];
end
end
end
pLLeg = pLLeg + dpLeft;
dpRight = pRLegStance - pRLeg;
for i = 1,6 do
if (math.abs(dpRight[i]) > tolLimit) then
tol = false;
if (dpRight[i] > dpDeltaMax[i]) then
dpRight[i] = dpDeltaMax[i];
elseif (dpRight[i] < -dpDeltaMax[i]) then
dpRight[i] = -dpDeltaMax[i];
end
end
end
pRLeg = pRLeg + dpRight;
q = Kinematics.inverse_legs(pLLeg, pRLeg, pTorso, 0);
Body.set_lleg_command(q);
if (tol) then
if delay <= 0 then
delay=Config.stance.delay or 0;
walk.still=true;
return "done";
else
delay=delay-1;
Body.set_larm_command(qLArm);
Body.set_larm_hardness(.2);
Body.set_rarm_command(qRArm);
Body.set_rarm_hardness(.2);
-- Body.set_head_command(vector.new({0,0}));
end
end
end
function exit()
-- Arms last
Body.set_larm_command(qLArm);
Body.set_rarm_command(qRArm);
Body.set_syncread_enable(0);--OP specific
-- walk.stopAlign();
-- walk.active=false; --to call walk.start
-- walk.start();
end
| gpl-3.0 |
ctakemoto/Human-Controlled-Naos | Player/HeadFSM/NaoGoalie/headTrack.lua | 12 | 1552 | module(..., package.seeall);
require('Body')
require('Config')
require('vcm')
t0 = 0;
timeout = 30.0;
-- ball detection timeout
tLost = 2.0;
--forikinecam
camOffsetZ = Config.head.camOffsetZ;
pitchMin = Config.head.pitchMin;
pitchMax = Config.head.pitchMax;
yawMin = Config.head.yawMin;
yawMax = Config.head.yawMax;
cameraPos = Config.head.cameraPos;
cameraAngle = Config.head.cameraAngle;
-- z-axis tracking position
trackZ = Config.vision.ball_diameter;
function entry()
print(_NAME.." entry");
t0 = Body.get_time();
-- only use bottom camera
vcm.set_camera_command(1);
end
function update()
local t = Body.get_time();
-- update head position based on ball location
ball = wcm.get_ball();
local yaw, pitch = ikineCam(ball.x, ball.y, trackZ);
Body.set_head_command({yaw, pitch});
ballR = math.sqrt(ball.x^2 + ball.y^2);
local tLook = 5.0/(1.0 + ballR/0.3) + 2.0;
local tState = t - t0;
if (tState > tLook) then
return 'timeout';
end
if (t - ball.t > tLost and tState > tLost) then
return 'lost';
end
end
function exit()
end
function ikineCam(x, y, z)
--Bottom camera by default (cameras are 0 indexed so add 1)
select = 2;
--Look at ground by default
z = z or 0;
z = z-camOffsetZ;
local norm = math.sqrt(x^2 + y^2 + z^2);
local yaw = math.atan2(y, x);
local pitch = math.asin(-z/(norm + 1E-10));
pitch = pitch - cameraAngle[select][2];
yaw = math.min(math.max(yaw, yawMin), yawMax);
pitch = math.min(math.max(pitch, pitchMin), pitchMax);
return yaw, pitch;
end
| gpl-3.0 |
vnavbha/game | code/src/tools/premake/contrib/lua/test/sort.lua | 889 | 1494 | -- two implementations of a sort function
-- this is an example only. Lua has now a built-in function "sort"
-- extracted from Programming Pearls, page 110
function qsort(x,l,u,f)
if l<u then
local m=math.random(u-(l-1))+l-1 -- choose a random pivot in range l..u
x[l],x[m]=x[m],x[l] -- swap pivot to first position
local t=x[l] -- pivot value
m=l
local i=l+1
while i<=u do
-- invariant: x[l+1..m] < t <= x[m+1..i-1]
if f(x[i],t) then
m=m+1
x[m],x[i]=x[i],x[m] -- swap x[i] and x[m]
end
i=i+1
end
x[l],x[m]=x[m],x[l] -- swap pivot to a valid place
-- x[l+1..m-1] < x[m] <= x[m+1..u]
qsort(x,l,m-1,f)
qsort(x,m+1,u,f)
end
end
function selectionsort(x,n,f)
local i=1
while i<=n do
local m,j=i,i+1
while j<=n do
if f(x[j],x[m]) then m=j end
j=j+1
end
x[i],x[m]=x[m],x[i] -- swap x[i] and x[m]
i=i+1
end
end
function show(m,x)
io.write(m,"\n\t")
local i=1
while x[i] do
io.write(x[i])
i=i+1
if x[i] then io.write(",") end
end
io.write("\n")
end
function testsorts(x)
local n=1
while x[n] do n=n+1 end; n=n-1 -- count elements
show("original",x)
qsort(x,1,n,function (x,y) return x<y end)
show("after quicksort",x)
selectionsort(x,n,function (x,y) return x>y end)
show("after reverse selection sort",x)
qsort(x,1,n,function (x,y) return x<y end)
show("after quicksort again",x)
end
-- array to be sorted
x={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}
testsorts(x)
| mit |
osch/lmake | lua/test/sort.lua | 889 | 1494 | -- two implementations of a sort function
-- this is an example only. Lua has now a built-in function "sort"
-- extracted from Programming Pearls, page 110
function qsort(x,l,u,f)
if l<u then
local m=math.random(u-(l-1))+l-1 -- choose a random pivot in range l..u
x[l],x[m]=x[m],x[l] -- swap pivot to first position
local t=x[l] -- pivot value
m=l
local i=l+1
while i<=u do
-- invariant: x[l+1..m] < t <= x[m+1..i-1]
if f(x[i],t) then
m=m+1
x[m],x[i]=x[i],x[m] -- swap x[i] and x[m]
end
i=i+1
end
x[l],x[m]=x[m],x[l] -- swap pivot to a valid place
-- x[l+1..m-1] < x[m] <= x[m+1..u]
qsort(x,l,m-1,f)
qsort(x,m+1,u,f)
end
end
function selectionsort(x,n,f)
local i=1
while i<=n do
local m,j=i,i+1
while j<=n do
if f(x[j],x[m]) then m=j end
j=j+1
end
x[i],x[m]=x[m],x[i] -- swap x[i] and x[m]
i=i+1
end
end
function show(m,x)
io.write(m,"\n\t")
local i=1
while x[i] do
io.write(x[i])
i=i+1
if x[i] then io.write(",") end
end
io.write("\n")
end
function testsorts(x)
local n=1
while x[n] do n=n+1 end; n=n-1 -- count elements
show("original",x)
qsort(x,1,n,function (x,y) return x<y end)
show("after quicksort",x)
selectionsort(x,n,function (x,y) return x>y end)
show("after reverse selection sort",x)
qsort(x,1,n,function (x,y) return x<y end)
show("after quicksort again",x)
end
-- array to be sorted
x={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}
testsorts(x)
| gpl-2.0 |
kaustavha/lit | deps/readline.lua | 3 | 13693 | --[[
Copyright 2014-2015 The Luvit Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--]]
exports.name = "luvit/readline"
exports.version = "1.1.0-1"
exports.homepage = "https://github.com/luvit/luvit/blob/master/deps/readline.lua"
exports.description = "A readline interface for terminals in pure lua."
exports.tags = {"readline", "tty"}
exports.license = "Apache 2"
exports.author = { name = "Tim Caswell" }
-- Heavily inspired by ljlinenoise : <http://fperrad.github.io/ljlinenoise/>
local sub = string.sub
local gmatch = string.gmatch
local remove = table.remove
local insert = table.insert
local concat = table.concat
local History = {}
exports.History = History
function History:add(line)
assert(type(line) == "string", "line must be string")
while #self >= self.maxLength do
remove(self, 1)
end
insert(self, line)
return true
end
function History:setMaxLength(length)
assert(type(length) == "number", "max length length must be number")
self.maxLength = length
while #self > length do
remove(self, 1)
end
return true
end
function History:clean()
for i = 1, #self do
self[i] = nil
end
return true
end
function History:dump()
return concat(self, "\n") .. '\n'
end
function History:load(data)
assert(type(data) == "string", "history dump required as string")
for line in gmatch(data, "[^\n]+") do
insert(self, line)
end
return true
end
function History:updateLastLine(line)
self[#self] = line
end
History.__index = History
function History.new()
local history = { maxLength = 100 }
return setmetatable(history, History)
end
local Editor = {}
exports.Editor = Editor
function Editor:refreshLine()
local line = self.line
local position = self.position
-- Cursor to left edge
local command = "\x1b[0G"
-- Write the prompt and the current buffer content
.. self.prompt .. line
-- Erase to right
.. "\x1b[0K"
-- Move cursor to original position.
.. "\x1b[0G\x1b[" .. tostring(position + self.promptLength - 1) .. "C"
self.stdout:write(command)
end
function Editor:insertAbove(line)
-- Cursor to left edge
local command = "\x1b[0G"
-- Erase to right
.. "\x1b[0K"
self.stdout:write(command .. line .. "\n", function()
self:refreshLine()
end)
end
function Editor:insert(character)
local line = self.line
local position = self.position
if #line == position - 1 then
self.line = line .. character
self.position = position + #character
if self.promptLength + #self.line < self.columns then
self.stdout:write(character)
else
self:refreshLine()
end
else
-- Insert the letter in the middle of the line
self.line = sub(line, 1, position - 1) .. character .. sub(line, position)
self.position = position + 1
self:refreshLine()
end
self.history:updateLastLine(self.line)
end
function Editor:moveLeft()
if self.position > 1 then
self.position = self.position - 1
self:refreshLine()
end
end
function Editor:moveRight()
if self.position - 1 ~= #self.line then
self.position = self.position + 1
self:refreshLine()
end
end
function Editor:getHistory(delta)
local history = self.history
local length = #history
local index = self.historyIndex
if length > 1 then
index = index + delta
if index < 1 then
index = 1
elseif index > length then
index = length
end
if index == self.historyIndex then return end
local line = self.history[index]
self.line = line
self.historyIndex = index
self.position = #line + 1
self:refreshLine()
end
end
function Editor:backspace()
local line = self.line
local position = self.position
if position > 1 and #line > 0 then
self.line = sub(line, 1, position - 2) .. sub(line, position)
self.position = position - 1
self.history:updateLastLine(self.line)
self:refreshLine()
end
end
function Editor:delete()
local line = self.line
local position = self.position
if position > 0 and #line > 0 then
self.line = sub(line, 1, position - 1) .. sub(line, position + 1)
self.history:updateLastLine(self.line)
self:refreshLine()
end
end
function Editor:swap()
local line = self.line
local position = self.position
if position > 1 and position <= #line then
self.line = sub(line, 1, position - 2)
.. sub(line, position, position)
.. sub(line, position - 1, position - 1)
.. sub(line, position + 1)
if position ~= #line then
self.position = position + 1
end
self.history:updateLastLine(self.line)
self:refreshLine()
end
end
function Editor:deleteLine()
self.line = ''
self.position = 1
self.history:updateLastLine(self.line)
self:refreshLine()
end
function Editor:deleteEnd()
self.line = sub(self.line, 1, self.position - 1)
self.history:updateLastLine(self.line)
self:refreshLine()
end
function Editor:moveHome()
self.position = 1
self:refreshLine()
end
function Editor:moveEnd()
self.position = #self.line + 1
self:refreshLine()
end
local function findLeft(line, position, wordPattern)
local pattern = wordPattern .. "$"
if position == 1 then return 1 end
local s
repeat
local start = sub(line, 1, position - 1)
s = string.find(start, pattern)
if not s then
position = position - 1
end
until s or position == 1
return s or position
end
function Editor:deleteWord()
local position = self.position
local line = self.line
self.position = findLeft(line, position, self.wordPattern)
self.line = sub(line, 1, self.position - 1) .. sub(line, position)
self:refreshLine()
end
function Editor:jumpLeft()
self.position = findLeft(self.line, self.position, self.wordPattern)
self:refreshLine()
end
function Editor:jumpRight()
local _, e = string.find(self.line, self.wordPattern, self.position)
self.position = e and e + 1 or #self.line + 1
self:refreshLine()
end
function Editor:clearScreen()
self.stdout:write('\x1b[H\x1b[2J')
self:refreshLine()
end
function Editor:beep()
self.stdout:write('\x07')
end
function Editor:complete()
if not self.completionCallback then
return self:beep()
end
local line = self.line
local position = self.position
local res = self.completionCallback(sub(line, 1, position))
if not res then
return self:beep()
end
local typ = type(res)
if typ == "string" then
self.line = res .. sub(line, position + 1)
self.position = #res + 1
self.history:updateLastLine(self.line)
elseif typ == "table" then
print()
print(unpack(res))
end
self:refreshLine()
end
local function escapeKeysForDisplay(keys)
return string.gsub(keys, '[%c\\\128-\255]', function(c)
local b = string.byte(c, 1)
if b < 10 then return '\\00' .. b end
if b <= 31 then return '\\0' .. b end
if b == 92 then return '\\\\' end
if b >= 128 and b <= 255 then return '\\' .. b end
end)
end
-- an array of tables so that the iteration order is consistent
-- each entry is an array with two entries: a table and a function
-- the table can contain any number of the following:
-- numbers (to be compared to the char value),
-- strings (to be compared to the input string that has been truncated to the same length),
-- functions (to be called with the (key, char) values and returns either the consumed keys or nil)
-- the function recieves the Editor instance as the first parameter and the consumedKeys as the second
-- its returns will be propagated to Editor:onKey if either of them are non-nil
-- note: the function is only called if the key handler is the one doing the consuming
local keyHandlers =
{
-- Enter
{{13}, function(self)
local history = self.history
local line = self.line
-- Only record new history if it's non-empty and new
if #line > 0 and history[#history - 1] ~= line then
history[#history] = line
else
history[#history] = nil
end
return self.line
end},
-- Tab
{{9}, function(self)
self:complete()
end},
-- Control-C
{{3}, function(self)
self.stdout:write("^C\n")
if #self.line > 0 then
self:deleteLine()
else
return false, "SIGINT in readLine"
end
end},
-- Backspace, Control-H
{{127, 8}, function(self)
self:backspace()
end},
-- Control-D
{{4}, function(self)
if #self.line > 0 then
self:delete()
else
self.history:updateLastLine()
return nil, "EOF in readLine"
end
end},
-- Control-T
{{20}, function(self)
self:swap()
end},
-- Up Arrow, Control-P
{{'\027[A', 16}, function(self)
self:getHistory(-1)
end},
-- Down Arrow, Control-N
{{'\027[B', 14}, function(self)
self:getHistory(1)
end},
-- Right Arrow, Control-F
{{'\027[C', 6}, function(self)
self:moveRight()
end},
-- Left Arrow, Control-B
{{'\027[D', 2}, function(self)
self:moveLeft()
end},
-- Home Key, Home for terminator, Home for CMD.EXE, Control-A
{{'\027[H', '\027OH', '\027[1~', 1}, function(self)
self:moveHome()
end},
-- End Key, End for terminator, End for CMD.EXE, Control-E
{{'\027[F', '\027OF', '\027[4~', 5}, function(self)
self:moveEnd()
end},
-- Control-U
{{21}, function(self)
self:deleteLine()
end},
-- Control-K
{{11}, function(self)
self:deleteEnd()
end},
-- Control-L
{{12}, function(self)
self:clearScreen()
end},
-- Control-W
{{23}, function(self)
self:deleteWord()
end},
-- Delete Key
{{'\027[3~'}, function(self)
self:delete()
end},
-- Control Left Arrow, Alt Left Arrow (iTerm.app), Alt Left Arrow (Terminal.app)
{{'\027[1;5D', '\027\027[D', '\027b'}, function(self)
self:jumpLeft()
end},
-- Control Right Arrow, Alt Right Arrow (iTerm.app), Alt Right Arrow (Terminal.app)
{{'\027[1;5C', '\027\027[C', '\027f'}, function(self)
self:jumpRight()
end},
-- Alt Up Arrow (iTerm.app), Page Up
{{'\027\027[A', '\027[5~'}, function(self)
self:getHistory(-10)
end},
-- Alt Down Arrow (iTerm.app), Page Down
{{'\027\027[B', '\027[6~'}, function(self)
self:getHistory(10)
end},
-- Printable characters
{{function(key, char) return char > 31 and key:sub(1,1) or nil end}, function(self, consumedKeys)
self:insert(consumedKeys)
end},
}
function Editor:onKey(key)
local char = string.byte(key, 1)
local consumedKeys = nil
for _, keyHandler in ipairs(keyHandlers) do
local handledKeys = keyHandler[1]
local handlerFn = keyHandler[2]
for _, handledKey in ipairs(handledKeys) do
if type(handledKey) == "number" then
consumedKeys = handledKey == char and key:sub(1,1) or nil
elseif type(handledKey) == "string" then
-- test against the first key using the same strlen as the handled key
local testKey = (type(handledKey) == "string" and #key >= #handledKey) and key:sub(1,#handledKey) or nil
consumedKeys = (testKey and testKey == handledKey) and testKey or nil
elseif type(handledKey) == "function" then
consumedKeys = handledKey(key, char)
end
if consumedKeys ~= nil then
local ret, err = handlerFn(self, consumedKeys)
if err ~= nil or ret ~= nil then
return ret, err
end
break
end
end
if consumedKeys ~= nil then break end
end
if consumedKeys ~= nil then
assert(#consumedKeys > 0)
if #consumedKeys < #key then
local unconsumedKeys = key:sub(#consumedKeys+1)
if #unconsumedKeys > 0 then
self:onKey(unconsumedKeys)
end
end
else
self:insertAbove(string.format("Unhandled key(s): %s", escapeKeysForDisplay(key)))
end
return true
end
function Editor:readLine(prompt, callback)
local onKey, finish
self.prompt = prompt
self.promptLength = #prompt
self.columns = self.stdout:get_winsize() or 80
function onKey(err, key)
local r, out, reason = pcall(function ()
assert(not err, err)
return self:onKey(key)
end)
if r then
if out == true then return end
return finish(nil, out, reason)
else
return finish(out)
end
end
function finish(...)
self.stdin:read_stop()
self.stdin:set_mode(0)
self.stdout:write('\n')
return callback(...)
end
self.line = ""
self.position = 1
self.stdout:write(self.prompt)
self.history:add(self.line)
self.historyIndex = #self.history
self.stdin:set_mode(1)
self.stdin:read_start(onKey)
end
Editor.__index = Editor
function Editor.new(options)
options = options or {}
local history = options.history or History.new()
assert(options.stdin, "stdin is required")
assert(options.stdout, "stdout is required")
local editor = {
wordPattern = options.wordPattern or "%w+",
history = history,
completionCallback = options.completionCallback,
stdin = options.stdin,
stdout = options.stdout,
}
return setmetatable(editor, Editor)
end
exports.readLine = function (prompt, options, callback)
if type(options) == "function" and callback == nil then
callback, options = options, callback
end
local editor = Editor.new(options)
editor:readLine(prompt, callback)
return editor
end
| apache-2.0 |
technomancy/bussard | ship/hud.lua | 1 | 4032 | local utils = require "utils"
local body = require "body"
local hud_text = "speed: %0.2f pos: %5.2f, %5.2f\n" ..
"target: %s distance: %0.2f\n" ..
"epoch: %s credits: %s"
local vector_size = 50
local w, h = love.graphics:getWidth(), love.graphics:getHeight()
return {
-- TODO: data-driven hud
render = function(ship, target)
local speed = utils.distance(ship.dx, ship.dy)
local formatted_time = utils.format_seconds(os.time() + ship.time_offset)
local distance, target_name
-- TODO: move target indicators to upper right, add mass, time to target
if(target) then
distance = utils.distance(ship.x - target.x, ship.y - target.y)
target_name = target.name
else
target_name, distance = "none", 0
end
love.graphics.setColor(255, 255, 255, 150)
love.graphics.print(string.format(hud_text, speed, ship.x, ship.y,
target_name, distance,
formatted_time, ship.credits), 5, 5)
-- TODO: throttle indicator
-- TODO: cargo indicator
-- scale indicator
local scale_y = math.log(ship.api.scale) * h
love.graphics.line(w - 5, scale_y, w, scale_y)
love.graphics.setLineWidth(1)
-- battery
love.graphics.setColor(20, 255, 20);
love.graphics.rectangle("fill", 5, 75,
math.min(ship.battery, ship.battery_capacity), 10)
love.graphics.setColor(200, 255, 200);
love.graphics.rectangle("line", 5, 75, ship.battery_capacity, 10)
-- remaining fuel
love.graphics.setColor(255, 20, 20);
love.graphics.rectangle("fill", 5, 60,
math.min(ship.fuel, ship.fuel_capacity), 10)
love.graphics.setColor(255, 200, 200);
love.graphics.rectangle("line", 5, 60, ship.fuel_capacity, 10)
-- how much fuel will we use to stop?
local fuel_to_stop = speed * ship.engine_strength * ship.burn_rate /
-- no idea where this 20 factor comes from
(ship.mass * 20)
love.graphics.setColor(150, 50, 50);
love.graphics.rectangle("fill", 5, 60, fuel_to_stop, 5)
end,
trajectory = function(ship, bodies, steps, step_size, color)
local last_x, last_y
local x, y, dx, dy = ship.x, ship.y, ship.dx, ship.dy
local body_points = {}
for _, b in pairs(bodies) do
if(b ~= ship) then
body_points[b.name] = {x = b.x, y = b.y, dx = b.dx, dy = b.dy,
mass = b.mass}
end
end
love.graphics.setLineWidth(5)
love.graphics.setColor(color)
for _=0, steps do
for _, b in pairs(body_points) do
local ddx, ddy = body.gravitate(b, x, y)
dx = dx + ddx * step_size
dy = dy + ddy * step_size
b.x = b.x + (b.dx * step_size * 100)
b.y = b.y + (b.dy * step_size * 100)
end
for _, b2 in ipairs(body_points) do
if(b ~= b2 and (not b2.star)) then
local ddx2, ddy2 = body.gravitate(b, b2.x, b2.y)
b2.dx = b2.dx + (dt * ddx2)
b2.dy = b2.dy + (dt * ddy2)
end
end
last_x, last_y = x, y
x = x + (dx * step_size * 100)
y = y + (dy * step_size * 100)
love.graphics.line(last_x - ship.x, last_y - ship.y, x - ship.x, y - ship.y)
end
end,
vector = function(x, y, at_x, at_y)
local half = vector_size / 2
love.graphics.push()
love.graphics.setLineWidth(1)
love.graphics.setColor(255, 255, 255);
love.graphics.rectangle("line", at_x, at_y, vector_size, vector_size)
love.graphics.setLineWidth(3)
love.graphics.setColor(50, 255, 50);
-- TODO: scale length of vector non-linearly
love.graphics.line(at_x + half, at_y + half,
at_x + half + x, at_y + half + y)
love.graphics.pop()
end,
vector_size = vector_size,
}
| gpl-3.0 |
prineside/mtaw | resources/MTAW/client/dimension.lua | 2 | 2938 | --------------------------------------------------------------------------------
--<[ Внутренние события ]>------------------------------------------------------
--------------------------------------------------------------------------------
addEvent( "Dimension.onServerRegistryResponse", true ) -- Начальная загрузка регистра ( table newRegistry, table newNameRegistry )
addEvent( "Dimension.onServerUpdateRegistry", true ) -- Обновление во время выполнения ( table newRegistry, table newNameRegistry )
--------------------------------------------------------------------------------
--<[ Модуль Dimension ]>--------------------------------------------------------
--------------------------------------------------------------------------------
Dimension = {
registry = {};
nameRegistry = {};
init = function()
addEventHandler( "Dimension.onServerUpdateRegistry", resourceRoot, Dimension.onServerUpdateRegistry )
-- Загружаем список измерений из сервера
addEventHandler( "Dimension.onServerRegistryResponse", resourceRoot, function( newRegistry, newNameRegistry )
Dimension.onServerUpdateRegistry( newRegistry, newNameRegistry )
Main.setModuleLoaded( "Dimension", 1 )
end )
triggerServerEvent( "Dimension.onClientRequestRegistry", resourceRoot )
end;
-- Получить ID измерения из MTA (например, для setElementDimension)
-- > dimensionName string - название измерения
-- > dimensionID number / nil - номер измерения (в соответствии с названием). Опционально (для измерений типа Global, без ID)
-- = number dimensionIngameID
get = function( dimensionName, dimensionID )
if ( Dimension.nameRegistry[ dimensionName ] == nil ) then
return nil
else
if ( dimensionID == nil or type( Dimension.nameRegistry[ dimensionName ] ) == "number" ) then
return Dimension.nameRegistry[ dimensionName ]
else
return Dimension.nameRegistry[ dimensionName ][ dimensionID ]
end
end
end;
----------------------------------------------------------------------------
--<[ Обработчики событий ]>-------------------------------------------------
----------------------------------------------------------------------------
-- Регистр измерений обновился
-- TODO не обязательно передавать весь массив регистра, лостаточно передать только изменения
onServerUpdateRegistry = function( newRegistry, newNameRegistry )
Dimension.registry = newRegistry
Dimension.nameRegistry = newNameRegistry
--Debug.info( "Регистр измерений обновлен" )
end;
}
addEventHandler( "onClientResourceStart", resourceRoot, Dimension.init ) | mit |
ctakemoto/Human-Controlled-Naos | Player/Test/test_vision.lua | 5 | 7290 | module(... or "", package.seeall)
require('unix')
webots = false;
darwin = false;
-- mv up to Player directory
unix.chdir('..');
local cwd = unix.getcwd();
-- the webots sim is run from the WebotsController dir (not Player)
if string.find(cwd, "WebotsController") then
webots = true;
cwd = cwd.."/Player"
package.path = cwd.."/?.lua;"..package.path;
end
computer = os.getenv('COMPUTER') or "";
if (string.find(computer, "Darwin")) then
-- MacOS X uses .dylib:
package.cpath = cwd.."/Lib/?.dylib;"..package.cpath;
else
package.cpath = cwd.."/Lib/?.so;"..package.cpath;
end
package.path = cwd.."/Util/?.lua;"..package.path;
package.path = cwd.."/Config/?.lua;"..package.path;
package.path = cwd.."/Lib/?.lua;"..package.path;
package.path = cwd.."/Dev/?.lua;"..package.path;
package.path = cwd.."/Motion/?.lua;"..package.path;
package.path = cwd.."/Motion/keyframes/?.lua;"..package.path;
package.path = cwd.."/Vision/?.lua;"..package.path;
package.path = cwd.."/World/?.lua;"..package.path;
require('Config');
smindex = 0;
package.path = cwd..'/BodyFSM/'..Config.fsm.body[smindex+1]..'/?.lua;'..package.path;
package.path = cwd..'/HeadFSM/'..Config.fsm.head[smindex+1]..'/?.lua;'..package.path;
package.path = cwd..'/GameFSM/'..Config.fsm.game..'/?.lua;'..package.path;
require('shm')
require('Body')
require('vector')
BodyFSM=require('BodyFSM');
HeadFSM=require('HeadFSM');
require('getch')
require('vcm');
require('Motion');
require('walk');
--require('HeadTransform')
require('Broadcast')
require('Comm')
require('Speak')
getch.enableblock(1);
unix.usleep(1E6*1.0);
-- initialize state machines
HeadFSM.entry();
Motion.entry();
Body.set_head_hardness({0.4,0.4});
HeadFSM.sm:set_state('headScan');
--BodyFSM.sm:set_state('bodySearch');
--Motion.sm:set_state('stance');
--walk.entry();
Motion.sm:set_state('sit');
-- main loop
count = 0;
vcmcount=0;
local t0=Body.get_time();
local last_update_time=t0;
local headangle=vector.new({0,10*math.pi/180});
local headsm_running=0;
local last_vision_update_time=t0;
targetvel=vector.zeros(3);
t_update=2;
--Motion.fall_check=0;
--Motion.fall_check=1;
broadcast_enable=0;
ballcount,visioncount,imagecount=0,0,0;
hires_broadcast=0;
cameraparamcount=1;
broadcast_count=0;
buttontime=0;
function print_debug()
local t = Body.get_time();
local ball = wcm.get_ball();
print(string.format("Ball: (%f, %f) seen %.1f sec ago", ball.x, ball.y, t-ball.t));
end
function process_keyinput()
local str=getch.get();
if #str>0 then
local byte=string.byte(str,1);
-- Move the head around
bodysm_running=0;
if byte==string.byte("w") then
headsm_running=0;
headangle[2]=headangle[2]-5*math.pi/180;
elseif byte==string.byte("a") then
headangle[1]=headangle[1]+5*math.pi/180;
headsm_running=0;
elseif byte==string.byte("s") then
headangle[1],headangle[2]=0,0;
headsm_running=0;
elseif byte==string.byte("d") then
headangle[1]=headangle[1]-5*math.pi/180;
headsm_running=0;
elseif byte==string.byte("x") then
headangle[2]=headangle[2]+5*math.pi/180;
headsm_running=0;
elseif byte==string.byte("e") then
headangle[2]=headangle[2]-1*math.pi/180;
headsm_running=0;
elseif byte==string.byte("c") then
headangle[2]=headangle[2]+1*math.pi/180;
headsm_running=0;
elseif byte==string.byte("v") then
HeadFSM.sm:set_state('headFigure8');
--Camera angle tuning
elseif byte==string.byte("q") then
cameraangle=cameraangle-1*math.pi/180;
print("Head camera angle:",cameraangle*180/math.pi);
vcm.motion.cameraAngle[1]=cameraangle;
elseif byte==string.byte("z") then
cameraangle=cameraangle+1*math.pi/180;
print("Head camera angle:",cameraangle*180/math.pi);
vcm.motion.cameraAngle[1]=cameraangle;
--Broadcast selection
elseif byte==string.byte("g") then
local mymod = 2;
mymod = 4;
broadcast_enable=(broadcast_enable+1)%mymod;
print("Broadcast:", broadcast_enable);
-- Walk velocity setting
elseif byte==string.byte("i") then targetvel[1]=targetvel[1]+0.02;
elseif byte==string.byte("j") then targetvel[3]=targetvel[3]+0.1;
elseif byte==string.byte("k") then targetvel[1],targetvel[2],targetvel[3]=0,0,0;
elseif byte==string.byte("l") then targetvel[3]=targetvel[3]-0.1;
elseif byte==string.byte(",") then targetvel[1]=targetvel[1]-0.02;
elseif byte==string.byte("h") then targetvel[2]=targetvel[2]+0.02;
elseif byte==string.byte(";") then targetvel[2]=targetvel[2]-0.02;
-- HeadFSM setting
elseif byte==string.byte("1") then
headsm_running = 1-headsm_running;
if( headsm_running==1 ) then
HeadFSM.sm:set_state('headScan');
end
elseif byte==string.byte("2") then
headsm_running = 0; -- Turn off the head state machine
-- HeadTransform
local ball = wcm.get_ball();
local trackZ = Config.vision.ball_diameter; -- Look a little above the ground
-- TODO: Nao needs to add the camera select
headangle = vector.zeros(2);
headangle[1],headangle[2] = HeadTransform.ikineCam(ball.x, ball.y, trackZ);
print("Head Angles for looking directly at the ball", unpack(headangle*180/math.pi));
Body.set_head_command(headangle);
elseif byte==string.byte("3") then
if Config.game.robotID==9 then
local ball = vcm.ball;
pickup.throw=0;
Motion.event("pickup");
else
kick.set_kick("kickForwardLeft");
Motion.event("kick");
end
elseif byte==string.byte("4") then
if Config.game.robotID==9 then
pickup.throw=1;
Motion.event("pickup");
else
kick.set_kick("kickForwardRight");
Motion.event("kick");
end
elseif byte==string.byte("5") then --Turn on body SM
headsm_running=1;
bodysm_running=1;
BodyFSM.sm:set_state('bodySearch');
HeadFSM.sm:set_state('headScan');
elseif byte==string.byte("6") then --Kick head SM
headsm_running=1;
HeadFSM.sm:set_state('headKick');
elseif byte==string.byte("7") then Motion.event("sit");
elseif byte==string.byte("8") then
if walk.active then
walk.stopAlign();
end
Motion.event("standup");
elseif byte==string.byte("9") then
Motion.event("walk");
walk.start();
end
walk.set_velocity(unpack(targetvel));
end
end
function update()
Body.set_syncread_enable(0); --read from only head servos
-- Update the relevant engines
Body.update();
Motion.update();
-- Update the HeadFSM if it is running
if( headsm_running==1 ) then
HeadFSM.update();
end
-- Update the BodyFSM if it is running
if( headsm_running==1 ) then
HeadFSM.update();
end
-- Get a keypress
process_keyinput();
-- Send updates over the network
Broadcast.update(broadcast_enable);
end
local tDelay=0.002*1E6;
local ncount = 100;
local tUpdate = Body.get_time();
while 1 do
count = count + 1;
update();
-- Show FPS
local t = Body.get_time();
if(count==ncount) then
local fps = ncount/(t-tUpdate);
tUpdate = t;
count = 1;
print(fps.." FPS")
-- Print the debug information
print_debug();
end
--Wait until dcm has done reading/writing
unix.usleep(tDelay);
end
| gpl-3.0 |
gabrielc63/nvim | after/plugin/lualine.rc.lua | 1 | 1217 | local status, lualine = pcall(require, 'lualine')
if (not status) then return end
lualine.setup {
options = {
icons_enabled = true,
theme = 'auto',
section_separators = { left = '', right = '' },
component_separators = { left = '', right = ''},
disabled_filetypes = {}
},
sections = {
lualine_a = {'mode'},
lualine_b = { 'branch' },
lualine_c = { {
'filename',
file_status = true, -- displays file status
path = 0 -- 0 = just filename, 1 = relative path, 2 = absolute path
}},
lualine_x = {
{ 'diagnostics', sources = { 'nvim_diagnostic' }, symbols = { error = ' ', warn = ' ', info = ' ',
hint = ' ' } },
'encoding',
'filetype'
},
lualine_y = { 'progress' },
lualine_z = { 'location' }
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { {
'filename',
file_status = true, -- displays file status (readonly status, modified status)
path = 1 -- 0 = just filename, 1 = relative path, 2 = absolute path
} },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {}
},
tabline = {},
extensions = { 'fugitive' }
}
| mit |
Ayditor/HPW_Rewrite | lua/hpwrewrite/cvars.lua | 2 | 7760 | if not HpwRewrite then return end
HpwRewrite.CVars = HpwRewrite.CVars or { }
if SERVER then
function HpwRewrite:UseSaver(bool)
if bool then
hook.Add("PlayerSpawn", "hpwrewrite_saverfortables", function(ply)
if not ply.HpwRewrite then
ply.HpwRewrite = { }
HpwRewrite:LogDebug(ply:Name() .. " HpwRewrite namespace has been initialized in SAVER - hpwrewrite_saverfortables hook")
end
HpwRewrite:UpdatePlayerInfo(ply)
end)
else
hook.Remove("PlayerSpawn", "hpwrewrite_saverfortables")
end
HpwRewrite:LogDebug("Loaded saver! Status: " .. tostring(bool))
end
end
HpwRewrite.CVars.Installed = CreateConVar("hpwrewrite_installed", 1, {
FCVAR_ARCHIVE,
FCVAR_NOTIFY,
FCVAR_REPLICATED,
FCVAR_SERVER_CAN_EXECUTE
}, "")
HpwRewrite.CVars.Version = CreateConVar("hpwrewrite_version", HpwRewrite.Version, {
FCVAR_ARCHIVE,
FCVAR_NOTIFY,
FCVAR_REPLICATED,
FCVAR_SERVER_CAN_EXECUTE
}, "")
-- Serverside cvars
HpwRewrite.CVars.DebugMode = CreateConVar("hpwrewrite_sv_debugmode", "0", { FCVAR_ARCHIVE, FCVAR_REPLICATED, FCVAR_NOTIFY })
local value = "0"
if game.SinglePlayer() then value = "1" end
HpwRewrite.CVars.NoLearning = CreateConVar("hpwrewrite_sv_nolearning", value, { FCVAR_ARCHIVE, FCVAR_REPLICATED, FCVAR_NOTIFY })
HpwRewrite.CVars.GiveWand = CreateConVar("hpwrewrite_sv_givewand", value, { FCVAR_ARCHIVE, FCVAR_NOTIFY })
HpwRewrite.CVars.DisableThrowing = CreateConVar("hpwrewrite_sv_nothrowing", "0", { FCVAR_ARCHIVE })
HpwRewrite.CVars.NoAccuracy = CreateConVar("hpwrewrite_sv_noaccuracy", "0", { FCVAR_ARCHIVE })
HpwRewrite.CVars.NoSay = CreateConVar("hpwrewrite_sv_nosay", "0", { FCVAR_ARCHIVE })
HpwRewrite.CVars.NoTimer = CreateConVar("hpwrewrite_sv_notimer", "0", { FCVAR_ARCHIVE })
HpwRewrite.CVars.AlwaysCenter = CreateConVar("hpwrewrite_sv_spawncenter", "0", { FCVAR_ARCHIVE })
HpwRewrite.CVars.AnimSpeed = CreateConVar("hpwrewrite_sv_animspeed", "1", { FCVAR_ARCHIVE, FCVAR_REPLICATED })
-- Notifying
HpwRewrite.CVars.ErrorNotify = CreateConVar("hpwrewrite_sv_error_notify", "0", { FCVAR_ARCHIVE })
cvars.AddChangeCallback("hpwrewrite_sv_nolearning", function(cvar, old, new)
if SERVER then for k, v in pairs(player.GetAll()) do HpwRewrite:UpdatePlayerInfo(v) end end
end)
HpwRewrite.CVars.UseSaver = CreateConVar("hpwrewrite_sv_usesaver", "0", { FCVAR_ARCHIVE })
cvars.AddChangeCallback("hpwrewrite_sv_usesaver", function(cvar, old, new)
if SERVER then HpwRewrite:UseSaver(tobool(new)) end
end)
if SERVER then HpwRewrite:UseSaver(HpwRewrite.CVars.UseSaver:GetBool()) end
-- Clientside cvars
if CLIENT then
HpwRewrite.CVars.NoHud = CreateClientConVar("hpwrewrite_cl_nohud", "0", true, false)
HpwRewrite.CVars.NoChoosing = CreateClientConVar("hpwrewrite_cl_nochoosing", "0", true, false)
HpwRewrite.CVars.NoTextIfIcon = CreateClientConVar("hpwrewrite_cl_notexticon", "0", true, false)
HpwRewrite.CVars.MmorpgStyle = CreateClientConVar("hpwrewrite_cl_mmorpgstyle", "1", true, false)
HpwRewrite.CVars.DrawIcons = CreateClientConVar("hpwrewrite_cl_drawicons", "1", true, false)
HpwRewrite.CVars.DrawSpellName = CreateClientConVar("hpwrewrite_cl_drawspname", "1", true, false)
HpwRewrite.CVars.DrawHint = CreateClientConVar("hpwrewrite_cl_drawhint", "1", true, false)
HpwRewrite.CVars.DrawSelHint = CreateClientConVar("hpwrewrite_cl_drawhint2", "1", true, false)
HpwRewrite.CVars.DrawCurrentSpell = CreateClientConVar("hpwrewrite_cl_drawcurspell", "1", true, false)
HpwRewrite.CVars.DrawSpellBar = CreateClientConVar("hpwrewrite_cl_drawspellbar", "1", true, false)
HpwRewrite.CVars.DrawBookText = CreateClientConVar("hpwrewrite_cl_drawbooktext", "1", true, false)
HpwRewrite.CVars.DisableBinds = CreateClientConVar("hpwrewrite_cl_disablebinds", "0", true, false)
HpwRewrite.CVars.DisableMsg = CreateClientConVar("hpwrewrite_cl_disablemsg", "0", true, false)
HpwRewrite.CVars.DisableAllMsgs = CreateClientConVar("hpwrewrite_cl_disableallmsgs", "0", true, false)
HpwRewrite.CVars.InstantAttack = CreateClientConVar("hpwrewrite_cl_instantattack", "0", true, false)
HpwRewrite.CVars.HideSparks = CreateClientConVar("hpwrewrite_cl_hidesparks", "0", true, false)
HpwRewrite.CVars.CloseOnSelect = CreateClientConVar("hpwrewrite_cl_closeonselect", "1", true, false)
HpwRewrite.CVars.BlockLeftMouse = CreateClientConVar("hpwrewrite_cl_blockleftmouse", "0", true, true)
cvars.AddChangeCallback("hpwrewrite_cl_blockleftmouse", function(cvar, old, new)
HpwRewrite:DoNotify(Format("Left mouse has been %s! Changes will be made after your death", tobool(new) and "blocked" or "unblocked"))
end)
HpwRewrite.CVars.HideTree = CreateClientConVar("hpwrewrite_cl_hidetree", "0", true, false)
cvars.AddChangeCallback("hpwrewrite_cl_hidetree", function(cvar, old, new)
HpwRewrite.VGUI:UpdateVgui()
end)
HpwRewrite.CVars.XOffset = CreateClientConVar("hpwrewrite_cl_xoffset", "0", true, false)
HpwRewrite.CVars.YOffset = CreateClientConVar("hpwrewrite_cl_yoffset", "0", true, false)
HpwRewrite.CVars.UseWhiteSmoke = CreateClientConVar("hpwrewrite_cl_appwhitesmoke", "0", true, true)
-- 66 is a code of backspace key, 108 is a code of mouse right
HpwRewrite.CVars.SelfCastKey = CreateClientConVar("hpwrewrite_cl_selfcastkey", "66", true, false)
HpwRewrite.CVars.MenuKey = CreateClientConVar("hpwrewrite_cl_mmenukey", "108", true, false)
HpwRewrite.CVars.FontName = CreateClientConVar("hpwrewrite_cl_fontname", "Harry P", true, false)
cvars.AddChangeCallback("hpwrewrite_cl_fontname", function(cvar, old, new)
HpwRewrite:LoadFonts()
HpwRewrite.VGUI.ShouldUpdate = true
end)
HpwRewrite.CVars.Language = CreateClientConVar("hpwrewrite_cl_language", "en", true, false)
concommand.Add("hpwrewrite_cl_updatevgui", function(ply)
HpwRewrite.VGUI:UpdateVgui()
end, nil, "Updates main VGUI")
concommand.Add("hpwrewrite_cl_cleardebug", function(ply)
table.Empty(HpwRewrite.DebugInfo)
end, nil, "Cleans debug info array")
end
-- Console commands
concommand.Add("hpwrewrite_dumpdata", function(ply)
if CLIENT then return end
local white = HpwRewrite.Colors.White
local col2 = HpwRewrite.Colors.Blue
MsgC(white, "Dumping players' data files...\n")
local plys = player.GetAll()
for k, v in pairs(plys) do
local data, filen = HpwRewrite.DM:LoadDataFile(v)
MsgC(white, v:Name(), " ", filen, " ...\n")
MsgC(white, "SteamID ", col2, data.SteamID, "\n")
MsgC(white, "Learned spells ", col2, table.concat(data.Spells, ", "), "\n")
MsgC(white, "Learnable spells ", col2, table.concat(data.LearnableSpells, ", "), "\n")
if next(plys, k) != nil then Msg("\n") end
end
Msg("\n")
MsgC(white, "Dumping config...\n")
local data, filen = HpwRewrite.DM:ReadConfig()
MsgC(white, "AdminOnly ", col2, table.concat(data.AdminOnly, ", "), "\n")
MsgC(white, "Blacklist ", col2, table.concat(data.Blacklist, ", "), "\n")
MsgC(white, "Default skin ", col2, data.DefaultSkin, "\n")
end, nil, "")
concommand.Add("hpwrewrite_admin_updatespells", function(ply)
if CLIENT then return end
if not HpwRewrite.CheckAdminError(ply) then return end
for k, v in pairs(player.GetAll()) do
HpwRewrite:UpdatePlayerInfo(v)
HpwRewrite:DoNotify(ply, "Spells for " .. v:Name() .. " has been updated!", 4)
end
HpwRewrite:LogDebug(ply:Name() .. " has updated spells for everyone!")
end, nil, "Updates spells for every player")
concommand.Add("hpwrewrite_admin_cleardebug", function(ply)
if CLIENT then return end
if not HpwRewrite.CheckAdminError(ply) then return end
table.Empty(HpwRewrite.DebugInfo)
end, nil, "Cleans debug info array")
concommand.Add("hpwrewrite_admin_cleaneverything", function(ply)
if CLIENT then return end
if not HpwRewrite.CheckAdminError(ply) then return end
HpwRewrite:CleanEverything()
end, nil, "Cleans debug info array")
| mit |
amirkingred/nod | plugins/time.lua | 94 | 3004 | -- Implement a command !time [area] which uses
-- 2 Google APIs to get the desired result:
-- 1. Geocoding to get from area to a lat/long pair
-- 2. Timezone to get the local time in that lat/long location
-- Globals
-- If you have a google api key for the geocoding/timezone api
api_key = nil
base_api = "https://maps.googleapis.com/maps/api"
dateFormat = "%A %d %B - %H:%M:%S"
-- Need the utc time for the google api
function utctime()
return os.time(os.date("!*t"))
end
-- Use the geocoding api to get the lattitude and longitude with accuracy specifier
-- CHECKME: this seems to work without a key??
function get_latlong(area)
local api = base_api .. "/geocode/json?"
local parameters = "address=".. (URL.escape(area) or "")
if api_key ~= nil then
parameters = parameters .. "&key="..api_key
end
-- Do the request
local res, code = https.request(api..parameters)
if code ~=200 then return nil end
local data = json:decode(res)
if (data.status == "ZERO_RESULTS") then
return nil
end
if (data.status == "OK") then
-- Get the data
lat = data.results[1].geometry.location.lat
lng = data.results[1].geometry.location.lng
acc = data.results[1].geometry.location_type
types= data.results[1].types
return lat,lng,acc,types
end
end
-- Use timezone api to get the time in the lat,
-- Note: this needs an API key
function get_time(lat,lng)
local api = base_api .. "/timezone/json?"
-- Get a timestamp (server time is relevant here)
local timestamp = utctime()
local parameters = "location=" ..
URL.escape(lat) .. "," ..
URL.escape(lng) ..
"×tamp="..URL.escape(timestamp)
if api_key ~=nil then
parameters = parameters .. "&key="..api_key
end
local res,code = https.request(api..parameters)
if code ~= 200 then return nil end
local data = json:decode(res)
if (data.status == "ZERO_RESULTS") then
return nil
end
if (data.status == "OK") then
-- Construct what we want
-- The local time in the location is:
-- timestamp + rawOffset + dstOffset
local localTime = timestamp + data.rawOffset + data.dstOffset
return localTime, data.timeZoneId
end
return localTime
end
function getformattedLocalTime(area)
if area == nil then
return "The time in nowhere is never"
end
lat,lng,acc = get_latlong(area)
if lat == nil and lng == nil then
return 'It seems that in "'..area..'" they do not have a concept of time.'
end
local localTime, timeZoneId = get_time(lat,lng)
return "The local time in "..timeZoneId.." is: ".. os.date(dateFormat,localTime)
end
function run(msg, matches)
return getformattedLocalTime(matches[1])
end
return {
description = "Displays the local time in an area",
usage = "!time [area]: Displays the local time in that area",
patterns = {"^!time (.*)$"},
run = run
}
--Copyright and edit; @behroozyaghi
--Persian Translate; @behroozyaghi
--ch : @nod32team
--کپی بدون ذکر منبع حرام است
| gpl-2.0 |
Maxize/LuaPractice | practice/testfor13.1.lua | 1 | 1156 | Set = {};
local mt = {};
function Set.new (l)
local set = {};
setmetatable(set,mt);
for _, v in ipairs(l) do
set[v] = true;
end
return set;
end
function Set.union(a, b)
if getmetatable(a) ~= mt or getmetatable(b) ~= mt then
error(" attempt to 'add' a set with a non-set value ",2);
end
local res = Set.new{};
for k in pairs(a) do
res[k] = true;
end
for k in pairs(b) do
res[k] = true;
end
return res;
end
function Set.intersection(a, b)
if getmetatable(a) ~= mt or getmetatable(b) ~= mt then
error(" attempt to 'mul' a set with a non-set value ",2);
end
local res = Set.new{};
for k in pairs(a) do
res[k] = b[k];
end
return res;
end
function Set.toString(set)
local l = {};
for e in pairs(set) do
l[#l+1] = e;
end
return "{".. table.concat(l, ", ") .. "}";
end
function Set.print(s)
print(Set.toString(s));
end
s1 = Set.new{10, 20, 30, 50};
for _, k in pairs(s1) do
print(_, k);
end
print(" --------------- ");
s2 = Set.new{30, 40, 50};
print(getmetatable(s1));
print(getmetatable(s2));
mt. __add = Set.union;
s3 = s1 + s2;
Set.print(s3);
mt. __mul = Set.intersection;
Set.print((s1 + s2) * s1);
| apache-2.0 |
Enignite/darkstar | scripts/globals/items/bowl_of_oceanfin_soup.lua | 36 | 1822 | -----------------------------------------
-- ID: 6070
-- Item: Bowl of Oceanfin Soup
-- Food Effect: 4 Hrs, All Races
-----------------------------------------
-- Accuracy % 15 Cap 95
-- Ranged Accuracy % 15 Cap 95
-- Attack % 19 Cap 85
-- Ranged Attack % 19 Cap 85
-- Amorph Killer 6
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
local result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,14400,6070);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_FOOD_ACCP, 15);
target:addMod(MOD_FOOD_ACC_CAP, 95);
target:addMod(MOD_FOOD_RACCP, 15);
target:addMod(MOD_FOOD_RACC_CAP, 95);
target:addMod(MOD_FOOD_ATTP, 19);
target:addMod(MOD_FOOD_ATT_CAP, 85);
target:addMod(MOD_FOOD_RATTP, 19);
target:addMod(MOD_FOOD_RATT_CAP, 85);
target:addMod(MOD_AMORPH_KILLER, 6);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_FOOD_ACCP, 15);
target:delMod(MOD_FOOD_ACC_CAP, 95);
target:delMod(MOD_FOOD_RACCP, 15);
target:delMod(MOD_FOOD_RACC_CAP, 95);
target:delMod(MOD_FOOD_ATTP, 19);
target:delMod(MOD_FOOD_ATT_CAP, 85);
target:delMod(MOD_FOOD_RATTP, 19);
target:delMod(MOD_FOOD_RATT_CAP, 85);
target:delMod(MOD_AMORPH_KILLER, 6);
end;
| gpl-3.0 |
Enignite/darkstar | scripts/globals/items/heat_rod.lua | 41 | 1097 | -----------------------------------------
-- ID: 17071
-- Item: Heat Rod
-- Additional Effect: Lightning Damage
-----------------------------------------
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------
-- onAdditionalEffect Action
-----------------------------------
function onAdditionalEffect(player,target,damage)
local chance = 10;
if (math.random(0,99) >= chance) then
return 0,0,0;
else
local dmg = math.random(5,20);
local params = {};
params.bonusmab = 0;
params.includemab = false;
dmg = addBonusesAbility(player, ELE_LIGHTNING, target, dmg, params);
dmg = dmg * applyResistanceAddEffect(player,target,ELE_LIGHTNING,0);
dmg = adjustForTarget(target,dmg,ELE_LIGHTNING);
dmg = finalMagicNonSpellAdjustments(player,target,ELE_LIGHTNING,dmg);
local message = MSGBASIC_ADD_EFFECT_DMG;
if (dmg < 0) then
message = MSGBASIC_ADD_EFFECT_HEAL;
end
return SUBEFFECT_LIGHTNING_DAMAGE,message,dmg;
end
end; | gpl-3.0 |
Rakoonic/Skybox | code/example2.lua | 1 | 2851 | --------------------------------------------------------------
-- SETUP -----------------------------------------------------
local __G = require( "libs.globals" )
local skyboxClass = require( "libs.skybox" )
local storyboard = require( "storyboard" )
local scene = storyboard.newScene()
local setUpSkybox, update
local skybox
local yAngle, xAngle
--------------------------------------------------------------
-- SET UP ----------------------------------------------------
function setUpSkybox( group )
local border = 25
-- Create a sky box
yAngle, xAngle = 0, 50
skybox = skyboxClass.new{
-- Object properties
objType = "container",
parent = group,
-- View
xAngle = xAngle,
yAngle = yAngle,
-- Window - clipping only occurs with 'snapshot' and 'container' objTypes
left = border,
top = border,
width = display.contentWidth - border * 2,
height = display.contentHeight - border * 2,
-- Skybox images
images = {
-- Where the images live
path = "gfx/",
file = "sky",
extension = "png",
-- Size of each image - must be the same
width = 512,
height = 512,
-- List only wanted faces
faces = { "front", "back", "up", "down" },
},
}
end
--------------------------------------------------------------
-- UPDATE ----------------------------------------------------
function update( event )
yAngle = yAngle + 0.1
xAngle = math.max( xAngle - 0.04, 0 )
skybox:update( yAngle, xAngle )
end
--------------------------------------------------------------
-- STORYBOARD ------------------------------------------------
function scene:createScene( event )
-- Set up the skybox
setUpSkybox( self.view )
-- Add in clickable area to return to menu
local rect = display.newRect( self.view, display.contentWidth / 2, display.contentHeight / 2, display.contentWidth, display.contentHeight )
rect.isVisible = false
rect.isHitTestable = true
rect:addEventListener( "tap", function()
storyboard.gotoScene( "code.menu", __G.sbFade )
end
)
end
function scene:enterScene( event )
-- Add in the frame event
Runtime:addEventListener( "enterFrame", update )
end
function scene:exitScene( event )
-- Add in the frame event
Runtime:removeEventListener( "enterFrame", update )
end
function scene:didExitScene( event )
storyboard.purgeScene( "code.example2" )
end
--------------------------------------------------------------
-- STORYBOARD LISTENERS --------------------------------------
scene:addEventListener( "createScene", scene )
scene:addEventListener( "enterScene", scene )
scene:addEventListener( "exitScene", scene )
scene:addEventListener( "didExitScene", scene )
--------------------------------------------------------------
-- RETURN STORYBOARD OBJECT ----------------------------------
return scene
| mit |
troopizer/ot-server | data/npc/scripts/beer4.lua | 1 | 3219 | local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
local random_texts = {
'Do you want to order something?.',
'Do you want to order something?.',
'We are not used to big people here in Buckland, but you are wellcome.',
'We are not used to big people here in Buckland, but you are wellcome.',
'First time in Bucklebury?.',
'We have fresh salmon from the river.'
}
local rnd_sounds = 0
function onThink()
if(rnd_sounds < os.time()) then
rnd_sounds = (os.time() + 25)
if(math.random(100) < 40) then
Npc():say(random_texts[math.random(#random_texts)], TALKTYPE_SAY)
end
end
npcHandler:onThink()
end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'year') or msgcontains(msg, 'date') or msgcontains(msg, 'tales') or msgcontains(msg, 'information')) then
selfSay('We are in the year 2900 of the third age.', cid)
selfSay('Gorbadoc is currently our mayor and a very good one.', cid)
end
if(msgcontains(msg, 'beer')) then
selfSay('Dont have beer right now...', cid)
end
if(msgcontains(msg, 'food')) then
selfSay('I sell bread for 2 gp, cheese for 2 gp and salmon for 10 gp.', cid)
end
if(msgcontains(msg, 'mission')) then
if (getPlayerStorageValue(cid,2306) < 0) then
setPlayerStorageValue(cid,30034,33)
setPlayerStorageValue(cid,2306,4)
setPlayerStorageValue(cid,2307,150)
end
if (getPlayerStorageValue(cid,2006) == 0) then
selfSay('What? a mission? what is your mission here?.', cid)
else
selfSay('What? a mission? I havent hear of any mission around here..but if you want a job, go to the Brandy Hall.', cid)
end
end
if(msgcontains(msg, 'old mine')) then
selfSay('the old mine? I dont know about any old mine, but I know that under the hills north from here, there is a iron mine. But.. the renegades build their town over it..', cid)
end
if(msgcontains(msg, 'mine')) then
selfSay('I know that under the hills north from here, there is a iron mine. But.. the renegades build their town over it..', cid)
end
if(msgcontains(msg, 'golden goblet')) then
selfSay('I havent hear about that...', cid)
end
if(msgcontains(msg, 'Buckland')) then
selfSay('We are in Buckland right now, all the land surrounded by the hedge. If you are looking for a job, talk to the mayor in Brandy Hall.', cid)
end
if(msgcontains(msg, 'Brandy Hall')) then
selfSay('The Brandy Hall is a very big house under the hill to the south. Is the house of Gorbadoc the mayor.', cid)
end
if(msgcontains(msg, 'Gorbadoc')) then
selfSay('He is the lord of Buckland, a very respected hobbit, he always needs people for jobs.', cid)
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
| gpl-2.0 |
dwdm/snabbswitch | src/lib/lua/alt_getopt.lua | 17 | 4361 | -- Copyright (c) 2009 Aleksey Cheusov <vle@gmx.net>
--
-- Permission is hereby granted, free of charge, to any person obtaining
-- a copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
-- without limitation the rights to use, copy, modify, merge, publish,
-- distribute, sublicense, and/or sell copies of the Software, and to
-- permit persons to whom the Software is furnished to do so, subject to
-- the following conditions:
--
-- The above copyright notice and this permission notice shall be
-- included in all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
local type, pairs, ipairs, io, os = type, pairs, ipairs, io, os
module (...)
local function convert_short2long (opts)
local i = 1
local len = #opts
local ret = {}
for short_opt, accept_arg in opts:gmatch("(%w)(:?)") do
ret[short_opt]=#accept_arg
end
return ret
end
local function exit_with_error (msg, exit_status)
io.stderr:write (msg)
os.exit (exit_status)
end
local function err_unknown_opt (opt)
exit_with_error ("Unknown option `-" ..
(#opt > 1 and "-" or "") .. opt .. "'\n", 1)
end
local function canonize (options, opt)
if not options [opt] then
err_unknown_opt (opt)
end
while type (options [opt]) == "string" do
opt = options [opt]
if not options [opt] then
err_unknown_opt (opt)
end
end
return opt
end
function get_ordered_opts (arg, sh_opts, long_opts)
local i = 1
local count = 1
local opts = {}
local optarg = {}
local options = convert_short2long (sh_opts)
for k,v in pairs (long_opts) do
options [k] = v
end
while i <= #arg do
local a = arg [i]
if a == "--" then
i = i + 1
break
elseif a == "-" then
break
elseif a:sub (1, 2) == "--" then
local pos = a:find ("=", 1, true)
if pos then
local opt = a:sub (3, pos-1)
opt = canonize (options, opt)
if options [opt] == 0 then
exit_with_error ("Bad usage of option `" .. a .. "'\n", 1)
end
optarg [count] = a:sub (pos+1)
opts [count] = opt
else
local opt = a:sub (3)
opt = canonize (options, opt)
if options [opt] == 0 then
opts [count] = opt
else
if i == #arg then
exit_with_error ("Missed value for option `" .. a .. "'\n", 1)
end
optarg [count] = arg [i+1]
opts [count] = opt
i = i + 1
end
end
count = count + 1
elseif a:sub (1, 1) == "-" then
local j
for j=2,a:len () do
local opt = canonize (options, a:sub (j, j))
if options [opt] == 0 then
opts [count] = opt
count = count + 1
elseif a:len () == j then
if i == #arg then
exit_with_error ("Missed value for option `-" .. opt .. "'\n", 1)
end
optarg [count] = arg [i+1]
opts [count] = opt
i = i + 1
count = count + 1
break
else
optarg [count] = a:sub (j+1)
opts [count] = opt
count = count + 1
break
end
end
else
break
end
i = i + 1
end
return opts,i,optarg
end
function get_opts (arg, sh_opts, long_opts)
local ret = {}
local opts,optind,optarg = get_ordered_opts (arg, sh_opts, long_opts)
for i,v in ipairs (opts) do
if optarg [i] then
ret [v] = optarg [i]
else
ret [v] = 1
end
end
return ret,optind
end
| apache-2.0 |
ld-test/luaejdb | ejdb/inspect.lua | 5 | 6153 | -----------------------------------------------------------------------------------------------------------------------
-- inspect.lua - v1.2.1 (2013-01)
-- Enrique García Cota - enrique.garcia.cota [AT] gmail [DOT] com
-- human-readable representations of tables.
-- inspired by http://lua-users.org/wiki/TableSerialization
-----------------------------------------------------------------------------------------------------------------------
local inspect ={}
inspect.__VERSION = '1.2.0'
-- Apostrophizes the string if it has quotes, but not aphostrophes
-- Otherwise, it returns a regular quoted string
local function smartQuote(str)
if string.match( string.gsub(str,"[^'\"]",""), '^"+$' ) then
return "'" .. str .. "'"
end
return string.format("%q", str )
end
local controlCharsTranslation = {
["\a"] = "\\a", ["\b"] = "\\b", ["\f"] = "\\f", ["\n"] = "\\n",
["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v", ["\\"] = "\\\\"
}
local function unescapeChar(c) return controlCharsTranslation[c] end
local function unescape(str)
local result, _ = string.gsub( str, "(%c)", unescapeChar )
return result
end
local function isIdentifier(str)
return type(str) == 'string' and str:match( "^[_%a][_%a%d]*$" )
end
local function isArrayKey(k, length)
return type(k)=='number' and 1 <= k and k <= length
end
local function isDictionaryKey(k, length)
return not isArrayKey(k, length)
end
local sortOrdersByType = {
['number'] = 1, ['boolean'] = 2, ['string'] = 3, ['table'] = 4,
['function'] = 5, ['userdata'] = 6, ['thread'] = 7
}
local function sortKeys(a,b)
local ta, tb = type(a), type(b)
if ta ~= tb then return sortOrdersByType[ta] < sortOrdersByType[tb] end
if ta == 'string' or ta == 'number' then return a < b end
return false
end
local function getDictionaryKeys(t)
local length = #t
local keys = {}
for k,_ in pairs(t) do
if isDictionaryKey(k, length) then table.insert(keys,k) end
end
table.sort(keys, sortKeys)
return keys
end
local function getToStringResultSafely(t, mt)
local __tostring = type(mt) == 'table' and rawget(mt, '__tostring')
local string, status
if type(__tostring) == 'function' then
status, string = pcall(__tostring, t)
string = status and string or 'error: ' .. tostring(string)
end
return string
end
local Inspector = {}
function Inspector:new(t, depth)
local inspector = {
buffer = {},
depth = depth,
level = 0,
maxIds = {
['function'] = 0,
['userdata'] = 0,
['thread'] = 0,
['table'] = 0
},
ids = {
['function'] = setmetatable({}, {__mode = "kv"}),
['userdata'] = setmetatable({}, {__mode = "kv"}),
['thread'] = setmetatable({}, {__mode = "kv"}),
['table'] = setmetatable({}, {__mode = "kv"})
},
tableAppearances = setmetatable({}, {__mode = "k"})
}
setmetatable(inspector, {__index = Inspector})
inspector:countTableAppearances(t)
return inspector:putValue(t)
end
function Inspector:countTableAppearances(t)
if type(t) == 'table' then
if not self.tableAppearances[t] then
self.tableAppearances[t] = 1
for k,v in pairs(t) do
self:countTableAppearances(k)
self:countTableAppearances(v)
end
self:countTableAppearances(getmetatable(t))
else
self.tableAppearances[t] = self.tableAppearances[t] + 1
end
end
end
function Inspector:tabify()
self:puts("\n", string.rep(" ", self.level))
return self
end
function Inspector:up()
self.level = self.level - 1
end
function Inspector:down()
self.level = self.level + 1
end
function Inspector:puts(...)
local args = {...}
local len = #self.buffer
for i=1, #args do
len = len + 1
self.buffer[len] = tostring(args[i])
end
return self
end
function Inspector:commaControl(comma)
if comma then self:puts(',') end
return true
end
function Inspector:putTable(t)
if self:alreadyVisited(t) then
self:puts('<table ', self:getId(t), '>')
elseif self.depth and self.level >= self.depth then
self:puts('{...}')
else
if self.tableAppearances[t] > 1 then
self:puts('<',self:getId(t),'>')
end
self:puts('{')
self:down()
local length = #t
local mt = getmetatable(t)
local string = getToStringResultSafely(t, mt)
if type(string) == 'string' and #string > 0 then
self:puts(' -- ', unescape(string))
if length >= 1 then self:tabify() end -- tabify the array values
end
local comma = false
for i=1, length do
comma = self:commaControl(comma)
self:puts(' '):putValue(t[i])
end
local dictKeys = getDictionaryKeys(t)
for _,k in ipairs(dictKeys) do
comma = self:commaControl(comma)
self:tabify():putKey(k):puts(' = '):putValue(t[k])
end
if mt then
comma = self:commaControl(comma)
self:tabify():puts('<metatable> = '):putValue(mt)
end
self:up()
if #dictKeys > 0 or mt then -- dictionary table. Justify closing }
self:tabify()
elseif length > 0 then -- array tables have one extra space before closing }
self:puts(' ')
end
self:puts('}')
end
return self
end
function Inspector:alreadyVisited(v)
return self.ids[type(v)][v] ~= nil
end
function Inspector:getId(v)
local tv = type(v)
local id = self.ids[tv][v]
if not id then
id = self.maxIds[tv] + 1
self.maxIds[tv] = id
self.ids[tv][v] = id
end
return id
end
function Inspector:putValue(v)
local tv = type(v)
if tv == 'string' then
self:puts(smartQuote(unescape(v)))
elseif tv == 'number' or tv == 'boolean' or tv == 'nil' then
self:puts(tostring(v))
elseif tv == 'table' then
self:putTable(v)
else
self:puts('<',tv,' ',self:getId(v),'>')
end
return self
end
function Inspector:putKey(k)
if isIdentifier(k) then return self:puts(k) end
return self:puts( "[" ):putValue(k):puts("]")
end
function Inspector:tostring()
return table.concat(self.buffer)
end
setmetatable(inspect, { __call = function(_,t,depth)
return Inspector:new(t, depth):tostring()
end })
return inspect
| lgpl-2.1 |
fcpxhacks/fcpxhacks | src/extensions/cp/adobe/aftereffects/init.lua | 2 | 11413 | --- === cp.adobe.aftereffects ===
---
--- Adobe After Effects Extension
local require = require
--local log = require "hs.logger".new "ae"
local osascript = require "hs.osascript"
local app = require "cp.adobe.aftereffects.app"
local shortcuts = require "cp.adobe.aftereffects.shortcuts"
local config = require "cp.config"
local delegator = require "cp.delegator"
local lazy = require "cp.lazy"
local tools = require "cp.tools"
local class = require "middleclass"
local applescript = osascript.applescript
local readFromFile = tools.readFromFile
local aftereffects = class("cp.adobe.aftereffects")
:include(lazy)
:include(delegator)
:delegateTo("app")
function aftereffects:initialize()
--- cp.adobe.aftereffects.app <cp.app>
--- Constant
--- The `cp.app` for After Effects.
self.app = app
--- cp.adobe.aftereffects.preferences <cp.app.prefs>
--- Constant
--- The `cp.app.prefs` for After Effects.
self.preferences = app.preferences
app:update()
end
--- cp.adobe.aftereffects:preferencesPath() -> string | nil
--- Function
--- The path to After Effects Preferences folder.
---
--- Parameters:
--- * None
---
--- Returns:
--- * A string or `nil` if no path can be found.
function aftereffects:preferencesPath()
local version = self:version()
if version then
local major = version.major
local minor = version.minor
local path = os.getenv("HOME") .. "/Library/Preferences/Adobe/After Effects/" .. major .. "." .. minor .. "/"
return path
end
end
--- cp.adobe.aftereffects:preferencesFilePath() -> string
--- Function
--- The path to the main Preferences file.
---
--- Parameters:
--- * None
---
--- Returns:
--- * A string
function aftereffects:preferencesFilePath()
local version = self:version()
if version then
local major = version.major
local minor = version.minor
local preferencesPath = self:preferencesPath()
local prefsFile = preferencesPath and preferencesPath .. "Adobe After Effects " .. major .. "." .. minor .. " Prefs.txt"
return prefsFile
end
end
--- cp.adobe.aftereffects:allowScriptsToWriteFilesAndAccessNetwork() -> boolean
--- Function
--- Is "Allow Scripts to Write Files and Access Network" enabled in After Effects Preferences?
---
--- Parameters:
--- * None
---
--- Returns:
--- * A boolean
function aftereffects:allowScriptsToWriteFilesAndAccessNetwork()
local preferencesFilePath = self:preferencesFilePath()
local preferencesContents = preferencesFilePath and readFromFile(preferencesFilePath)
return preferencesContents and preferencesContents:find([["Pref_SCRIPTING_FILE_NETWORK_SECURITY" = "1"]], 1, true) and true or false
end
--- cp.adobe.aftereffects:refreshPreferences() -> none
--- Function
--- If After Effects is running, this forces the preferences file to be saved to disk.
---
--- Parameters:
--- * None
---
--- Returns:
--- * None
function aftereffects:refreshPreferences()
if self:running() then
applescript([[
tell application id "]] .. self:bundleID() .. [["
DoScriptFile "]] .. config.bundledPluginsPath .. [[/aftereffects/preferences/js/refreshprefs.jsx"
end tell
]])
end
end
--- cp.adobe.aftereffects:shortcutsPreferencesPath() -> string
--- Function
--- Gets the active shortcut key preferences file path.
---
--- Parameters:
--- * None
---
--- Returns:
--- * A string
function aftereffects:shortcutsPreferencesPath()
--------------------------------------------------------------------------------
-- NOTE: You can also use this ExtendScript:
-- app.preferences.getPrefAsString('General Section', 'Shortcut File Location', PREFType.PREF_Type_MACHINE_SPECIFIC)
-- However, I'm not sure how you can get this result to CommandPost easily?
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- NOTE: I've commented out refreshPreferences() because it adds a
-- substantial delay due to the fact that it triggers AppleScript.
--------------------------------------------------------------------------------
--self:refreshPreferences()
local preferencesFilePath = self:preferencesFilePath()
local preferencesContents = preferencesFilePath and readFromFile(preferencesFilePath)
if preferencesContents then
for line in string.gmatch(preferencesContents,'[^\r\n]+') do
if line:find([["Shortcut File Location" =]], 1, true) then
local preferencesPath = self: preferencesPath()
return preferencesPath .. "aeks/" .. line:sub(30, -2)
end
end
end
end
-- processKeyboardShortcut(currentSection, id, value) -> table
-- Function
-- Converts a keyboard shortcut from an After Effects format to the Hammerspoon format.
--
-- Parameters:
-- * section - The section as a string
-- * id - The ID as a string
-- * value - The keyboard shortcut as a string in the After Effects format
--
-- Returns:
-- * A table containing the modifiers, key and label
local function processKeyboardShortcut(section, id, value)
--------------------------------------------------------------------------------
-- Translate modifiers and key:
--------------------------------------------------------------------------------
local mods = {}
local key = ""
local components = value:split("+")
for _, comp in pairs(components) do
if shortcuts.modifiers[comp] then
table.insert(mods, shortcuts.modifiers[comp])
elseif shortcuts.keys[comp] then
key = shortcuts.keys[comp]
end
end
--------------------------------------------------------------------------------
-- Get human-readable value:
--------------------------------------------------------------------------------
local label = id
if shortcuts.labels[section] and shortcuts.labels[section][id] then
label = shortcuts.labels[section][id]
end
--------------------------------------------------------------------------------
-- If we don't have a human-readable value on file, just use the ID:
--------------------------------------------------------------------------------
if label == "" then
label = id
end
--------------------------------------------------------------------------------
-- Return result:
--------------------------------------------------------------------------------
return {
["modifiers"] = mods,
["character"] = key,
["label"] = label,
}
end
--- cp.adobe.aftereffects:shortcutsPreferences() -> table
--- Function
--- Gets a table of all the active After Effects keyboard shortcuts.
---
--- Parameters:
--- * None
---
--- Returns:
--- * A table
function aftereffects:shortcutsPreferences()
local shortcutsPreferencesPath = self:shortcutsPreferencesPath()
local preferencesContents = shortcutsPreferencesPath and readFromFile(shortcutsPreferencesPath)
local result = {}
if preferencesContents then
local currentSection
local lastID, lastValue
for line in string.gmatch(preferencesContents,'[^\r\n]+') do
if line:sub(1,1) ~= "#" and line ~= "" then
if line:sub(1, 2) == [[["]] then
--------------------------------------------------------------------------------
-- Section Heading:
--------------------------------------------------------------------------------
local value = line:sub(3, -3)
if value and value ~= "** header **" then
currentSection = value
end
elseif currentSection then
if line:sub(1, 2) == [[ "]] then
--------------------------------------------------------------------------------
-- Single line value (or start of multi-line value):
--------------------------------------------------------------------------------
local start, finish = line:find([[".-"]])
local id = line:sub(start + 1, finish - 1)
local value = line:sub(finish + 5, -2)
if line:sub(-1) == [[\]] then
--------------------------------------------------------------------------------
-- Start of a multi-line value:
--------------------------------------------------------------------------------
lastID = id
lastValue = value:sub(1, -2)
else
--------------------------------------------------------------------------------
-- Single line value:
--------------------------------------------------------------------------------
local s, f = value:find([[%(.-%)]])
value = value:sub(s + 1, f - 1)
value = processKeyboardShortcut(currentSection, id, value)
if not result[currentSection] then result[currentSection] = {} end
result[currentSection][id] = value
end
else
--------------------------------------------------------------------------------
-- Continuation of a multi-line value:
--------------------------------------------------------------------------------
local start, finish = line:find([[".-"]])
local v = line:sub(start + 1, finish - 1)
if line:sub(-1) == [["]] then
--------------------------------------------------------------------------------
-- End of a multi-line value:
--------------------------------------------------------------------------------
local id = lastID
lastValue = lastValue .. v
local s, f = lastValue:find([[%(.-%)]])
local value = lastValue:sub(s + 1, f - 1)
value = processKeyboardShortcut(currentSection, id, value)
if not result[currentSection] then result[currentSection] = {} end
result[currentSection][id] = value
else
--------------------------------------------------------------------------------
-- Middle of a multi-line value:
--------------------------------------------------------------------------------
lastValue = lastValue .. v
end
end
end
end
end
end
return result
end
return aftereffects()
| mit |
Enignite/darkstar | scripts/globals/spells/thunderstorm.lua | 31 | 1165 | --------------------------------------
-- Spell: Thunderstorm
-- Changes the weather around target party member to "thundery."
--------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/magic");
-----------------------------------------
-- OnSpellCast
-----------------------------------------
function onMagicCastingCheck(caster,target,spell)
return 0;
end;
function onSpellCast(caster,target,spell)
target:delStatusEffectSilent(EFFECT_FIRESTORM);
target:delStatusEffectSilent(EFFECT_SANDSTORM);
target:delStatusEffectSilent(EFFECT_RAINSTORM);
target:delStatusEffectSilent(EFFECT_WINDSTORM);
target:delStatusEffectSilent(EFFECT_HAILSTORM);
target:delStatusEffectSilent(EFFECT_THUNDERSTORM);
target:delStatusEffectSilent(EFFECT_AURORASTORM);
target:delStatusEffectSilent(EFFECT_VOIDSTORM);
local merit = caster:getMerit(MERIT_STORMSURGE);
local power = 0;
if merit > 0 then
power = merit + caster:getMod(MOD_STORMSURGE_EFFECT) + 2;
end
target:addStatusEffect(EFFECT_THUNDERSTORM,power,0,180);
return EFFECT_THUNDERSTORM;
end; | gpl-3.0 |
Enignite/darkstar | scripts/globals/mobskills/Dark_Wave.lua | 18 | 1178 | ---------------------------------------------
-- Dark Wave
--
-- Description: A wave of dark energy washes over targets in an area of effect. Additional effect: Bio
-- Type: Magical
-- Utsusemi/Blink absorb: Ignores shadows
-- Range: 10' radial
-- Notes: Severity of Bio effect varies by time of day, from 8/tic at midday to 20/tic at midnight.
---------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
return 0;
end;
function onMobWeaponSkill(target, mob, skill)
local typeEffect = EFFECT_BIO;
local cTime = VanadielHour();
local power = 8;
if (12 <= cTime) then
local power = 8 + (cTime - 11);
end
MobStatusEffectMove(mob, target, typeEffect, power, 3, 60);
local dmgmod = 1;
local info = MobMagicalMove(mob,target,skill,mob:getWeaponDmg()*5,ELE_DARK,dmgmod,TP_NO_EFFECT);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_MAGICAL,MOBPARAM_DARK,MOBPARAM_IGNORE_SHADOWS);
target:delHP(dmg);
return dmg;
end;
| gpl-3.0 |
BooM-amour/MOHAMAD | plugins/all.lua | 54 | 4746 | do
data = load_data(_config.moderation.data)
local function get_msgs_user_chat(user_id, chat_id)
local user_info = {}
local uhash = 'user:'..user_id
local user = redis:hgetall(uhash)
local um_hash = 'msgs:'..user_id..':'..chat_id
user_info.msgs = tonumber(redis:get(um_hash) or 0)
user_info.name = user_print_name(user)..' ['..user_id..']'
return user_info
end
local function chat_stats(chat_id)
local hash = 'chat:'..chat_id..':users'
local users = redis:smembers(hash)
local users_info = {}
for i = 1, #users do
local user_id = users[i]
local user_info = get_msgs_user_chat(user_id, chat_id)
table.insert(users_info, user_info)
end
table.sort(users_info, function(a, b)
if a.msgs and b.msgs then
return a.msgs > b.msgs
end
end)
local text = 'Chat stats:\n'
for k,user in pairs(users_info) do
text = text..user.name..' = '..user.msgs..'\n'
end
return text
end
local function get_group_type(target)
local data = load_data(_config.moderation.data)
local group_type = data[tostring(target)]['group_type']
if not group_type or group_type == nil then
return 'No group type available.'
end
return group_type
end
local function show_group_settings(target)
local data = load_data(_config.moderation.data)
if data[tostring(target)] then
if data[tostring(target)]['settings']['flood_msg_max'] then
NUM_MSG_MAX = tonumber(data[tostring(target)]['settings']['flood_msg_max'])
print('custom'..NUM_MSG_MAX)
else
NUM_MSG_MAX = 5
end
end
local settings = data[tostring(target)]['settings']
local text = "Lock group name : "..settings.lock_name.."\nLock group photo : "..settings.lock_photo.."\nLock group member : "..settings.lock_member.."\nflood sensitivity : "..NUM_MSG_MAX
return text
end
local function get_description(target)
local data = load_data(_config.moderation.data)
local data_cat = 'description'
if not data[tostring(target)][data_cat] then
return 'No description available.'
end
local about = data[tostring(target)][data_cat]
return about
end
local function get_rules(target)
local data = load_data(_config.moderation.data)
local data_cat = 'rules'
if not data[tostring(target)][data_cat] then
return 'No rules available.'
end
local rules = data[tostring(target)][data_cat]
return rules
end
local function modlist(target)
local data = load_data(_config.moderation.data)
local groups = 'groups'
if not data[tostring(groups)] or not data[tostring(groups)][tostring(target)] then
return 'Group is not added or is Realm.'
end
if next(data[tostring(target)]['moderators']) == nil then
return 'No moderator in this group.'
end
local i = 1
local message = '\nList of moderators :\n'
for k,v in pairs(data[tostring(target)]['moderators']) do
message = message ..i..' - @'..v..' [' ..k.. '] \n'
i = i + 1
end
return message
end
local function get_link(target)
local data = load_data(_config.moderation.data)
local group_link = data[tostring(target)]['settings']['set_link']
if not group_link or group_link == nil then
return "No link"
end
return "Group link:\n"..group_link
end
local function all(target, receiver)
local text = "All the things I know about this group\n\n"
local group_type = get_group_type(target)
text = text.."Group Type: \n"..group_type
local settings = show_group_settings(target)
text = text.."\n\nGroup settings: \n"..settings
local rules = get_rules(target)
text = text.."\n\nRules: \n"..rules
local description = get_description(target)
text = text.."\n\nAbout: \n"..description
local modlist = modlist(target)
text = text.."\n\nMods: \n"..modlist
local link = get_link(target)
text = text.."\n\nLink: \n"..link
local stats = chat_stats(target)
text = text.."\n\n"..stats
local ban_list = ban_list(target)
text = text.."\n\n"..ban_list
local file = io.open("./groups/all/"..target.."all.txt", "w")
file:write(text)
file:flush()
file:close()
send_document(receiver,"./groups/all/"..target.."all.txt", ok_cb, false)
return
end
function run(msg, matches)
if matches[1] == "all" and matches[2] and is_owner2(msg.from.id, matches[2]) then
local receiver = get_receiver(msg)
local target = matches[2]
return all(target, receiver)
end
if not is_owner(msg) then
return
end
if matches[1] == "all" and not matches[2] then
local receiver = get_receiver(msg)
if not is_owner(msg) then
return
end
return all(msg.to.id, receiver)
end
end
return {
usage = {
"all: All Actions In Group.",
"all [id]: All Actions From [id].",
},
patterns = {
"^(all)$",
"^(all) (%d+)$"
},
run = run
}
end
| gpl-2.0 |
florian-shellfire/luci | modules/luci-base/luasrc/tools/webadmin.lua | 59 | 2301 | -- Copyright 2008 Steven Barth <steven@midlink.org>
-- Copyright 2008-2015 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
module("luci.tools.webadmin", package.seeall)
local util = require "luci.util"
local uci = require "luci.model.uci"
local ip = require "luci.ip"
function byte_format(byte)
local suff = {"B", "KB", "MB", "GB", "TB"}
for i=1, 5 do
if byte > 1024 and i < 5 then
byte = byte / 1024
else
return string.format("%.2f %s", byte, suff[i])
end
end
end
function date_format(secs)
local suff = {"min", "h", "d"}
local mins = 0
local hour = 0
local days = 0
secs = math.floor(secs)
if secs > 60 then
mins = math.floor(secs / 60)
secs = secs % 60
end
if mins > 60 then
hour = math.floor(mins / 60)
mins = mins % 60
end
if hour > 24 then
days = math.floor(hour / 24)
hour = hour % 24
end
if days > 0 then
return string.format("%.0fd %02.0fh %02.0fmin %02.0fs", days, hour, mins, secs)
else
return string.format("%02.0fh %02.0fmin %02.0fs", hour, mins, secs)
end
end
function cbi_add_networks(field)
uci.cursor():foreach("network", "interface",
function (section)
if section[".name"] ~= "loopback" then
field:value(section[".name"])
end
end
)
field.titleref = luci.dispatcher.build_url("admin", "network", "network")
end
function cbi_add_knownips(field)
local _, n
for _, n in ipairs(ip.neighbors({ family = 4 })) do
if n.dest then
field:value(n.dest:string())
end
end
end
function firewall_find_zone(name)
local find
luci.model.uci.cursor():foreach("firewall", "zone",
function (section)
if section.name == name then
find = section[".name"]
end
end
)
return find
end
function iface_get_network(iface)
local link = ip.link(tostring(iface))
if link.master then
iface = link.master
end
local cur = uci.cursor()
local dump = util.ubus("network.interface", "dump", { })
if dump then
local _, net
for _, net in ipairs(dump.interface) do
if net.l3_device == iface or net.device == iface then
-- cross check with uci to filter out @name style aliases
local uciname = cur:get("network", net.interface, "ifname")
if not uciname or uciname:sub(1, 1) ~= "@" then
return net.interface
end
end
end
end
end
| apache-2.0 |
QUSpilPrgm/cuberite | Server/Plugins/APIDump/Hooks/OnKilling.lua | 36 | 1190 | return
{
HOOK_KILLING =
{
CalledWhen = "A player or a mob is dying.",
DefaultFnName = "OnKilling", -- also used as pagename
Desc = [[
This hook is called whenever a {{cPawn|pawn}}'s (a player's or a mob's) health reaches zero. This
means that the pawn is about to be killed, unless a plugin "revives" them by setting their health
back to a positive value.
]],
Params =
{
{ Name = "Victim", Type = "{{cPawn}}", Notes = "The player or mob that is about to be killed" },
{ Name = "Killer", Type = "{{cEntity}}", Notes = "The entity that has caused the victim to lose the last point of health. May be nil for environment damage" },
{ Name = "TDI", Type = "{{TakeDamageInfo}}", Notes = "The damage type, cause and effects." },
},
Returns = [[
If the function returns false or no value, Cuberite calls other plugins with this event. If the
function returns true, no other plugin is called for this event.</p>
<p>
In either case, the victim's health is then re-checked and if it is greater than zero, the victim is
"revived" with that health amount. If the health is less or equal to zero, the victim is killed.
]],
}, -- HOOK_KILLING
}
| apache-2.0 |
fcpxhacks/fcpxhacks | src/extensions/cp/apple/finalcutpro/export/GoToPrompt.lua | 2 | 5658 | --- === cp.apple.finalcutpro.export.GoToPrompt ===
---
--- Go To Prompt.
local require = require
local prop = require "cp.prop"
local axutils = require "cp.ui.axutils"
local just = require "cp.just"
local tools = require "cp.tools"
local Button = require "cp.ui.Button"
local ComboBox = require "cp.ui.ComboBox"
local Sheet = require "cp.ui.Sheet"
local TextField = require "cp.ui.TextField"
local cache = axutils.cache
local childFromLeft = axutils.childFromLeft
local childMatching = axutils.childMatching
local keyStroke = tools.keyStroke
local doUntil = just.doUntil
local GoToPrompt = Sheet:subclass("cp.apple.finalcutpro.export:GoToPrompt")
--- cp.apple.finalcutpro.export.GoToPrompt.matches(element) -> boolean
--- Function
--- Checks to see if an element matches what we think it should be.
---
--- Parameters:
--- * element - An `axuielementObject` to check.
---
--- Returns:
--- * `true` if matches otherwise `false`
function GoToPrompt.static.matches(element)
if Sheet.matches(element) then
return (childMatching(element, TextField.matches) ~= nil -- with a text field
or childMatching(element, ComboBox.matches) ~= nil) -- or a combo box.
end
return false
end
--- cp.apple.finalcutpro.export.GoToPrompt.new(app) -> GoToPrompt
--- Function
--- Creates a new Go To Prompt object.
---
--- Parameters:
--- * app - The `cp.apple.finalcutpro` object.
---
--- Returns:
--- * A new GoToPrompt object.
function GoToPrompt:initialize(parent)
local UI = parent.UI:mutate(function(original)
return cache(self, "_ui", function()
return childMatching(original(), GoToPrompt.matches)
end,
GoToPrompt.matches)
end)
Sheet.initialize(self, parent, UI)
end
--- cp.apple.finalcutpro.export.GoToPrompt:show() -> cp.apple.finalcutpro.export.GoToPrompt
--- Method
--- Shows the Go To Prompt
---
--- Parameters:
--- * None
---
--- Returns:
--- * The `cp.apple.finalcutpro.export.GoToPrompt` object for method chaining.
function GoToPrompt:show()
if self:parent():isShowing() then
--------------------------------------------------------------------------------
-- NOTE: I tried sending the keyStroke directly to FCPX, but it didn't work.
--------------------------------------------------------------------------------
keyStroke({"cmd", "shift"}, "g")
doUntil(function() return self:isShowing() end)
end
return self
end
--- cp.apple.finalcutpro.export.GoToPrompt:hide() -> cp.apple.finalcutpro.export.GoToPrompt
--- Method
--- Hides the Go To Prompt
---
--- Parameters:
--- * None
---
--- Returns:
--- * The `cp.apple.finalcutpro.export.GoToPrompt` object for method chaining.
function GoToPrompt:hide()
self:cancel()
end
--- cp.apple.finalcutpro.export.GoToPrompt.cancel <cp.ui.Button>
--- Field
--- The "Cancel" `Button`.
function GoToPrompt.lazy.value:cancel()
return Button(self, self.UI:mutate(function(original)
return childFromLeft(original(), 1, Button.matches)
end))
end
--- cp.apple.finalcutpro.export.GoToPrompt.go <cp.ui.Button>
--- Field
--- The "Go" `Button`.
function GoToPrompt.lazy.value:go()
return Button(self, self.UI:mutate(function(original)
return childFromLeft(original(), 2, Button.matches)
end))
end
-- Override the base `default` since it doesn't seem to be publishing "AXDefaultButton"
function GoToPrompt.lazy.value:default()
return self.go
end
--- cp.apple.finalcutpro.export.GoToPrompt.valueText <cp.ui.TextField>
--- Field
--- The `TextField` containing the folder value, if available.
function GoToPrompt.lazy.value:valueText()
return TextField(self, self.UI:mutate(function(original)
return childMatching(original(), TextField.matches)
end))
end
--- cp.apple.finalcutpro.export.GoToPrompt.valueCombo <cp.ui.ComboBox>
--- Field
--- The `ComboBox` containing the folder value, if available.
function GoToPrompt.lazy.value:valueCombo()
return ComboBox(self,
self.UI:mutate(function(original)
return childMatching(original(), ComboBox.matches)
end),
function(list, itemUI)
return TextField(list, prop.THIS(itemUI))
end
)
end
--- cp.apple.finalcutpro.export.GoToPrompt:valueField() -> TextField | ComboField
--- Method
--- Returns either the `valueText` or `valueCombo`, depending what is available on-screen.
---
--- Parameters:
--- * None
---
--- Returns:
--- * The `TextField` or `ComboField` containing the value.
function GoToPrompt:valueField()
if self.valueText:isShowing() then
return self.valueText
else
return self.valueCombo
end
end
--- cp.apple.finalcutpro.export.GoToPrompt:value([newValue]) -> string
--- Method
--- Returns the current path value, or `nil`.
---
--- Parameters:
--- * newValue - (optional) The new value for the path.
---
--- Returns:
--- * The current value of the path.
function GoToPrompt:value(newValue)
return self:valueField():value(newValue)
end
--- cp.apple.finalcutpro.export.GoToPrompt:setValue(value) -> cp.apple.finalcutpro.export.GoToPrompt
--- Method
--- Sets the value of the text box within the Go To Prompt.
---
--- Parameters:
--- * value - The value of the text box as a string.
---
--- Returns:
--- * The `cp.apple.finalcutpro.export.GoToPrompt` object for method chaining.
function GoToPrompt:setValue(value)
self.UI:setAttributeValue("AXValue", value)
return self
end
return GoToPrompt
| mit |
tks2103/angel-test | Code/Tools/BuildScripts/lua-lib/penlight-1.0.2/tests/test-text.lua | 7 | 3375 | local T = require 'pl.text'
local utils = require 'pl.utils'
local Template = T.Template
local asserteq = require 'pl.test'.asserteq
local OrderedMap = require 'pl.OrderedMap'
local t1 = Template [[
while true do
$contents
end
]]
assert(t1:substitute {contents = 'print "hello"'},[[
while true do
print "hello"
end
]])
assert(t1:indent_substitute {contents = [[
for i = 1,10 do
gotcha(i)
end
]]},[[
while true do
for i = 1,10 do
gotcha(i)
end
end
]])
asserteq(T.dedent [[
one
two
three
]],[[
one
two
three
]])
asserteq(T.fill ([[
It is often said of Lua that it does not include batteries. That is because the goal of Lua is to produce a lean expressive language that will be used on all sorts of machines, (some of which don't even have hierarchical filesystems). The Lua language is the equivalent of an operating system kernel; the creators of Lua do not see it as their responsibility to create a full software ecosystem around the language. That is the role of the community.
]],20),[[
It is often said of Lua
that it does not include
batteries. That is because
the goal of Lua is to
produce a lean expressive
language that will be
used on all sorts of machines,
(some of which don't
even have hierarchical
filesystems). The Lua
language is the equivalent
of an operating system
kernel; the creators of
Lua do not see it as their
responsibility to create
a full software ecosystem
around the language. That
is the role of the community.
]])
local template = require 'pl.template'
local t = [[
# for i = 1,3 do
print($(i+1))
# end
]]
asserteq(template.substitute(t),[[
print(2)
print(3)
print(4)
]])
t = [[
> for i = 1,3 do
print(${i+1})
> end
]]
asserteq(template.substitute(t,{_brackets='{}',_escape='>'}),[[
print(2)
print(3)
print(4)
]])
--- iteration using pairs is usually unordered. But using OrderedMap
--- we can get the exact original ordering.
t = [[
# for k,v in pairs(T) do
"$(k)", -- $(v)
# end
]]
if utils.lua51 then
-- easy enough to define a general pairs in Lua 5.1
local rawpairs = pairs
function pairs(t)
local mt = getmetatable(t)
local f = mt and mt.__pairs
if f then
return f(t)
else
return rawpairs(t)
end
end
end
local Tee = OrderedMap{{Dog = 'Bonzo'}, {Cat = 'Felix'}, {Lion = 'Leo'}}
-- note that the template will also look up global functions using _parent
asserteq(template.substitute(t,{T=Tee,_parent=_G}),[[
"Dog", -- Bonzo
"Cat", -- Felix
"Lion", -- Leo
]])
-- for those with a fondness for Python-style % formatting...
T.format_operator()
asserteq('[%s]' % 'home', '[home]')
asserteq('%s = %d' % {'fred',42},'fred = 42')
-- mostly works like string.format, except that %s forces use of tostring()
-- rather than throwing an error
local List = require 'pl.List'
asserteq('TBL:%s' % List{1,2,3},'TBL:{1,2,3}')
-- table with keys and format with $
asserteq('<$one>' % {one=1}, '<1>')
-- (second arg may also be a function, like os.getenv)
function subst(k)
if k == 'A' then return 'ay'
elseif k == 'B' then return 'bee'
else return '?'
end
end
asserteq(
'$A & $B' % subst,'ay & bee'
)
| bsd-3-clause |
Enignite/darkstar | scripts/zones/Windurst_Woods/npcs/Millerovieunet.lua | 17 | 1535 | -----------------------------------
-- Area: Windurst_Woods
-- NPC: Millerovieunet
-- Only sells when Windurst controlls Qufim Region
-- Confirmed shop stock, August 2013
-----------------------------------
package.loaded["scripts/zones/Windurst_Woods/TextIDs"] = nil;
-----------------------------------
require("scripts/globals/events/harvest_festivals")
require("scripts/globals/shop");
require("scripts/globals/conquest");
require("scripts/zones/Windurst_Woods/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
onHalloweenTrade(player,trade,npc);
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (GetRegionOwner(QUFIMISLAND) ~= WINDURST) then
player:showText(npc,MILLEROVIEUNET_CLOSED_DIALOG);
else
player:showText(npc,MILLEROVIEUNET_OPEN_DIALOG);
stock = {
0x03BA, 4032 --Magic Pot Shard
}
showShop(player,WINDURST,stock);
end
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
| gpl-3.0 |
weinyzhou/ffmpegAutoBuild | ffmpegAutoBuild/main.lua | 1 | 4155 | --[[
描述: main 主执行模块
作者: weiny zhou
创建日期: 2012-04-30
修改日期: 2012-04-30
版权: 版权所有,未经授权不得擅自拷贝复制或传播本代码的部分或全部.违者必究!
]]--
PROJECT_TYPE=3;--项目类型
curPath="E:/WeinyDesign/WeinyCore/ffmpegAutoBuild/";
luaExt=".lua";
local ffmpegProjPath="C:/Users/Weiny/Desktop/ffmpeg/";
local unixDir=""$(WZLINUX_INC)"";
VCIncDir=""$(VCInstallDir)include"";
CLANG_RESOURCE_DIRS="D:/llvm/build/bin/MinSizeRel/../lib/clang/3.1";
CLANG_CACHE_PATH="C:\\Users\\Weiny\\AppData\\Local\\Temp\\clang-module-cache"
IS_INSERT_INCLUDE=false;--是否插入include config.h
IS_INSERT_DEFINE=false;--是否插入宏定义
dofile(curPath.."parser"..luaExt);
--[[
函数:run_vc
功能:生成VC编译工程
参数:
返回:
]]--
function run_vc(isConvC99,useClang)
run_ffmpeg(project_type.vc,ffmpegProjPath,isConvC99,useClang);
print("\n\n\n\n**************************华丽的分割线******************");
print("* *");
print("* 生成VC工程项目成功 *")
print("* *");
print("* *");
print("***********************************************************");
end
--[[
函数:run_android
功能:生成android编译工程
参数:
返回:
]]--
function run_android()
run_ffmpeg(project_type.android,ffmpegProjPath);
print("\n\n\n\n**************************华丽的分割线******************");
print("* *");
print("* 生成android工程项目成功 *")
print("* *");
print("* *");
print("***********************************************************");
end
function run()
if (PROJECT_TYPE==1) then
run_vc(true,false);
elseif (PROJECT_TYPE==2) then
run_vc(false,true);
elseif (PROJECT_TYPE==3) then
run_android();
end;
end
function run_ffmpeg(protype,szPath,isConvC99,useClang)
--avcodec_parser_allfile(szPath,includes,protype);
--avdevice_parser_allfile(szPath,includes,protype);
local includes={"./","../","../"};
local ffmpegtbl={
{name="libavcodec",func=avcodec_parser_allfile},
{name="libavdevice",func=avdevice_parser_allfile},
{name="libavfilter",func=avfilter_parser_allfile},
{name="libavformat",func=avformat_parser_allfile},
{name="libavresample",func=avresample_parser_allfile},
{name="libavutil",func=avutil_parser_allfile},
{name="libpostproc",func=postproc_parser_allfile},
{name="libswresample",func=swresample_parser_allfile},
{name="libswscale",func=swscale_parser_allfile}
};
local isToc89=false;
if protype==project_type.vc then
if(isConvC99==nil or isConvC99==true) then
isToc89=true;
end;
table.insert(includes,unixDir);
table.insert(includes,""$(SolutionDir)../.."");
table.insert(includes,""$(WSYSEX_INC)/zlib"");
table.insert(includes,VCIncDir);
elseif protype==project_type.android then
table.insert(includes,"$(JNI_H_INCLUDE)");
table.insert(includes,"$(CUR_PATH)");
table.insert(includes,"$(LOCAL_PATH)");
end
for index,value in pairs(ffmpegtbl) do
print("begin dispose",value.name)
value.func(szPath..value.name.."/",includes,protype,isToc89,useClang);
print("end dispose",value.name)
end
run_successed();
end
function run_successed()
print("\n\n*********************************");
print("*\t恭喜转换结束\t*");
print("*\t尽情享受ffmpeg工具转VC带来的喜悦感吧.\t*");
print("\n\n*********************************");
end
run();
--[[
local szFilePath="F:/ffmpeg-0.8.11/libavcodec/"
if false then
local tbl=avcodec_struct_avcodec_default(szFilePath.."avcodec.h","AVCodec");
avcodec_struct_avcodec_Repalce(szFilePath.."pngenc.c",tbl,"AVCodec");
else
local tbl=avcodec_struct_avcodec_default(szFilePath.."ass_split.c","ASSSection");
ffmpeg_struct_array_var_Repalce(szFilePath.."ass_split.c",tbl,"ASSSection");
end
]]-- | gpl-2.0 |
zendey/Flashcard_mobile_app | scripts/screens/events-confirm-exit.lua | 1 | 2039 | -----------------------------------------------------------------------------------------
--
-- events-confirm-exit.lua
-- Events for confirm exit.
--
-----------------------------------------------------------------------------------------
local eventsConfirmExit = {}
-- Include files.
local globalVariable = require "scripts.common.global-variable" -- Global variables.
local OverlayScreen = require "scripts.classes.screen.OverlayScreen" -- Screen class.
-- To remove after to do:
local form = require "scripts.widgets.form" -- Form widgets.
local screen = require "scripts.common.screen" -- Screen functions.
local widget = require "widget" -- Widgets.
-- Draw the screen.
function drawScreen()
local options = {
screenTitle = "Exit app",
screenText = "Are you sure you want to close this app?",
-- To do:
--[[buttons = {
choiceButton = {
label = "Exit",
action = native.requestExit,
y = globalVariable.screenCenterY + 25,
},
backButton = {
label = "Back",
action = OverlayScreen.closeOverlayScreen,
screen = "scripts.screens.screen-home",
y = globalVariable.screenCenterY + 100,
}
}]]--
}
local overlayScreen1 = OverlayScreen.new( options )
theOverlayScreen = overlayScreen1:getOverlayScreen()
-- Show exit button on top right corner.
local exitButton = form.displayButtonImage( "scripts.screens.screen-confirm-exit", "Exit", native.requestExit, "images/icons/ic_cancel_white_18dp.png" )
exitButton.x = globalVariable.screenWidth - 50
exitButton.y = 50
theOverlayScreen:insert( exitButton )
-- Show back button.
local backButton = form.displayButton( "scripts.screens.screen-confirm-exit", "Back", screen.closeOverlayScreen )
backButton.y = globalVariable.screenCenterY + 100
theOverlayScreen:insert( backButton )
return overlayScreen1
end
function eventsConfirmExit.new()
local confirmExitScreen
confirmExitScreen = drawScreen()
return confirmExitScreen
end
return eventsConfirmExit | gpl-2.0 |
Enignite/darkstar | scripts/zones/Upper_Jeuno/npcs/Mhao_Kehtsoruho.lua | 38 | 1041 | -----------------------------------
-- Area: Upper Jeuno
-- NPC: Mhao Kehtsoruho
-- Type: Past Event Watcher
-- @zone: 244
-- @pos -73.032 -1 146.919
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
package.loaded["scripts/zones/Upper_Jeuno/TextIDs"] = nil;
-----------------------------------
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:startEvent(0x27bd);
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
thoaionline/vlc | share/lua/playlist/dailymotion.lua | 19 | 3036 | --[[
Translate Daily Motion video webpages URLs to the corresponding
FLV URL.
$Id$
Copyright © 2007-2011 the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]]
function get_prefres()
local prefres = -1
if vlc.var and vlc.var.inherit then
prefres = vlc.var.inherit(nil, "preferred-resolution")
if prefres == nil then
prefres = -1
end
end
return prefres
end
-- Probe function.
function probe()
return vlc.access == "http"
and string.match( vlc.path, "dailymotion." )
and string.match( vlc.peek( 2048 ), "<!DOCTYPE.*video_type" )
end
function find( haystack, needle )
local _,_,ret = string.find( haystack, needle )
return ret
end
-- Parse function.
function parse()
prefres = get_prefres()
while true
do
line = vlc.readline()
if not line then
break
end
if string.match( line, "\"sequence\"")
then
line = vlc.strings.decode_uri(line):gsub("\\/", "/")
arturl = find( line, "\"videoPreviewURL\":\"([^\"]*)\"")
name = find( line, "\"videoTitle\":\"([^\"]*)\"")
if name then
name = string.gsub( name, "+", " " )
end
description = find( line, "\"videoDescription\":\"([^\"]*)\"")
if description then
description = string.gsub( description, "+", " " )
end
for _,param in ipairs({ "hd1080URL", "hd720URL", "hqURL", "sdURL" }) do
path = string.match( line, "\""..param.."\":\"([^\"]*)\"" )
if path then
if prefres < 0 then
break
end
height = string.match( path, "/cdn/%w+%-%d+x(%d+)/video/" )
if not height then
height = string.match( param, "(%d+)" )
end
if not height or tonumber(height) <= prefres then
break
end
end
end
if not path then
break
end
return { { path = path; name = name; description = description; url = vlc.path; arturl = arturl } }
end
end
vlc.msg.err("Couldn't extract the video URL from dailymotion")
return { }
end
| gpl-2.0 |
Enignite/darkstar | scripts/zones/Bastok_Markets_[S]/npcs/Karlotte.lua | 38 | 1069 | ----------------------------------
-- Area: Bastok Markets [S]
-- NPC: Karlotte
-- Type: Item Deliverer
-- @pos -191.646 -8 -36.349 87
-----------------------------------
package.loaded["scripts/zones/Bastok_Markets_[S]/TextIDs"] = nil;
-----------------------------------
require("scripts/zones/Bastok_Markets_[S]/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, KARLOTTE_DELIVERY_DIALOG);
player:openSendBox();
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
-- printf("CSID: %u",csid);
-- printf("RESULT: %u",option);
end;
| gpl-3.0 |
florian-shellfire/luci | modules/luci-mod-admin-full/luasrc/model/cbi/admin_system/fstab/mount.lua | 29 | 3928 | -- Copyright 2010 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.
local fs = require "nixio.fs"
local util = require "nixio.util"
local has_fscheck = fs.access("/usr/sbin/e2fsck")
local block = io.popen("block info", "r")
local ln, dev, devices = nil, nil, {}
repeat
ln = block:read("*l")
dev = ln and ln:match("^/dev/(.-):")
if dev then
local e, s, key, val = { }
for key, val in ln:gmatch([[(%w+)="(.-)"]]) do
e[key:lower()] = val
end
s = tonumber((fs.readfile("/sys/class/block/%s/size" % dev)))
e.dev = "/dev/%s" % dev
e.size = s and math.floor(s / 2048)
devices[#devices+1] = e
end
until not ln
block:close()
m = Map("fstab", translate("Mount Points - Mount Entry"))
m.redirect = luci.dispatcher.build_url("admin/system/fstab")
if not arg[1] or m.uci:get("fstab", arg[1]) ~= "mount" then
luci.http.redirect(m.redirect)
return
end
mount = m:section(NamedSection, arg[1], "mount", translate("Mount Entry"))
mount.anonymous = true
mount.addremove = false
mount:tab("general", translate("General Settings"))
mount:tab("advanced", translate("Advanced Settings"))
mount:taboption("general", Flag, "enabled", translate("Enable this mount")).rmempty = false
o = mount:taboption("general", Value, "uuid", translate("UUID"),
translate("If specified, mount the device by its UUID instead of a fixed device node"))
for i, d in ipairs(devices) do
if d.uuid and d.size then
o:value(d.uuid, "%s (%s, %d MB)" %{ d.uuid, d.dev, d.size })
elseif d.uuid then
o:value(d.uuid, "%s (%s)" %{ d.uuid, d.dev })
end
end
o:value("", translate("-- match by label --"))
o = mount:taboption("general", Value, "label", translate("Label"),
translate("If specified, mount the device by the partition label instead of a fixed device node"))
o:depends("uuid", "")
for i, d in ipairs(devices) do
if d.label and d.size then
o:value(d.label, "%s (%s, %d MB)" %{ d.label, d.dev, d.size })
elseif d.label then
o:value(d.label, "%s (%s)" %{ d.label, d.dev })
end
end
o:value("", translate("-- match by device --"))
o = mount:taboption("general", Value, "device", translate("Device"),
translate("The device file of the memory or partition (<abbr title=\"for example\">e.g.</abbr> <code>/dev/sda1</code>)"))
o:depends({ uuid = "", label = "" })
for i, d in ipairs(devices) do
if d.size then
o:value(d.dev, "%s (%d MB)" %{ d.dev, d.size })
else
o:value(d.dev)
end
end
o = mount:taboption("general", Value, "target", translate("Mount point"),
translate("Specifies the directory the device is attached to"))
o:value("/", translate("Use as root filesystem (/)"))
o:value("/overlay", translate("Use as external overlay (/overlay)"))
o = mount:taboption("general", DummyValue, "__notice", translate("Root preparation"))
o:depends("target", "/")
o.rawhtml = true
o.default = [[
<p>%s</p><pre>mkdir -p /tmp/introot
mkdir -p /tmp/extroot
mount --bind / /tmp/introot
mount /dev/sda1 /tmp/extroot
tar -C /tmp/intproot -cvf - . | tar -C /tmp/extroot -xf -
umount /tmp/introot
umount /tmp/extroot</pre>
]] %{
translate("Make sure to clone the root filesystem using something like the commands below:"),
}
o = mount:taboption("advanced", Value, "fstype", translate("Filesystem"),
translate("The filesystem that was used to format the memory (<abbr title=\"for example\">e.g.</abbr> <samp><abbr title=\"Third Extended Filesystem\">ext3</abbr></samp>)"))
o:value("", "auto")
local fs
for fs in io.lines("/proc/filesystems") do
fs = fs:match("%S+")
if fs ~= "nodev" then
o:value(fs)
end
end
o = mount:taboption("advanced", Value, "options", translate("Mount options"),
translate("See \"mount\" manpage for details"))
o.placeholder = "defaults"
if has_fscheck then
o = mount:taboption("advanced", Flag, "enabled_fsck", translate("Run filesystem check"),
translate("Run a filesystem check before mounting the device"))
end
return m
| apache-2.0 |
Enignite/darkstar | scripts/zones/Lower_Jeuno/npcs/Harnek.lua | 17 | 2370 | -----------------------------------
-- Area: Lower Jeuno
-- NPC: Harnek
-- Starts and Finishes Quest: The Tenshodo Showdown (finish)
-- @zone 245
-- @pos 44 0 -19
-----------------------------------
package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil;
package.loaded["scripts/globals/settings"] = nil;
-----------------------------------
require("scripts/globals/settings");
require("scripts/globals/titles");
require("scripts/globals/keyitems");
require("scripts/globals/quests");
require("scripts/zones/Lower_Jeuno/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
if (player:hasKeyItem(LETTER_FROM_THE_TENSHODO)) then
player:startEvent(0x2725,0,LETTER_FROM_THE_TENSHODO); -- During Quest "The Tenshodo Showdown"
elseif (player:hasKeyItem(SIGNED_ENVELOPE)) then
player:startEvent(0x2726); -- Finish Quest "The Tenshodo Showdown"
else
player:startEvent(0x00d9); -- Standard dialog
end
end;
-- 0x000c 0x000d 0x0009 0x000a 0x0014 0x00d9 0x009f 0x2725 0x2726
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
if (csid == 0x2725) then
player:setVar("theTenshodoShowdownCS",2);
player:delKeyItem(LETTER_FROM_THE_TENSHODO);
player:addKeyItem(TENSHODO_ENVELOPE);
player:messageSpecial(KEYITEM_OBTAINED,TENSHODO_ENVELOPE);
elseif (csid == 0x2726) then
if (player:getFreeSlotsCount() == 0 or player:hasItem(16764)) then
player:messageSpecial(ITEM_CANNOT_BE_OBTAINED,16764); -- Marauder's Knife
else
player:delKeyItem(SIGNED_ENVELOPE);
player:addItem(16764);
player:messageSpecial(ITEM_OBTAINED, 16764); -- Marauder's Knife
player:setVar("theTenshodoShowdownCS",0);
player:addFame(WINDURST,WIN_FAME*30);
player:completeQuest(WINDURST,THE_TENSHODO_SHOWDOWN);
end
end
end; | gpl-3.0 |
Enignite/darkstar | scripts/globals/items/fum-long_salmon_sub.lua | 36 | 1452 | -----------------------------------------
-- ID: 4266
-- Item: Fum-Long Salmon Sub
-- Food Effect: 60Min, All Races
-----------------------------------------
-- Agility 1
-- Vitality 1
-- Dexterity 2
-- Intelligence 2
-- Mind -2
-- Ranged Accuracy 3
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,3600,4266);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_AGI, 1);
target:addMod(MOD_VIT, 1);
target:addMod(MOD_DEX, 2);
target:addMod(MOD_INT, 1);
target:addMod(MOD_MND, -2);
target:addMod(MOD_RACC, 3);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_AGI, 1);
target:delMod(MOD_VIT, 1);
target:delMod(MOD_DEX, 2);
target:delMod(MOD_INT, 1);
target:delMod(MOD_MND, -2);
target:delMod(MOD_RACC, 3);
end;
| gpl-3.0 |
fcpxhacks/fcpxhacks | src/extensions/cp/spec/Scenario.lua | 2 | 7030 | --- === cp.spec.Scenario ===
---
--- A [Definition](cp.spec.Definition.md) which describes a specific scenario.
---
--- A `Scenario` is most typically created via the [it](cp.spec.md#it) function, like so:
---
--- ```lua
--- local spec = require "cp.spec"
--- local describe, it = spec.describe, spec.it
---
--- local Rainbow = require "my.rainbow"
---
--- return describe "a rainbow" {
--- it "has seven colors"
--- :doing(function()
--- local rainbow = Rainbow()
--- assert(#rainbow:colors() == 7, "the rainbow has seven colors")
--- end)
--- }
--- ```
---
--- Scenarios can be run asynchronously via the [Run.This](cp.spec.Run.This.md) instance passed to the `doing` function.
--- To indicate a scenario is asynchronous, call [`this:wait()`](cp.spec.Run.This.md#wait), then call
--- [`this:done()`](cp.spec.Run.This.md#done), to indicate it has completed. Any `assert` call which fails will
--- result in the run failing, and stop at that point.
---
--- For example:
---
--- ```lua
--- return describe "a rainbow" {
--- it "has a pot of gold at the end"
--- :doing(function(this)
--- this:wait()
--- local rainbow = Rainbow()
--- rainbow:goToEnd(function(whatIsThere)
--- assert(whatIsThere:isInstanceOf(PotOfGold))
--- this:done()
--- end)
--- end)
--- }
--- ```
---
--- Definitions can also be data-driven, via the [where](#where) method:
---
--- ```lua
--- return describe "a rainbow" {
--- it "has ${color} at index ${index}"
--- :doing(function(this)
--- local rainbow = Rainbow()
--- assert(rainbow[this.index] == this.color)
--- end)
--- :where {
--- { "index", "color" },
--- { 1, "red" },
--- { 2, "orange" },
--- { 3, "yellow" },
--- { 4, "blue" },
--- { 5, "green" },
--- { 6, "indigo" },
--- { 7, "violet" },
--- },
--- }
--- ```
---
--- This will do a run for each variation and interpolate the value into the run name for each.
---
--- **Note:** "where" parameters will not override built-in functions and fields in the [this](cp.spec.Run.This.md)
--- instance (such as "async" or "done") so ensure that you pick names that don't clash.
local require = require
-- local log = require "hs.logger" .new "Scenario"
local Definition = require "cp.spec.Definition"
local Handled = require "cp.spec.Handled"
local Run = require "cp.spec.Run"
local Where = require "cp.spec.Where"
local format = string.format
local Scenario = Definition:subclass("cp.spec.Scenario")
-- default `doing` function for Definitions.
local function doingNothing()
error("It must be doing something.")
end
--- cp.spec.Specification.is(instance) -> boolean
--- Function
--- Checks if the `instance` is an instance of `Specification`.
---
--- Presentation:
--- * instance - The instance to check
---
--- Returns:
--- * `true` if it's a `Specification` instance.
function Scenario.static.is(instance)
return type(instance) == "table" and instance.isInstanceOf and instance:isInstanceOf(Scenario)
end
--- cp.spec.Scenario(name[, testFn]) -> cp.spec.Scenario
--- Constructor
--- Creates a new `Scenario` with the specified name.
---
--- Parameters:
--- * name - The name of the scenario.
--- * testFn - (optional) The `function` which performs the test for in the scenario.
---
--- Returns:
--- * The new `Scenario`.
---
--- Notes:
--- * If the `testFn` is not provided here, it must be done via the [doing](#doing) method prior to running,
--- an `error` will occur.
function Scenario:initialize(name, testFn)
Definition.initialize(self, name)
self.testFn = testFn or doingNothing
end
--- cp.spec.Scenario:doing(actionFn) -> self
--- Method
--- Specifies the `function` for the definition.
---
--- Parameters:
--- * testFn - The function that will do the test.
---
--- Returns:
--- * The same `Definition`.
function Scenario:doing(testFn)
if type(testFn) ~= "function" then
error("Provide a function to execute.")
end
if self.testFn and self.testFn ~= doingNothing then
error("It already has a test function.")
end
self.testFn = testFn
return self
end
local ASSERT = {}
local ERROR = {}
-- hijacks the global `assert` and `error` functions and captures the results as part of the spec.
local function hijackAssert(this)
-- log.df(">>> hijackAssert: called")
this:run()[ASSERT] = _G.assert
this:run()[ERROR] = _G.error
_G.assert = function(ok, message, level)
level = (level or 1) + 1
-- log.df("hijacked assert: called with %s, %q", ok, string.format(message, ...))
if ok then
-- log.df("hijacked assert: passed")
return ok, message
else
local msg = tostring(message)
if this:fail(format("[%s:%d] %s", debug.getinfo(level, 'S').short_src, debug.getinfo(level, 'l').currentline, msg)) then
this:run()[ASSERT](ok, Handled(msg, level))
end
end
end
_G.error = function(msg, level)
level = (level or 1) + 1
-- log.df("hijacked error: %s", msg)
if this:abort(format("[%s:%d] %s", debug.getinfo(level, 'S').short_src, debug.getinfo(level, 'l').currentline, msg)) then
this:run()[ERROR](msg, level)
end
end
end
-- restores the global `assert` and `error` functions to their previous values.
local function restoreAssert(this)
-- log.df(">>> restoreAssert: called")
if this:run()[ASSERT] then
-- log.df("restoreAssert: resetting assert")
_G.assert = this:run()[ASSERT]
this:run()[ASSERT] = nil
end
if this:run()[ERROR] then
_G.error = this:run()[ERROR]
this:run()[ERROR] = nil
end
end
--- cp.spec.Scenario:run(...) -> cp.spec.Run
--- Method
--- Runs the scenario.
---
--- Parameters:
--- * ... - The list of filters. The first one will be compared to this scenario to determine it should be run.
function Scenario:run()
-- TODO: support filtering
return Run(self.name, self)
:onBefore(hijackAssert)
:onRunning(self.testFn)
:onAfter(restoreAssert)
:onComplete(function(this)
if this:run().result == Run.result.running then
this:run().report:passed()
end
end)
end
--- cp.spec.Scenario:where(data) -> cp.spec.Where
--- Method
--- Specifies a `table` of data that will be iterated through as multiple [Runs](cp.spec.Run.md), one row at a time.
--- The first row should be all strings, which will be the name of the parameter. Subsequent rows are the values for
--- those rows.
---
--- Parameters:
--- * data - The data table.
---
--- Returns:
--- * The [Where](cp.spec.Where.md).
function Scenario:where(data)
return Where(self, data)
end
return Scenario | mit |
apung/prosody-modules | mod_captcha_registration/util/dataforms.lua | 33 | 6601 | -- Prosody IM
-- Copyright (C) 2008-2010 Matthew Wild
-- Copyright (C) 2008-2010 Waqas Hussain
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
local setmetatable = setmetatable;
local pairs, ipairs = pairs, ipairs;
local tostring, type, next = tostring, type, next;
local t_concat = table.concat;
local st = require "util.stanza";
local jid_prep = require "util.jid".prep;
module "dataforms"
local xmlns_forms = 'jabber:x:data';
local form_t = {};
local form_mt = { __index = form_t };
function new(layout)
return setmetatable(layout, form_mt);
end
function form_t.form(layout, data, formtype)
local form = st.stanza("x", { xmlns = xmlns_forms, type = formtype or "form" });
if layout.title then
form:tag("title"):text(layout.title):up();
end
if layout.instructions then
form:tag("instructions"):text(layout.instructions):up();
end
for n, field in ipairs(layout) do
local field_type = field.type or "text-single";
-- Add field tag
form:tag("field", { type = field_type, var = field.name, label = field.label });
local value = (data and data[field.name]) or field.value;
if value then
-- Add value, depending on type
if field_type == "hidden" then
if type(value) == "table" then
-- Assume an XML snippet
form:tag("value")
:add_child(value)
:up();
else
form:tag("value"):text(tostring(value)):up();
end
elseif field_type == "boolean" then
form:tag("value"):text((value and "1") or "0"):up();
elseif field_type == "fixed" then
form:tag("value"):text(value):up();
elseif field_type == "jid-multi" then
for _, jid in ipairs(value) do
form:tag("value"):text(jid):up();
end
elseif field_type == "jid-single" then
form:tag("value"):text(value):up();
elseif field_type == "text-single" or field_type == "text-private" then
form:tag("value"):text(value):up();
elseif field_type == "text-multi" then
-- Split into multiple <value> tags, one for each line
for line in value:gmatch("([^\r\n]+)\r?\n*") do
form:tag("value"):text(line):up();
end
elseif field_type == "list-single" then
local has_default = false;
for _, val in ipairs(value) do
if type(val) == "table" then
form:tag("option", { label = val.label }):tag("value"):text(val.value):up():up();
if val.default and (not has_default) then
form:tag("value"):text(val.value):up();
has_default = true;
end
else
form:tag("option", { label= val }):tag("value"):text(tostring(val)):up():up();
end
end
elseif field_type == "list-multi" then
for _, val in ipairs(value) do
if type(val) == "table" then
form:tag("option", { label = val.label }):tag("value"):text(val.value):up():up();
if val.default then
form:tag("value"):text(val.value):up();
end
else
form:tag("option", { label= val }):tag("value"):text(tostring(val)):up():up();
end
end
elseif field_type == "media" then
form:tag("media", { xmlns = "urn:xmpp:media-element" });
for _, val in ipairs(value) do
form:tag("uri", { type = val.type }):text(val.uri):up()
end
form:up();
end
end
if field.required then
form:tag("required"):up();
end
-- Jump back up to list of fields
form:up();
end
return form;
end
local field_readers = {};
function form_t.data(layout, stanza)
local data = {};
local errors = {};
for _, field in ipairs(layout) do
local tag;
for field_tag in stanza:childtags() do
if field.name == field_tag.attr.var then
tag = field_tag;
break;
end
end
if not tag then
if field.required then
errors[field.name] = "Required value missing";
end
else
local reader = field_readers[field.type];
if reader then
data[field.name], errors[field.name] = reader(tag, field.required);
end
end
end
if next(errors) then
return data, errors;
end
return data;
end
field_readers["text-single"] =
function (field_tag, required)
local data = field_tag:get_child_text("value");
if data and #data > 0 then
return data
elseif required then
return nil, "Required value missing";
end
end
field_readers["text-private"] =
field_readers["text-single"];
field_readers["jid-single"] =
function (field_tag, required)
local raw_data = field_tag:get_child_text("value")
local data = jid_prep(raw_data);
if data and #data > 0 then
return data
elseif raw_data then
return nil, "Invalid JID: " .. raw_data;
elseif required then
return nil, "Required value missing";
end
end
field_readers["jid-multi"] =
function (field_tag, required)
local result = {};
local err = {};
for value_tag in field_tag:childtags("value") do
local raw_value = value_tag:get_text();
local value = jid_prep(raw_value);
result[#result+1] = value;
if raw_value and not value then
err[#err+1] = ("Invalid JID: " .. raw_value);
end
end
if #result > 0 then
return result, (#err > 0 and t_concat(err, "\n") or nil);
elseif required then
return nil, "Required value missing";
end
end
field_readers["list-multi"] =
function (field_tag, required)
local result = {};
for value in field_tag:childtags("value") do
result[#result+1] = value:get_text();
end
if #result > 0 then
return result;
elseif required then
return nil, "Required value missing";
end
end
field_readers["text-multi"] =
function (field_tag, required)
local data, err = field_readers["list-multi"](field_tag, required);
if data then
data = t_concat(data, "\n");
end
return data, err;
end
field_readers["list-single"] =
field_readers["text-single"];
local boolean_values = {
["1"] = true, ["true"] = true,
["0"] = false, ["false"] = false,
};
field_readers["boolean"] =
function (field_tag, required)
local raw_value = field_tag:get_child_text("value");
local value = boolean_values[raw_value ~= nil and raw_value];
if value ~= nil then
return value;
elseif raw_value then
return nil, "Invalid boolean representation";
elseif required then
return nil, "Required value missing";
end
end
field_readers["hidden"] =
function (field_tag)
return field_tag:get_child_text("value");
end
field_readers["media"] = field_readers["text-single"]
return _M;
--[=[
Layout:
{
title = "MUC Configuration",
instructions = [[Use this form to configure options for this MUC room.]],
{ name = "FORM_TYPE", type = "hidden", required = true };
{ name = "field-name", type = "field-type", required = false };
}
--]=]
| mit |
Shayan123456/bot | bot/bot.lua | 2 | 6650 | package.path = package.path .. ';.luarocks/share/lua/5.2/?.lua'
..';.luarocks/share/lua/5.2/?/init.lua'
package.cpath = package.cpath .. ';.luarocks/lib/lua/5.2/?.so'
require("./bot/utils")
local f = assert(io.popen('/usr/bin/git describe --tags', 'r'))
VERSION = assert(f:read('*a'))
f:close()
-- This function is called when tg receive a msg
function on_msg_receive (msg)
if not started then
return
end
local receiver = get_receiver(msg)
-- vardump(msg)
msg = pre_process_service_msg(msg)
if msg_valid(msg) then
msg = pre_process_msg(msg)
if msg then
match_plugins(msg)
mark_read(receiver, ok_cb, false)
end
end
end
function ok_cb(extra, success, result)
end
function on_binlog_replay_end()
started = true
postpone (cron_plugins, false, 60*5.0)
-- See plugins/isup.lua as an example for cron
_config = load_config()
-- load plugins
plugins = {}
load_plugins()
end
function msg_valid(msg)
-- Don't process outgoing messages
if msg.out then
print('\27[36mNot valid: msg from us\27[39m')
return false
end
-- Before bot was started
if msg.date < now then
print('\27[36mNot valid: old msg\27[39m')
return false
end
if msg.unread == 0 then
print('\27[36mNot valid: readed\27[39m')
return false
end
if not msg.to.id then
print('\27[36mNot valid: To id not provided\27[39m')
return false
end
if not msg.from.id then
print('\27[36mNot valid: From id not provided\27[39m')
return false
end
if msg.from.id == our_id then
print('\27[36mNot valid: Msg from our id\27[39m')
return false
end
if msg.to.type == 'encr_chat' then
print('\27[36mNot valid: Encrypted chat\27[39m')
return false
end
if msg.from.id == 777000 then
print('\27[36mNot valid: Telegram message\27[39m')
return false
end
return true
end
--
function pre_process_service_msg(msg)
if msg.service then
local action = msg.action or {type=""}
-- Double ! to discriminate of normal actions
msg.text = "!!tgservice " .. action.type
-- wipe the data to allow the bot to read service messages
if msg.out then
msg.out = false
end
if msg.from.id == our_id then
msg.from.id = 0
end
end
return msg
end
-- Apply plugin.pre_process function
function pre_process_msg(msg)
for name,plugin in pairs(plugins) do
if plugin.pre_process and msg then
print('Preprocess', name)
msg = plugin.pre_process(msg)
end
end
return msg
end
-- Go over enabled plugins patterns.
function match_plugins(msg)
for name, plugin in pairs(plugins) do
match_plugin(plugin, name, msg)
end
end
-- Check if plugin is on _config.disabled_plugin_on_chat table
local function is_plugin_disabled_on_chat(plugin_name, receiver)
local disabled_chats = _config.disabled_plugin_on_chat
-- Table exists and chat has disabled plugins
if disabled_chats and disabled_chats[receiver] then
-- Checks if plugin is disabled on this chat
for disabled_plugin,disabled in pairs(disabled_chats[receiver]) do
if disabled_plugin == plugin_name and disabled then
local warning = 'Plugin '..disabled_plugin..' is disabled on this chat'
print(warning)
send_msg(receiver, warning, ok_cb, false)
return true
end
end
end
return false
end
function match_plugin(plugin, plugin_name, msg)
local receiver = get_receiver(msg)
-- Go over patterns. If one matches it's enough.
for k, pattern in pairs(plugin.patterns) do
local matches = match_pattern(pattern, msg.text)
if matches then
print("msg matches: ", pattern)
if is_plugin_disabled_on_chat(plugin_name, receiver) then
return nil
end
-- Function exists
if plugin.run then
-- If plugin is for privileged users only
if not warns_user_not_allowed(plugin, msg) then
local result = plugin.run(msg, matches)
if result then
send_large_msg(receiver, result)
end
end
end
-- One patterns matches
return
end
end
end
-- DEPRECATED, use send_large_msg(destination, text)
function _send_msg(destination, text)
send_large_msg(destination, text)
end
-- Save the content of _config to config.lua
function save_config( )
serialize_to_file(_config, './data/config.lua')
print ('saved config into ./data/config.lua')
end
-- Returns the config from config.lua file.
-- If file doesn't exist, create it.
function load_config( )
local f = io.open('./data/config.lua', "r")
-- If config.lua doesn't exist
if not f then
print ("Created new config file: data/config.lua")
create_config()
else
f:close()
end
local config = loadfile ("./data/config.lua")()
for v,user in pairs(config.sudo_users) do
print("Allowed user: " .. user)
end
return config
end
-- Create a basic config.json file and saves it.
function create_config( )
-- A simple config with basic plugins and ourselves as privileged user
config = {
enabled_plugins = {
"9gag",
"eur",
"echo",
"btc",
"get",
"giphy",
"google",
"gps",
"help",
"id",
"images",
"img_google",
"location",
"media",
"plugins",
"channels",
"set",
"stats",
"time",
"version",
"weather",
"xkcd",
"youtube" },
sudo_users = {87160007},
disabled_channels = {}
}
serialize_to_file(config, './data/config.lua')
print ('saved config into ./data/config.lua')
end
function on_our_id (id)
our_id = id
end
function on_user_update (user, what)
--vardump (user)
end
function on_chat_update (chat, what)
--vardump (chat)
end
function on_secret_chat_update (schat, what)
--vardump (schat)
end
function on_get_difference_end ()
end
-- Enable plugins in config.json
function load_plugins()
for k, v in pairs(_config.enabled_plugins) do
print("Loading plugin", v)
local ok, err = pcall(function()
local t = loadfile("plugins/"..v..'.lua')()
plugins[v] = t
end)
if not ok then
print('\27[31mError loading plugin '..v..'\27[39m')
print('\27[31m'..err..'\27[39m')
end
end
end
-- Call and postpone execution for cron plugins
function cron_plugins()
for name, plugin in pairs(plugins) do
-- Only plugins with cron function
if plugin.cron ~= nil then
plugin.cron()
end
end
-- Called again in 5 mins
postpone (cron_plugins, false, 5*60.0)
end
-- Start and load values
our_id = 0
now = os.time()
math.randomseed(now)
started = false
| gpl-2.0 |
Enignite/darkstar | scripts/globals/items/pear_crepe.lua | 36 | 1325 | -----------------------------------------
-- ID: 5777
-- Item: Pear Crepe
-- Food Effect: 30 Min, All Races
-----------------------------------------
-- Intelligence +2
-- MP Healing +2
-- Magic Accuracy +5
-- Magic Defense +1
-----------------------------------------
require("scripts/globals/status");
-----------------------------------------
-- OnItemCheck
-----------------------------------------
function onItemCheck(target)
result = 0;
if (target:hasStatusEffect(EFFECT_FOOD) == true or target:hasStatusEffect(EFFECT_FIELD_SUPPORT_FOOD) == true) then
result = 246;
end
return result;
end;
-----------------------------------------
-- OnItemUse
-----------------------------------------
function onItemUse(target)
target:addStatusEffect(EFFECT_FOOD,0,0,1800,5777);
end;
-----------------------------------------
-- onEffectGain Action
-----------------------------------------
function onEffectGain(target,effect)
target:addMod(MOD_INT, 2);
target:addMod(MOD_MPHEAL, 2);
target:addMod(MOD_MACC, 5);
target:addMod(MOD_MDEF, 1);
end;
-----------------------------------------
-- onEffectLose Action
-----------------------------------------
function onEffectLose(target,effect)
target:delMod(MOD_INT, 2);
target:delMod(MOD_MPHEAL, 2);
target:delMod(MOD_MACC, 5);
target:delMod(MOD_MDEF, 1);
end;
| gpl-3.0 |
Enignite/darkstar | scripts/zones/Southern_San_dOria_[S]/npcs/AshmeaBGreinner1.lua | 36 | 1124 | -----------------------------------
-- Area: Southern SandOria [S]
-- NPC: Ashmea B Greinner
-- @zone 80
-- @pos 2 2 -81
-----------------------------------
package.loaded["scripts/zones/Southern_San_dOria_[S]/TextIDs"] = nil;
require("scripts/zones/Southern_San_dOria_[S]/TextIDs");
-----------------------------------
-- onTrade Action
-----------------------------------
function onTrade(player,npc,trade)
end;
-----------------------------------
-- onTrigger Action
-----------------------------------
function onTrigger(player,npc)
player:showText(npc, 11690); -- How dare a baseborn peasant raise [his/her] voice to a noble knight!? Begone, before I strike you down myself!
end;
-----------------------------------
-- onEventUpdate
-----------------------------------
function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;
-----------------------------------
-- onEventFinish
-----------------------------------
function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end; | gpl-3.0 |
clevermm/clever-bot | plugins/translate.lua | 13 | 1365 | do
function translate(source_lang, target_lang, text)
local path = "http://translate.google.com/translate_a/single"
— URL query parameters
local params = {
client = "gtx",
ie = "UTF-8",
oe = "UTF-8",
hl = "en",
dt = "t",
tl = target_lang or "en",
sl = source_lang or "auto",
q = URL.escape(text)
}
local query = format_http_params(params, true)
local url = path..query
local res, code = https.request(url)
if code > 200 then
return
end
local trans = res:gmatch("%[%[%[\"(.*)\"")():gsub("\"(.*)", "")
return trans
end
function run(msg, matches)
if #matches == 1 then
print("First")
local text = matches[1]
return translate(nil, nil, text)
end
if #matches == 2 then
print("Second")
local target = matches[1]
local text = matches[2]
return translate(nil, target, text)
end
if #matches == 3 then
print("Third")
local source = matches[1]
local target = matches[2]
local text = matches[3]
return translate(source, target, text)
end
end
return {
description = "Translate some text",
usage = {
"[/!]tr text. Translate the text to English.",
"[/!]tr target_lang text.",
"[/!]tr source.target text",
},
patterns = {
"^[/!]tr ([%w]+).([%a]+) (.+)",
"^[/!]tr ([%w]+) (.+)",
"^[/!]tr (.+)",
},
run = run
}
end
| gpl-2.0 |
bgamari/pandoc | data/sample.lua | 22 | 8328 | -- This is a sample custom writer for pandoc. It produces output
-- that is very similar to that of pandoc's HTML writer.
-- There is one new feature: code blocks marked with class 'dot'
-- are piped through graphviz and images are included in the HTML
-- output using 'data:' URLs.
--
-- Invoke with: pandoc -t sample.lua
--
-- Note: you need not have lua installed on your system to use this
-- custom writer. However, if you do have lua installed, you can
-- use it to test changes to the script. 'lua sample.lua' will
-- produce informative error messages if your code contains
-- syntax errors.
-- Character escaping
local function escape(s, in_attribute)
return s:gsub("[<>&\"']",
function(x)
if x == '<' then
return '<'
elseif x == '>' then
return '>'
elseif x == '&' then
return '&'
elseif x == '"' then
return '"'
elseif x == "'" then
return '''
else
return x
end
end)
end
-- Helper function to convert an attributes table into
-- a string that can be put into HTML tags.
local function attributes(attr)
local attr_table = {}
for x,y in pairs(attr) do
if y and y ~= "" then
table.insert(attr_table, ' ' .. x .. '="' .. escape(y,true) .. '"')
end
end
return table.concat(attr_table)
end
-- Run cmd on a temporary file containing inp and return result.
local function pipe(cmd, inp)
local tmp = os.tmpname()
local tmph = io.open(tmp, "w")
tmph:write(inp)
tmph:close()
local outh = io.popen(cmd .. " " .. tmp,"r")
local result = outh:read("*all")
outh:close()
os.remove(tmp)
return result
end
-- Table to store footnotes, so they can be included at the end.
local notes = {}
-- Blocksep is used to separate block elements.
function Blocksep()
return "\n\n"
end
-- This function is called once for the whole document. Parameters:
-- body is a string, metadata is a table, variables is a table.
-- This gives you a fragment. You could use the metadata table to
-- fill variables in a custom lua template. Or, pass `--template=...`
-- to pandoc, and pandoc will add do the template processing as
-- usual.
function Doc(body, metadata, variables)
local buffer = {}
local function add(s)
table.insert(buffer, s)
end
add(body)
if #notes > 0 then
add('<ol class="footnotes">')
for _,note in pairs(notes) do
add(note)
end
add('</ol>')
end
return table.concat(buffer,'\n')
end
-- The functions that follow render corresponding pandoc elements.
-- s is always a string, attr is always a table of attributes, and
-- items is always an array of strings (the items in a list).
-- Comments indicate the types of other variables.
function Str(s)
return escape(s)
end
function Space()
return " "
end
function LineBreak()
return "<br/>"
end
function Emph(s)
return "<em>" .. s .. "</em>"
end
function Strong(s)
return "<strong>" .. s .. "</strong>"
end
function Subscript(s)
return "<sub>" .. s .. "</sub>"
end
function Superscript(s)
return "<sup>" .. s .. "</sup>"
end
function SmallCaps(s)
return '<span style="font-variant: small-caps;">' .. s .. '</span>'
end
function Strikeout(s)
return '<del>' .. s .. '</del>'
end
function Link(s, src, tit)
return "<a href='" .. escape(src,true) .. "' title='" ..
escape(tit,true) .. "'>" .. s .. "</a>"
end
function Image(s, src, tit)
return "<img src='" .. escape(src,true) .. "' title='" ..
escape(tit,true) .. "'/>"
end
function Code(s, attr)
return "<code" .. attributes(attr) .. ">" .. escape(s) .. "</code>"
end
function InlineMath(s)
return "\\(" .. escape(s) .. "\\)"
end
function DisplayMath(s)
return "\\[" .. escape(s) .. "\\]"
end
function Note(s)
local num = #notes + 1
-- insert the back reference right before the final closing tag.
s = string.gsub(s,
'(.*)</', '%1 <a href="#fnref' .. num .. '">↩</a></')
-- add a list item with the note to the note table.
table.insert(notes, '<li id="fn' .. num .. '">' .. s .. '</li>')
-- return the footnote reference, linked to the note.
return '<a id="fnref' .. num .. '" href="#fn' .. num ..
'"><sup>' .. num .. '</sup></a>'
end
function Span(s, attr)
return "<span" .. attributes(attr) .. ">" .. s .. "</span>"
end
function Cite(s, cs)
local ids = {}
for _,cit in ipairs(cs) do
table.insert(ids, cit.citationId)
end
return "<span class=\"cite\" data-citation-ids=\"" .. table.concat(ids, ",") ..
"\">" .. s .. "</span>"
end
function Plain(s)
return s
end
function Para(s)
return "<p>" .. s .. "</p>"
end
-- lev is an integer, the header level.
function Header(lev, s, attr)
return "<h" .. lev .. attributes(attr) .. ">" .. s .. "</h" .. lev .. ">"
end
function BlockQuote(s)
return "<blockquote>\n" .. s .. "\n</blockquote>"
end
function HorizontalRule()
return "<hr/>"
end
function CodeBlock(s, attr)
-- If code block has class 'dot', pipe the contents through dot
-- and base64, and include the base64-encoded png as a data: URL.
if attr.class and string.match(' ' .. attr.class .. ' ',' dot ') then
local png = pipe("base64", pipe("dot -Tpng", s))
return '<img src="data:image/png;base64,' .. png .. '"/>'
-- otherwise treat as code (one could pipe through a highlighter)
else
return "<pre><code" .. attributes(attr) .. ">" .. escape(s) ..
"</code></pre>"
end
end
function BulletList(items)
local buffer = {}
for _, item in pairs(items) do
table.insert(buffer, "<li>" .. item .. "</li>")
end
return "<ul>\n" .. table.concat(buffer, "\n") .. "\n</ul>"
end
function OrderedList(items)
local buffer = {}
for _, item in pairs(items) do
table.insert(buffer, "<li>" .. item .. "</li>")
end
return "<ol>\n" .. table.concat(buffer, "\n") .. "\n</ol>"
end
-- Revisit association list STackValue instance.
function DefinitionList(items)
local buffer = {}
for _,item in pairs(items) do
for k, v in pairs(item) do
table.insert(buffer,"<dt>" .. k .. "</dt>\n<dd>" ..
table.concat(v,"</dd>\n<dd>") .. "</dd>")
end
end
return "<dl>\n" .. table.concat(buffer, "\n") .. "\n</dl>"
end
-- Convert pandoc alignment to something HTML can use.
-- align is AlignLeft, AlignRight, AlignCenter, or AlignDefault.
function html_align(align)
if align == 'AlignLeft' then
return 'left'
elseif align == 'AlignRight' then
return 'right'
elseif align == 'AlignCenter' then
return 'center'
else
return 'left'
end
end
-- Caption is a string, aligns is an array of strings,
-- widths is an array of floats, headers is an array of
-- strings, rows is an array of arrays of strings.
function Table(caption, aligns, widths, headers, rows)
local buffer = {}
local function add(s)
table.insert(buffer, s)
end
add("<table>")
if caption ~= "" then
add("<caption>" .. caption .. "</caption>")
end
if widths and widths[1] ~= 0 then
for _, w in pairs(widths) do
add('<col width="' .. string.format("%d%%", w * 100) .. '" />')
end
end
local header_row = {}
local empty_header = true
for i, h in pairs(headers) do
local align = html_align(aligns[i])
table.insert(header_row,'<th align="' .. align .. '">' .. h .. '</th>')
empty_header = empty_header and h == ""
end
if empty_header then
head = ""
else
add('<tr class="header">')
for _,h in pairs(header_row) do
add(h)
end
add('</tr>')
end
local class = "even"
for _, row in pairs(rows) do
class = (class == "even" and "odd") or "even"
add('<tr class="' .. class .. '">')
for i,c in pairs(row) do
add('<td align="' .. html_align(aligns[i]) .. '">' .. c .. '</td>')
end
add('</tr>')
end
add('</table')
return table.concat(buffer,'\n')
end
function Div(s, attr)
return "<div" .. attributes(attr) .. ">\n" .. s .. "</div>"
end
-- The following code will produce runtime warnings when you haven't defined
-- all of the functions you need for the custom writer, so it's useful
-- to include when you're working on a writer.
local meta = {}
meta.__index =
function(_, key)
io.stderr:write(string.format("WARNING: Undefined function '%s'\n",key))
return function() return "" end
end
setmetatable(_G, meta)
| gpl-2.0 |
apung/prosody-modules | mod_tcpproxy/mod_tcpproxy.lua | 31 | 3923 | local st = require "util.stanza";
local xmlns_ibb = "http://jabber.org/protocol/ibb";
local xmlns_tcp = "http://prosody.im/protocol/tcpproxy";
local host_attr, port_attr = xmlns_tcp.."\1host", xmlns_tcp.."\1port";
local base64 = require "util.encodings".base64;
local b64, unb64 = base64.encode, base64.decode;
local host = module.host;
local open_connections = {};
local function new_session(jid, sid, conn)
if not open_connections[jid] then
open_connections[jid] = {};
end
open_connections[jid][sid] = conn;
end
local function close_session(jid, sid)
if open_connections[jid] then
open_connections[jid][sid] = nil;
if next(open_connections[jid]) == nil then
open_connections[jid] = nil;
end
return true;
end
end
function proxy_component(origin, stanza)
local ibb_tag = stanza.tags[1];
if (not (stanza.name == "iq" and stanza.attr.type == "set")
and stanza.name ~= "message")
or
(not (ibb_tag)
or ibb_tag.attr.xmlns ~= xmlns_ibb) then
if stanza.attr.type ~= "error" then
origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
end
return;
end
if ibb_tag.name == "open" then
-- Starting a new stream
local to_host, to_port = ibb_tag.attr[host_attr], ibb_tag.attr[port_attr];
local jid, sid = stanza.attr.from, ibb_tag.attr.sid;
if not (to_host and to_port) then
return origin.send(st.error_reply(stanza, "modify", "bad-request", "No host/port specified"));
elseif not sid or sid == "" then
return origin.send(st.error_reply(stanza, "modify", "bad-request", "No sid specified"));
elseif ibb_tag.attr.stanza ~= "message" then
return origin.send(st.error_reply(stanza, "modify", "bad-request", "Only 'message' stanza transport is supported"));
end
local conn, err = socket.tcp();
if not conn then
return origin.send(st.error_reply(stanza, "wait", "resource-constraint", err));
end
conn:settimeout(0);
local success, err = conn:connect(to_host, to_port);
if not success and err ~= "timeout" then
return origin.send(st.error_reply(stanza, "wait", "remote-server-not-found", err));
end
local listener,seq = {}, 0;
function listener.onconnect(conn)
origin.send(st.reply(stanza));
end
function listener.onincoming(conn, data)
origin.send(st.message({to=jid,from=host})
:tag("data", {xmlns=xmlns_ibb,seq=seq,sid=sid})
:text(b64(data)));
seq = seq + 1;
end
function listener.ondisconnect(conn, err)
origin.send(st.message({to=jid,from=host})
:tag("close", {xmlns=xmlns_ibb,sid=sid}));
close_session(jid, sid);
end
conn = server.wrapclient(conn, to_host, to_port, listener, "*a" );
new_session(jid, sid, conn);
elseif ibb_tag.name == "data" then
local conn = open_connections[stanza.attr.from][ibb_tag.attr.sid];
if conn then
local data = unb64(ibb_tag:get_text());
if data then
conn:write(data);
else
return origin.send(
st.error_reply(stanza, "modify", "bad-request", "Invalid data (base64?)")
);
end
else
return origin.send(st.error_reply(stanza, "cancel", "item-not-found"));
end
elseif ibb_tag.name == "close" then
if close_session(stanza.attr.from, ibb_tag.attr.sid) then
origin.send(st.reply(stanza));
else
return origin.send(st.error_reply(stanza, "cancel", "item-not-found"));
end
end
end
local function stanza_handler(event)
proxy_component(event.origin, event.stanza);
return true;
end
module:hook("iq/bare", stanza_handler, -1);
module:hook("message/bare", stanza_handler, -1);
module:hook("presence/bare", stanza_handler, -1);
module:hook("iq/full", stanza_handler, -1);
module:hook("message/full", stanza_handler, -1);
module:hook("presence/full", stanza_handler, -1);
module:hook("iq/host", stanza_handler, -1);
module:hook("message/host", stanza_handler, -1);
module:hook("presence/host", stanza_handler, -1);
require "core.componentmanager".register_component(host, function() end); -- COMPAT Prosody 0.7
| mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.