I changed the hotspot syntax to pass the name of the function, and simplified the function so I could test only the hotspot. Still when I click on the hotspot nothing happens. I wondered if I'd placed the hotspot improperly so I made a rectangle with the same dimensions in the window. Found that I'd made a tiny line for a hotspot. So I worked out the dimensions I wanted with the rectangle, then rewrote the hotspot to fit it. Still, nothing happening when I click inside the rectangle/hotspot.
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)
WindowFont (atkwin, "f","Trebuchet MS", 10, 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)
WindowRectOp(atkwin, 1, 3, 15, 32, 32, ColourNameToRGB("blue"))
WindowAddHotspot(atkwin, "dsl", 3, 15, 32, 32, "", "", "", "", "knightAI.modatk", "", 1, 0)
end
function knightAI:modatk()
Note("hotspot working")
end |