mIRC Home    About    Download    Register    News    Help

Print Thread
Back to the source . . . . . :) #74564 09/03/04 11:59 AM
Joined: Nov 2003
Posts: 46
D
Dizkonnekted Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2003
Posts: 46
Hi All,

Thanks a lot for the speedy help offered previously, I'm hoping for a repeat performance here. I have a learned a lot since my last visit! cool

So the question:
I have a simple # check in place when someone joins my # I whois them, the resulting raw info is checked to see if a user is on a 'bad channel' and if so they are kicked. ( you can see where I'm going with this!! :tongue: )

Now currently there is nothing in place to prevent someone from joining a 'bad chanel' AFTER they have joined my # and made it past my initial check!!

What I would like to be able to do is the same check again say every 5 mins, but automatically, from say a popup or constantly running loop, for all the people in the channel. Prefferably with say a 10 - 15 second gap between each user. I.E. $nick(#, 1) then 10 secs later $nick(#, 2) etc etc.

I have tried using a while loop to no avail, and have even managed to get kicked off irc for flooding! heh!
So any help would really be appreciated.

Thanks,
Dizkonnekted


Dizkonnekted from reality....!
Re: Back to the source . . . . . :) #74565 09/03/04 12:15 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
alias checkall {
var %i 1
while $nick(#channel,%i) {
/yourcheck $nick(#channel,%i)
inc %i
}
}

/timer 1 300 checkall


New username: hixxy
Re: Back to the source . . . . . :) #74566 09/03/04 02:00 PM
Joined: Nov 2003
Posts: 46
D
Dizkonnekted Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2003
Posts: 46
Hi tidy_trax,

Thanks for the speedy response, but it not *quite* what I am looking for. The code you provided will allow me to whois the whole channel at once, I want to try and avoid this as I could get kicked for flooding if there is a lot of users on the channel!

I'm looking for a way to start at $nick(#,1) and run through all of the nicks up to the limit of $nick(#, 0) in the channel as I said, but I want a *delay* (say 15 secs) between each nick.
I'm just not sure how to do this. But thanks again tidy_trax!!

If anyone else has any ideas please let me know!

Thanks,
Dizkonnekted


Dizkonnekted from reality....!
Re: Back to the source . . . . . :) #74567 09/03/04 02:30 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
alias checkall {
var %i 1
while $nick(#channel,%i) {
/timer [ $+ [ $nick ] ] 1 $calc(%i *15) yourcheck $nick(#channel,%i)
inc %i
}
}


New username: hixxy
Re: Back to the source . . . . . :) #74568 09/03/04 03:05 PM
Joined: Nov 2003
Posts: 46
D
Dizkonnekted Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2003
Posts: 46
Hi Again tidy_trax,

