mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 20
P
popsy Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2004
Posts: 20
ON 1:TEXT:*:#chan: {
if ($wildtok($strip($1-),#*,0,32) > 0) {
{
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
}
}
}
if ($ifmatch != $chan) {
inc $+(%,spam,$chan,$wildsite)
if ($($+(%,spam,$chan,$wildsite),2) = 1) {
notice $nick Ingen reklamer mens du opholder dig i $chan please! Det her er din første advarsel, 2 advarsel udløser auto-kick!
}
elseif ($($+(%,spam,$chan,$wildsite),2) = 2) {
kick $chan $nick Der blev sagt ingen reklamer, dette var 2 advarsel + kick. Gør det igen, og bliv banned!
}
else {
ban $chan $nick 2 Der blev sagt ingen reklamer, tænk over det mens du er banned!

}
}
}
}
Right now, it reacts only on #
I would like it to react on both <#*>, < ¤*>, <*www*> and <http://*>
At the same time, it has to check if the abuser is an op, and if he is, it has to halt.

Can anyone figure this out?

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
.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

^ thats the most rudest thing i have ever seen

How about checking if $nick is even in the channel you just spammed yourself, before you spam them, personally if i was an op on that channel you would be the one who ends up banned.

on checking for $nick not being a op.
if ($nick !isop #blablah) { ...

on checking multiple possable things try
if ($wildtok($strip($1-),#*,0,32) > 0) || ($wildtok($strip($1-),¤*,0,32) > 0) || ($wildtok($strip($1-),*www*,0,32) > 0) || ($wildtok($strip($1-),http://*,0,32) > 0) {


Joined: Jan 2004
Posts: 20
P
popsy Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2004
Posts: 20
I get the picture smile
Didn't think of it that way, and i think you're right smile

Could you please show exactly where i put the line checking for op in the script?

Also, one thing i forgot, is there any way i can make the script not react on people who have op in my channel?

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
ON 1:TEXT:*:#chan: {
if ($nick !isop $chan) { .....

remaining code well only be executed if $nick is not an op on the chan he just said something on

Joined: Jan 2004
Posts: 9
W
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
W
Joined: Jan 2004
Posts: 9
it's shorter to have like below cause it removes a pair of { } surrounding everything... laugh and it's cleaner conding... i think

ON 1:TEXT:*:#chan: {
if ($nick isop $chan) { return }

code normally goes here

}

Joined: Jan 2004
Posts: 20
P
popsy Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2004
Posts: 20
Thanks alot guys.

I still don't understand how to make my bot check if a spammer are op in the chan he advertises for though? Can anyone help me out there?

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Change this:
.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

To this:
set -u10 %spam.chan %n | set -u10 %spam.nick $nick | set -u10 %spam.msg $1- | join -n %n

Add this:
Code:
raw 366:$(* %spam.chan *):{
  if %spam.nick isop $2 { msg $2 Lad være med at reklamere på min kanal! / Do not advertise in my channel: $+(&lt;,$nick,&gt;) %spam.msg }
  part #
  unset %spam.*
}

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
shorter coding? I doubt it.
The majority of on text events well not be by an op, so having to pharse past the { return } to reach the executing code, well in the long run exceed the fewer times an ops text well cause mirc to have to pharse paste all the other code.

After saying the above I well admit Im not sure if it actully has to phrase out blocks of no active code, as the file may be pharsed once using indenting to aligne for the next code chunk, This would likely be something only Khaled would know.

And personally, I think mulitiple exit points in code are anything BUT cleaner, they create the worse nightmare for adding aditions to code.

Joined: Jan 2004
Posts: 20
P
popsy Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2004
Posts: 20
Lol, that gives an unwanted reaction laugh
When spamming my chan, the bot warnes me, and then leaves my channel laugh At the same time, it enters the channel whoms name was spammed, and stays there wink

It says in botscreen: 366:$(* Unknown command

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Looks like you added the raw event inside the join event codeblock, that makes mIRC send "366:$(* %spam.chan *):{" as a raw command.

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
thats your code doing that, i never thought you could issue a join / msg / part with out it being event driven or timer driven.

Whats happening is liley this

12:00:00.00 Join other channel (this takes say 1 second to complete)
12:00:00.05 msg other channel (this dont work your not in that channel yet, so maybe it goes to your channel)
12:00:00.10 part other channel (this dont work your not in that channel yet, so maybe it parts your channel)
12:00:00.15 ..
:
12:00:00.95 ..
12:00:01.00 [join other channel completes] (your now in the other channel)

The 1 second is just a estimate, likely a larger than real one.

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Actually you can do that, oddly enough.

The problem was partly my code, "part #" should have been "part $2".
Plus I think the "raw 366:..." block was pasted inside of the join block, making mirc send "366:$(* %spam.chan *):{" as a /raw command, thus the 401 "366:$(* Unknown command ", and also the reason for parting the #.
Anyway, I sent a PM with fixed and better code all laid out nicely. smile


Link Copied to Clipboard