AnGelBot-Portal²

Normale Version: geburtstagsscript
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
hallöchen

ich nutze das geb.asc
aber ich vermisse eine funktion

wenn jemand geburtstag hat wäre es schön wenn der bot das dann auch an dem tag in den channel postet. (wenn möglich mehrmals am tag des geburtstags)

sowas macht des script leider nicht
es zählt nur die tage runter bis 0 und mehr leider nicht

kann mir da jemand helfen ???
woher hast denn das script ? mir ist ne bakannt das wir sowas haben ! *grübbel*

poste mal das script dann kann man dir auch weiterhelfen
vielleicht meint er das script. Confused:

Code:
Dim geburtstag,gebtag,gebmonat,gebjahr

'<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
'<>@ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ <>
'<>¿|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|¿<>
'<>@|*****   GeburtstagsCountdown-Script © by Verjigorm   *****|@<>
'<>¿|__________________________________________________________|¿<>
'<>@ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ ¿ @ <>
'<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

Sub Init
Script "Geburtstagsscript mit Countdown v1.9 by Verjigorm"
Hook "chan_msg"
SpreadFlagMessage 0, "+m", "12 *** Geburtstagsscript geladen v1.9 by Verjigorm*** "
End Sub


Sub Chan_Msg(Chan, Nick, RegUser, Line)
'-----------------------------------------------------------------------------------------------------------------
'kleiner HilfeText
'-----------------------------------------------------------------------------------------------------------------

If lcase(param(line,1)) = "?addgeb" then
sendline "privmsg " & chan & " : Gib deinen VOLLSTÄNDIGEN Geburtstag (tt.mm.jjjj also z.b. 14.4.1978) per !addgeb tt.mm.jjjj ein ! ",3
sendline "privmsg " & chan & " : Per ?geb nickname kannst du dir die geburtsdaten verschiedener personen ausgeben lassen!! ",3
end if

'-----------------------------------------------------------------------------------------------------------------
'Eingabe
'-----------------------------------------------------------------------------------------------------------------

If lcase(param(line,1)) = "!addgeb" then
  
GebTag   = ""
GebMonat = ""
GebJahr  = ""

If isnumeric(param(line,2)) then
  geburtstag=param(line,2)
  zerlegen(geburtstag)

'sendline "privmsg " & chan & " : " & gebtag & "," & gebmonat & "," & gebjahr,3

else

'-----------------------------------------------------------------------------------------------------------------
'Hier kommen ein paar "Überprüfungen der RichtigKeit" der Eingabe des Geburtstagsdatums mit "FehlerAnzeige"
'-----------------------------------------------------------------------------------------------------------------

  sendline "privmsg " & chan & " : Ungültige Eingabe!! " & param(line,2) & " ist NICHT numerisch!! ",3
  exit sub
