Multi Timebot
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Multi Timebot

Started by Roy, 15 October, 2003, 22:43:56

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Roy

Wondering if anyone can translate this cool script by Gadget into a LUA one. And that it shows all the different times on every hour in main :)  if this can be done it would be great, i think many would love such a script.

Roy


'Time&Date by Gadget
Dim sBotName,bShowTimeOnLogon,iShowTimeOnMainInterval,iTicker

Sub Main
  sBotName="Timekeeper"
  bShowTimeOnLogon=True
  iShowTimeOnMainInterval=0 '<- In minutes, 0=Disabled
  tmrScriptTimer.Interval = 60000
  tmrScriptTimer.Enabled = True
  iTicker=iShowTimeOnMainInterval
End Sub

Sub NewUserConnected(curUser)
  curUser.PrivateMessage cStr(sBotName),CStr("Welcome to "+frmHub.txtName+vbCrLf+DZ+" "+TZ(True)+vbCrLf+"If you need the time just type +time in main and if you need date just type +date in main")
End Sub

Sub OpConnected(curUser)
  Call NewUserConnected(curUser)
End Sub

Sub tmrScriptTimer_Timer()
  iTicker=iTicker+1
  If iTicker>iShowTimeOnMainInterval Then
    iTicker=0
    If iShowTimeOnMainInterval>0 Then
      colUsers.SendChatToAll cStr(sBotName),CStr(TZ(False))
    End If
  End If
End Sub

Sub DataArival(curUser,sCurData)
  If Left(sCurData,1)="<" Then
    If LCase(Right(sCurData,7))="> +time" Then
      colUsers.SendChatToAll cStr(sBotName),CStr(TZ(True))
    End If
    If LCase(Right(sCurData,7))="> +date" Then
      colUsers.SendChatToAll cStr(sBotName),CStr(DZ)
    End If
  End If
End Sub

Function TZ(bLong)
  Set wshShell=CreateObject("WScript.Shell")
  iBias=wshShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias")
  sTZ=CStr(Abs(iBias)Mod 60)
  If Len(sTZ)<2 Then sTZ=CStr(Int(Abs(iBias)/60))+":0"+sTZ Else sTZ=CStr(Int(Abs(iBias)/60))+":"+sTZ
  If iBias>0 Then sTZ="-"+sTZ Else sTZ="+"+sTZ
  TZ=TZ+"Time in hub is now "+FormatDateTime(Now,vbShortTime)+" ("+sTZ+" GMT)."
  If bLong Then
    TZ=TZ+vbCrLF+"Time is now "
    TZ=TZ+FormatDateTime(DateAdd("n",iBias+12*60,Now),vbShortTime)+" in Fiji, "
    TZ=TZ+FormatDateTime(DateAdd("n",iBias+9*60,Now),vbShortTime)+" in Tokyo, "
    TZ=TZ+FormatDateTime(DateAdd("n",iBias+10*60,Now),vbShortTime)+" in Sydney, "
    TZ=TZ+FormatDateTime(DateAdd("n",iBias+4*60,Now),vbShortTime)+" in Moscow, "
    TZ=TZ+FormatDateTime(DateAdd("n",iBias+1*60,Now),vbShortTime)+" in London, "
    TZ=TZ+FormatDateTime(DateAdd("n",iBias-5*60,Now),vbShortTime)+" in Jamaica, "
    TZ=TZ+FormatDateTime(DateAdd("n",iBias-6*60,Now),vbShortTime)+" in Middle America and "
    TZ=TZ+FormatDateTime(DateAdd("n",iBias+2*60,Now),vbShortTime)+" in Oslo."
  End If
End Function

Function DZ
  DZ="Today is "+FormatDateTime(Now,vbLongDate)+"."
End Function

pHaTTy

can you edit it and put
code here

like that plzz otherwise i cant read it properly, confiusing :)



-phatty
Resistance is futile!

[NL]Pur

phatty is script won't run in ptokax since it's vb ;)

pHaTTy

i know i just like to read the code ;)
Resistance is futile!

SMF spam blocked by CleanTalk