Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, 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
➜ Tips and tricks
➜ New custom status bar window
New custom status bar window
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
3 4
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #30 on Fri 17 Dec 2004 07:49 PM (UTC) |
Message
| I don't think it is the ShellEnhanced stuff. It happened to me once yesterday, and I just reproduced it.
I don't quite know why, the program itself is so simple it shouldn't go wrong. However I am guessing from what seems to be happening is that sometimes when it tries to draw on its little window it somehow grabs the entire desktop and draws on that, hence the desktop changes colour. Why, I'm not sure. For one thing, Windows should not allow programs to interfere with each others like it seems to be doing.
I'm trying to Google my way to finding an article that explains if there is some sort of exception situation that should be handled differently. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #31 on Fri 17 Dec 2004 08:51 PM (UTC) |
Message
| OK, I think I fixed it. Download the new source/executable from the same spot as before.
In case anyone is wondering, the problem seemed to be that it was not freeing resources, and what eventually happened was that Windows ran out of drawing resources, and in my case at least, the desktop went crazy. This is the change (in a few places):
Before
FillRect (hdc, &rect, CreateSolidBrush (colours [i]););
After
HBRUSH barbrush = CreateSolidBrush (colours [i]);
if (barbrush)
{
FillRect (hdc, &rect, barbrush);
DeleteObject (barbrush);
} // end of having brush
What the original was doing was CreateSolidBrush for each bar drawn, and each background of the bar, plus the background for the whole window, every time the window was redrawn. This meant that it would have used around 9 brushes per redraw (for 4 bars).
The new version frees each resource as it uses it, so it should never use them up. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Afkeraeon
(7 posts) Bio
|
Date
| Reply #32 on Fri 17 Dec 2004 10:04 PM (UTC) |
Message
| Rock on Nick, just one more thing.
I didn't really get how to print multiple textlines in the window. I'd like to put some statistics as well as some affecting protections information, wether spells are up or not etc. To make it a bit easier to keep track off :) | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #33 on Sat 18 Dec 2004 12:59 AM (UTC) Amended on Sat 18 Dec 2004 01:00 AM (UTC) by Nick Gammon
|
Message
| OK, it's that last line with "text" in it that is the key. If you change:
-- monster name
--udp ("text,5,95," .. t.mud_monster_name)
... to:
udp ("text,5,95," ..
[[You stand at the entrance to the Darkhaven Academy. A large flight of
stone stairs lead down into the massive subterranean structure, which
has the responsibility of training the young adventurers of the world.
A small cobbled street leads eastward to a shop catering to the needs
of these adventurers. To the north, you see the lengthy Horizon Road.
]])
Then you will see (especially if you resize the window a bit) all that text. The "text" line lets you send multi-line text to appear that the nominated pixel onwards (horizontal 5, vertical 95 in this case).
So, you can append a few things together as required, with \r\n at the end of each line for a line break. The multi-line literal in Lua does that automatically for you.
For example:
udp ("text,5,95," ..
"blah blah\r\n" .. -- something
"lalalala I'm not listening\r\n" .. -- something else
GetUniqueID () -- something that changes
)
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| David Berthiaume
(202 posts) Bio
|
Date
| Reply #34 on Sat 18 Dec 2004 01:03 AM (UTC) Amended on Sat 18 Dec 2004 01:06 AM (UTC) by David Berthiaume
|
Message
| Well, a Scrolling Text window would basically be what I've been looking for for channel capturing... I know, Notepad works too but I don't like that way.
Basically, with this window it looks like what I'm looking for, if it could just scroll like the output window.
Anyways, So that's why. | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #35 on Sat 18 Dec 2004 02:05 AM (UTC) |
Message
| With the status bar window, if you have a comma in your text, then whatever is after the comma will not display (in the "text" section). This is because it uses a comma as a delimiter.
This could be worked around with a few changes, however for now, if your text has commas in it replace them with something else if possible (eg. replace-all comma with semicolon). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Natasi
(79 posts) Bio
|
Date
| Reply #36 on Tue 28 Dec 2004 06:11 PM (UTC) |
Message
| ok, I'm having some trouble with this. Iv'e dl'd both the http://www.gammon.com.au/files/utils/udpsend.zip and http://www.gammon.com.au/files/utils/statusbar.zip
, the statusbar coems up fine, but when I use the updsend prog, it just flashes a black screen real fast and that's all. I've unzipped both and tried to alter the IP source in the statusbar by hand but that didn't help. I've redone everything, reinstalled and everything to start over and still have problems. I've been trying to do this in VBscript and used the
function multiline_trigger (name, line, wildcards)
local function udp (msg)
UdpSend ("127.0.0.1", 4111, "m," .. msg)
end
udp ("title,Inventory")
udp ("size,10,10,300,300")
udp ("config,10,5,100,15,80,300,20")
udp ("font,Harem,12")
udp ("textcolour,0")
udp ("backcolour,14804223")
udp ("text,5,5," .. wildcards.inventory)
end -- function
part as a script and loaded it. It just gives me errors though and has no effect on the statusbar, Iv'e also tried setting up and alisa to send this information to script. I'm probally just doing this all wrong, so if anyone can help me through this I'd appreciate it. I'm completly lost now, so if someone can lead me through this....
Also, I've seen Zmud users with buttons and bitmaps used with information sent from variables to set these up. Is this basically the same thing? | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #37 on Tue 28 Dec 2004 06:42 PM (UTC) Amended on Tue 28 Dec 2004 09:00 PM (UTC) by Flannel
|
Message
| Well, you need to send the magic text when sending through UDP. So its m,title,Inventory
or whatever.
What errors?
That UDP program isn't required, its just a standalone UDP thing. MC has UDP capabilities built in.
Yes, that stuff should be sent to script, in either a script file, or from an alias/trigger (this one should be in a trigger, since it uses wildcards in the last line).
Oh, wait. No, in VB you need to ditch most of that stuff, and just use the UDPSend built in to MC:
UDPSend "127.0.0.1", 4111, "m,title,Inventory"
would be your first line, for instance.
If you wanted to make a subroutine (to take care of the IP, port, and magic text) you could do that.
sub udp(sSend)
UDPSend "127.0.0.1", 4111, "m," & sSend
end sub
Put that in your script file, then you can use those lines already (except the inventory one, for that you just substitute the wildcard). |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #38 on Tue 28 Dec 2004 08:01 PM (UTC) |
Message
|
Quote:
Also, I've seen Zmud users with buttons and bitmaps used with information sent from variables to set these up. Is this basically the same thing?
Yes, basically. I think zMUD has some of that built into the client, but this program illustrates how you can expand MUSHclient to add these sorts of things as stand-alone add-ons.
My original examples were in Lua, that should have been mentioned on the page somewhere. If you are not commited to VBscript you could switch your script language to Lua and then they should work unchanged. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #39 on Tue 28 Dec 2004 08:19 PM (UTC) Amended on Tue 28 Dec 2004 08:20 PM (UTC) by Flannel
|
Message
| Or put them in a plugin.
And yes, zMud has this sort of thing. Or at least it started with the capabilities to draw things and such, someone still had to code everything as a plugin. And it's capabilities are more limited than MCs currently (since you can only do what it has functions for, with MC you can do literally anything). There just isn't a plugin/program already built for MC. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Natasi
(79 posts) Bio
|
Date
| Reply #40 on Tue 28 Dec 2004 08:49 PM (UTC) |
Message
| ok, I set the following in an alias and had it send to script with the status bar up:
UdpSend "0.0.0.1", 4111, "m," .. msg
end
udp ("title,Inventory")
udp ("size,10,10,300,300")
udp ("config,10,5,100,15,80,300,20")
udp ("font,Harem,12")
udp ("textcolour,0")
udp ("backcolour,14804223")
and got this error:
Error number: -2146827263
Event: Execution of line 1 column 31
Description: Expected end of statement
Line in error:
UdpSend "0.0.0.1", 4111, "m," .. msg
Called by: Immediate execution
in the source for the status bar I have the IP set as 0.0.0.1
I'm just not getting this for some reason. I've tried other options aswell, taking out parts and adding and using the text found in hte contents file, but nothing changes the statusbar
| Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #41 on Tue 28 Dec 2004 09:04 PM (UTC) |
Message
| You need to have the IP be 127.0.0.1, since it references your own computer.
Youre using VBscript, so you have to rewrite a lot of that stuff to VBScript.
And I believe you need to put that subroutine in your main script file. Although I may be mistaken, it might be able to go in an alias. However it would make sense to put it in your main script, so other aliases/triggers can call it as well. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| Natasi
(79 posts) Bio
|
Date
| Reply #42 on Tue 28 Dec 2004 09:31 PM (UTC) |
Message
| Ok, Flannel walked me through this and it's fixed, but still having problems seeing any text when written and sent to the statusbar | Top |
|
Posted by
| Luowei98
China (7 posts) Bio
|
Date
| Reply #43 on Wed 03 Oct 2007 01:49 AM (UTC) |
Message
| hi, nick.
status is good job. and i want to load it at the OnPluginInstall function.
how can i do it? | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #44 on Wed 03 Oct 2007 09:08 PM (UTC) |
Message
| Which part are you asking about? To start up the status bar window your plugin would probably need to do os.execute (in Lua) to start the program running. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
172,085 views.
This is page 3, subject is 4 pages long:
1
2
3 4
It is now over 60 days since the last post. This thread is closed.
Refresh page
top