Author Topic: "d" and "w" suffixes for time related arguments (i.e. ban length)  (Read 4078 times)

0 Members and 1 Guest are viewing this topic.

Offline lavacano201014

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 9
  • Archbishop of Cristina Scabbia worship
So instead of having to calculate 60 * 24 * 3 for a 3 day ban, I can just input "3d" as the time.

Soon as ULib and ULX SVNs update I'll try to find the relevant part in the code and make a diff file. Done. Download from here, the forum software apparently refuses to accept the file as an attachment.

It's a TortoiseSVN patch, but it looks like `patch -p0 timesuffix.patch` would apply it on a *NIX system as well.

er, doy - I accidentally broke the permanently text - I set it so minutes is expected as a string but then I didn't keep the rest of my changes consistent. Either unstring it or switch the variable checked to "timearg" there. fixed this later on
« Last Edit: September 04, 2011, 04:15:13 PM by lavacano201014 »
Circle reasoning works because circle reasoning works because...

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: "d" and "w" suffixes for time related arguments (i.e. ban length)
« Reply #1 on: August 29, 2011, 07:12:17 PM »
Thanks!

Could have sworn we'd done something like this already.
Maybe I'd just mentioned wanting it.
Past few years are a blur. :)

Good to see you around again lavacano.
With spbogie not lurking as much either, maybe a Gmod revival is occuring.
Heck, I love UDodge..it and the ULib update release alone brought me back and updated Gmod.
I look forward to the smell of burniing idea brain cells.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline lavacano201014

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 9
  • Archbishop of Cristina Scabbia worship
Re: "d" and "w" suffixes for time related arguments (i.e. ban length)
« Reply #2 on: September 04, 2011, 03:42:43 PM »
I updated the patch (same download link). All I did was underp the permanently text and apply it to banid as well.

You guys probably did that already but hey you never know.
Circle reasoning works because circle reasoning works because...

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: "d" and "w" suffixes for time related arguments (i.e. ban length)
« Reply #3 on: September 04, 2011, 03:56:16 PM »
Mind if I code something similar to this into ULX proper, lavacano? I'll give you credit in the changelog. :)
Experiencing God's grace one day at a time.

Offline lavacano201014

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 9
  • Archbishop of Cristina Scabbia worship
Re: "d" and "w" suffixes for time related arguments (i.e. ban length)
« Reply #4 on: September 04, 2011, 04:10:59 PM »
Mind if I code something similar to this into ULX proper, lavacano? I'll give you credit in the changelog. :)

Sure.

Heck, go ahead and just outright use my patch if you like. That's what it's there for :)
Circle reasoning works because circle reasoning works because...

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: "d" and "w" suffixes for time related arguments (i.e. ban length)
« Reply #5 on: September 22, 2011, 01:18:19 AM »
Implemented in rev 188. :)

Sorry lavacano201014, didn't use your patch. I wanted something a little more robust and general purpose. :)
Experiencing God's grace one day at a time.