Geyser UI Template

Share your scripts and packages with other Mudlet users.
User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Geyser UI Template

Post by Akaya »

Each echo to a label will overwrite the previous. So try sending everything at once. You can separate with a <br>...
Code: [show] | [select all] lua
GUI.Box1:echo("Hello World <br> Hello World again!")
a bit more advanced way...
Code: [show] | [select all] lua
local stuff_to_say = {
  "Hello World.",
  "Hey there bud.",
  "Get off my lawn!"
}
GUI.Box1:echo( table.concat( stuff_to_say, "<br>" ) )

darcor78
Posts: 3
Joined: Sun Feb 15, 2015 11:15 pm

Re: Geyser UI Template

Post by darcor78 »

Thank you for the reply. I have tried to use this solution but it can't solve my problem... I need to send to box1 a chat channel or a spell activation...
I need to not overwite the phrases...

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Geyser UI Template

Post by Akaya »

In that case you'll want a miniconsole instead of a label.

This will create a miniconsole that covers GUI.Box1
Code: [show] | [select all] lua
my_miniconsole = Geyser.MiniConsole:new({
  name = "my_miniconsole",
  x = 0, y = 0,
  width = "100%",
  height = "100%",
}, GUI.Box1 )
And this is how you send text to the miniconsole. You can do this as many times as you want and the text will not overwrite.
Code: [show] | [select all] lua
my_miniconsole:echo("Hello world!")
If you want to learn more, you can read all about it here: http://wiki.mudlet.org/w/Manual:Geyser# ... iniConsole

darcor78
Posts: 3
Joined: Sun Feb 15, 2015 11:15 pm

Re: Geyser UI Template

Post by darcor78 »

Thank you very much!!! :D :D :D

Aaze
Posts: 6
Joined: Thu Feb 19, 2015 3:09 pm

Re: Geyser UI Template

Post by Aaze »

Okay, I went through this entire thing, and I still have no idea how to update my gauges. I have a script and everything, and it has successfully activated (first time without getting the little bug, hehe) but the gauges still don't work.
Code: [show] | [select all] lua
function getVitals()


currentHealth = gmcp.Char.Vitals.hp
maxHealth = gmcp.Char.Vitals.maxhp
currentMana = gmcp.Char.Vitals.mp
maxMana = gmcp.Char.Vitals.maxmp
currentEndurance = gmcp.Char.Vitals.ep
maxEndurance = gmcp.Char.Vitals.maxep
currentWillpower = gmcp.Char.Vitals.wp
maxWillpower = gmcp.Char.Vitals.maxwp


setGauge("GUI.Health",currentHealth,maxHealth,""..currentHealth.."/"..maxHealth.."")
setGauge("GUI.Mana",currentMana,maxMana,""..currentMana.."/"..maxMana.."")
setGauge("GUI.Endurance",currentEndurance,maxEndurance,""..currentEndurance.."/"..maxEndurance.."")
setGauge("GUI.Willpower",currentWillpower,maxWillpower,""..currentWillpower.."/"..maxWillpower.."")




end
Plus, I have 'gmcp.Char.Vitals' in the Registered Event Handler. Am I missing something?

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Geyser UI Template

Post by Akaya »

Is your script named getVitals ? The script name and function name must match for the event to work properly.

Aaze
Posts: 6
Joined: Thu Feb 19, 2015 3:09 pm

Re: Geyser UI Template

Post by Aaze »

Yea, it is.

I've heard talk of a trigger that you are supposed to have for these or something so it would update every prompt. Does my code require one, or what?

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Geyser UI Template

Post by Akaya »

Here's the object oriented way Geyser provides. Try replacing your setGauge functions with setValue like so:
Code: [show] | [select all] lua
GUI.Health:setValue( tonumber(currentHealth), tonumber(maxHealth) )

Filion
Posts: 93
Joined: Sat Mar 26, 2011 4:21 pm

Re: Geyser UI Template

Post by Filion »

How do you make the mapper clickable if you place it in box1?

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Geyser UI Template

Post by Akaya »

The mapper doesn't seem to like when it is placed within a container, such as GUI.Box1. While it will still track and update your location, you will lose all mouse-based functionality. The only solution I've found is to give the exact x,y location of where you want the mapper placed and make sure it is called after the GUI is drawn so it is on the top-most layer.

Post Reply