Author Topic: Calendar Script  (Read 3908 times)

zubpe

  • Newbie
  • *
  • Posts: 25
    • View Profile
Calendar Script
« Reply #15 on: October 21, 2008, 11:57:50 AM »
Hmm. I don't know what's wrong, maybe I'm the one doing it wrong. But I can't seem to make it work.

I loaded the plugin joined the channel and without even announcing anything it whispered me directly: "Date entry for:"

Anyways, I continued and whispered the bot .announce 21/10/2008 Hello.

Afterwards I rejoined the channel and nothing happened. I didn't get the whisper-

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Calendar Script
« Reply #16 on: October 21, 2008, 12:01:47 PM »
Hm, you may still have a calendar.ini file in your stealthbot folder. Delete it, and try again.

the date format would be 10/21/2008, not 21/10/2008.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

zubpe

  • Newbie
  • *
  • Posts: 25
    • View Profile
Calendar Script
« Reply #17 on: October 22, 2008, 07:07:54 AM »
Ah I see  It works now, and I like that it actually doesn't "spam". But only say it once, that's nice.

Though one thing that could be nice to change would be the..  "Date Entry For: bla bla bla"

If you just could remove something in the whisper you recieve: "Date Entry For:" this part, then it would be great.

So basically, instead of receiving the part "Date Entry For:" and afterwards the actual message, it would be much better (in my opinion) if it just replaced the part "Date Entry For:" with the date it's set for and afterwards the actual message.

So something like this: 10/22/2008: AND THE ACTUAL MESSAGE - HELLO D:


Btw, just one last note, could the date thingy possibly be changed to 22/10/2008 (day/month/year) instead of 10/22/2008 (month/day/year)

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Calendar Script
« Reply #18 on: October 23, 2008, 12:20:38 AM »
Please note that this version will only work with the new date format you specified: 23/10/2008.

If any of you who do not want this format, then get the code to this plugin from my previous post where I posted it. Don't come to me and tell me that it does not work.

Access changed to 100, like you requested

Code: [Select]
'cs
'110.2
'&Calendar Script:Vector

Const CS_Ver = "0.2"

Public CS_File
CS_File = BotPath() & "calendar.ini"

Const CS_acc = 100

Sub cs_Event_Load()
  AddChat vbGreen, "Vector's Calendar Script v" & CS_Ver & " Loaded"
End Sub

Sub cs_Event_WhisperFromUser(Username, Flags, Message)
  If Not Left(Message, Len(BotVars.Trigger)) = BotVars.Trigger Then Exit Sub

  GetDBEntry Username, a, f
  if a < CS_Acc Then Exit Sub

  cmd = Split(Mid(Trim(Message), Len(BotVars.Trigger) + 1), " ")
  If Lcase(cmd(0)) <> "announce" Then Exit Sub
  uDate = Ubound(Split(cmd(1), "/"))

  If uDate <> 2 Then
    mDate = Split(Date, "/")(0)
    dDate = Split(Date, "/")(1)
    yDate = Split(Date, "/")(2)
    fDate = dDate & "/" & mDate & "/" & yDate

    AddQ "/w " & PsD2 & Username & " Incorrect date format. Example: " & fDate
    Exit Sub
  End If

  splitDAte = Split(cmd(1), "/")

  tempDay = splitDate(0)
  tempMonth = splitDate(1)

  setDate = tempDay & "/" & tempMonth & "/" & Split(Date(), "/")(2)

  setNotification = Split(message, cmd(1) & " ")(1)

  getDateList = GetConfigEntry("datelist", "list", CS_File)

  If getDateList <> "" Then
    WriteConfigEntry "datelist", "list", getDateList & ", " & setDate, CS_File
  Else
    WriteConfigEntry "datelist", "list", setDate, CS_File
  End If

  WriteConfigEntry "dates", setDate, setNotification, CS_File
  AddQ "/w " & PsD2 & Username & " Date notification set for " & setDate
End Sub

