Ive combined a few bits of code from hours of searching, and I cannot for the life of me understand how to get miniwindows to work right. If someone could write maybe the beginning or just a skeleton example, id love them. I have looked over about 10000 help files it seems.
It basically keeps track of spells and displays as UP or DOWN. I want this in a miniwindow and not the infobar. It would be nice to also have it green or red, which i could do if i knew how to start.
This is not working code, this is just where I am at. It will not run unless you remove the window part ;p
<plugin
name="Buff Indicator Frankensteined"
author="Copy + Paste"
id="a2af5216d68563401888e01e"
language="Lua"
purpose="EVERYTHING"
date_written="2003-04-28 09:50:05"
date_modified="2005-05-05 16:00"
requires="3.49"
version="1.2"
>
<description trim="y">
</description>
</plugin>
<timers>
<timer enabled="y" second="1.00" send_to="6"
>
<send>function cnv (what)
if what then
return "UP"
else
return "DOWN"
end -- if
end -- cnv
infobar_text = string.format (
"PFG: %s, Dark: %s, DB: %s",
cnv (pfg), cnv (dark), cnv (dbless))
if infobar_text ~= old_infobar_text then
InfoClear()
Info (infobar_text)
old_infobar_text = infobar_text
end -- changed</send>
</timer>
</timers>
<triggers>
<trigger
enabled="y"
match="*You feel less protected from good.*"
sendto="6"
sequence="100"
>
<send>pfg = false</send>
</trigger>
<trigger
enabled="y"
match="*The circle of darkness fades away.*"
sendto="6"
sequence="100"
>
<send>dark = false</send>
</trigger>
<trigger
enabled="y"
match="*You feel the dark powers leave your body.*"
sendto="6"
sequence="100"
>
<send>dbless = false</send>
</trigger>
<trigger
enabled="y"
match="*You summon a circle of darkness.*"
sendto="6"
sequence="100"
>
<send>dark = true</send>
</trigger>
<trigger
enabled="y"
match="*A shimmering aura of evil surrounds your body.*"
sendto="6"
sequence="100"
>
<send>pfg = true</send>
</trigger>
<trigger
enabled="y"
match="*You chant the ancient words of magic, calling forth the powers of darkness.*"
sendto="6"
sequence="100"
>
<send>dbless = true</send>
</trigger>
</triggers>
win = "buff"
long WindowCreate(buff, 0,0, 50, 100, 6, miniwin.create_absolute_location, ColourNameToRGB("black"));
WindowFont (buff, "f", "Fixedsys", 9, true, false, false, false) -- define font
|