Page 2 of 3

Re: Quick Geyser and GMCP question

Posted: Sun Aug 10, 2014 1:17 am
by Iktomi
Sorry it took so long. Here's what the script looks like.

Re: Quick Geyser and GMCP question

Posted: Sun Aug 10, 2014 2:48 am
by Knute
Changing the size of the text using Geyser is easy.

Code: Select all

whatever:echo(<text you want to echo>, <text color>, <text formatting>)
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.

Code: Select all

test:echo("Test text going to be red and centered size 12", "red", "c12")
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

Re: Quick Geyser and GMCP question

Posted: Sun Aug 10, 2014 2:51 am
by Iktomi
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

Posted: Sun Aug 10, 2014 2:55 am
by Knute
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.

Re: Quick Geyser and GMCP question

Posted: Sun Aug 10, 2014 3:02 am
by Iktomi
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:

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)
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.

Re: Quick Geyser and GMCP question

Posted: Sun Aug 10, 2014 3:11 am
by Knute
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?

Re: Quick Geyser and GMCP question

Posted: Sun Aug 10, 2014 4:26 am
by Akaya
Changing font size:
Code: [show] | [select all] lua
mylabel:echo([[<span style="font-size:20px">Hello World</span>]])
Changing font color AND size:
Code: [show] | [select all] lua
mylabel:echo([[<span style="color: yellow"><span style="font-size: 16pt">Hello World Again!</span></span>]])

Re: Quick Geyser and GMCP question

Posted: Sun Aug 10, 2014 5:03 am
by Oneymus
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.

Re: Quick Geyser and GMCP question

Posted: Sun Aug 10, 2014 10:33 pm
by Iktomi
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:

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>]])
Just echoes the variable name.

Re: Quick Geyser and GMCP question

Posted: Mon Aug 11, 2014 2:10 pm
by Knute
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>]])