Sub cs_Event_Userjoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
  If GetConfigEntry("datelist", "list", CS_File) = "" Then Exit Sub

  getList = GetConfigEntry("datelist", "list", CS_File)

  If InStr(getList, ", ") Then
    splitList = Split(getList, ", ")

    Dim dateEntry

    For i=0 to Ubound(splitList)
      tempDay = Split(splitList(i), "/")(0)
      tempMonth = Split(splitList(i), "/")(1)
      tempList = tempMonth & "/" & tempDay & "/" & Split(Date, "/")(2)

      If Trim(tempList) = Trim(Date()) Then
        dateEntry = splitList(i) : Exit For
      End If
    Next

    getDateEntry = GetConfigEntry("dates", dateEntry, CS_File)

    If GetConfigEntry("noreply", Date() & "|" & Username, CS_File) <> "" Then Exit Sub

    WriteConfigEntry "noreply", Date() & "|" & Username, Username, CS_File

    Dsp 3, getEntry & ": " & getDateEntry, Username, vbGreen
  Else
    getEntry = getList

    tempDay = Split(getEntry, "/")(0)
    tempMonth = Split(getEntry, "/")(1)
    tempEntry = tempMonth & "/" & tempDay & "/" & Split(Date, "/")(2)

    If Trim(tempEntry) = Trim(Date()) Then
      getDateEntry = GetConfigEntry("dates", getEntry, CS_File)

      If GetConfigEntry("noreply", Date() & "|" & Username, CS_File) <> "" Then Exit Sub

      WriteConfigEntry "noreply", Date() & "|" & Username, Username, CS_File

      Dsp 3, getEntry & ": " & getDateEntry, Username, vbGreen
    End If
  End If
End Sub
« Last Edit: October 23, 2008, 12:51:37 PM by Vector »
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

zubpe

  • Newbie
  • *
  • Posts: 25
    • View Profile
Calendar Script
« Reply #19 on: October 23, 2008, 11:20:25 AM »
[20:01:12] Loaded 2 of 2 script files referenced.
 [20:01:12] 11 plugins loaded. Type /plugins in the bot to view them. Type /phelp for help using them.
 [20:01:12] Type /updates in the bot to view updates and new plugins that are available for download.
 [20:01:12] Vector's Calendar Script v0.2 Loaded
 [20:01:12] Loading GD...
 [20:01:12] Greet Delay by Hero loaded!
 [20:01:12] Checking if your built-in greet is enabled...
 [20:01:12] Your built-in greet messages are disabled!
 [20:01:43] UserJoins Call Error On File> C:\bot-s\tn.StealthBot\plugins\cs.plug
 [20:01:43] Error Number: 450   Description: Wrong number of arguments or invalid property assignment



and btw, it's saying that a new calendar version 1.3 or something like that is available for download etc.
is this yours or what is this?

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Calendar Script
« Reply #20 on: October 23, 2008, 12:52:54 PM »
Problem solved. Copy the code again. Apparently, I was testing it on the beta, and it added another argument to UserTalk, which is not so with 2.6r3, so I apologize on that note.

Also, the reason its saying there is a new plugin is because the plugin uses the same prefix as the one on the official plugins server. I also changed the version number, so this wouldn't happen.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

zubpe

  • Newbie
  • *
  • Posts: 25
    • View Profile
Calendar Script
« Reply #21 on: October 27, 2008, 03:00:49 AM »
I really appreciate your work and I'm grateful.  But if you've time and still would like to help me I would appreciate it very much. I was wondering if there could be a few changes/additions to the current plugin, I'm just wondering if it's secure if enough - I mean, it seems like there isn't any delay, ergo it's might flood out? Yes, No? I'm using the greetdelay plugin by hero as well, and this calendar plugin by you. So I just want to be sure it doesn't flood out. Because as it seems I instantly get the message when I join the channel (the calendar plugin), but the GD plugin I've set to 6secs delay. So was wondering if there could be added a few seconds delay to the calendar plugin as well?

1. Another thing is, that if there are not set an announcement the bot still simply messages you with the message: ":"
Could that be removed?

2. Could there be added a "standard" message, which will message the same message everyday until it's changed. So the only thing it would be updating would be the date. Is this even possible? So there would be a command to set a announcement for any day, like the current .announce 27/10/2008 or for example I could just use the ".announce" command now, and set it to announce something the next month. (This is the currently how it works) So the other thing would be something like .stanannounce (standard announcement) which will message the same message every day until I either delete it or use the ".announce" command where I set a date etc. or update. Maybe you have better ideas on how it is possible to work out, but I just wanted to give you my ideas etc.  

