mIRC Home    About    Download    Register    News    Help

Print Thread
#66223 02/01/04 12:44 AM
Joined: Jan 2004
Posts: 20
P
popsy Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
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
}
}
}

#66224 02/01/04 01:21 AM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
on *:text:*#*:#ffj: { ...


Code:
//if ( khaled isgod ) echo yes | else echo no
#66225 02/01/04 01:22 AM
Joined: Nov 2003
Posts: 227
H
Fjord artisan
Offline
Fjord artisan
H
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:

Code:
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 $+(&lt;,$nick,&gt;) $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.

#66226 02/01/04 01:53 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
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
#66227 02/01/04 07:38 AM
Joined: Jan 2004
Posts: 20
P
popsy Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2004
Posts: 20
Thx alot guys, it works now.

#66228 03/01/04 03:09 PM
Joined: Dec 2003
Posts: 33
M
Man Offline
Ameglian cow
Offline
Ameglian cow
M
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 &

#66229 03/01/04 09:16 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
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

Link Copied to Clipboard