|
Joined: May 2005
Posts: 449
Fjord artisan
|
OP
Fjord artisan
Joined: May 2005
Posts: 449 |
Hey, I have a script that tracks what nicks a person has used by using $address. It works for the most part except for two problems, one of which I think I fixed tonight. On joins, it used to say "Match found PersonsName" and "No match found PersonsName" at the same time, but I reversed two lines and I think that will work. I wasn't on the server long enough to tell. My other problem is that the variable gets too long and I get errors. Is there any way to change this script to make it work with more data? I thought hash tables might have something to do with it, but I dont know much about those. Also, would there be a way to keep the data I have in the log files and use it in the new fix for this? Thanks, here's the script.
on 1:JOIN:#: {
{ set -u5 %owner.chan $chan }
{ set %jointime. [ $+ [ $nick ] ] $fulldate }
{ set %join. [ $+ [ $nick ] ] 1 }
{ set %defaultqmsg "The pedestrian had no idea which direction to go, so I ran over him."
unset %addressoldlocation
unset %nicklist
unset %ad
unset %adold
unset %oldnicklist
var %ad = $address
var %adold = $read(C:\mirc\nicks.txt,w, %ad)
var %addressoldlocation = $readn + 1
var %nickwas = $read(C:\mirc\nicks.txt,n,%addressoldlocation)
var %nicklist = $read(C:\mirc\nicks.txt,n,%addressoldlocation) $+ , $nick
var %oldnicklist = $read(C:\mirc\nicks.txt,n,%addressoldlocation)
if ($nick iswm %nickwas) { notice Blake $nick was $remove(%nickwas,nick) }
if (%ad = %adold) { echo match found $nick }
elseif (%ad != %adold) { write -l %addressoldlocation C:\mirc\nicks.txt %nicklist }
else { echo no match found $nick | write C:\mirc\nicks.txt %ad | write C:\mirc\nicks.txt $nick }
unset %addressoldlocation
unset %nicklist
unset %ad
unset %adold
unset %nickwas
unset %oldnicklist
unset %jointime. [ $+ [ $nick ]
halt
}
}
on 1:PART:#: {
unset %jdate
unset %join. [ $+ [ $nick ] ]
unset %quit. [ $+ [ $nick ] ]
unset %fdjoin. [ $+ [ $nick ] ]
unset %jointime. [ $+ [ $nick ] ]
var %quit. [ $+ [ $nick ] ] $fulldate
if (%join. [ $+ [ $nick ] ] = 1) { write C:\mirc\whowas.txt $address | write C:\mirc\whowas.txt $nick joined $chan on $date at %jointime and left on %quit. [ $+ [ $nick ] ] }
else { write C:\mirc\whowas.txt $address | write C:\mirc\whowas.txt $nick parted on %quit. [ $+ [ $nick ] ] }
halt
}
on 1:QUIT: {
unset %fdjoin. [ $+ [ $nick ] ]
unset %join. [ $+ [ $nick ] ]
unset %quit. [ $+ [ $nick ] ]
unset %jointime. [ $+ [ $nick ] ]
unset %jdate
var %quit. [ $+ [ $nick ] ] $fulldate
if (%join. [ $+ [ $nick ] ] = 1) { write C:\mirc\whowas.txt $address | write C:\mirc\whowas.txt $nick joined $chan on $date at %jointime and left on %quit. [ $+ [ $nick ] ] }
elseif ($nick == $me) { /unsetall }
else { write C:\mirc\whowas.txt $address | write C:\mirc\whowas.txt $nick parted on %quit. [ $+ [ $nick ] ] }
halt
}
on 1:KICK:#: {
var %quit. [ $+ [ $knick ] ] $fulldate
if (%join. [ $+ [ $nick ] ] = 1) { write C:\mirc\whowas.txt $address | write C:\mirc\whowas.txt $knick joined $chan on $date at %jointime and was kicked on %quit. [ $+ [ $nick ] ] }
else { write C:\mirc\whowas.txt $address | write C:\mirc\whowas.txt $knick was kicked on %quit. [ $+ [ $nick ] ] }
unset %fdjoin. [ $+ [ $nick ] ]
unset %join. [ $+ [ $nick ] ]
unset %quit. [ $+ [ $nick ] ]
halt
}
on 1:NICK: {
unset %addressoldlocation
unset %nicklist
unset %ad
unset %adold
var %ad = $address
var %adold = $read(C:\mirc\nicks.txt,w, %ad)
var %addressoldlocation = $readn + 1
var %nickwas = $read(C:\mirc\nicks.txt,n,%addressoldlocation)
var %nicklist = $read(C:\mirc\nicks.txt,n,%addressoldlocation) $+ , $newnick
var %oldnicklist = $read(C:\mirc\nicks.txt,n,%addressoldlocation)
if (*phobia* iswm $newnick) { msg #chat $read(phobia.txt,w, $newnick $+ *) }
elseif ($newnick isin %oldnicklist) { notice Blake $newnick was %nicklist }
elseif (%ad = %adold) { echo match found $nick | notice $me $newnick was %nickwas | write -l %addressoldlocation C:\mirc\nicks.txt %nicklist }
else { echo no match found %newnick | write C:\mirc\nicks.txt %ad | write C:\mirc\nicks.txt $newnick | halt }
unset %addressoldlocation
unset %nicklist
unset %ad
unset %adold
unset %oldnicklist
}
|
|
|
|
Joined: Oct 2005
Posts: 54
Babel fish
|
Babel fish
Joined: Oct 2005
Posts: 54 |
What is this script supposed to do? Log IP's? 'cause if it is just use on *:JOIN:#: {
/writeini loggedips.ini $remove($address($nick,2),@,!,*) $nick $time
/echo $nick Logged as $remove($address($nick,2),@,!,*)
} ...But yeah, what is your code supposed to do?
Chat NSNMy Server: sleepystickman.ircxpro.com
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
No. His code is to track all nicks for a given IP/DNS.
Example:
*!*@192.34.124.1 Riamus Riamus[Away] Riamus[Sleep] Not_Me
It helps to allow you to know if someone changed their nick in an effort to hide who they are.
The use of &binvars will probably help you out without having to really change much of your script.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
OP
Fjord artisan
Joined: May 2005
Posts: 449 |
Hey,
Thanks for that info. I looked into binary variables and didn't understand it completely. Could you give me an example of how it works or how it could help me here? And is there a way to keep the info I have in the log file from the existing script> Thanks
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
I've never actually messed with them, but here... This will read the first line of the file. What you'll need to do is change the "1" in the bread based on where you want to start your search. You'll need to find the address in the file (use $read) and figure out what character in the file that that address line starts on. Replace 1 with that. Then, it will read in the line for that address... assuming the address is on the same line as the nicks.
var &nicks
bread -t [color:red]your_file.txt[/color] 1 99999 &nicks
Then, you will use /btrunc to truncate the list of nicks at perhaps 900 or so characters and display those, then display the next X characters using $bvar(&nicks,%startinglocation,900) Maybe someone else can give a better explanation. As I said, I've never really used them.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
You should post exactly what you want the script to do. For example:
When user joins/changes nick: - Log their nick, address, join time to a file - Check for other nicknames that used that address - Report the other nicknames to someone
When user quits/parts/gets kicked: - Log their nick, address, part time to a file
-genius_at_work
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
OP
Fjord artisan
Joined: May 2005
Posts: 449 |
The script does most of what I want it to do, although I have noticed some problems. On joins, if it finds a match from the file, it's supposed to say "Blake was Blake-brb, Blake-away" etc. I've noticed that it won't do that for me on joins, and I'm not sure why. It does it on nick though. From the beginning, to explain the whole script, it's supposed to do this:
1. On join, if it does not find a match, it makes a two line entry in the log, just like Riamus said, like this:
*!*@192.34.124.1 Riamus If it finds a match, it is supposed to tell me who they were like I mentioned before. 2. Quits and parts are the same. If it did not find a match, it writes the two line entry. I also have another log to record when they left, but that doesn't need worked with. 3. Nick changes are the same as joins. I just want it to tell me who they were and record the nick.
I'm kinda out of it right now (tired), so I apologize if I missed anything. You can ask any questions you have. Thanks.
PS--I just fixed the on join problem. The original line was this: if (%ad = %adold) { echo match found $nick } I changed it to this: if (%ad = %adold) { echo match found $nick | notice Blake $nick was $remove(%nickwas,nick) } I'm not sure why I wasn't noticed on joins with this line: if ($nick iswm %nickwas) { notice Blake $nick was $remove(%nickwas,nick) } Oh well, I'm giving this up for tonight. Thanks for any help.
Last edited by bwr30060; 18/11/05 05:40 AM.
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
OP
Fjord artisan
Joined: May 2005
Posts: 449 |
Hi, Sorry for all the posts. I do have one more question about the current script. If it does not find a match on join, it only echoes "No match found" in my status window. It's supposed to say "No match found PersonsName" With this line in the script, how is it not including the name?
else { echo no match found $nick | write C:\mirc\nicks.txt %ad | write C:\mirc\nicks.txt $nick }
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
Here is a preliminary script that I wrote to record hosts/nicks for you. I wasn't sure exactly what you wanted to be informed of, etc.. so I just made it how I would want such a script to operate. Here is the code:
alias -l wwsend [color:blue]notice geniusBOT[/color] $1-
on *:JOIN:#: {
var %wwaddr = $gettok($address,2,64)
var %wwtimes = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$nick)),1,58),$ifmatch,0)
var %wwpart = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$nick)),3,58),$ifmatch,0)
var %wwmsg = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$nick)),4,58),$ifmatch,0)
writeini -n whowas.ini %wwaddr $+(n.,$nick) $+($calc(%wwtimes + 1),:,$ctime,:,%wwpart,:,%wwmsg)
var %wwncount = $ini(whowas.ini,%wwaddr,0)
if (%wwncount > 1) {
wwsend $nick has used $calc(%wwncount - 1) other nicks. $nick was:
var %wwnick, %wwlist, %wwnum = 1
while (%wwnum < %wwncount) {
%wwnick = $gettok($ini(whowas.ini,%wwaddr,%wwnum),2,46)
if ($len($addtok(%wwlist,$chr(32) $+ %wwnick,44)) > 300) {
wwsend %wwlist
%wwlist = $null
}
%wwlist = $addtok(%wwlist,$chr(32) $+ %wwnick,44)
inc %wwnum
}
if ($len(%wwlist) > 0) wwsend %wwlist
}
}
on *:NICK: {
var %wwaddr = $gettok($address,2,64)
var %wwtimes = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$newnick)),1,58),$ifmatch,0)
var %wwpart = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$newnick)),3,58),$ifmatch,0)
var %wwmsg = NICK- was $nick
writeini -n whowas.ini %wwaddr $+(n.,$newnick) $+($calc(%wwtimes + 1),:,$ctime,:,%wwpart,:,%wwmsg)
var %wwncount = $ini(whowas.ini,%wwaddr,0)
if (%wwncount > 1) {
wwsend $newnick has used $calc(%wwncount - 1) other nicks. $newnick was:
var %wwnick, %wwlist, %wwnum = 1
while (%wwnum < %wwncount) {
%wwnick = $gettok($ini(whowas.ini,%wwaddr,%wwnum),2,46)
if ($len($addtok(%wwlist,$chr(32) $+ %wwnick,44)) > 300) {
wwsend %wwlist
%wwlist = $null
}
%wwlist = $addtok(%wwlist,$chr(32) $+ %wwnick,44)
inc %wwnum
}
if ($len(%wwlist) > 0) wwsend %wwlist
}
}
on *:PART:#: {
var %wwaddr = $gettok($address,2,64)
var %wwtimes = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$nick)),1,58),$ifmatch,0)
var %wwjoin = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$nick)),2,58),$ifmatch,0)
var %wwmsg = PART- $1-
writeini -n whowas.ini %wwaddr $+(n.,$nick) $+(%wwtimes,:,%wwjoin,:,$ctime,:,%wwmsg)
}
on 1:QUIT: {
var %wwaddr = $gettok($address,2,64)
var %wwtimes = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$nick)),1,58),$ifmatch,0)
var %wwjoin = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$nick)),2,58),$ifmatch,0)
var %wwmsg = QUIT- $1-
writeini -n whowas.ini %wwaddr $+(n.,$nick) $+(%wwtimes,:,%wwjoin,:,$ctime,:,%wwmsg)
}
on 1:KICK:#: {
var %wwaddr = $gettok($address,2,64)
var %wwtimes = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$knick)),1,58),$ifmatch,0)
var %wwjoin = $iif($gettok($readini(whowas.ini,%wwaddr,$+(n.,$knick)),2,58),$ifmatch,0)
var %wwmsg = KICK- $1-
writeini -n whowas.ini %wwaddr $+(n.,$knick) $+(%wwtimes,:,%wwjoin,:,$ctime,:,%wwmsg)
}
I made it keep track of how many times the person has joined/changed nicks, when they last joined/changed nicks, when they last quit/parted/were kicked, and a message to keep track of their changes (QUITs, KICKs, PARTs, NICKs, and any accompanying messages). The blue part in the first line of code is what you would change if you wanted the notifications to be /echo'd or /msg'd, etc. If you need help making any further changes to the code, just post it here. -genius_at_work
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Hi, Sorry for all the posts. I do have one more question about the current script. If it does not find a match on join, it only echoes "No match found" in my status window. It's supposed to say "No match found PersonsName" With this line in the script, how is it not including the name?
else { echo no match found $nick | write C:\mirc\nicks.txt %ad | write C:\mirc\nicks.txt $nick }
echo no match found %newnick
You didn't use $nick in your code above, you used %newnick. If you used $newnick, this would do what you wanted, I think.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
OP
Fjord artisan
Joined: May 2005
Posts: 449 |
I used %newnick in the ON NICK section, but in the ON JOIN section where I'm having problems, I used $nick. Not sure what to do there. Thanks.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Ah, my mistake. I'm not sure why it's not displaying the nick. It would take some debugging to figure that out. Just a couple notes with looking more closely at your script...
/var doesn't need to be /unset. So you can remove all those /unset lines as long as the variable is set with /var instead of /set.
And, your first 3 lines in the on join have {}'s around them for some reason. I'm not sure why as those aren't needed.
Anyhow, you might want to try out the other script posted above and see if that does what you need. I've not looked at it or tested it, so I'm not sure exactly what it does right now.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
|