mIRC Home    About    Download    Register    News    Help

Print Thread
#159148 14/09/06 01:43 PM
Joined: Dec 2005
Posts: 15
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Dec 2005
Posts: 15
how can i make a script who read and notify me everytime that connects a same IP ??, for example we have an IP 200.221.45.67 with the nick of mirna....then the next week the same ip connects but with the nick of norma...then the script read that and send me a message about this IP, can we do that ??

#159149 14/09/06 02:01 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
By connect, do you literally mean when they connect to the network, or do you mean when they join your room/channel? If the first, then you will probably need to have IRCop status on the network. Please reply with the network and if you have IRCop status on it or not.

If the second, then it's quite a bit easier. In either case, there's no guarantee that it's going to be the same person, whether they are using a different nick or not. Some IP addresses (especially those used for people using dial-up access) are dynamically set, not statically. The difference is that with a dynamic address, as soon as one person stops using an address, it becomes available for someone else to use. In comparison, a static address is reserved for you and you only.

#159150 14/09/06 02:07 PM
Joined: Dec 2005
Posts: 15
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Dec 2005
Posts: 15
well im not an ircop so the second alternative is the right ask....i mean this script must be work in all channels where i will be...so if just work in one channel thats ok too...

#159151 14/09/06 02:11 PM
Joined: Dec 2005
Posts: 15
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Dec 2005
Posts: 15
maybe i can make a list (ips.txt) and read it every time that a nick joins in my channels and send me a message or...another list (kicks.txt) with nicks and kick it...maybe..i dont know!!

#159152 14/09/06 07:32 PM
Joined: Sep 2003
Posts: 261
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
I dunno your level of script experience but I'm no better off, so I'm gunna give you some small stuff I just came up with.

Code:
on 1:join:#: {
  var %pathtoaddressdat = $+(", $scriptdirips.txt, ")

  ;$scriptdirips.txt means $scriptdir (the scripts directory) plus ips.txt
  ;$address($nick,2) will result in *!*@address
  ;read the %pathtoaddressdat for a line beginning with the address if found echos the result

  if ($read(%pathtoaddressdat,w, $address($nick,2))) {
    echo -a $nick $+ 's address matches address in database
  }
}

ips.txt
*!*@ipaddress
*!*@somethingblahblah

#159153 14/09/06 08:35 PM
Joined: Dec 2005
Posts: 15
M
Pikka bird
OP Offline
Pikka bird
M
Joined: Dec 2005
Posts: 15
thanks im gonna try it...:)

#159154 14/09/06 09:44 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Here's what I came up with. While Scorpwanna's script looks like it'd work (I didn't test it), this is more complex, and will track on a channel by channel basis, and is also multiple network compatable.
Code:
 on me:*:join:#:{
  var %a = 1, %b = $nick($chan,0)
  while %a <= %b {
    var %address = $address($nick($chan,%a),0)
    %address = $right(%address,-2)
    .hadd -m Aliases $+($network,.,$chan,.,%address) $addtok($hget(Aliases,$+($network,.,$chan,.,%address)),$nick($chan,%a),44)
    if $numtok($hget(Aliases,$+($network,.,$chan,.,%address)),44) > 1 {
      var %aka = $remtok($hget(Aliases,$+($network,.,$chan,.,%address)),$nick,1,44)
      echo -a $nick in $chan from $network using $address also recognized as $replace(%aka,$chr(44),$+($chr(44),$chr(32)))
    }
  }
}
on *:join:#:{
  .hadd -m Aliases $+($network,.,$chan,.,$address) $addtok($hget(Aliases,$+($network,.,$chan,.,$address)),$nick,44)
  if $numtok($hget(Aliases,$+($network,.,$chan,.,$address)),44) > 1 {
    var %aka = $remtok($hget(Aliases,$+($network,.,$chan,.,$address)),$nick,1,44)
      echo -a $nick in $chan from $network using $address also recognized as $replace(%aka,$chr(44),$+($chr(44),$chr(32)))
  }
}
on *:start:{
  if !$hget(Aliases) { .hmake Aliases 10 }
  if $exists(Aliases.hsh) { .hload Aliases Aliases.hsh }
}
on *:exit:{
  .hsave -o Aliases Aliases.hsh
}
on *:disconnect:{
  .hsave -o Aliases Aliases.hsh
}
 

