|
Joined: Jun 2004
Posts: 291
Fjord artisan
|
OP
Fjord artisan
Joined: Jun 2004
Posts: 291 |
how come this doesnt work? [color:purple]
alias CloneScan {
var %chan = $$1
var %i = 1, %c = 1
hmake Hosts 5000
hmake Clones 5000
while ($nick(%chan,%i)) {
var %s = $address($nick(%chan,%i),2)
if ($hfind(Hosts,* $+ %s $+ *,0,w).data) {
if (!$hfind(Clones,* $+ %s %+ *,0,w).data) {
hadd -m Clones %c %s
inc %c
}
}
hadd -m Hosts $nick(%chan,%i) %s
inc %i
}
var %y = 1
while ($hget(Clones,%y)) {
var %a = $hget(Clones,%y)
var %xy = 1
while ($hget(Hosts,$hfind(Hosts,* $+ %a $+ *,%xy,w).data) {
echo -a Clone: %xy Nick: $hfind(Hosts,* $+ %a $+ *,%xy,w).data) Address: $hget(Hosts, $hfind(Hosts,* $+ %a $+ *,%xy,w).data))
inc %xy
}
inc %y
}
hfree Hosts
hfree Clones
echo -a Scan Finishes
}
[/color] thanks
|
|
|
|
NeUtRoN_StaR
|
NeUtRoN_StaR
|
at a glance your while loop is set to go on forever granted i dont know much but you might want to do while ($nick(%chan, %i) <= $nick(%chan, 0) then it runs through the routine until it has looked at everyone in the channel
|
|
|
|
DaveC
|
DaveC
|
Your loop is fine, why he suggested comparing a nick to being <= to the total number nicks is beyond me. Your code broke down here... while ($hget(Hosts,$hfind(Hosts,%a,%xy,w).data) { shoule have been... while ($hget(Hosts,$hfind(Hosts,%a,%xy,w).data)) ) { * below are suggestion only.... (1) Free the tables to begin with as from memory the script stops if the table already exists (i might be wrong on that) (2) $hfind( ???? , * $+ %x $+ *, ? ,w) can be replaced with $hfind( ???? ,%x, ? ,w) ( the %x is formated *!*@somedomain.com already so **!*@somedomain.com* is unlikely to find anything more) Below is the code i had after debuging the error and adding the suggestions, results before and after suggestion (2) remained the same.
alias CloneScan {
hfree -w Hosts
hfree -w Clones
hmake Hosts 5000
hmake Clones 5000
var %chan = $$1
var %i = 1, %c = 1
while ($nick(%chan,%i)) {
var %s = $address($nick(%chan,%i),2)
if ($hfind(Hosts,%s,0,w).data) {
if (!$hfind(Clones,%s,0,w).data) {
hadd -m Clones %c %s
inc %c
}
}
hadd -m Hosts $nick(%chan,%i) %s
inc %i
}
var %y = 1
while ($hget(Clones,%y)) {
var %a = $hget(Clones,%y)
var %xy = 1
while ($hget(Hosts,$hfind(Hosts,%a,%xy,w).data)) {
echo -a Clone: %xy Nick: $hfind(Hosts,%a,%xy,w).data) Address: $hget(Hosts, $hfind(Hosts,%a,%xy,w).data))
inc %xy
}
inc %y
}
hfree -w Hosts
hfree -w Clones
echo -a Scan Finishes
}
PS : I didnt actually find the output of this overly helpfull, but I guess if its what you needed 
|
|
|
|
Joined: Jun 2004
Posts: 291
Fjord artisan
|
OP
Fjord artisan
Joined: Jun 2004
Posts: 291 |
haah ^_^ thats great thanks works perfect now :P
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
Your loop is fine, why he suggested comparing a nick to being <= to the total number nicks is beyond me. Neutronstar == ricky knuckles. Why he said that is also beyond me... trying to help people is a great thing, though sometimes, if you are really inadequate at something, perhaps one shouldn't bother trying to help.
|
|
|
|
Joined: Jun 2004
Posts: 291
Fjord artisan
|
OP
Fjord artisan
Joined: Jun 2004
Posts: 291 |
any way i can make this script work..without having to /who the channel?
|
|
|
|
DaveC
|
DaveC
|
Oh yeah sorry, i forgot to say, i had to do a /who #channel to load the IAL up, when i was debugging it, i was like, WTF whys this person got no $address ?!?!?!?
To answer your question, you could whois everyone in the channel, lol
|
|
|
|
Joined: Jun 2004
Posts: 291
Fjord artisan
|
OP
Fjord artisan
Joined: Jun 2004
Posts: 291 |
|
|
|
|
|