end if
  
  If GebMonat = "" or GebJahr = "" then
    sendline "privmsg " & chan & " : Ungültige Eingabe!! Du musst schon deinen kompletten Geburtstag angeben ",3
  exit sub
  end if  

  If GebTag > 31 then
    sendline "privmsg " & chan & " : Ungültige Eingabe!! Ein Monat hat höchstens 31 Tage!! ",3
  exit sub
  end if

  If GebMonat = 2 and GebTag = 29 then
    testzahl = cstr(Gebjahr / 4)      
    if (InStr(LCase(testzahl), ",") > 0) then
      sendline "privmsg " & chan & " : Ungültige Eingabe!! Dieses Jahr war kein Schaltjahr !",3
    exit sub
   end if
  end if
  
  If GebMonat = 2 and GebTag > 29 then      
    sendline "privmsg " & chan & " : Ungültige Eingabe!! Dieser Monat hat im höchstfall 29 Tage !",3
  exit sub
  end if

  If GebMonat = 4 or GebMonat = 6 or GebMonat = 9 or GebMonat = 11 then
    if GebTag > 30 then
     sendline "privmsg " & chan & " : Ungültige Eingabe!! Dieser Monat hat nur 30 Tage!! ",3
     exit sub
    end if
  end if
  
  If GebTag < 1 then
    sendline "privmsg " & chan & " : Ungültige Eingabe!! Ein Monat hat mindestens 1 Tag!! ",3
  exit sub
  end if

  If GebMonat > 12 then
    sendline "privmsg " & chan & " : Ungültige Eingabe!! Ein Jahr hat Höchstens 12 Monate ! " ,3
  exit sub
  end if
  
  If GebMonat < 1 then
    sendline "privmsg " & chan & " : Ungültige Eingabe!! Ein Jahr hat Mindestens 1 Monat!! ",3
  exit sub
  end if

  If GebJahr > 1995 then
    sendline "privmsg " & chan & " : Ungültige Eingabe!! Ich denke mal nicht das du " & cstr(year(now))-GebJahr & " Jahre alt bist :) , also gib dein vollständiges und richtiges GeburtsJahr an!",3
  exit sub
  end if
  
  If GebJahr < 1950 then
    sendline "privmsg " & chan & " : Ungültige Eingabe!! Ich glaube nicht das du " & cstr(year(now))-GebJahr & " Jahre alt bist :) , also gib dein vollständiges und richtiges GeburtsJahr an! ",3
  exit sub
  end if
  
  If param(line,2) = "" then
   sendline "privmsg " & chan & " : Ungültige Eingabe!! Du musst schon ein Geburtsdatum eingeben!!" ,3
   exit sub
  end if

'-----------------------------------------------------------------------------------------------------------------
'Ende der "EingabeÜberprüfung"
'-----------------------------------------------------------------------------------------------------------------

  writeinistring nick , "Geburtstag " , getrest(line,2) , "geb.ini"       '---Speichern des Geburtsdatums---
  Sendline "Privmsg " & chan & " : Speichere Geburtstag für " & nick & " am " & param(line,2) ,3
end if


'----------------------------------------------------------------------------------------------------------------
'Verarbeitung für spätere Ausgabe
'----------------------------------------------------------------------------------------------------------------

if lcase(param(line,1)) ="?geb" or lcase(param(line,1)) ="!geb" then

  if param(line,2) = "" then
    Sendline "Privmsg " & chan & " : Na du musst mir schon sagen nach wem ich suchen muss :P *ggg* ",3
  exit sub
  end if

  geburtstag = readinistring(param(line,2) , "Geburtstag " , "" , "geb.ini")     '---Auslesen des Geburtsdatums---

  if geburtstag ="" then
    FileNum = FileOpen("geb.ini",FA_Read)
    CheckGrade = 0
    BestGrade = 0  
    BestMatch = ""  
    while not FileEOF(FileNum)
      FileLine=FileReadLn(FileNum)
      If InStr(LCase(FileLine), "[") > 0 then
       name=mid(fileline,2,len(fileline)-2)
       CheckGrade = MatchGrade(param(line,2), name)
       If CheckGrade > BestGrade Then
           BestMatch = name        
           BestGrade = CheckGrade      
       End If    
      end if  
    wend
    FileClose FileNum
    If Bestgrade > 50 then
      Sendline "Privmsg " & chan & " : Kein Eintrag für " & param(line,2) & " , bester Eintrag : " & Bestmatch,3
    else
      Sendline "Privmsg " & chan & " : Kein Eintrag für " & param(line,2) & " , auch kein vergleichbarer Eintrag gefunden! ",3
    end if
  exit sub
  end if

zerlegen(geburtstag)

dim Monatstage(13)
Monatstage(1) = 31
Monatstage(3) = 31
Monatstage(4) = 30
Monatstage(5) = 31
Monatstage(6) = 30
Monatstage(7) = 31
Monatstage(8) = 31
Monatstage(9) = 30
Monatstage(10) = 31
Monatstage(11) = 30
Monatstage(12) = 31

if CStr(GebMonat) - CStr(month(now)) > 0 then

if CStr(GebTag) - CStr(day(now)) > 0 then
  monate = GebMonat - CStr(month(now))
  tage = GebTag - CStr(day(now))-1
end if

