mIRC Home    About    Download    Register    News    Help

Print Thread
#66223 02/01/04 12:44 AM
P
popsy
popsy
P
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
T
theRat
theRat
T
on *:text:*#*:#ffj: { ...

#66225 02/01/04 01:22 AM
Joined: Nov 2003
Posts: 203
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Nov 2003
Posts: 203
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: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
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?

#66227 02/01/04 07:38 AM
P
popsy
popsy
P
Thx alot guys, it works now.

#66228 03/01/04 03:09 PM
M
Man
Man
M
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: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
Ahh, thats why people do things like ([a-zA-Z0-9]) blah >:D Thanks.

Also, does ^ mean "exclude" in the []'s?


Link Copied to Clipboard