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.
'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