Geyser UI Template

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

Re: Geyser UI Template

Post by Akaya » Mon Jul 07, 2014 12:01 am

If you're playing Achaea (not sure for other IRE games), your health is stored as gmcp.Char.Vitals.hp
The event gmcp.Char.Vitals is raised when your health changes so you can update from that.
http://wiki.mudlet.org/w/Manual:Event_Engine

GUI.Box1 is meant to be the container for the mapper in my example. If you do not set a container, the main window is used.
When creating the mapper, we can place it in GUI.Box1 like so...
Code: [show] | [select all] lua
myMapper = Geyser.Mapper:new({
  name = "myMapper",
  x = 0, y = 0,
  width = "100%",
  height = "100%",
}, GUI.Box1 )
Do not replace GUI.Box1 with this script as we need it as the container for the mapper.

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

Re: Geyser UI Template

Post by Akaya » Mon Jul 07, 2014 10:12 pm

@sbgamer as for having each item on a new line, change your script to this:
Code: [show] | [select all] lua
local t = {}
for k,v in pairs(gmcp.Char.Items.List.items) do
  table.insert(t, v.name)
end
GUI.Box7:echo(table.concat(t, "<br>"))
Since you're echoing to a label, a break <br> is needed. If it was a miniConsole, you'd use a new line \n.

In regards to your other questions, you'll want to have a look at how events work in Mudlet. Each time the table updates, an event will raise (gmcp.Char.Items). Create an event handler script to update GUI.Box7 with the proper info.
http://wiki.mudlet.org/w/Manual:Event_Engine

Ruran
Posts: 3
Joined: Fri Jul 04, 2014 4:53 pm

Re: Geyser UI Template

Post by Ruran » Tue Jul 08, 2014 2:13 pm

I am playing Achaea. But I still don't understand how I'm actually supposed to ascertain that value. I know what it is, but I don't know how to tell Mudlet what it is in a way that it can use to display it back to me. The best I can think of is to trigger the prompt to reset the value every time it updates.
Akaya wrote:
Code: [show] | [select all] lua
myMapper = Geyser.Mapper:new({
  name = "myMapper",
  x = 0, y = 0,
  width = "100%",
  height = "100%",
}, GUI.Box1 )
Okay, so where do I put this script? In the same place as the box script in the template? A completely new script?

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

Re: Geyser UI Template

Post by Akaya » Tue Jul 08, 2014 2:32 pm

Again, you'll want to have a look at how events work in Mudlet. Did you check out the link I posted? It explains how to register an event handler.

I did a bit more digging for you and found this nice gmcp tutorial written by Vadi: http://www.mudlet.org/wp-content/upload ... torial.pdf
It's more directed towards what you're doing so have a look.

As for the mapper script... put it in a completely new script that is after or underneath the Geyser Template folder.

sbgamer
Posts: 2
Joined: Sun Jul 06, 2014 11:41 pm

Re: Geyser UI Template

Post by sbgamer » Tue Jul 08, 2014 10:36 pm

I did read the information on the link, thank you for the assistance. I have it working (for the most part now). I am still trying to figure out how to update it automatically, as it is it updates if I move or if I do a quicklook.

As an aside I would like to thank people like you and Vadi and demonic who are willing to share their scripting knowledge so that the rest of us can enjoy the game as well

User avatar
demonnic
Posts: 576
Joined: Sat Dec 05, 2009 3:19 pm

Re: Geyser UI Template

Post by demonnic » Tue Jul 08, 2014 11:25 pm

sbgamer,

There are some other events which need to be listened for in order to get updates to the room items. I don't have them in front of me now, but I believe they are gmcp.Char.Items.Add and .Remove and .Update.

Some of them are handled HERE but I haven't updated it to include the .Update handling, iirc. I've got the code for it, and I really ought to get that updated accordingly. Either way, it ought to give you an idea of how to get things updating automatically (for the most part, without update you get things entering/leaving but not necessarily when they move from alive to dead/etc).


ETA: It warms my heart to hear you're getting some good use out of anything I put out here on the forums or the various IRE game forums/website scripting section. I only keep putting this stuff out there in the hopes someone can get something out of it, whether it's direct use or ideas for their own scripts. I consider it mission accomplished any time I see a post like this =)

Arkantos
Posts: 1
Joined: Fri Jul 18, 2014 3:41 am

Re: Geyser UI Template

Post by Arkantos » Fri Jul 18, 2014 3:47 am

I agree. Thanks to you people for threads like this. It seems we have to do a whole major in programming to be able to play Achaea these days.

I've basically struggled and spent a very long time getting the gauges and mapper to work.

Can anyone help me out on getting the afflictions window and maybe a limb counter into two of those other boxes on this template? I would be most grateful.

spoofmanbob
Posts: 9
Joined: Sat Oct 25, 2014 4:49 am

Re: Geyser UI Template

Post by spoofmanbob » Sat Oct 25, 2014 3:21 pm

Do you know why my mapper does not show a map, just the room name and id?

http://imgur.com/RKU5ZmH.png

My mapper script is just:
Code: [show] | [select all] lua
GUI.Map_Container = Geyser.Container:new({
name = "GUI.Map_Container",
x = 0, y = 0,
width = "100%",
height = "100%",
},GUI.Box1)

GUI.Mapper = Geyser.Mapper:new({
name = "GUI.Mapper",
x = 20, y = 20,
width = GUI.Map_Container:get_width()-40,
height = GUI.Map_Container:get_height()-40,
},GUI.Map_Container)

 

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

Re: Geyser UI Template

Post by Akaya » Sun Oct 26, 2014 1:42 am

Might be that centerview() needs to be called. That'd be my guess anyways. You can try entering: lua centerview("10938")

spoofmanbob
Posts: 9
Joined: Sat Oct 25, 2014 4:49 am

Re: Geyser UI Template

Post by spoofmanbob » Mon Oct 27, 2014 11:37 am

It looks centered by the looks of the toolbar on the bottom? Just no rooms.

http://imgur.com/8LZBFlJ.png

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests