I already use the status line, and wanted to see if I could place that information on a miniwindow instead, just a little more noticeable for me
Also if you use the statue line for something else, the last piece of information on it goes, so if I want to have a few things on it, I would have to make the statue line quite long -
you get the idea, I know you can make the exits go on a miniwindow, just would of been nice to see the target and spell on it and make it a little bigger and brighter.
The code for target works well enough, I managed to make a small window where the target is displayed (though I have not mastered moving it yet).
My problem is some spells are cast on the character, though I have managed to alter the variables in the spell to do this, I cannot get the miniwindow to refresh to show the new variable (me).
this is what I have to target -
SetVariable ("target", "%1")
local spellname1 = GetVariable("spellname1")
local target = GetVariable("target")
ColourNote ("white", "blue", "Spell is still: " .. spellname1)
ColourNote ("white", "blue", "Target is now: " .. target)
Typing in t attacker will set that target and ill appear in the miniwindow
And this is for my spells so typing arm gives-
SetVariable ("spellname1", "armor")
SetVariable ("target", "me")
local spellname1 = GetVariable("spellname1")
local target = GetVariable("target")
SetStatus ("Target: " .. target," / Spell: " .. spellname1)
ColourNote ("white", "blue", "Spell is now: " .. spellname1)
ColourNote ("white", "blue", "Target is still: " .. target)
world.Execute ("t " .. target (just added after I first made this post)
Though the spell and targets are correct and it works when I cast the spell, I cant get the targetwindow to refresh.
I've tried WindowShow ("targetwindow", true) which does not come up with an eror, but it does not refresh the target window.
Any advise on where I'm going wrong?
For the moment I'm using - "world.Execute ("t " .. target) at the end of the spellname alias (just discovered it after writing this) I would like to know if there is a better method
This is to let me use one alias to cast spells where it knows the difference between spells I cast on me and mobs with an option of casting a spell normally for me (a heal) to a friend, hence the if post I made
<aliases>
<alias
match="keypad_0"
enabled="y"
expand_variables="y"
group="cast"
send_to="12"
sequence="100"
>
<send>
local x = GetVariable("targetme")
local spellname = GetVariable("spellname1")
local targetme = GetVariable("targetme")
local target2 = GetVariable ("target2")
if x == "me" then Send ("cast " .. spellname, " on " .. targetme)
else
Send ("cast " .. spellname, " on " .. target2)
end
</send>
</alias>
</aliases>
With this done I will have to figure out how to move the target box in the 't *' and then see if I can master the inventory problem I have with the line.
It changed for me. What I suspect is happening is that you have two miniwindows, one on top of the other, and the one underneath is changing. Try closing the world completely (to get rid of the windows) and try again. I moved the target to the top right corner by changing the position parameter:
The aa alias will change it because of the world.Execute ("t " .. target2) but the arm alias won't change it, and if I try world.Execute ("t " .. targetme) then it changes the variable target2 as well.
So by going 't attacker' target2 changes to attacker, when I go arm, I get -targetme me- but if I add the world.Execute as above and use arm alias then target2 also becomes me
I was thinking if it was a WindowShow or some kind of refresh command it might help
And thanks the Courier, never noticed, too busy looking at the program itself
The arm alias doesn't change the miniwindow at all.
I think you are getting into a bit of a muddle here. You really want a function (or an alias maybe) that simply updates the miniwindow. Then call that from various spots.