Author Topic: [BROKEN] UMotd Revived - Motd and OTHER informational screens.  (Read 55464 times)

0 Members and 4 Guests are viewing this topic.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
This mod was broken by garry's updates and currently does not work!



Introducing Umotd Revived - Ulysses Message Of The Day Revived

Want a message of the day server intro screen like days of old?
Want a way for your server visitors to see help, rules or other informative screens you create?

Then Umotd is the release for you!


NOTICE! This release requires ULib 2+
Get the latest version of ULib from the download link at http://www.ulyssesmod.net
This release does not require you to use ULX, just ULib

Features
- Display HTML or text (File must still be named .txt)
- Enable/Disable whether or not players see a motd when joining your server. They will still be able to run the commands in game from console or chat.
- Configure which screen appears when players join your server.
- Multi-command, Multi-file support. A configurable table allows you to add your own command and associated file. Defaults to !motd, !helpme, !serverinfo and !rules, but you're not limited to just those!
- Configure what character opens the command from chat. Defaults to !, but you could switch to /, \, or any that you may wish.
- Can run with or without ULX. By default, attempts to disable/override ULX motd command.
- ULX support - If you use ULX, Umotd will add a "Informational" category to "ulx help", and add autocomplete "ulx <command>" listings.
- Dynamic variables allow text/html to fill in with information. (See Umotd_readme.txt)
- Configure where files load from ... they can load from gmod/data if you wish.
- URL display - Will attempt to load a page if you give a URL instead of a file name in the config. (No dynamic variables supported) (New as of SVN revision 10 (v2.A6)
- Plays one of six random sounds at screen show.

Quick instructions
- If you don't know how to use/get SVN code...see our tutorials in the SVN release
- Create a Umotd_Revived folder in your server/garrysmod/addons.
- Use checkout on that folder using SVN information provided below.
- Read the garrysmod\addons\Umotd_revived\Umotd_readme.txt file, it contains more detailed instructions.
- Start your server
- Enjoy

Notes
- This attempts to disable ULX 3+ motd function if you use ULX.
- Correctly guess the secret meanings behind the rule numbers in the default motd_template.txt, and get a permanent credit in the main lua and readme file.
  (I judge winners on any basis I wish)

Known Issues
- Currently only detects SuperAdmin and Admin as %curadmins%
- Locks client when links are included and clicked. Unknown bug. I can't figure out why (ULX does this too) Fixed in 2.A1
- %maxsents% returns blank when used. I've left it in the code and my info_template.txt anyway. Hope Garry adds it back (he removed it 3/31/08 Gmod release)

Again, this requires ULib 2 or higher.

(Not So)FAQS
Q. Why didn't you use the default source "motdfile" location variable"
A. 1) Easier file management. 2) You can change where files are stored by default. See readme for where to edit.

Q. Why can't I name my files .htm or .html? This would make it easier to track what file type it is for me.
A. Source API Limitation. Will only read files named .txt

Q. Why don't scroll bars appear correctly?
A. Source API Limitation. Something about memory usage increase/leaks. Removed by Source until fixed.

I'll be keeping a running changelog here of the past few changes per SVN commit.
If you don't see an older change here, look in my changelog.txt
Code: [Select]
-[Version 2.A6 - 5/00/08]
          [Change] HTTP in A5 removed, placed on Client side. Garry's http.Get is buggy, more so than a hound dog travelling flea circus.
                   No dynamic variables when URLs are given due to this.
-[Version 2.A4 - 4/00/08]
          [Added] If motdfile points to root, and no motd file is in root gmod directory, loads template instead of TF2 default motd.
          [Added] Added %maptime_short%, %maptime_long%, %maptime_secs%. Gives time since map load in 3 different formats.
          [Added] Map time explanations to Umotd_readme.txt
          [Added] Map time demonstration to data/Umotd/info_template.txt
          [Change] Optimized math of uptime(used in map and server uptime)
-[Version 2.A3 - 4/21/08]
 ULX module added - ULX NOT required. This just adds the Umotd functions to "ulx help" if you have ULX installed.

Current Version: 2 ALPHA #?
DOWNLOAD: SVN Only - http://ulyssesmod.net/Umotd/trunk/
SVN username : pass = anonsvn : anonsvn

