[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  MXP and Pueblo
. . -> [Subject]  infobars not updating when receiving mxp vars
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

infobars not updating when receiving mxp vars

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


Posted by Hawgpadre   (5 posts)  [Biography] bio
Date Sat 10 Mar 2012 06:54 AM (UTC)

Amended on Sat 10 Mar 2012 06:55 AM (UTC) by Hawgpadre

Message
I'm sure I'm doing something wrong. The world properties show the MXP vars are updating correctly, so I think maybe the WatchValue call is wrong? Or the way I'm making a local copy of the variable in OnMXPVariable? Not sure as I can't find much info on it. Any help would be appreciated!


<!--  Script  -->

<script>
require "InfoBox"
require "wait"

-- PLUGIN GLOBALS
statusbar = InfoBox:New("Menu")
statusbar.window_width = 200
statusbar:Columns(1)
statusbar:Rows(3)

mxp_health=0
mxp_credits = 0

hpbar = statusbar:AddBar("Health", 80, "green")
hpbar.padding = 4
hpbar.threshold = 100
hpbar:WatchValue("mxp_health")
cashbar = statusbar:AddBar("Credits", 80, "green")
cashbar.padding = 4
cashbar:WatchValue("mxp_credits")
cashbar.threshold = 100
statusbar.windowposition = InfoBox.windowPositions.SE


-- Do on connect thing

function OnPluginDisconnect ()

end --function

function OnPluginConnect ()
-- show windows
statusbar:Update();
-- bind keys

end -- function


-- Updates the info bar
function OnMXPvariable(key, value)
	SetVariable(key, value)
	hpbar:Update()
	cashbar:Update()
	statusbar:Update()
end -- function 

-- ... unrelated code
</script>
[Go to top] 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.


2,101 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]