3. Is it possible to make the bot send/message the announcement every time a user joins the channel instead of just giving it once to the user?

4. Could there be added commands? For example, .delan (delete announcement), .upan (update announcement), .announce (this is already implented)
« Last Edit: October 27, 2008, 03:01:16 AM by zubpe »

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Calendar Script
« Reply #22 on: October 27, 2008, 12:42:36 PM »
Quote from: zubpe
I really appreciate your work and I'm grateful. ...

Well thank you very much. I appreciate it.

Quote
1. Another thing is, that if there are not set an announcement the bot still simply messages you with the message: ":"
Could that be removed?

The way its set up, it shouldn't message you if the date on which the user joins no message is set for

Quote
2. Could there be added a "standard" message, which will message the same message everyday until it's changed. So the only thing it would be updating would be the date. Is this even possible? So there would be a command to set a announcement for any day, like the current .announce 27/10/2008 or for example I could just use the ".announce" command now, and set it to announce something the next month. (This is the currently how it works) So the other thing would be something like .stanannounce (standard announcement) which will message the same message every day until I either delete it or use the ".announce" command where I set a date etc. or update. Maybe you have better ideas on how it is possible to work out, but I just wanted to give you my ideas etc.

Yes, I can put this into the bot. Do you want the standard message whispered to the user, even if there is another message assigned for that date?

Quote
3. Is it possible to make the bot send/message the announcement every time a user joins the channel instead of just giving it once to the user?
I figure once the user has received the message, they already know what it says. I guess I can do this for you, if it's really important.

Quote
4. Could there be added commands? For example, .delan (delete announcement), .upan (update announcement), .announce (this is already implented)

Yes, this is possible.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

zubpe

  • Newbie
  • *
  • Posts: 25
    • View Profile
Calendar Script
« Reply #23 on: October 28, 2008, 12:52:47 AM »
Quote from: Vector
Well thank you very much. I appreciate it.



Quote from: Vector
The way its set up, it shouldn't message you if the date on which the user joins no message is set for
Then I don't know if it's a bug, but at the moment it still messages people when they enter the channel even though I haven't made an announcement. It just messages them with ":"

Quote from: Vector
Yes, I can put this into the bot. Do you want the standard message whispered to the user, even if there is another message assigned for that date?
No, if there is "manually" set an announcement for a specific day then that day the standard message should somehow go off, and then next day on again and so on. If possible of course  


Quote from: Vector
I figure once the user has received the message, they already know what it says. I guess I can do this for you, if it's really important.
Hmm, well I guess you're right. Now I just started to wonder if it's possible to make a command to turn that off and on  hehe.


Quote from: Vector
Yes, this is possible.
Cool, could you add a few then, just some you think would be useful etc.

Greetings z,

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Calendar Script
« Reply #24 on: October 29, 2008, 01:06:32 PM »
Fixed the problem where it messaged the user everytime they joined. This time, there is a three second delay where the bot whispers the person the date.

The bot will open up a pop-up asking you what you want the standard message to be. It will whisper each user everytime, until you cancel it (.stannounce off)

If there is a message for that given date, the bot will whisper the user the message, AND NOT  whisper them the standard message. Let me know if I need to patch anything up.
Code: [Select]
'cs
'110.2
'&Calendar Script:Vector

Const CS_Ver = "0.2"
Const CS_acc = 100

Public CS_File
CS_File = BotPath() & "calendar.ini"

Public dspStandard
dspStandard = True

Sub cs_Event_Load()
  AddChat vbGreen, "Vector's Calendar Script v" & CS_Ver & " Loaded"

  If Not GetSetting("cs", "sMessage") Then
    sMessage = InputBox("Enter the standard greet message", "Vector's cs plugin")
    SetSetting "cs", "standardMessage", sMessage, "Standard Message", True
  End If
  

  TimerInterval "cs", "greetDelay", 3
    TimerEnabled "cs", "greetDelay", False
End Sub