#159155 14/09/06 11:52 PM
Joined: Sep 2003
Posts: 261
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2003
Posts: 261
Whoa, yeah I'd say that's more complex heh. Prolly better for what he needs too.

#159156 16/09/06 09:05 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
I tried using the script, and it does look neat.
Just discovered one problem though.
When I join a channel, it freezes my mIRC.

I hit CTRL+Break
* Break: command halted (line 7, Aliasses_script.mrc)

Which refers to:
if $numtok($hget(Aliases,$+($network,.,$chan,.,%address)),44) > 1 {

Any idea what's wrong?

#159157 16/09/06 10:05 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
I think you forgot the inc %a command

Code:
on me:*:join:#:{
  var %a = 1, %b = $nick($chan,0)
  while %a <= %b {
    var %address = $address($nick($chan,%a),0)
    %address = $right(%address,-2)
    .hadd -m Aliases $+($network,.,$chan,.,%address) $addtok($hget(Aliases,$+($network,.,$chan,.,%address)),$nick($chan,%a),44)
    if $numtok($hget(Aliases,$+($network,.,$chan,.,%address)),44) > 1 {
      var %aka = $remtok($hget(Aliases,$+($network,.,$chan,.,%address)),$nick,1,44)
      echo -a $nick in $chan from $network using $address also recognized as $replace(%aka,$chr(44),$+($chr(44),$chr(32)))
    }
    [color:blue]inc %a[/color]
  }
}

#159158 16/09/06 01:15 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Ooops..yeah, I did miss that...sorry...nice catch. Thanks.

#159159 24/09/06 02:48 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
I've been using RusselB's script for a while now, and in general it works pretty neat.
There is just one thing that bugs me (kind of).

When someone joins like 5 channels, that we are both in, the script relays it all 5 times.

Is there a way to limit this, so that it only echo's this 1 time.

Below is the example of what I mean:
=16:36:31= NICK in #channel1 from SERVER using ADDRESS also recognized as ALIAS1, ALIAS2
=16:36:45= NICK in #channel2 from SERVER using ADDRESS also recognized as ALIAS1, ALIAS2
=16:36:47= NICK in #channel3 from SERVER using ADDRESS also recognized as ALIAS1, ALIAS2
=16:36:49= NICK in #channel4 from SERVER using ADDRESS also recognized as ALIAS1, ALIAS2
=16:36:51= NICK in #channel5 from SERVER using ADDRESS also recognized as ALIAS1, ALIAS2

Thx for any help

#159160 25/09/06 01:56 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Here you go:
Code:
 on me:*:join:#:{
  var %a = 1, %b = $nick($chan,0)
  while %a <= %b {
    var %address = $address($nick($chan,%a),0)
    %address = $right(%address,-2)
    .hadd -m Aliases $+($network,.,$chan,.,%address) $addtok($hget(Aliases,$+($network,.,$chan,.,%address)),$nick($chan,%a),44)
    if $numtok($hget(Aliases,$+($network,.,$chan,.,%address)),44) > 1 {
      var %aka = $remtok($hget(Aliases,$+($network,.,$chan,.,%address)),$nick,1,44)
      echo -a $nick in $chan from $network using $address also recognized as $replace(%aka,$chr(44),$+($chr(44),$chr(32)))
    }
    inc %a
  }
}
on *:join:#:{
  .hadd -m Aliases $+($network,.,$chan,.,$address) $addtok($hget(Aliases,$+($network,.,$chan,.,$address)),$nick,44)
  if $numtok($hget(Aliases,$+($network,.,$chan,.,$address)),44) > 1 {
    var %aka = $remtok($hget(Aliases,$+($network,.,$chan,.,$address)),$nick,1,44)
    if $comchan($nick,0) == 1 {
      echo -a $nick in $chan from $network using $address also recognized as $replace(%aka,$chr(44),$+($chr(44),$chr(32)))
    }
  }
}
on *:start:{
  if !$hget(Aliases) { .hmake Aliases 10 }
  if $exists(Aliases.hsh) { .hload Aliases Aliases.hsh }
}
on *:exit:{
  .hsave -o Aliases Aliases.hsh
}
on *:disconnect:{
  .hsave -o Aliases Aliases.hsh
}
 

#159161 25/09/06 05:41 AM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Cool!

Thx a lot RusselB.


Link Copied to Clipboard