ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: JFSF on September 16, 2017, 07:37:16 AM

Title: Getting time and using it in a menu
Post by: JFSF on September 16, 2017, 07:37:16 AM
sub time
set %AMPM AM
set %d1 %1 / 1 % 10
set %d2 %1 / 10 % 10
set %d3 %1 / 100 % 10
set %d4 %1 / 1000 % 10
set %d5 %1 / 10000 % 10
set %d6 %1 / 100000 % 10
set %tempampm %d6 , %d5
if %tempampm > 12 && %2 = 12
  {
  set %AMPM PM
  set %tempampm %tempampm - 12
  }
if %2 = 12
  return %tempampm , : , %d4 , %d3 , : , %d2 , %d1 , #SPC , %AMPM
return %tempampm , : , %d4 , %d3 , : , %d2 , %d1

gosub time #time 12 <------ this is how the sub is called. I get #time will return the computer local time, but im missing what the (12) is for

This is a sub from an old idoc timing script. Im writing my own and was using this to learn a few things from. I got it about all done other that the time part. I dont understand any of this sub. I searched the forums on time as in actual time and found very little information so was hoping that someone could maybe explain this by each line. Thanks
Title: Re: Getting time and using it in a menu
Post by: The Ghost on September 16, 2017, 07:40:31 AM
TM have few Script that use time.   You can also at Raz's  Bushido training. 
Title: Re: Getting time and using it in a menu
Post by: JFSF on September 16, 2017, 07:43:45 AM
I will start looking there. I searched and came up with over 800 pages lol I stopped after about 40 when I didnt find anything useful. This narrows it down. Thanks
Title: Re: Getting time and using it in a menu
Post by: The Ghost on September 16, 2017, 07:45:50 AM
You are on the right track.  Search, and read lot and lot of page. 
Title: Re: Getting time and using it in a menu
Post by: JFSF on September 16, 2017, 04:50:36 PM
Ok I'm still struggling to figure out what is happening in this sub or any other time based sub I've found so far. Can anyone dumb this down to my level?
Title: Re: Getting time and using it in a menu
Post by: Burnhazel88 on October 18, 2017, 02:22:27 AM
You still messing with time or you get it all sorted?