Sub cs_Event_WhisperFromUser(Username, Flags, Message)
  If Not Left(Message, Len(BotVars.Trigger)) = BotVars.Trigger Then Exit Sub

  GetDBEntry Username, a, f
  if a < CS_Acc Then Exit Sub

  cmd = Split(Mid(Trim(Message), Len(BotVars.Trigger) + 1), " ")
  If Lcase(cmd(0)) <> "announce" Then Exit Sub
End Sub

Sub cs_Event_Userjoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
  If GetConfigEntry("noreply", Date() & "|" & Username, CS_File) <> "" Then Exit Sub
  TimerEnabled "cs", "greetDelay", True

  If Not dspStandard Then Exit Sub

  getStandard = GetSetting("cs", "standardMessage")
  If getStandard = "" Then Exit Sub
  AddQ "/w " & PsD2 & Username & " " & getStandard
  dspStandard = True
End Sub

Sub cs_Event_UserTalk(Username, Flags, Message, Ping)
  Call cs_processInput(Username, Message, 1)
End Sub

Sub cs_processInput(Username, Message, Origin)
  If Left(Message, Len(BotVars.Trigger)) <> BotVars.Trigger Then Exit Sub

  GetDBEntry Username, a, f
  If a < CS_acc Then Exit Sub

  cmd = Split(Mid(Trim(Lcase(Message)), Len(BotVars.Trigger) + 1), " ")
  ucmd = Ubound(cmd)

  Select Case cmd(0)
    Case "stannounce"
      If ucmd < 1 Then Exit Sub
      If cmd(1) = "off" Then
        SetSetting "cs", "standardMessage", "", "", True
        DSP Origin, "Standard message cancelled."
      Else
        sMessage = Split(cmd(0) & " ")(1)
        SetSetting "cs", "standardMessage", sMessage, "", True
        DSP Origin, "Standard message set.", Username, vbWhite
      End If
    Case "announce"
      uDate = Ubound(Split(cmd(1), "/"))

      If uDate <> 2 Then
        mDate = Split(Date, "/")(0)
        dDate = Split(Date, "/")(1)
        yDate = Split(Date, "/")(2)
        fDate = dDate & "/" & mDate & "/" & yDate

        DSP Origin, "Incorrect date format. Example: " & fDate, Username, vbWhite
        Exit Sub
      End If

      splitDAte = Split(cmd(1), "/")

      tempDay = splitDate(0)
      tempMonth = splitDate(1)

      setDate = tempDay & "/" & tempMonth & "/" & Split(Date(), "/")(2)

      setNotification = Split(message, cmd(1) & " ")(1)

      getDateList = GetConfigEntry("datelist", "list", CS_File)

      If getDateList <> "" Then
        WriteConfigEntry "datelist", "list", getDateList & ", " & setDate, CS_File
      Else
        WriteConfigEntry "datelist", "list", setDate, CS_File
      End If

      WriteConfigEntry "dates", setDate, setNotification, CS_File
      DSP Origin, "Date notification set for " & setDate, Username, vbWhite
  End Select
End Sub

'// TIMER SUBS \\'

Sub cs_greetDelay_Timer()
  TimerEnabled "cs", "greetDelay", False

  If GetConfigEntry("datelist", "list", CS_File) = "" Then Exit Sub

  getList = GetConfigEntry("datelist", "list", CS_File)

  If InStr(getList, ", ") Then
    splitList = Split(getList, ", ")

    Dim dateEntry

    For i=0 to Ubound(splitList)
      tempDay = Split(splitList(i), "/")(0)
      tempMonth = Split(splitList(i), "/")(1)
      tempList = tempMonth & "/" & tempDay & "/" & Split(Date, "/")(2)

      If Trim(tempList) = Trim(Date()) Then
        dateEntry = splitList(i) : Exit For
      End If
    Next

    getDateEntry = GetConfigEntry("dates", dateEntry, CS_File)
    if getDateEntry = "" Then Exit Sub

    If GetConfigEntry("noreply", Date() & "|" & Username, CS_File) <> "" Then Exit Sub
    WriteConfigEntry "noreply", Date() & "|" & Username, Username, CS_File

    Dsp 3, getEntry & ": " & getDateEntry, Username, vbGreen
    dspStandard = False
  Else
    getEntry = getList

    tempDay = Split(getEntry, "/")(0)
    tempMonth = Split(getEntry, "/")(1)
    tempEntry = tempMonth & "/" & tempDay & "/" & Split(Date, "/")(2)

    If Trim(tempEntry) = Trim(Date()) Then
      getDateEntry = GetConfigEntry("dates", getEntry, CS_File)
      If getDateEntry = "" Then Exit Sub

      If GetConfigEntry("noreply", Date() & "|" & Username, CS_File) <> "" Then Exit Sub
      WriteConfigEntry "noreply", Date() & "|" & Username, Username, CS_File

      Dsp 3, getEntry & ": " & getDateEntry, Username, vbGreen
      dspStandard = False
    End If
  End If
