I removed the thing causing the loop, now I have this:
atkwin = "knightattacks"
dslcolor = "silver"
function knightAI:attackwindow()
WindowCreate (atkwin, 640, 325, 175, 200, 6, 2, ColourNameToRGB("black"))
WindowShow (atkwin, true)
WindowFont (atkwin, "a","Trebuchet MS", 12, true, false, false, false)
WindowText (atkwin, "f","Attacks:", 4, 0, 0, 0, ColourNameToRGB ("lightgreen"), false)
WindowText (atkwin, "a","DSL", 4, 13, 0, 0, ColourNameToRGB (dslcolor), false)
WindowText (atkwin, "a","SSL", 6.5, 30, 0, 0, ColourNameToRGB ("silver"), false)
WindowText (atkwin, "a","IMPALE", 4, 47, 0, 0, ColourNameToRGB ("silver"), false)
WindowText (atkwin, "a","HELLSIGHT/ARC", 40, 13, 0, 0, ColourNameToRGB ("silver"), false)
WindowText (atkwin, "a","DISEMBOWEL", 40, 30, 0, 0, ColourNameToRGB ("silver"), false)
WindowText (atkwin, "f", "Spells:", 5, 67, 0, 0, ColourNameToRGB ("lightgreen"), false)
WindowText (atkwin, "a","ENGAGE", 4, 80, 0, 0, ColourNameToRGB ("silver"), false)
WindowText (atkwin, "a","PIETY", 75, 80, 0, 0, ColourNameToRGB ("silver"), false)
WindowText (atkwin, "a","HEAL", 4, 97, 0, 0, ColourNameToRGB ("silver"), false)
WindowText (atkwin, "a","REVIT", 55, 97, 0, 0, ColourNameToRGB ("silver"), false)
WindowText (atkwin, "a","DEMONS", 4, 114, 0, 0, ColourNameToRGB ("silver"), false)
WindowAddHotspot(atkwin, "dsl", 3, 12, 25, 12, "", "", "", "", knightAI:modatk(), "", 1, 0)
end
function knightAI:modatk()
atk = "dsl"
dslcolor = "red"
end
when I tried that, I got an error saying 'bad argument #11, string required', so I changed it to
WindowAddHotspot(atkwin, "dsl", 3, 12, 25, 12, "", "", "", "", "knightAI:modatk()", "", 1, 0)
But nothing happens when I redraw the window with my 'testme1' alias posted above after clicking in the hotspot, the text should be turning red. |