Author Topic: AutoPromote: The Continuation  (Read 19994 times)

0 Members and 1 Guest are viewing this topic.

Offline emilhem

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
AutoPromote: The Continuation
« on: June 26, 2013, 11:24:15 AM »
AutoPromote is a lightweight UTime-integrated alternative to other promotion systems such as APromotion.

Since it has been forever since the last developer of AutoPromote gave it up, I fixed it and created a new topic for it.
Original topic

Feature suggestions are accepted but I can't promise anything. I might take on AutoPromote XGUI soon though.

FAQ:
Code: [Select]
Q: What is AutoPromote?
A: AutoPromote automatically promotes players to different groups based on their time on the server.

Q: Requirements for AutoPromote?
A: AutoPromote requires ULX, ULib, and UTime!

Q: How do I set different groups to be promoted?
A: In the file lua/ulx/modules/sh/autopromote.lua you can add/change groups in the promotes array at the top.
This is the format: { hours = [The amount of hours a player need to level up], group = "[Groupname CASE SENSITIVE!]", name = "[Name to be displayed when player is promoted]" }
Example: { hours = 5, group = "Regular", name = "Regular" }

Changelog:
Code: [Select]
Version 4.1 (2013-06-25)
Released by Emilhem
*It really works now with Garry's Mod 13!
*Added more documentation in code how to not "create" the unlimited promotion "bug".
*Added the option to disable sound while keeping the effects turned on. And you can do the opposite as well.
*Added console message when player joins that says how many hours he/she's been on.
*Changed folder and file names to lowcaps to make it easier to administer on GNU/Linux OS's.

----------------------

Version 4.0
Released by Emilhem
*Works with Garry's Mod 13!

----------------------

Version 3.2
Released by Smithy
*Fixed a pretty major flaw in the code, where it would only exclude the last group in the excludes table.

----------------------
Version 3.1
Released by HOLOGRAPHICpizza
*Now loads as a ULX module.
*Calls ULX promote function directly, instead of through a console command.

----------------------
Version 3.0
Released by Smithy
*Fixed and simplified code, almost a complete rewrite (based on V2)
*Added chat notifications for when you get promoted.

----------------------
Version 2.0
Released by Major_Pain
*Fixed code
*Almost complete rewrite

---------------------
Version 1.0
Released by HOLOGRAPHICpizza
*Initial release
*Autopromotion based on UTime, groups and times defined in the script

License:
Code: [Select]
The MIT License

Copyright (c) 2009 Michael Craft (HOLOGRAPHICpizza)
Copyright (c) 2009 Major_Pain
Copyright (c) 2009 Smithy
Copyright (c) 2013 Emil Hemdal (Emilhem)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

You need to be signed in to see the attachment!
« Last Edit: July 04, 2013, 11:43:14 PM by emilhem »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: re: AutoPromote: The Continuation
« Reply #1 on: June 26, 2013, 02:01:17 PM »
Continuum
:P
Go ahead and work on XGUI too.
They'll go hand in hand.
"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: 6214
  • Karma: 394
  • Project Lead
Re: re: AutoPromote: The Continuation
« Reply #2 on: June 26, 2013, 02:42:25 PM »
Well done!
Experiencing God's grace one day at a time.

Offline sabo

  • Full Member
  • ***
  • Posts: 136
  • Karma: 2
  • Hello :)
    • The Elite Gaming
Re: re: AutoPromote: The Continuation
« Reply #3 on: June 27, 2013, 06:48:06 AM »
I am not sure if the Exmaple is correct:

Code: [Select]
Example: { hours = 5, group = "Regular", name = "Regular" }
It says group = "Regular"

Note the capital R.

Since groups are case sensitive wouldnt all groups be small letters in ULX or am I missing something O.o

Also cookies to you! I will be trying this out and see if it works with my Scoreboard Rank Bar :o

Offline emilhem

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
Re: re: AutoPromote: The Continuation
« Reply #4 on: June 27, 2013, 12:35:37 PM »
I am not sure if the Exmaple is correct:

Code: [Select]
Example: { hours = 5, group = "Regular", name = "Regular" }
It says group = "Regular"

Note the capital R.

Since groups are case sensitive wouldnt all groups be small letters in ULX or am I missing something O.o

Also cookies to you! I will be trying this out and see if it works with my Scoreboard Rank Bar :o

