comparison Devian.lua @ 31:6fcfe60bbd0f

Another fix to /dvn tag assignments. It also outputs the channel signature and index so you know you aren't psychotic.
author Nenue
date Sat, 26 Dec 2015 05:18:24 -0500
parents 42e74b72726d
children c6a2c2df4790
comparison
equal deleted inserted replaced
30:42e74b72726d 31:6fcfe60bbd0f
66 if not D.tags[tag] then 66 if not D.tags[tag] then
67 D.tags[tag] = {} 67 D.tags[tag] = {}
68 end 68 end
69 if D.tags[tag][channel.index] then 69 if D.tags[tag][channel.index] then
70 D.tags[tag][channel.index] = nil 70 D.tags[tag][channel.index] = nil
71 D:Print('Removed |cFFFFFF00'..tag..'|r from |cFF00FFFF'.. dest .. '|r') 71 D:Print('Removed |cFFFFFF00'..tag..'|r to |cFF00FFFF['..channel.index..', '..channel.signature..']|r')
72 else 72 else
73 D.tags[tag][channel.index] = channel.index 73 D.tags[tag][channel.index] = channel.index
74 D:Print('Assigning |cFFFFFF00'..tag..'|r to |cFF00FFFF'.. dest .. '|r') 74 D:Print('Assigning |cFFFFFF00'..tag..'|r to |cFF00FFFF['..channel.index..', '..channel.signature..']|r')
75 end 75 end
76 76
77 else 77 else
78 D:Print('Usage: /dvn tag <prefix> <console name or number>') 78 D:Print('Usage: /dvn tag <prefix> <console name or number>')
79 end 79 end
469 if not (cinfo.signature or t_info.signature) then 469 if not (cinfo.signature or t_info.signature) then
470 t_info.signature = 'Console' 470 t_info.signature = 'Console'
471 end 471 end
472 472
473 -- was an index given? 473 -- was an index given?
474 if not i then 474 if D.sigID[t_info.signature] then
475 i = D.sigID[t_info.signature]
476 -- the signature has one
477 elseif not i then
475 i = D.num_channels + 1 478 i = D.num_channels + 1
476 t_info.index = i 479 t_info.index = i
477 -- make a new one 480 -- or we need to make a new one
478 else 481 else
479 i = tonumber(i) 482 i = tonumber(i)
480 -- is it valid? 483 -- is it valid?
481 if db.channels[i] then 484 if db.channels[i] then
482 dbvars = db.channels[i] 485 dbvars = db.channels[i]
483 -- use that as our base vars 486 -- that is our base vars
484 else 487 else
485 if D.sig[t_info.signature] then 488 if D.sig[t_info.signature] then
486 local sigvar = t_info.signature 489 local sigvar = t_info.signature
487 local j = 2 490 local j = 2
488 while D.sig[sigvar] do 491 while D.sig[sigvar] do