Sub ONJOIN(Nickname,Host,Channel,ServerNumber) writeinifile "seen.ini",Channel,"join:" & Nickname,GetIdentifier("$day") & "." & GetIdentifier("$monthnum") & "." & GetIdentifier("$year") & " at " & GetIdentifier("$time") writeinifile "seen.ini",Channel,"part:" & Nickname,"" End Sub Sub ONPART(Nickname,Host,Channel,Reason,ServerNumber) writeinifile "seen.ini",Channel,"part:" & Nickname,GetIdentifier("$day") & "." & GetIdentifier("$monthnum") & "." & GetIdentifier("$year") & " at " & GetIdentifier("$time") writeinifile "seen.ini",Channel,"join:" & Nickname,"" End Sub Sub ONQUIT(Nickname,Host,Reason,ServerNumber) if FileExists(getidentifier("$scriptdir")+"seen.ini") then channels = sections(getidentifier("$scriptdir") + "seen.ini") for c=lbound(channels) to ubound(channels)-1 channel = channels(c) If Len(channel) > 0 then keys = options(getidentifier("$scriptdir") + "seen.ini",channel) for k=lbound(keys) to ubound(keys) key = keys(k) If instr(key,Nickname) then Writeinifile "seen.ini",channel,"part:" + Nickname,GetIdentifier("$day") & "." & GetIdentifier("$monthnum") & "." & GetIdentifier("$year") & " at " & GetIdentifier("$time") Writeinifile "seen.ini",channel,"join:" + Nickname,"" End if next End If next End If End Sub Sub ONKICK(Nickname,Host,Channel,WhoKicked,Reason,ServerNumber) writeinifile "seen.ini",Channel,"part:" & Nickname,GetIdentifier("$day") & "." & GetIdentifier("$monthnum") & "." & GetIdentifier("$year") & " at " & GetIdentifier("$time") writeinifile "seen.ini",Channel,"join:" & Nickname,"" End Sub Sub ONNICK(NewNick,OldNick,ServerNumber) if FileExists(getidentifier("$scriptdir")+"seen.ini") then channels = sections(getidentifier("$scriptdir") + "seen.ini") for c=lbound(channels) to ubound(channels)-1 channel = channels(c) If Len(channel) > 0 then keys = options(getidentifier("$scriptdir") + "seen.ini",channel) for k=lbound(keys) to ubound(keys) key = keys(k) If instr(key,OldNick) then Writeinifile "seen.ini",channel,"join:" + OldNick,"" Writeinifile "seen.ini",channel,"part:" + OldNick,"" Writeinifile "seen.ini",channel,"join:" + NewNick,"" Writeinifile "seen.ini",channel,"part:" + NewNick,"" Writeinifile "seen.ini",channel,"join:" + NewNick,GetIdentifier("$day") & "." & GetIdentifier("$monthnum") & "." & GetIdentifier("$year") & " at " & GetIdentifier("$time") Writeinifile "seen.ini",channel,"part:" + OldNick,GetIdentifier("$day") & "." & GetIdentifier("$monthnum") & "." & GetIdentifier("$year") & " at " & GetIdentifier("$time") End if next End If next End If End Sub Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber) If Channel="#brony" or Channel = "#furaffinity-afterdark" then exit sub if len(message) > 6 then if left(Message,5) = "!seen" then Who = Mid(Message,7) When = getinifile("seen.ini",Channel,"join:" & Who,"") If Len(When) > 0 then SendCommand "/msg " & Channel & " " & Who & " is in this channel right now",ServerNumber End If If Len(When) = 0 then When = getinifile("seen.ini",Channel,"part:" & Who,"") If Len(When) > 0 then SendCommand "/msg " & Channel & " " & Who & " was last seen on " & When,ServerNumber End If If Len(When) = 0 then SendCommand "/msg " & Channel & " " & Who & " has never been seen on this channel",ServerNumber End If End If end if end if End sub Sub scan(s_channel) if FileExists(getidentifier("$scriptdir")+"seen.ini") then dim objFSo, objFile Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(getidentifier("$scriptdir")+"seen.ini",1) sText = objFile.ReadAll sText = Left(sText,InStr(sText,"[End]")-2) Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(getidentifier("$scriptdir")+"seen.ini",2) objFile.writeLine(sText) objFile.close End If NickCount = 0 ChanCount = 0 If s_channel = "$1" then for i = 1 to GetIdentifier("$totalservers") Chanlist = GetIdentifier("$channels",i) channels = Split(Chanlist," ") for j = 0 to Ubound(channels) ChanCount = ChanCount + 1 channel = channels(j) Nicknames = Nicks(channel,i) Nicknames = Split(Nicknames," ") for k = 0 to UBound(Nicknames) NickCount = NickCount + 1 Nick = Nicknames(k) writeinifile "seen.ini",Channel,"join:" & Nick,GetIdentifier("$day") & "." & GetIdentifier("$monthnum") & "." & GetIdentifier("$year") & " at " & GetIdentifier("$time") next next next SendCommand "/echo -a A Total of " & NickCount & " Nicknames found on " & ChanCount & " channels, on " & GetIdentifier("$totalservers") & " networks" End If If Not s_channel = "$1" then Nicknames = Nicks(s_channel,GetIdentifier("$currentservernumber")) Nicknames = Split(Nicknames," ") for i = 0 to UBound(Nicknames) NickCount = NickCount + 1 Nick = Nicknames(i) writeinifile "seen.ini",s_channel,"join:" & Nick,GetIdentifier("$day") & "." & GetIdentifier("$monthnum") & "." & GetIdentifier("$year") & " at " & GetIdentifier("$time") next SendCommand "/echo -a " & NickCount & " Nicknames found on channel " & s_channel End If WriteIniFile "seen.ini","End","end","end" WriteIniFile "seen.ini","End","end","" End Sub Function sections(fname) dim objFSo, objFile Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(fname,1) sText = objFile.ReadAll If Len(sText) > 0 then arr = split(sText,vbCrLf) text = "" for i=lbound(arr) to ubound(arr) if left(arr(i),1)="[" then if len(text)>0 then text = text & vbCrLf & mid(arr(i),2,len(arr(i))-2) else text = mid(arr(i),2,len(arr(i))-2) end if end if next sections = split(text,vbCrLf) End If End Function Function options(fname,section) dim objFSo, objFile Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(fname,1) sText = objFile.ReadAll If Len(sText) > 0 then arr = split(sText,vbCrLf) text = "" cur = 0 for i=lbound(arr) to ubound(arr) if left(arr(i),1)="[" then cur = (mid(arr(i),2,len(arr(i))-2)=section) else if cur then if len(text)>0 then text = text & vbCrLf & split(arr(i),"=")(0) else text = split(arr(i),"=")(0) end if end if end if next options = split(text,vbCrLf) End If End Function Function FileExists(fname) Set fso = CreateObject("Scripting.FileSystemObject") FileExists = fso.FileExists(fname) End Function