mIRC Home    About    Download    Register    News    Help

Topic Options
#66223 - 02/01/04 12:44 AM Problems with a snippet
popsy Offline
Ameglian cow

Registered: 02/01/04
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
}
}
}

Top
#66224 - 02/01/04 01:21 AM Re: Problems with a snippet
theRat Offline
Hoopy frood

Registered: 11/12/02
Posts: 774
on *:text:*#*:#ffj: { ...
_________________________
Code:
//if ( khaled isgod ) echo yes | else echo no

Top
#66225 - 02/01/04 01:22 AM Re: Problems with a snippet
Hitchhiker Offline
Fjord artisan

Registered: 13/11/03
Posts: 227
Loc: around
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.

Top
#66226 - 02/01/04 01:53 AM Re: Problems with a snippet
KingTomato Offline
Planetary brain

Registered: 04/01/03
Posts: 3012
Loc: New Hampshire, USA
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

Top
#66227 - 02/01/04 07:38 AM Re: Problems with a snippet
popsy Offline
Ameglian cow

Registered: 02/01/04
Posts: 20
Thx alot guys, it works now.

Top
#66228 - 03/01/04 03:09 PM Re: Problems with a snippet
Man Offline
Ameglian cow

Registered: 11/12/03
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 &

Top
#66229 - 03/01/04 09:16 PM Re: Problems with a snippet
KingTomato Offline
Planetary brain

Registered: 04/01/03
Posts: 3012
Loc: New Hampshire, USA
Ahh, thats why people do things like ([a-zA-Z0-9]) blah >:D Thanks.

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

Top