End Sub
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

zubpe

  • Newbie
  • *
  • Posts: 25
    • View Profile
Calendar Script
« Reply #25 on: November 08, 2008, 01:22:00 PM »
.announce 8/11/2008 Hello & Welcome to our Clan.

Quote
WhisperFromUser Call Error On File> C:\mappen\mappen.StealthBot\plugins\XML-download.plug
Error Number: 5   Description: Invalid procedure call or argument

Sorry for no response, I've been a bit busy ~ IRL

I tested it out, and it seems that it interferes with another plugin I'm using. At least that's what I think. I tried to use the command to announce something, and inside the bot I got the above error. The reason to that I think that this cs plugin interferes with another plugin is that the name "XML-download.plug" is another plugin I've in the plugin folder.

So I guess I've to delete/remove that plugin to be able to use the cs plugin?


Cheers,
« Last Edit: November 08, 2008, 01:22:29 PM by zubpe »

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Calendar Script
« Reply #26 on: November 12, 2008, 01:02:49 PM »
Weird. That error looks like it has nothing to do with my plugin. As a precaution, I changed the prefix to "cal" instead.

Code: [Select]
'cal
'0.2
'&Calendar Script:Vector

Const cal_Ver = "0.2"
Const cal_acc = 100

Public cal_File
cal_File = BotPath() & "calendar.ini"

Public dspStandard
dspStandard = True

Sub cal_Event_Load()
  AddChat vbGreen, "Vector's Calendar Script v" & cal_Ver & " Loaded"

  If Not GetSetting("cal", "sMessage") Then
    sMessage = InputBox("Enter the standard greet message", "Vector's cal plugin")
    SetSetting "cal", "standardMessage", sMessage, "Standard Message", True
  End If
  

  TimerInterval "cal", "greetDelay", 3
    TimerEnabled "cal", "greetDelay", False
End Sub

Sub cal_Event_WhisperFromUser(Username, Flags, Message)
  If Not Left(Message, Len(BotVars.Trigger)) = BotVars.Trigger Then Exit Sub

  GetDBEntry Username, a, f
  if a < cal_Acc Then Exit Sub

  cmd = Split(Mid(Trim(Message), Len(BotVars.Trigger) + 1), " ")
  If Lcase(cmd(0)) <> "announce" Then Exit Sub
End Sub

Sub cal_Event_Userjoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
  If GetConfigEntry("noreply", Date() & "|" & Username, cal_File) <> "" Then Exit Sub
  TimerEnabled "cal", "greetDelay", True

  If Not dspStandard Then Exit Sub

  getStandard = GetSetting("cal", "standardMessage")
  If getStandard = "" Then Exit Sub
  AddQ "/w " & PsD2 & Username & " " & getStandard
  dspStandard = True
End Sub

Sub cal_Event_UserTalk(Username, Flags, Message, Ping)
  Call cal_processInput(Username, Message, 1)
End Sub

