Problems with a snippet
#66223
02/01/04 12:44 AM
|
Joined: Jan 2004
Posts: 20
popsy
OP
Ameglian cow
|
OP
Ameglian cow
Joined: Jan 2004
Posts: 20 |
I got this snippet, but i can't get it to work.
It's supposed to make my bot join any channels that are advertised in my channel, and tell the abuser to stop, but nothing happens.
Can anyone please tell me what's wrong?
ON *:TEXT:#:#ffj: { if ($wildtok($1-,*#*,1,32)) { var %n = $remove($ifmatch,!,.,$chr(44),?) if (%n != $chan) { .raw join %n $cr PRIVMSG %n :Lad være med at reklamere på min kanal! / Do not advertise in my channel: < $+ $nick $+ > $1- $cr PART %n } } }
|
|
|
Re: Problems with a snippet
#66224
02/01/04 01:21 AM
|
Joined: Dec 2002
Posts: 774
theRat
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 774 |
on *:text:*#*:#ffj: { ...
//if ( khaled isgod ) echo yes | else echo no
|
|
|
Re: Problems with a snippet
#66225
02/01/04 01:22 AM
|
Joined: Nov 2003
Posts: 227
Hitchhiker
Fjord artisan
|
Fjord artisan
Joined: Nov 2003
Posts: 227 |
First thing is, you have to wait until you join the channel to message it, so you will need to set a global variable then check if that var exists when you join the channel. Also you will have lost the spam message by this time, so you'll need to save that to the variable too:
ON *:TEXT:*:#ffj:{
if ($wildtok($1-,#*,1,32)) {
var %n = $remove($ifmatch,!,.,$chr(44),?)
if ($me !ison %n) {
join -n %n
set -u20 %antispam %n $+(<,$nick,>) $1-
}
}
}
on me:*:join:#:{
if (# == $gettok(%antispam,1,32)) {
msg # Lad være med at reklamere på min kanal! / Do not advertise in my channel: $gettok(%antispam,2-,32)
part #
unset %antispam
}
}
should be something like what you want.
|
|
|
Re: Problems with a snippet
#66226
02/01/04 01:53 AM
|
Joined: Jan 2003
Posts: 3,012
KingTomato
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
Figued this would be a good time to test out what regex can do, but what is wrong with this?
on $*:TEXT:/^[\(\)\[\]]*(#|&)[^\s,]*[\.!\?\(\)\[\]]*$/i:#: { /echo -a Channel Found! $regml(1) }
That should mean: May begin with ()[] Channel must have prefix of # or & May contain any characters but space, and comma (Not sure how to incorperate char 7 May end in ()[].!? [ Is Case Insensitive ]
but it's definatly not working for me. It tests true for when a channel is found, but $regml doesn't return the channel name, only "#". It's gott o have tomsehting to do with the [^\s,], but what?
-KingTomato
|
|
|
Re: Problems with a snippet
#66227
02/01/04 07:38 AM
|
Joined: Jan 2004
Posts: 20
popsy
OP
Ameglian cow
|
OP
Ameglian cow
Joined: Jan 2004
Posts: 20 |
Thx alot guys, it works now.
|
|
|
Re: Problems with a snippet
#66228
03/01/04 03:09 PM
|
Joined: Dec 2003
Posts: 33
Man
Ameglian cow
|
Ameglian cow
Joined: Dec 2003
Posts: 33 |
no its got to do with the (#|&), $regml will return what it found inside ( and ), so $regml is either going to be # or &
|
|
|
Re: Problems with a snippet
#66229
03/01/04 09:16 PM
|
Joined: Jan 2003
Posts: 3,012
KingTomato
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
Ahh, thats why people do things like ([a-zA-Z0-9]) blah >:D Thanks.
Also, does ^ mean "exclude" in the []'s?
-KingTomato
|
|
|
|
|