mIRC Home    About    Download    Register    News    Help

Print Thread
Auto reset topic, if the new topic includs a word. #220791
29/04/10 12:39 PM
29/04/10 12:39 PM
Joined: Jun 2004
Posts: 243
Norway.
G
gomp Offline OP
Fjord artisan
gomp  Offline OP
Fjord artisan
G

Joined: Jun 2004
Posts: 243
Norway.
Say I had a quake 2 related channel. (the game.) And had it sett to -t ..

But this one kid, avoids ban, and come in and always sett the same topic. Say he set: "toyman rules"
"toyman is the best"

Etcetera..

Is there a script, that could detect that word, and automatically reset the topic to something I have premade?


Like if he sat any topic containing the word 'toyman', I would immediately reset it to something like; "Feel free to set any topic relevant to quake 2, it might spark an interesting chat!" ..

PS: Also it would be nice if it would set the channel +t for a random time, between 10 seconds and 1 minute.. But that is not needed. smile





I know I could just set it to +t .. But it is sad that one kid shall be able to ruin an open channel like this..


Alternatively, is there a script that; every time a "nickname" set any topic, ... makes me reset it, and ban the person?

Last edited by gomp; 29/04/10 12:48 PM.

I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Re: Auto reset topic, if the new topic includs a word. [Re: gomp] #220792
29/04/10 01:01 PM
29/04/10 01:01 PM
Joined: Oct 2004
Posts: 8,327
MA, USA
Riamus2 Offline
Hoopy frood
Riamus2  Offline
Hoopy frood

Joined: Oct 2004
Posts: 8,327
MA, USA
I don't have mIRC in front of me to get the exact format, but use /help on topic . I'm pretty sure that's a valid event.


Invision Support
#Invision on irc.irchighway.net
Re: Auto reset topic, if the new topic includs a word. [Re: gomp] #220793
29/04/10 01:02 PM
29/04/10 01:02 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
5618  Offline
Hoopy frood
5

Joined: Jun 2007
Posts: 933
The code should be self-explanatory...
Code:
on *:TOPIC:#channel:{
  if ($nick == personsnick) { mode $chan +b $address($nick,2) | kick $chan $nick You're banned from setting a topic | topic $chan Your new topic here }
  elseif (toyman isin $1-) { mode $chan +t | .timer 1 $rand(10,60) mode $chan -t | topic $chan Feel free to set any topic relevant to quake 2, it might spark an interesting chat! }
}

Re: Auto reset topic, if the new topic includs a word. [Re: 5618] #220794
29/04/10 01:48 PM
29/04/10 01:48 PM
Joined: Jun 2004
Posts: 243
Norway.
G
gomp Offline OP
Fjord artisan
gomp  Offline OP
Fjord artisan
G

Joined: Jun 2004
Posts: 243
Norway.
Thanks a lot! laugh

Seems to be just what I am after.

I'll implement it now.

Edit: Tested it now, it seems to be just what I needed! Thanks a lot! Tell me if there is anything I can do for you, back! laugh

Last edited by gomp; 29/04/10 02:05 PM.

I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Re: Auto reset topic, if the new topic includs a word. [Re: 5618] #220795
29/04/10 01:54 PM
29/04/10 01:54 PM
Joined: Jun 2004
Posts: 243
Norway.
G
gomp Offline OP
Fjord artisan
gomp  Offline OP
Fjord artisan
G

Joined: Jun 2004
Posts: 243
Norway.
If he uses multiple nicknames. Like "toyman", "toyM4n", etcetera..

How would I add those in that script?

Just add it several times with different nick? Or would that conflict?

I understood that code, and edited in the things, thanks for making it so obvious!

But unsure how to make it work for multiple nicks. smile

Thanks again though! I usually have a hard time making myself understood in English. But you got it! laugh


I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Re: Auto reset topic, if the new topic includs a word. [Re: gomp] #220796
29/04/10 03:40 PM
29/04/10 03:40 PM
Joined: Mar 2004
Posts: 526
New York, USA
HorseC Offline
Fjord artisan
HorseC  Offline
Fjord artisan

Joined: Mar 2004
Posts: 526
New York, USA
Originally Posted By: gomp
If he uses multiple nicknames. Like "toyman", "toyM4n", etcetera..

How would I add those in that script?

Just add it several times with different nick? Or would that conflict?