if CStr(GebTag) - CStr(day(now)) <= 0 then
  monate = Gebmonat - CStr(month(now)) -1
  if gebmonat > 1 then
   x= GebMonat-1
  end if
  if GebMonat = 1 then
   x=12
  end if
  if x=2 then
    testzahl = cstr(Gebjahr / 4)      
    if (InStr(LCase(testzahl), ",") > 0) then
     Monatstage(2)=28
    else
     Monatstage(2)=29
    end if
  end if
  tage = monatstage(x) + cint(GebTag) - CStr(day(now)) -1  
end if

wirdalt= CStr(year(now)) - GebJahr

end if

if CStr(GebMonat) - CStr(month(now)) < 0 then

if CStr(GebTag) - CStr(day(now)) > 0 then
  monate = 12 + cint(GebMonat) - CStr(month(now))
  tage = GebTag - CStr(day(now))-1
end if

if CStr(GebTag) - CStr(day(now)) <= 0 then
  monate = 12 + cint(GebMonat) - CStr(month(now)) -1
  if gebmonat > 1 then
   x= GebMonat-1
  end if
  if GebMonat = 1 then
   x=12
  end if
  if x=2 then
    testzahl = cstr(Gebjahr / 4)      
    if (InStr(LCase(testzahl), ",") > 0) then
     Monatstage(2)=28
    else
     Monatstage(2)=29
    end if
  end if
  tage = monatstage(x) + cint(GebTag) - CStr(day(now)) -1
end if

wirdalt= CStr(year(now)) - GebJahr +1

end if

if CStr(GebMonat) - CStr(month(now)) = 0 then

if CStr(GebTag) - CStr(day(now)) > 0 then
  monate = 0
  tage = GebTag - CStr(day(now))-1
  wirdalt= CStr(year(now)) - GebJahr
end if

if CStr(GebTag) - CStr(day(now)) <= 0 then
  monate = 11
  if gebmonat > 1 then
   x= GebMonat-1
  end if
  if GebMonat = 1 then
   x=12
  end if
  if x=2 then
    testzahl = cstr(Gebjahr / 4)      
    if (InStr(LCase(testzahl), ",") > 0) then
     Monatstage(2)=28
    else
     Monatstage(2)=29
    end if
  end if
  tage = monatstage(x) + cint(GebTag) - CStr(day(now)) -1
  wirdalt= CStr(year(now)) - GebJahr +1
end if

end if

stunden = 24 - CStr(hour(now))-1
minuten = 60 - CStr(minute(now))
alter = wirdalt -1


if Monate = 1 then
Monatedazu = "Monat "
else
Monatedazu = "Monate "
end if

if tage = 1 then
Tagedazu = "Tag "
else
Tagedazu = "Tage "
end if

if Stunden = 1 then
Stundendazu = "Stunde "
else
Stundendazu = "Stunden "
end if

if minuten = 1 then
Minutendazu = "Minute "
else
Minutendazu = "Minuten "
end if

'------------------------------------------------------------------------------------------
'Sternzeichenermittlung
'------------------------------------------------------------------------------------------

if (CStr(GebMonat)=3 and CStr(GebTag)=>21) or (CStr(GebMonat)=4 and CStr(Gebtag)=<20) then
  sternzeichen="Widder"
end if
if (CStr(GebMonat)=4 and CStr(GebTag)=>21) or (CStr(GebMonat)=5 and CStr(Gebtag)=<20) then
  sternzeichen="Stier"
end if
if (CStr(GebMonat)=5 and CStr(GebTag)=>21) or (CStr(GebMonat)=6 and CStr(Gebtag)=<20) then
  sternzeichen="Zwilling"
end if
if (CStr(GebMonat)=6 and CStr(GebTag)=>21) or (CStr(GebMonat)=7 and CStr(Gebtag)=<22) then
  sternzeichen="Krebs"
end if
if (CStr(GebMonat)=7 and CStr(GebTag)=>23) or (CStr(GebMonat)=8 and CStr(Gebtag)=<22) then
  sternzeichen="Löwe"
end if
if (CStr(GebMonat)=8 and CStr(GebTag)=>23) or (CStr(GebMonat)=9 and CStr(Gebtag)=<22) then
  sternzeichen="Jungfrau"
