Author Topic: CCT  (Read 734 times)

ArticWolve

  • Global Moderators
  • Hero Member
  • *****
  • Posts: 636
    • View Profile
    • http://
CCT
« on: December 07, 2008, 06:50:11 AM »
The is the second of several scripts in the Public Commands Series by Shadow. When CTime is spoken, it will return the current time on the computer. Can be used only once every 5 minutes to prevent spam.
Code: [Select]
'CCTime
'1.0
'& Current Computer Time:Shadow:Returns the current time on the bot.
'& CCTime

Sub CCTime_Event_Load()

  AddChat VBOrange, "Current Computer Time Script by Shadow is loaded."
  TimerEnabled "CCTime", "TimeReset", False
  TimerInterval "CCTime", "TimeReset", 300
  SetSetting "CCTime", "Time", True, "", True

End Sub

Sub CCTime_Event_Usertalk(Username, Flags, Message, Ping)

h = hour(Time)
m = minute(Time)
s = second(Time)

  If LCase(Message) = LCase("CTime") Then
    If GetSetting("CCTime", "Time") Then
      SetSetting "CCTime", "Time", False, "", True
      '// This is the line that returns the time (below). Edit it how you want to display the Current Time: h = Hour; m = Minutes; s = Seconds. Remember to use & ":" & between them.
      AddQ "The current time on this computer is: " & h & ":" & m & ":" & s
      TimerEnabled "CCTime", "TimeReset", True
    Else
      Exit Sub
    End If
  End If

End Sub

Sub CCTime_TimeReset_Timer()

  TimerEnabled "CCTime", "TimeReset", False
  SetSetting "CCTime", "Time", True, "", True

End Sub
« Last Edit: December 07, 2008, 06:51:04 AM by Shadow »
Quote
Darker then the darkest shade of night...
    A Rebel at heart... A criminal by mind
    All in the eyes of the beholder... is the truth to life
    But Th---The Only---The One and Only True Master of Death is the Reaper itself
[/color]
[/color]
[div align=\'center\'][img]http://img261.imageshack.us/img261/9411/mydesktopce6.jpg\" border=\"0\" class=\"linked-sig-image\" /][img]http://www.danasoft.com/sig/238153.jpg\" border=\"0\" class=\"linked-sig-image\" /][/div]                     [div align=\'center\']    Click ME for my forums. You know you want to click ME. Come on CLICK ME DAMN IT! But don't click THIS!![/div]

Reason

  • Global Moderators
  • Full Member
  • ***
  • Posts: 193
    • View Profile
    • http://Rev77.net/FailBot/latest.zip
CCT
« Reply #1 on: December 07, 2008, 04:22:37 PM »
... just use "& Format(Time, "hh:mm:ss") heres a guide
Code: [Select]
C
Display the date as ddddd and display the time as t t t t t, in that order. Display only date information if there is no fractional part to the date serial number; display only time information if there is no integer portion.
d
Display the day as a number without a leading zero (1 - 31).
dd
Display the day as a number with a leading zero (01 - 31).
ddd
Display the day as an abbreviation (Sun - Sat).
dddd
Display the day as a full name (Sunday - Saturday).
ddddd
Display the date as a complete date (including day, month, and year), formatted according to your system's short date format setting. The default short date format is m/d/yy.
dddddd
Display a date serial number as a complete date (including day, month, and year) formatted according to the long date setting recognized by your system. The default long date format is mmmm dd, yyyy.
w
Display the day of the week as a number (1 for Sunday through 7 for Saturday).
ww
Display the week of the year as a number (1 - 53).
m
Display the month as a number without a leading zero (1 - 12). If m immediately follows h or hh, the minute rather than the month is displayed.
mm
Display the month as a number with a leading zero (01 - 12). If m immediately follows h or hh, the minute rather than the month is displayed.
mmm
Display the month as an abbreviation (Jan - Dec).
mmmm
Display the month as a full month name (January - December).
q
Display the quarter of the year as a number (1 - 4).
y
Display the day of the year as a number (1 - 366).
yy
Display the year as a 2-digit number (00 - 99).
yyyy
Display the year as a 4-digit number (100 - 9999).
h
Display the hour as a number without leading zeros (0 - 23).
hh
Display the hour as a number with leading zeros (00 - 23).
n
Display the minute as a number without leading zeros (0 - 59).
nn
Display the minute as a number with leading zeros (00 - 59).
s
Display the second as a number without leading zeros (0 - 59).
ss
Display the second as a number with leading zeros (00 - 59).
t t t t t
Display a time as a complete time (including hour, minute, and second), formatted using the time separator defined by the time format recognized by your system. A leading zero is displayed if the leading zero option is selected and the time is before 10:00 A.M. or P.M. The default time format is h:mm:ss.
AM/PM
Use the 12-hour clock and display an uppercase AM with any hour before noon; display an uppercase PM with any hour between noon and 11:59 P.M.
am/pm
Use the 12-hour clock and display a lowercase AM with any hour before noon; display a lowercase PM with any hour between noon and 11:59 P.M.
A/P
Use the 12-hour clock and display an uppercase A with any hour before noon; display an uppercase P with any hour between noon and 11:59 P.M.
a/p
Use the 12-hour clock and display a lowercase A with any hour before noon; display a lowercase P with any hour between noon and 11:59 P.M.
AMPM
Use the 12-hour clock and display the AM string literal as defined by your system with any hour before noon; display the PM string literal as defined by your system with any hour between noon and 11:59 P.M. AMPM can be either uppercase or lowercase, but the case of the string displayed matches the string as defined by your system settings. The default format is AM/PM.
Quote
04:37:18 PM | ?Swamp_Demon15@Azeroth? make me 1..?
04:37:28 PM | ?MikeA@Azeroth? can you code in VB6, lol?
04:37:47 PM | ?MikeA@Azeroth? And do you know how to have sex while hanging from your little toe?
04:38:01 PM | ?MikeA@Azeroth? If no to either, I'm sorry, we can't take you.
04:38:11 PM | ?MikeA@Azeroth? Joel taught us all the second one.