Do not upload any SVN you download to any website, as Umotd will be changing frequently over the next few weeks/months.
Report bugs. Don't just come here and say "It doesn't work". Provide detail. Error messages. Who, what, where, when, why, and how.
« Last Edit: June 21, 2009, 09:48:59 AM by Megiddo »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #1 on: April 12, 2008, 11:34:03 PM »
Note to all who download, though I don't expect this to crash your server, it is pretty rough around the edges, and doesn't include a feature or two (or the features it does aren't as robust) I'd wanted in it.
Consider this alpha code.
I'm not posting it to Facepunch until I get some feedback on it, polish it up a bit.
If you think of any more dynamic variables you'd like to see, let me know. Perhaps I'll add them
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #2 on: April 12, 2008, 11:56:15 PM »
Good work JamminR! :D
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #3 on: April 16, 2008, 09:05:30 PM »
I've placed this on our UHQ gmod server.
It worked fine for me. However, another person, who'd never loaded it before, had trouble with it.
He'd also been having trouble with ULX autocomplete usermessage errors too though. This seems to be a pattern for some as of late.
I have no idea what's causing it.

Edit (spbogie): Fixed your typo
« Last Edit: April 17, 2008, 03:01:35 PM by spbogie »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Typo001

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
    • My (Personal) Site
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #4 on: April 17, 2008, 02:35:05 PM »
Thank You, I could never get the it to work right. It works for me, but could you tell me which file it shows when you first get on the server, I can not find that for some reason. I have eddited all of them and I am still seeing the basic rules.

Offline blacksythe

  • Newbie
  • *
  • Posts: 38
  • Karma: -1
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #5 on: April 17, 2008, 02:45:42 PM »
delete the team fortress motd and it should fix a few problems

As html is now usable would it be possible to set this up to stream it from a website. I know you have probably been asked this 100 times

perhaps a suggestion for a future version.
« Last Edit: April 17, 2008, 02:48:51 PM by blacksythe »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #6 on: April 17, 2008, 03:36:22 PM »
Thank You, I could never get the it to work right. It works for me, but could you tell me which file it shows when you first get on the server, I can not find that for some reason. I have eddited all of them and I am still seeing the basic rules.

I believe I made the Umotd_readme file, mentioned in the original post "Quick Instructions", "usage" section very clear. That section points to another file which I also believe I commented well.
If you believe I could make either one clearer, please suggest how.

{edit - corrected readme file name}
« Last Edit: April 17, 2008, 08:15:06 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #7 on: April 17, 2008, 03:39:04 PM »
I fixed the link crash problem in ULX Jam. Talk to me if you want further details. :)
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #8 on: April 17, 2008, 08:06:33 PM »
would it be possible to set this up to stream it from a website.

perhaps a suggestion for a future version.

Give a bit more detail as to what you mean?
Do you mean instead of displaying a local file, display a site from the web such as "sv_welcomemessage" used to do when joining a server?
That gets a bit more than I intended, but this could do just about anything that Source html allowed for.

Also, all, ulx motd allowed for html too. My html addition isn't new, the main feature this adds are multiple file support and dynamic variables.

I've updated the script to fix linking (thanks to Megiddo), and add links to addons if the author included them.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #9 on: April 18, 2008, 08:51:19 PM »
I've been working some Umotd code tonight. I HAVE NOT uploaded it here at this time.
If ULX is installed, Umotd will now attempt to create a "informational" category in ULX help, and displays the following (defaults are shown, any you edit/create would appear)

Category: Informational
   o serverinfo  - Shows the serverinfo screen using Umotd (say:!serverinfo)
   o motd  - Shows the motd screen using Umotd (say:!motd)
   o helpme  - Shows the helpme screen using Umotd (say:!helpme)
   o rules  - Shows the rules screen using Umotd (say:!rules)

Again, ULX is not required...this just attempts to add it if ULX is installed.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #10 on: April 21, 2008, 01:31:46 PM »
This is now released to the public at large here at Ulysses forums through SVN. See information in original post.
Do not upload any SVN you download to any website, as Umotd will be changing frequently over the next few weeks/months.
At some point in time, I'll be posting a 'release' to Facepunch and here.

Biggest change as of this moment since I went SVN is that the ULX code to add to menus has now been placed in it's own ULX module, and (I believe) is more reliable about adding to those menus.

Report bugs. Don't just come here and say "It doesn't work". Provide detail. Error messages. Who, what, where, when, why, and how.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Kingtendo

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #11 on: April 26, 2008, 10:07:25 AM »
Does it support transparent PNG's and/or GIF's ?

Offline Marlamin

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #12 on: April 26, 2008, 10:21:58 AM »
Yes! It works perfectly! Though I'm not a HTML expert at all, I made a pretty nice MOTD. (I think.)

I was wondering, I have a huge list of addons with download links behind them in my MOTD so people can download all important addons immediatly. Though is there any chance of this:

(Example)

www.google.com

being automaticly parsed to:

<A HREF="www.google.com">[/url]

So people can click those links?

Since running through that hole block of HTML (I copied it from my clan's forums. To my surprise it works.) and adding <A HREF="URL"> tag's to every link I come by is a bit to much for me.

But still, this addon rocks. Can't wait to see what the future brings!!


Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #13 on: April 26, 2008, 11:20:48 AM »
Does it support transparent PNG's and/or GIF's ?
This uses GMod html interperter, which uses Source html interpreter, which (loosely) uses Internet Explorer from your machine.
I believe GIF is used, unsure of PNG.

Though is there any chance of this:
<snip>
adding <A HREF="URL"> tag's to every link I come by is a bit to much for me.
<snip>

Marlamin, Very little. Though possible, this would add unnecessary time parsing the files that are read and looking for %blah%
I'm already trying to figure out ways to optimize the dynamic replacement loop, and feel that the actual html coder should do any linking.
You might be interested in using %addons_long% in a !addons page you make or something. See my current version !serverinfo (or Umotd serverinfo from console), which has a section showing %addons_blah% which loops through addons.
Any addons in which the author included an "author_url" in the info.txt of the addon gets linked. Though, unfortunately, not many authors seem to use that.
« Last Edit: April 26, 2008, 11:22:19 AM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: UMotd Revived - Motd and OTHER informational screens.
« Reply #14 on: April 26, 2008, 11:27:53 AM »
We use a .PNG image in our MOTDs so I can confirm support for .png files.