scan for ip - 31/10/05 07:24 PM
hi, i've been trying to make a script that searches for an ip address on all the channels that i'm currently in and i have a small problem: if a users is in 5 channels and he matches the mask that i'm searching for.. he shows up 5 times in my search.
any ideas what I should do? here's my script:
a small second question would be... $comchan($me,x) is the only way i can find out the names of the channels that i'm currently in? isn't there something else?
thanks everybody.
any ideas what I should do? here's my script:
Code:
/* IP SEARCH MENU BEGIN */ menu channel { Search IP:{ %mask = $$?="Enter address mask to search for (ex: *!*@*242.98) :" %totalNrOfChannels = $comchan($me,0) %foundAtLeastOne = 0 %iterator1 = 1 ; while (%iterator1 <= %totalNrOfChannels) { [color:green] // search in every channel[/color] %currentChan = $comchan($me,%iterator1) //get the name of current channel %iterator2 = 1 if ($ialchan(%mask,%currentChan,0) != 0) { [color:green] // if i've found at least a user that matches.. i list them all[/color] while (%iterator2 <= $ialchan(%mask,%currentChan,0)) { echo -at $ialchan(%mask,%currentChan,%iterator2) found matching %mask in %currentChan $+ . %foundAtLeastOne = 1 [color:green] //also remembering i found at least one [/color] inc %iterator2 } } inc %iterator1 } ; [color:green] // if i find none... show message[/color] if (%foundAtLeastOne == 0) echo -at Search found no results matching %mask $+ . } } /* IP SEARCH MENU END */
a small second question would be... $comchan($me,x) is the only way i can find out the names of the channels that i'm currently in? isn't there something else?
thanks everybody.