I understood that code, and edited in the things, thanks for making it so obvious!

But unsure how to make it work for multiple nicks. smile

Thanks again though! I usually have a hard time making myself understood in English. But you got it! laugh


from /help if

'Combining comparisons

You can combine comparisons by using the && for AND and || for OR characters.'

so...


try if ( ($nick == nick1) || ($nick == nick2) || ($nick3 == nick3 ) )

NOTE: if comparison starts with (( and last ends with )) to make it a group of comparisons to make..

Hope this helps, and I would suggest you start to use /help from
within mIRC.. everything you need to know is in there for future scripting.



Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!
Re: Auto reset topic, if the new topic includs a word. [Re: HorseC] #220797
29/04/10 03:47 PM
29/04/10 03:47 PM
Joined: Jun 2004
Posts: 243
Norway.
G
gomp Offline OP
Fjord artisan
gomp  Offline OP
Fjord artisan
G

Joined: Jun 2004
Posts: 243
Norway.
I did not fully understand that.. But I shall test it now. And thank you! smile

Edit: I have now tested it, and much more.. But I can only make it work with one nick.. :|

Last edited by gomp; 29/04/10 04:02 PM.

I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Re: Auto reset topic, if the new topic includs a word. [Re: HorseC] #220799
29/04/10 05:21 PM
29/04/10 05:21 PM
Joined: Feb 2009
Posts: 133
Belgique
C
chacha Offline
Vogon poet
chacha  Offline
Vogon poet
C

Joined: Feb 2009
Posts: 133
Belgique
what about $istok(nick1.nick2.nick3,$nick,46)


WorldDMT
Re: Auto reset topic, if the new topic includs a word. [Re: chacha] #220816
30/04/10 01:38 AM
30/04/10 01:38 AM
Joined: Jul 2007
Posts: 1,129
United States
T
Tomao Offline
Hoopy frood
Tomao  Offline
Hoopy frood
T

Joined: Jul 2007
Posts: 1,129
United States
Maybe HorseC was trying to be basic or rudimentary so newbies understand better.

Re: Auto reset topic, if the new topic includs a word. [Re: Tomao] #220826
30/04/10 09:11 AM
30/04/10 09:11 AM
Joined: Jun 2004
Posts: 243
Norway.
G
gomp Offline OP
Fjord artisan
gomp  Offline OP
Fjord artisan
G

Joined: Jun 2004
Posts: 243
Norway.
Originally Posted By: Tomao
Maybe HorseC was trying to be basic or rudimentary so newbies understand better.


I do not understand much coding. But that code from 5618 was very easy to understand.

I only wish I had asked for it to include several nicknames. frown

I shall try the suggestions above here today though! I hope it works. laugh


I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Re: Auto reset topic, if the new topic includs a word. [Re: chacha] #220827
30/04/10 09:21 AM
30/04/10 09:21 AM
Joined: Jun 2004
Posts: 243
Norway.
G
gomp Offline OP
Fjord artisan
gomp  Offline OP
Fjord artisan
G

Joined: Jun 2004
Posts: 243
Norway.
Originally Posted By: chacha
what about $istok(nick1.nick2.nick3,$nick,46)


That worked! laugh

Thanks a lot!

Is there a limit to how many nicks one can add that way? smile


I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Re: Auto reset topic, if the new topic includs a word. [Re: gomp] #220831
30/04/10 01:13 PM
30/04/10 01:13 PM
Joined: Oct 2004
Posts: 8,327
MA, USA
Riamus2 Offline
Hoopy frood
Riamus2  Offline
Hoopy frood

Joined: Oct 2004
Posts: 8,327
MA, USA
As many as you like... up to the line length limit in mIRC (which on 6.35 and newer is something like 4000 characters). You'll know if you reach it because you'll get a line too long error message when trying to run it.


Invision Support
#Invision on irc.irchighway.net
Re: Auto reset topic, if the new topic includs a word. [Re: Riamus2] #220832
30/04/10 01:14 PM
30/04/10 01:14 PM
Joined: Jun 2004
Posts: 243
Norway.
G
gomp Offline OP
Fjord artisan
gomp  Offline OP
Fjord artisan
G

Joined: Jun 2004
Posts: 243
Norway.
Neat!

Thanks a lot to all you who helped me make this script! it works perfectly! laugh


I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.