I've tested it. Apparently it is case sensitive. I tried with a group called "captain" and it promoted me but it continued every 15 seconds and the promotion didn't stick till the next time I joined! Then I tried with "Captain" and it worked as it should. Could anyone confirm that I'm right or that it does as it is supposed to? I should be since I've done extensive testing with a friend.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: re: AutoPromote: The Continuation
« Reply #5 on: June 27, 2013, 04:26:50 PM »
Always use lower case when it comes to groups in Gmod and ULib.
Teams can be mixed case.
We've written our parser, and commands to modify user input, for groups in lower case.
We have seen some space and case input issues with XGUI, but I thought Stickly/Megiddo had corrected those.
« Last Edit: June 27, 2013, 04:29:11 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline emilhem

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
Re: re: AutoPromote: The Continuation
« Reply #6 on: June 29, 2013, 04:28:46 PM »
Always use lower case when it comes to groups in Gmod and ULib.
Teams can be mixed case.
We've written our parser, and commands to modify user input, for groups in lower case.
We have seen some space and case input issues with XGUI, but I thought Stickly/Megiddo had corrected those.
We did add the groups in XGUI when we tested it. Haven't gotten around to test it again though.

Offline //AG// Not Me

  • Newbie
  • *
  • Posts: 11
  • Karma: 1
Re: re: AutoPromote: The Continuation
« Reply #7 on: July 04, 2013, 04:47:29 AM »
could anyone tell me whats wrong with this? i cant seem to get auto promote to work.
promotes = {
      { hours = 1, group = "starter", name = "Starter" },
      { hours = 3, group = "builder", name = "Builder" },
      { hours = 8, group = "regular", name = "Regular" },
      { hours = 15, group = "respected", name = "Respected" },
      { hours = 24
, group = "member", name = "Member" }
,      { hours = 48, group = "senior", name = "Senior" },
      { hours = 100, group = "alty", name = "Alty" },
      { hours = 300, group = "alty As ", name = "Alty As " }

---------IF A PLAYER IS A MEMBER OF THESE GROUPS THEY WONT GET PROMOTED.......EVER
-- Same here as the previous group names
excludes = { "admin", "superadmin", "Owner", "owner" } -- I have both Owner and owner in case you would end up capping the owner group.


Offline //AG// Not Me

  • Newbie
  • *
  • Posts: 11
  • Karma: 1
Re: re: AutoPromote: The Continuation
« Reply #8 on: July 04, 2013, 11:15:12 AM »
so has anyone tested what works?

Offline emilhem

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
Re: re: AutoPromote: The Continuation
« Reply #9 on: July 04, 2013, 11:17:48 AM »
so has anyone tested what works?
Of course it works. :P

The test is just a potential XGUI bug. Just make sure to type your groups in lower-case when you create them.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: re: AutoPromote: The Continuation
« Reply #10 on: July 04, 2013, 11:18:16 AM »
Please post this in the autopromote thread, as autopromote isn't officially supported by Team Ulysses (though we're very happy it exists!).
Experiencing God's grace one day at a time.

Offline //AG// Not Me

  • Newbie
  • *
  • Posts: 11
  • Karma: 1
Re: re: AutoPromote: The Continuation
« Reply #11 on: July 04, 2013, 11:29:35 AM »
ohk, thank you  :D, but regarding your example:  hours = 5, group = "Regular", name = "Regular", would i do this instead:  hours = 5, group = "regular", name = "regular"

Offline emilhem

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
Re: re: AutoPromote: The Continuation
« Reply #12 on: July 04, 2013, 11:32:29 AM »
ohk, thank you  :D, but regarding your example:  hours = 5, group = "Regular", name = "Regular", would i do this instead:  hours = 5, group = "regular", name = "regular"
I've tested it. Apparently it is case sensitive. I tried with a group called "captain" and it promoted me but it continued every 15 seconds and the promotion didn't stick till the next time I joined! Then I tried with "Captain" and it worked as it should. Could anyone confirm that I'm right or that it does as it is supposed to? I should be since I've done extensive testing with a friend.

That is the potential XGUI bug.

If you try AutoPromote out please don't hesitate to comment in this forum if it's not working as intended.

Also if it works for you please leave a thanks or just say that it works.

Offline //AG// Not Me

  • Newbie
  • *
  • Posts: 11
  • Karma: 1
Re: re: AutoPromote: The Continuation
« Reply #13 on: July 04, 2013, 12:56:09 PM »
thank u so much! it works!!  ;D

Offline Epsilon

  • Newbie
  • *
  • Posts: 19
  • Karma: -1
Re: AutoPromote: The Continuation
« Reply #14 on: August 04, 2013, 12:23:48 AM »
I don't suppose there would be a way to supplement this with some manner of progress bar to indicate when the next rank will be achieved? I think that would be a pretty useful feature, considering a lot of people ask when the next rank up is.