[ SOLVED ] Quick Geyser and GMCP question
Re: Quick Geyser and GMCP question
Sorry it took so long. Here's what the script looks like.
Re: Quick Geyser and GMCP question
Changing the size of the text using Geyser is easy.
The <text you want to echo> can either be a variable or "text".
<text color> can either be nil (which means it won't change the color) or a "color" from the showColors() function.
<text formatting> can be nil or a justification such as c for center and or a text size.
p.s. The way that you have your function written, MAY lock up mudlet, as you have it being called from within the function. Not a great way to keep that info up to date.
HTH
Code: Select all
whatever:echo(<text you want to echo>, <text color>, <text formatting>)
<text color> can either be nil (which means it won't change the color) or a "color" from the showColors() function.
<text formatting> can be nil or a justification such as c for center and or a text size.
Code: Select all
test:echo("Test text going to be red and centered size 12", "red", "c12")
HTH
--
Knute
Knute
Re: Quick Geyser and GMCP question
Hey Knute, thanks for the info. What would be a better way to do it? I can't get it to update at all unless I'm saving the script after altering it.
Re: Quick Geyser and GMCP question
Well, do you have gauges that you update? You could toss the function in there.
The other option has already been mentioned, and that is to update it with the prompt.
Also, since you are checking gold, you could call the function every time you pick up gold, or whatever other status messages show up. Just call your function from those triggers, and the data will refresh, even if you have the prompt method as well.
The other option has already been mentioned, and that is to update it with the prompt.
Also, since you are checking gold, you could call the function every time you pick up gold, or whatever other status messages show up. Just call your function from those triggers, and the data will refresh, even if you have the prompt method as well.
--
Knute
Knute
Re: Quick Geyser and GMCP question
Okay, now I'm really confused. I created the -- return isPrompt() -- trigger with -- charStatus()-- as the action. It is still not updating my little window with the correct values!
Here is the whole section for this label:
edit: the font-family tag in there works, but not the other. I tried it the way that you suggested, putting the info in the echo, but I think since there's so many concat'd stuff in there, it doesn't pay any attention to it.
Here is the whole section for this label:
Code: Select all
nameinfolabel = Geyser.Label:new({
name = "nameinfolabel",
x = 4, y = "4%",
width = 296, height = 200,
})
nameinfolabel:setColor(35, 0, 0)
nameinfolabel:setStyleSheet([[
qproperty-alignment: 'AlignLeft | AlignTop';
font-family: Calibri;
font-size: 30;
font-style: bold;
border: 2px solid firebrick;
font size="30"
]])
nameinfolabel:echo(myname.."<br>Level: "..mylevel.."<br>Gold: "..mygold.."<br>Messages: "..mymessages)
Re: Quick Geyser and GMCP question
Ok, so let's step back here. This last that you posted sets up your lablel, it's position, etc....
Your echo in that code will update it with the information in those variables at that time.
You function is what keeps the info current.
Ok, now your trigger for your prompt.... Does it resemble your prompt in any way?
So if your prompt was: 400hp, 300mp, 100end >
Then your trigger for the prompt would have to look something like: (\d+)hp, (\d+)mp, (\d+)end >
Does that make sense?
Your echo in that code will update it with the information in those variables at that time.
You function is what keeps the info current.
Ok, now your trigger for your prompt.... Does it resemble your prompt in any way?
So if your prompt was: 400hp, 300mp, 100end >
Then your trigger for the prompt would have to look something like: (\d+)hp, (\d+)mp, (\d+)end >
Does that make sense?
--
Knute
Knute
Re: Quick Geyser and GMCP question
Changing font size:
Changing font color AND size:
Re: Quick Geyser and GMCP question
It looks to me like, if you just removed that call to charStatus within the charStatus function (which will cause it to call itself infinitely, or until you hit a stack overflow), you should be fine. It should update every time the gmcp.Char.Status event is raised by Mudlet.
With the script as you have it now, with the name and event the way it is, just copy and paste what I gave you in the script box. Unless something else is terribly broken in your setup, it should work.
With the script as you have it now, with the name and event the way it is, just copy and paste what I gave you in the script box. Unless something else is terribly broken in your setup, it should work.
Re: Quick Geyser and GMCP question
Sometimes I hate coding.
The problem was my label was named "nameinfolabel" and the echo that I was trying to do was "namelabel:echo"
I do have the function being called from a -- return isPrompt() -- trigger though.
ANYWAYS. Moving on the label styling.
Akaya, your suggestion works... except for when the variables are included. Doing:
Just echoes the variable name.
The problem was my label was named "nameinfolabel" and the echo that I was trying to do was "namelabel:echo"
I do have the function being called from a -- return isPrompt() -- trigger though.
ANYWAYS. Moving on the label styling.
Akaya, your suggestion works... except for when the variables are included. Doing:
Code: Select all
nameinfolabel:echo([[<span style="color: yellow"><span style="font-size: 16pt">myname.."<br>Level: "..mylevel.."<br>Gold: "..mygold.."<br>Messages: "..mymessages</span></span>]])
Re: Quick Geyser and GMCP question
You need to use braces to single them out:
Code: Select all
nameinfolabel:echo([[<span style="color: yellow"><span style="font-size: 16pt">]] .. myname .. [["<br>Level: "]] .. mylevel .. [["<br>Gold: "]] .. mygold .. [["<br>Messages: "]] .. mymessages .. [[</span></span>]])
--
Knute
Knute