Author Topic: Was seen before script  (Read 4663 times)

Celitan

  • Newbie
  • *
  • Posts: 4
Was seen before script
« on: July 20, 2007, 12:16:51 AM »
Hi,
i am using Ice Chat and am very happy with it, though i did some light scripts i can not figure out how to do this:

I want a script to check on a file if an IP Adress of somewhone did appear before.

Have found the IP loging script for IceChat5 and tried to work from there on, but cant make it.

What i want to do is:

if a User logs in as AAA his IP, then logs off and returns later as BBB it should state something like this to me:

BBB was seen loged in before as AAA

and best with a timestamp when AAA entered or left the channel, so i can look it up in the logs...

thanks for your help and sorry for my bad english, i am generally german.

Celitan

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Was seen before script
« Reply #1 on: July 20, 2007, 09:05:14 AM »
Do you want to keep a separate file for all the joins to read this information from?
Do you want to keep it for a single channel, or multiple channels?

If so, best to keep a separate file for each channel.

All you basically need to do is in the ON JOIN event, read through the file to check for a previous match to
the host, and write out the message if a match is found.
If no match is found, write out the nickname and host to the file, and the time.

Of course, the larger the file gets, the slower the script will run, so you may want to limit the file somehow.
The IceChat God

Celitan

  • Newbie
  • *
  • Posts: 4
Re: Was seen before script
« Reply #2 on: July 23, 2007, 10:46:34 PM »
Yes, one file per channel,
a week should be more than enough for my purpose, so the script could delete older entrys...

will ponder over this and get myself into it at the weekend...

cu
Celitan

Celitan

  • Newbie
  • *
  • Posts: 4
Re: Was seen before script
« Reply #3 on: July 24, 2007, 10:07:04 AM »
o.k. usually i dont do dubble posts... but...

i got a mirc script from a friend, that does what i want, but i can not get it to work...

Code: [Select]

; Tye @ DALnet <tye@mirc.net>
ON *:START: {
  hmake trackusers 10
  if ($isfile(trackusers.dat)) {
    hload trackusers trackusers.dat
  }
}
on *:JOIN:#: {
  if ($hget(trackusers,$address($nick,3))) {
    var %n = $ifmatch
    if ($istok(%n,$nick,32)) { var %d = $deltok(%n,$findtok(%n,$nick,1,32),32) }
    else { var %d = %n }
    if (!%d) { return }
    echo $colour(info) -ti2 $chan * $nick has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d
    if (!$istok(%n,$nick,32)) {
      hadd trackusers $address($nick,3) %n $nick
    }
  }
  else {
    hadd trackusers $address($nick,3) $nick
  }
}
on *:NICK: {
  if ($hget(trackusers,$address($newnick,3))) {
    var %n = $ifmatch
    if (!$istok(%n,$newnick,32)) {
      hadd trackusers $address($newnick,3) %n $newnick
    }
  }
  else {
    hadd trackusers $address($nick,3) $newnick
  }
}
menu nicklist {
  Track Users
  .View Other Nicknames:{
    if (!$address($$1,3)) { echo $colour(info) -ti2 # * IAL not updated for $$1 $+ , performing userhost lookup | userhost $$1 | return }
    if ($hget(trackusers,$address($$1,3))) {
      var %n = $ifmatch
      if ($istok(%n,$$1,32)) { var %d = $deltok(%n,$findtok(%n,$$1,1,32),32) }
      else { var %d = %n }
      if (!%d) { goto notknown }
      echo $colour(info) -ti2 # * $$1 has also used the nickname $+ $iif($numtok(%d,32) > 1,s:,:) %d
    }
    else {
      :notknown
      echo $colour(info) -ti2 # * $$1 has not been known by any other nickname
    }
  }
  .Reset:hdel trackusers $address($$1,3)
}
ON *:EXIT: {
  if ($hget(trackusers)) { hsave -o trackusers trackusers.dat }
}


can anyone help it getting it working?

Celitan

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Was seen before script
« Reply #4 on: July 24, 2007, 11:34:50 AM »
The problem is with hmake, hget, hadd, and all those similar commands.
They are not supported in IceChat. The mirc scripting engine in IceChat is not a full copy, only partial.
But I am sure, the script can be converted to VB Script and be made to work, once we know what these commands do.
It doesn't look too complicated.
The IceChat God

Celitan

  • Newbie
  • *
  • Posts: 4
Re: Was seen before script
« Reply #5 on: July 31, 2007, 07:30:42 AM »
o.k. i tired but cant get the trick...

maybe someone can do it in vb...

hope to get this  :-D

well wishes
Celitan