Sub cal_processInput(Username, Message, Origin)
  If Left(Message, Len(BotVars.Trigger)) <> BotVars.Trigger Then Exit Sub

  GetDBEntry Username, a, f
  If a < cal_acc Then Exit Sub

  cmd = Split(Mid(Trim(Lcase(Message)), Len(BotVars.Trigger) + 1), " ")
  ucmd = Ubound(cmd)

  Select Case cmd(0)
    Case "stannounce"
      If ucmd < 1 Then Exit Sub
      If cmd(1) = "off" Then
        SetSetting "cal", "standardMessage", "", "", True
        DSP Origin, "Standard message cancelled."
      Else
        sMessage = Split(cmd(0) & " ")(1)
        SetSetting "cal", "standardMessage", sMessage, "", True
        DSP Origin, "Standard message set.", Username, vbWhite
      End If
    Case "announce"
      uDate = Ubound(Split(cmd(1), "/"))

      If uDate <> 2 Then
        mDate = Split(Date, "/")(0)
        dDate = Split(Date, "/")(1)
        yDate = Split(Date, "/")(2)
        fDate = dDate & "/" & mDate & "/" & yDate

        DSP Origin, "Incorrect date format. Example: " & fDate, Username, vbWhite
        Exit Sub
      End If

      splitDAte = Split(cmd(1), "/")

      tempDay = splitDate(0)
      tempMonth = splitDate(1)

      setDate = tempDay & "/" & tempMonth & "/" & Split(Date(), "/")(2)

      setNotification = Split(message, cmd(1) & " ")(1)

      getDateList = GetConfigEntry("datelist", "list", cal_File)

      If getDateList <> "" Then
        WriteConfigEntry "datelist", "list", getDateList & ", " & setDate, cal_File
      Else
        WriteConfigEntry "datelist", "list", setDate, cal_File
      End If

      WriteConfigEntry "dates", setDate, setNotification, cal_File
      DSP Origin, "Date notification set for " & setDate, Username, vbWhite
  End Select
End Sub

'// TIMER SUBS \\'

Sub cal_greetDelay_Timer()
  TimerEnabled "cal", "greetDelay", False

  If GetConfigEntry("datelist", "list", cal_File) = "" Then Exit Sub

  getList = GetConfigEntry("datelist", "list", cal_File)

  If InStr(getList, ", ") Then
    splitList = Split(getList, ", ")

    Dim dateEntry

    For i=0 to Ubound(splitList)
      tempDay = Split(splitList(i), "/")(0)
      tempMonth = Split(splitList(i), "/")(1)
      tempList = tempMonth & "/" & tempDay & "/" & Split(Date, "/")(2)

      If Trim(tempList) = Trim(Date()) Then
        dateEntry = splitList(i) : Exit For
      End If
    Next

    getDateEntry = GetConfigEntry("dates", dateEntry, cal_File)
    if getDateEntry = "" Then Exit Sub

    If GetConfigEntry("noreply", Date() & "|" & Username, cal_File) <> "" Then Exit Sub
    WriteConfigEntry "noreply", Date() & "|" & Username, Username, cal_File

    Dsp 3, getEntry & ": " & getDateEntry, Username, vbGreen
    dspStandard = False
  Else
    getEntry = getList

    tempDay = Split(getEntry, "/")(0)
    tempMonth = Split(getEntry, "/")(1)
    tempEntry = tempMonth & "/" & tempDay & "/" & Split(Date, "/")(2)

    If Trim(tempEntry) = Trim(Date()) Then
      getDateEntry = GetConfigEntry("dates", getEntry, cal_File)
      If getDateEntry = "" Then Exit Sub

      If GetConfigEntry("noreply", Date() & "|" & Username, cal_File) <> "" Then Exit Sub
      WriteConfigEntry "noreply", Date() & "|" & Username, Username, cal_File

      Dsp 3, getEntry & ": " & getDateEntry, Username, vbGreen
      dspStandard = False
    End If
  End If
End Sub
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

zubpe

  • Newbie
  • *
  • Posts: 25
    • View Profile
Calendar Script
« Reply #27 on: November 13, 2008, 11:15:14 AM »
Seems to have fixed it :-) Works great now.

I was wondering if you could make a little list of the commands, I tend to forget them all the time :-D

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
Calendar Script
« Reply #28 on: November 13, 2008, 08:36:26 PM »
<trigger>announce <date> <message for that date>
<trigger>stannounce <announcement>

If <trigger>stannounce off is used, will terminate the announcement and you have to set it again with <trigger>stannounce <announcement>
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector