Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Plugins ➜ InfoBox module to do gauges etc.

InfoBox module to do gauges etc.

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3 

Posted by Thorr686   (4 posts)  Bio
Date Reply #30 on Thu 01 Jul 2010 10:13 AM (UTC)
Message
I am completely new to LUA and to Writing my own Plugins/Scripts. I am trying to write a plugin for a miniwindow for my HP/EP (health and energy points)

Could you guys make a guide, like step by step as to what is requried to make this? I know that guys mention a prompt/hp trigger that is required, can anyone go into some detail, with the steps required, IE what variables need to be stored and then called up in the plugin?

I am familiar with C++ coding but have never done any LUA stuff. Any help would be appreciated.

Also, my prompt looks like this

HP:190/190 EP:190/190

thanks guys
Top

Posted by KaVir   Germany  (117 posts)  Bio
Date Reply #31 on Thu 01 Jul 2010 01:32 PM (UTC)
Message
Thorr686 said:
I am familiar with C++ coding but have never done any LUA stuff. Any help would be appreciated.

I was in the same position as you about 2.5 months ago - familiar with C++, but no experience with Lua or MUSHclient scripts. I wanted to create a plugin with energy bars, but wasn't really sure where to start.

What I did in the end was to download Nick's Experience_Bar plugin from here: http://www.gammon.com.au/mushclient/plugins/

Then I spent some time playing with it and reading the documentation on this site. I googled Lua to find the syntax for certain things when necessary, but the language is pretty simple and you can pick most of it up as you go along.

After a couple of weeks I'd modified the plugin into what I wanted, and felt confident enough to start working on my own plugin. Two months later and I've now got energy bars, a background image, an avatar, timers, a couple of click-to-move maps, and information about your opponent.

A couple of days ago I posted a thread on MudBytes where I briefly discussed the different stages of my plugin, with a screenshot at each stage. Perhaps you'll find it of interest: http://www.mudbytes.net/index.php?a=topic&t=2899

So my suggestion would be to look through the existing plugins, read over the documentation, and have a play - try changing things, see what works and what doesn't, get a feel for it.

One other point worth mentioning though: I don't know which mud you play, but if it supports an out-of-band protocol such as ZMP, ATCP/2, MSDP or 102, you can have energy bars that don't rely on your prompt. Not only does this make the plugin easier to write, it's also nicer to use, as you don't have to keep hitting enter for the energy bars to update.
Top

Posted by Thorr686   (4 posts)  Bio
Date Reply #32 on Thu 01 Jul 2010 11:48 PM (UTC)
Message
Ok, well I know that the mud i play on does not have the ability to update the health bars without the prompt appearing so unfortunately i will just have to have a bunch of spam on my screen.

I will look through those pages and get back to you with my progress.

A general process of what I will need, sorta like a toolbox with all my tools in it before i start building my plugin would still be helpful. Thanks for the quick response :)

Thorr
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #33 on Fri 02 Jul 2010 05:49 AM (UTC)
Message
The health bar plugin below shows most of what is required:

Template:post=9270 Please see the forum thread: http://gammon.com.au/forum/?id=9270.


You basically just need to modify the trigger to match what you receive. You don't have to have the screen fill up with prompts if you don't want, because you could omit them from output.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #34 on Mon 19 Jul 2010 05:26 PM (UTC)
Message
Nick, can you edit the first post to clarify that Infobox is now in the base install and not required to download from the plugins section?

Someone searching for gauges and how to's might get a little confused.
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #35 on Mon 19 Jul 2010 08:38 PM (UTC)
Message
OK did that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Eupher   (6 posts)  Bio
Date Reply #36 on Sat 14 Aug 2010 03:37 AM (UTC)
Message
Thanks a ton for this module. It looks great.

I'm very new to all of this and am trying to do something that may already be easy, or possibly could require changing the module...

Basically, I want a MW that has a dynamic set of Bars... one for the hp's of each current member of my group. Whenever I check group status, I'd like to update the respective hp bar of each member, assuming it's not a new member. In that case I'd need to add a hp bar for them ( and delete the bar of any group members that left the group).

The approach that I thought of was to have the bars indexed by group member name... so I could do a test like:

if ( MW ["Bars"] [member.name] ) then
-- update their bar
else
-- add their bar and set its initial values
end

Is there a way to do something like this cleanly? Am I being stupid again and overlooking something obvious? :) I'd hate to have to loop through all the bars checking the captions for the names...

Thanks!
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


124,233 views.

This is page 3, subject is 3 pages long:  [Previous page]  1  2  3 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.