Nick tracking script needs some work - 17/11/05 08:17 AM
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.
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.
Code:
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 }