This hasnt worked, I got flooded off frown lol.
Here is my understanding of what you posted, which is most likely completly wrong heh!
alias checkall {
;Declare %i and set it to 1
var %i 1
;here is where I'm stumped
;to me it appears as
;while ( nick 1 isin the #channel ) { do stuff }
while $nick(#channel,%i) {
;the 'stuff' to do, set a timer as someones nick
;+ 1, i.e. timerjoe 1
/timer [ $+ [ $nick ] ] 1
;then give result of multiplying %i by 15?
$calc(%i *15)
;then do my check ( a whois) on nick 1 on #channel
yourcheck $nick(#channel,%i)
;then increase %i by 1
}

I know im missing brackets etc but I wanted to break it down like that to see if I am getting it right. I have edited the above and placed it in the remote section as follows:
alias check {
var %i 1
while $nick( #, %i ) { timer [ $+ [ $nick ] ] 1
$calc(%i *15) whois $nick( #, %i ) }
inc %i
}
I have left it as # on purpose so I can run it in any channel, but I got a whole heap of timers (ctrl+break that!) and then flooded off once I stopped them.
If you could break down the examples as I have done I would appreciate it.

Thanks again for the help
Dizkonnekted


Dizkonnekted from reality....!
Re: Back to the source . . . . . :) #74569 09/03/04 03:35 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
alias checkall {
;Declare %i and set it to 1
var %i 1
;while ( %i'th nickname in the #channel exists ) { do stuff }
while $nick(#channel,%i) {
;the 'stuff' to do, set a timer as someones nick
;+ 1, i.e. timerjoe 1
/timer [ $+ [ $nick ] ] 1
;make sure each timer is 15 seconds longer than the previous, so the first nickname will get checked in 15 secs, 2nd in 30 etc.
$calc(%i *15)
;then do my check ( a whois) on nick 1 on #channel
yourcheck $nick(#channel,%i)
;then increase %i by 1
}

the timer line has to be on one line ;-]
basically the while () part checks that there is an "%i'th" nickname in the channel, so $nick(#,1) will be the first nick, $nick(#,2) the second etc, so %i loops through to get them all.


New username: hixxy
Re: Back to the source . . . . . :) #74570 09/03/04 03:49 PM
Joined: Nov 2003
Posts: 46
D
Dizkonnekted Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2003
Posts: 46
Hi Again tidy, smirk

Ok, I have tried your commented reply, all that happens when I
run the alias is that I get a whole bunch of timers starting. I have to ctrl+break out of it.

Looks like this aint going to be easy!! Anywhere else I have asked I havent had much luck either.
Any other/different suggestions?

Regards,
Dizkonnekted


Dizkonnekted from reality....!
Re: Back to the source . . . . . :) #74571 09/03/04 04:01 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
oh sorry, i made a mistake, in my uncommented reply, change timer [ $+ [ $nick ] ] to timer [ $+ [ $nick(#,%i) ] ] wink


New username: hixxy
Re: Back to the source . . . . . :) #74572 09/03/04 05:06 PM
Joined: Nov 2003
Posts: 46
D
Dizkonnekted Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2003
Posts: 46
No Problem,

I had picked up on that anyway, but I still get the same result!
Hundreds of timers activiating, well named timers activating.

I need to ctrl+break out of them. But thanks for the response back anyway. Anybody else any ideas? Lots of people viewing, but nobody posting except tidy_trax, and thanks again tidy.

I thought this was gonna be a tough one when I started down this road! heh! wink

Regards,
Dizkonnekted


Dizkonnekted from reality....!
Re: Back to the source . . . . . :) #74573 09/03/04 08:23 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Quote:
What I would like to be able to do is the same check again say every 5 mins

You definitely don't need to repeat this check. You only do it once: when you join the channel, and your whois on-join (I assume you already have one wink) will take care of the rest. Try this code:
Code:
alias mwhois {
  ; 
  ; Syntax: /mwhois [in the channel window or from an event]
  ;
  [color:purple]; OK, let's figure out what we have here...
  ; This command scans the channel nicklist and writes only
  ; regular users to tmp.txt
  ;
  ; The regex pattern /^[^@+]/ excludes users with status symbol
  ; Regex Tutorial: http://www.mircscripts.org/comments.php?id=989
  ;[/color]
  filter -wflcg # tmp.txt $+(/^[^,$prefix,]/)
  [color:purple];
  ; This part is tricky. To understand how it works you'd have
  ; to read the help file...
  ;
  ; (hint: "whois" plays a special role here)
  ;[/color]
  .play -a raw whois tmp.txt 5000
}

Re: Back to the source . . . . . :) #74574 09/03/04 08:39 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
thanks for that, i never realised you could play commands too.


New username: hixxy
Re: Back to the source . . . . . :) #74575 09/03/04 08:46 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
This time it turned to be very useful laugh

Re: Back to the source . . . . . :) #74576 09/03/04 11:00 PM
Joined: Nov 2003
Posts: 46
D
Dizkonnekted Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2003
Posts: 46
Hi Online,

WOW, this works brilliantly, nice and short too, excellent stuff!
I'm going to read through the tutorial as well so I can actually understand whats going on here!! heh! grin

I have a basic understanding of it but I need to know more so I can branch from it.
Thanks to tidy_trax for the all of the effort and responding so quickly earlier and thanks again online.

Just a quick thing, the @'s in the # are pretty safe, what if I
want to include the +'s ?

Regards,
Diz

Last edited by Dizkonnekted; 10/03/04 12:34 AM.

Dizkonnekted from reality....!