Help with non-prompt, spell/buff on or off miniwindow

Posted by Rydricc on Sun 11 Mar 2012 06:02 AM — 2 posts, 11,721 views.

#0
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

Amended on Sun 11 Mar 2012 06:05 AM by Rydricc
Australia Forum Administrator #1
Huh? Did you use the plugin wizard? Take a look at almost any plugin on this site and you will see that the script part goes inside "script" tags, like this:


<!--  Script  -->


<script>
<![CDATA[

--  your script here ...


]]>
</script>


Also there should be more preamble at the start and the end.

Look at existing plugins, quite a few came with the client.