end if
if (CStr(GebMonat)=9 and CStr(GebTag)=>23) or (CStr(GebMonat)=10 and CStr(Gebtag)=<22) then
  sternzeichen="Waage"
end if
if (CStr(GebMonat)=10 and CStr(GebTag)=>23) or (CStr(GebMonat)=11 and CStr(Gebtag)=<22) then
  sternzeichen="Skorpion"
end if
if (CStr(GebMonat)=11 and CStr(GebTag)=>23) or (CStr(GebMonat)=12 and CStr(Gebtag)=<21) then
  sternzeichen="Schütze"
end if
if (CStr(GebMonat)=12 and CStr(GebTag)=>22) or (CStr(GebMonat)=1 and CStr(Gebtag)=<20) then
  sternzeichen="Steinbock"
end if
if (CStr(GebMonat)=1 and CStr(GebTag)=>21) or (CStr(GebMonat)=2 and CStr(Gebtag)=<18) then
  sternzeichen="Wassermann"
end if
if (CStr(GebMonat)=2 and CStr(GebTag)=>19) or (CStr(GebMonat)=3 and CStr(Gebtag)=<20) then
  sternzeichen="Fische"
end if

'--------------------------------------------------------------------------------------------
'Ende Sternzeichen
'--------------------------------------------------------------------------------------------
'Kleiner Alterszusatz *gg*
'--------------------------------------------------------------------------------------------

if alter < 14 then
  text = "kindhafte "
end if

if alter < 17 and alter => 14 then
  text = "süsse "
end if

if alter <= 20 and alter => 17 then
  text = "heisse "
end if

if alter >20 and alter < 30 then
  text = "oh Gott uralte "
end if

if alter => 30 then
  text = "scheintote "
end if

'--------------------------------------------------------------------------------------------
'Ende Alterszusatz *gg*
'--------------------------------------------------------------------------------------------
'Endgültige Ausgabe
'--------------------------------------------------------------------------------------------

If clng(day(now)) = clng(gebtag) and clng(month(now)) = clng(gebmonat) then
  Sendline "Privmsg " & chan & " : " & param(line,2) & " ist heute " & alter & " Jahre alt geworden! " ,3
  Sendline "Privmsg " & chan & " : Also happy Birthday dir " & param(line,2) & " zu deinem " & alter & ". Geburtstag" ,3
  Exit sub
end if

  Sendline "Privmsg " & chan & " : " & param(line,2) & " hat Geburtstag am : " & geburtstag & " (" & text & " " & alter & " Jahre alt)" ,3
  sendline "privmsg " & chan & " : Noch " & monate & " " & Monatedazu & " , " & tage & " " & Tagedazu & " , " & stunden & " " & stundendazu & " und " & minuten & " " & Minutendazu & " bis zu " & param(line,2) & "'s " & wirdalt & "ten und nächstem Geburtstag :) " ,3
  sendline "privmsg " & chan & " : Sternzeichen : " & sternzeichen ,3
end if

End Sub

'--------------------------------------------------------------------------------------------
'Funktion(en)
'--------------------------------------------------------------------------------------------

function zerlegen(geburtstag)
i=1
j=1
For i=1 to len(geburtstag)
  if mid(geburtstag,i,1) = "." then
   GebTag = mid(geburtstag,1,i-1)
   For j=i+1 to len(geburtstag)
    if mid(geburtstag,j,1) = "." then
     GebMonat = mid(geburtstag,i+1,j-i-1)
     GebJahr = mid(geburtstag,j+1,len(geburtstag)-j+1)
     j=len(geburtstag)
     i=len(geburtstag)
    end if
   next
  end if
next
End Function

also des hier funzt einwandfrei. aber es hat auch keine meldefunktion bei einem aktuellen geburtstag.
yo genau das mein ich

danke fürs posten TheDaywalker Smile

und fürs eventuelle umprogrammieren dass es die funktion bekommt

wär genial

:D
hmmmm

scheint wohl keine möglichkeit zu geben diese funktion einzubaun

schade :(
Referenz-URLs