Alright guys, I've got it mostly working. Except when I omit the line with the data it screws everything up. The idea is to eventually have the alias triggered on a timer and completely stripped from my screen (aside from the miniwindow).
The trigger in question is here: <trigger
enabled="n"
group="WhoList"
keep_evaluating="y"
match="^(\s+)([\/\|][BH]|[DG]|[DK]|[HG]|[MG]|[SR])?(\s+)([A-Za-z\s]+) ([0-9mhs\s]+)?$"
omit_from_output="n"
regexp="y"
send_to="12"
script="ParseWhoList"
sequence="100"
>
</trigger>
And here is the scripting portion:winTMargin = 1 #Top Window Margin
winLMargin = 1 #Left Window Margin
yPos = 0 #Window Y Coordinate
xPos = 0 #Window X Coordinate
winHeight = 300 #Default Window Height
winWidth = 250 #Window Width
winColor = 0x000000 #Window Color
fontName = 'Dina' #Font
fontHeight = 16 #Font Height
#Char, Foreground, Background, Bold, Line
WhoList = [[],[],[],[],[]]
win = world.GetPluginID
def OnPluginConnect():
world.EnablePlugin (world.GetPluginID, 0)
def OnPluginDisconnect():
world.WindowShow (win, 0)
def OnPluginClose():
world.WindowShow (win, 0)
def OnPluginDisable():
world.WindowShow (win, 0)
def OnPluginEnable():
world.WindowCreate (win, xPos, yPos, winWidth, winHeight, 7, 0, winColor)
world.WindowShow (win, 1)
def ParseWhoList(TriggerName, trig_line, wildcards):
sFlag = wildcards[1]
sID = wildcards[3].rstrip()
sCompiled = sFlag.rjust(6) + ' ' + sID
xLine = world.GetLinesInBufferCount #Line Number
xStyle = world.GetLineInfo(xLine, 11) #Number of Styles
#world.Note(sCompiled + ', ' + str(xStyle))
for i in range(0, xStyle):
xStyleLen = world.GetStyleInfo(xLine, i+1, 2) #Length of Style
WhoList[0].append(sCompiled[0:xStyleLen])
sCompiled = sCompiled[xStyleLen:len(sCompiled)]
WhoList[1].append(world.GetStyleInfo(xLine, i+1, 14))
WhoList[2].append(world.GetStyleInfo(xLine, i+1, 15))
if world.GetStyleInfo(xLine, i+1, 8):
WhoList[3].append('1')
else:
WhoList[3].append('0')
WhoList[4].append(str(xLine))
def DisplayWho():
#for i in range(0, len(WhoList[0])):
# world.Note(str(WhoList[0][i]) + ', ' + str(WhoList[1][i]) +
#', ' +str(WhoList[2][i]) + ', ' +str(WhoList[3][i]) + ', ' + str(WhoList[4][i]))
world.WindowFont (win, 'body', fontName, 10, 0, 0, 0, 0, 1, 0)
world.WindowFont (win, 'title', fontName, 10, 1, 0, 0, 0, 1, 0)
xLineLast = WhoList[4][0]
xLineCount = 1
for i in range(0, len(WhoList[4])):
if not WhoList[4][i] == xLineLast:
xLineCount = xLineCount + 1
xLineLast = WhoList[4][i]
winHeight = fontHeight * xLineCount + 3
world.WindowCreate (win, xPos, yPos, winWidth, winHeight, 7, 0, winColor)
localTMargin = winTMargin
xLineLast = WhoList[4][0]
xChars = 0
for i in range(0, len(WhoList[0])):
if not WhoList[4][i] == xLineLast:
localTMargin = localTMargin + fontHeight
xLineLast = WhoList[4][i]
xChars = 0
if WhoList[3][i] == '1':
world.WindowText (win, 'title', str(WhoList[0][i]), winLMargin + (xChars + 1) * 8, localTMargin, 0, 0, WhoList[1][i], 1)
xChars = xChars + len(str(WhoList[0][i]))
else:
world.WindowText (win, 'body', str(WhoList[0][i]), winLMargin + (xChars + 1) * 8, localTMargin, 0, 0, WhoList[1][i], 1)
xChars = xChars + len(str(WhoList[0][i]))
world.WindowShow (win, 1)
def CleanUp():
for i in range(0, len(WhoList[0])):
WhoList[0].pop(0)
for i in range(0, len(WhoList[1])):
WhoList[1].pop(0)
for i in range(0, len(WhoList[2])):
WhoList[2].pop(0)
for i in range(0, len(WhoList[3])):
WhoList[3].pop(0)
for i in range(0, len(WhoList[4])):
WhoList[4].pop(0)
|