Author Topic: Requesting "!seen" script  (Read 33457 times)

jcof

  • Guest
Re: Requesting "!seen" script
« Reply #30 on: January 19, 2009, 11:36:53 AM »
[17:31:21]  ->> ERROR:modScriptFunctions:seen.ice:Function:LoadScriptFile: Error Number:1032 : Invalid character
[17:35:44]  ->> ERROR:modScriptFunctions:seen.ice:Function:LoadScriptFile: Error Number:1032 : Invalid character

[17:36:00] -- Script Engine Error:13:Type mismatch: 'scan': Line #1 --
[17:36:07] -- Script Engine Error:13:Type mismatch: 'scan': Line #1 --
[17:36:11] -- Script Engine Error:13:Type mismatch: 'scan': Line #1 --
[17:21:39] -- Script Engine Error:1002:Syntax error: Line #1 -- scan #channel

well these are the errors I'm getting and I cant fix it any help?  :?

Atreus

  • Guest
Re: Requesting "!seen" script
« Reply #31 on: January 19, 2009, 11:49:18 AM »
You want my version, which is know to be errorless?  :-D

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Requesting "!seen" script
« Reply #32 on: January 19, 2009, 12:10:12 PM »
This is an old script that never worked perfectly, I wrote a new one a while ago, and it's found in the download section of this site

or here if you're lazy
« Last Edit: January 20, 2009, 11:27:47 AM by DarkStar »
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

jcof

  • Guest
Re: Requesting "!seen" script
« Reply #33 on: January 19, 2009, 04:57:40 PM »
Yeah I downloaded it from the download section the first time and now from yourlink, it still give me the same error though. i added that command to alias /scan: something like this but no lucky! :(

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Requesting "!seen" script
« Reply #34 on: January 19, 2009, 07:36:35 PM »
It is supposed to be added as an alias.
So you go to the IceChat Editor, in the Aliases tab and add this.

/scan:/! scan $1

If that does not work, then the script was not loaded properly.
« Last Edit: January 20, 2009, 11:19:49 AM by Snerf »
The IceChat God

HKboy

  • Guest
Re: Requesting "!seen" script
« Reply #35 on: February 13, 2009, 02:22:24 AM »
Mario, nice seen script, I'm using it.

But can you make it so, that it only works in some channels, OR that only me can use it (maybe this is better, as BotServ usually has the seen script)?

Sorry, but I can't understand the scripting style of Icechat

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Requesting "!seen" script
« Reply #36 on: February 13, 2009, 03:40:43 AM »
I'm starting to think all new IceChat users come from a parallel universe where o is the same as a

anyway, back to your request.

To make the script work for you only, remove the ONTEXT sub in the script

To make the script work only in one or more channels (and still work for everyone) add this line to the beginning of the ONTEXT sub
Code: [Select]
If Not (Channel="#channelname" or Channel = "#someotherchannel") then exit sub

If you want to exclude one or more channels add this
Code: [Select]
If Channel="#channelname" or Channel = "#someotherchannel" then exit sub

fore only one channel, you can remove the parentheses and the "or Channel = ..."

The script will still record data for all channels, but it won't trigger when someone uses the !seen command.
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

HKboy

  • Guest
Re: Requesting "!seen" script
« Reply #37 on: February 14, 2009, 01:15:42 PM »
I'm starting to think all new IceChat users come from a parallel universe where o is the same as a
I'm not new with icechat, I just never cared about icechat scripting.


I've experimented, and this is what I came with:
Code: [Select]
If Nickname="HKboy" or Nickname = "Diffybot" then
I just did that, and it worked =). Thank you Morio.

Socom

  • Guest
Re: Requesting "!seen" script
« Reply #38 on: May 04, 2009, 08:29:10 AM »
I keep getting two errors.. upon loading the script I get:

[11:26]  ->> ERROR:modScriptFunctions:seen.ice:Function:LoadScriptFile: Error Number:1032 : Invalid character

When I run the /scan I get:

[11:27] -- Script Engine Error:1032:Invalid character: Line #335 -- __________ Information from ESET NOD32 Antivirus, version of virus signaturedatabase 3631 (20081121) __________
[11:27] -- Script Engine Error:1002:Syntax error: Line #1 -- scan #EoD

I have tried removing the script and reloading it.. but no such luck.. any ideas?

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Requesting "!seen" script
« Reply #39 on: May 04, 2009, 08:32:09 AM »
Best if you just post the lines that are producing those errors, to see what the problem is. An invalid character means the script was written wrong somewhere.
The IceChat God

Socom

  • Guest
Re: Requesting "!seen" script
« Reply #40 on: May 04, 2009, 08:34:20 AM »
Line1: '#####################

Line 335:    SendCommand "/msg " & Channel & " " & Who & " has never been seen on this channel",ServerNumber


Hope that helps

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Requesting "!seen" script
« Reply #41 on: May 04, 2009, 08:42:04 AM »
Well, both of those look fine, but line 335 looks like something else.

At line #1 it is seeing "scan #EOD" .. that must be somewhere there. Unless you have it in another script.

At the very bottom of the script, does it have "__________ Information from ESET NOD32 Antivirus, version of virus signaturedatabase 3631 (20081121) __________" or such, those lines should be removed, it looks like a NOD32 Tag (Thats an antivirus)
The IceChat God

Socom

  • Guest
Re: Requesting "!seen" script
« Reply #42 on: May 04, 2009, 08:51:01 AM »
The line 1 error was it echoing my /scan #EoD

Found the code at the bottom.. removed.. all errors are gone.. works perfect!

Thank you..

Anyway to allow for wildcards with the !seen?

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Requesting "!seen" script
« Reply #43 on: May 04, 2009, 11:26:12 AM »
The script would have to be modified to allow for wild cards.
The IceChat God

Manyman

  • Guest
Re: Requesting "!seen" script
« Reply #44 on: July 11, 2010, 11:29:29 PM »
Can sombody show me the code for when somebody types !seen Manyman or !seen Awayman it shows a message. Below is my code:
Code: [Select]
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="#wikia" or Channel="#wikia-vstf" or Channel="#cvn-wikia" 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 Not (Left(Who,1) = "!" or Left(Who,1) = "+" or Left(Who,1) = "." or InStr(Who," ") > 0)then
   
      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 and Not When = "pwo" 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

        If When = "pwo" then
          SendCommand "/msg " & Channel & " " & Who & " seems to have left the channel or changed his nick while I was offline",ServerNumber
        End If
      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)
  If s_channel = "$1" then
    arr = Split(Stext,vbCrLf)
      Text = ""
      For i = LBound(arr) to UBound(arr)
        if Len(arr(i)) > 4 and Left(arr(i),4) = "join" then
          arr(i) = "part" & Mid(arr(i),InStr(arr(i),":"))
          arr(i) = Left(arr(i),InStr(arr(i),"=")) & "pwo"
        End If
        If Not Text = "" then
          Text = Text & vbCrLf & arr(i)
        End If
        If Text = "" then
          Text = arr(i)
        End If
      Next
    End If

  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFile = objFSO.OpenTextFile(getidentifier("$scriptdir")+"seen.ini",2)
  objFile.writeLine(Text)
  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,""
        writeinifile "seen.ini",Channel,"part:" & Nick,""
        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
Manyman