Sou, hier extra für Kopfnicker ein Awayscript für NetTalk.
Die Befehle sind:
/away <Nickanhängsel> <Längerer Away-Grund>
/re
Alle Parameter optional
Folgenes im Scriptfenster von Nettalk einfügen:
Code:
#NewScriptBegin AwayWithNickchange
Dim zAwayTime
Dim zNormalNick
Dim zAwayAppend
Dim zIsAway
Dim zAwayReason
Dim zLastAnnounce
dim zLowNick
Sub Load()
MakeShortcut "", "away", "/call AwayWithNickchange.SetAwayMode $1 :$(room)\\-->$>1", 2
MakeShortcut "", "re", "/call AwayWithNickchange.SetRe", 1
zIsAway = "false"
End Sub
Sub SetAwayMode(aAppend, aReason)
If aAppend = "" Then
aAppend = "away"
End If
If LCase(aAppend) = LCase(zAwayAppend) And zIsAway <> "true" Then
oChange = "false"
Else
oChange = "true"
End If
If zIsAway <> "true" Then
zNormalNick = GetVal(FrontConId, 5)
zLowNick = LCase(zNormalNick)
zAwayTime = Time
End If
I = InStr(1, aReason, "\\-->")
zAwayReason = Mid(aReason, I + 5)
zAwayAppend = aAppend
If oChange = "true" Then
Send "/quote NICK :" & zNormalNick & "|" & zAwayAppend, FrontFrameID
End If
If zIsAway <> "true" Then
If zAwayReason = "" Then
Send "/me ist jetzt weg...", FrontFrameID
Else
Send "/me ist jetzt weg (" + zAwayReason + ")", FrontFrameID
End If
End If
zIsAway = "true"
End Sub
Sub SetRe()
If zIsAway = "true" Then
zIsAway = "false"
Send "/nick " + zNormalNick, FrontFrameID
Send "/me ist nach " + TimeDiffStr(DateDiff("s", zAwayTime, Time)) & " wieder da", FrontFrameID
End If
End Sub
Sub Chan_Msg(Text, Nick, Channel, FrameID, ConnID)
If zIsAway = "true" Then
If InStr(1, LCase(Text), zLowNick) > 0 And DateDiff("s", zLastAnnounce, Time) > 120 Then
If zAwayReason = "" Then
Send "/me ist " & zAwayAppend & ", weg seit " & TimeDiffStr(DateDiff("s", zAwayTime, Time)), FrameID
Else
Send "/me ist " & zAwayAppend & ", " + zAwayReason & ", weg seit " & TimeDiffStr(DateDiff("s", zAwayTime, Time)), FrameID
End If
zLastAnnounce = Time
End If
End If
End Sub
Function TimeDiffStr(xSeconds)
oHours = 0
oMinutes = 0
oSeconds = 0
aSeconds = Val(xSeconds)
Do
If aSeconds >= 3600 Then
oHours = oHours + 1
aSeconds = aSeconds - 3600
End If
Loop Until aSeconds < 3600
Do
If aSeconds >= 60 Then
oMinutes = oMinutes + 1
aSeconds = aSeconds - 60
End If
Loop Until aSeconds < 60
oSeconds = aSeconds
oOut = ""
If oHours > 0 Then
oOut = oOut & " " & oHours & " Std."
End If
If oMinutes > 0 Then
oOut = oOut & " " & oMinutes & " Min."
End If
If oSeconds > 0 Then
oOut = oOut & " " & oSeconds & " Sek."
End If
TimeDiffStr = Mid(oOut, 2)
End Function
Wenn dort schon ein Awayscript ist, dieses am besten ersetzen. Wenn dort andere Scripte sind, dies hier unten drunter einfügen.
Danach noch auf "Script neu starten" klicken.
Nur kurz getestet, Bugs müsst ihr selber beheben