mIRC Home    About    Download    Register    News    Help

Print Thread
#219197 08/03/10 05:10 PM
Joined: Jan 2010
Posts: 26
V
vinyltm Offline OP
Ameglian cow
OP Offline
Ameglian cow
V
Joined: Jan 2010
Posts: 26
I have a chat bot running that watches for key words in other chats it is logged in. It PM's me when my username is said in other channels. Now it also does it when i'm in my own channel so i get flooded with PM's. How would i set it to halt if the keyword is said in my channel... the script i am using is pretty basic
Quote:
on *:TEXT:*vinyltm*:#: { msg vinyltm SPYBOT $chan $nick : $1- }





Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Quote:
on *:TEXT:*vinyltm*:#YourChannel: {
Replace #YourChannel to the one you want the event to work in.

Joined: Jan 2010
Posts: 26
V
vinyltm Offline OP
Ameglian cow
OP Offline
Ameglian cow
V
Joined: Jan 2010
Posts: 26
what about if i dont want it to work in there. I want it to work in every room but mine.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Quote:
on *:TEXT:*vinyltm*:#: {
if ($chan != #YourChannel) {
msg vinyltm SPYBOT $chan $nick : $1-
}
}
This will exclude your channel from being triggered.

Joined: Jan 2010
Posts: 26
V
vinyltm Offline OP
Ameglian cow
OP Offline
Ameglian cow
V
Joined: Jan 2010
Posts: 26
Ok while using this i came across another problem. If i am in a channel it gets annoying if someone is talking to me and using my username. I see double. Any ideas on how to change the ($chan !=#channel) to make it so that if specific username is in the channel dont say it.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I suggest changing it to ($chan != #channel) && ($chan !isactive)

That way the script won't process the additional message for the channel you are currently chatting in.

Joined: Dec 2008
Posts: 95
A
Babel fish
Offline
Babel fish
A
Joined: Dec 2008
Posts: 95
Originally Posted By: RusselB
$chan !isactive

I thought this might be an undocumented operator when I read your post
but after testing it, it appears that it's not and therefore it should be $chan != $active.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
My apologies. I didn't have the actual help file available for me to check when I responded.
You are correct and I'm glad to see that you were able to figure out the correct way of getting what I was driving at.

Joined: Jan 2010
Posts: 26
V
vinyltm Offline OP
Ameglian cow
OP Offline
Ameglian cow
V
Joined: Jan 2010
Posts: 26
Code:
on *:TEXT:*vinyl*:#: { 
  if ($chan != #vinyltm) && ($chan != $active) {
    msg vinyltm  [SPYBOT][ $chan $time ] $nick : $1- 
  } 
}


This is what i have running. It is not working because i am assuming the TEXT is *vinyl* and not *vinyltm* now i tried changing $active to $vinyltm like i would have done for the #chan to #vinyltm. tested it in every possible way i could think of and its not working... anyone see what i am doing wrong? if the script doesnt trigger in a room i am in then the first ($chan != #vinyltm) is pointless anyway so that part could just be thrown out.

Last edited by vinyltm; 18/03/10 09:16 PM.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Quote:
it gets annoying if someone is talking to me and using my username. I see double. Make it that if specific username is in the channel, dont say it.
Try this:
Code:
on *:text:*vinyl*:#: { 
  if ($chan != #vinyltm) && ($chan != $active) || (*vinyltm* !iswm $nick) {
    msg vinyltm  [SPYBOT][ $chan $time ] $nick : $1- 
  } 
}
Notice I added $nick != vinyltm

By the way, you don't want to throw out $chan != #vinyltm

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I changed the last if statement using iswm operator instead.

Joined: Jan 2010
Posts: 26
V
vinyltm Offline OP
Ameglian cow
OP Offline
Ameglian cow
V
Joined: Jan 2010
Posts: 26
Originally Posted By: Tomao
[quote]
By the way, you don't want to throw out $chan != #vinyltm


Servers are private and require a whitelisted account... no worries, but thank you. smile

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Your condition is unclear (even if mIRC might understand it as you wish here), you probably mean

if ($chan != #vinyltm) && (($chan != $active) || (*vinyltm* !iswm $nick)) {


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Actually, I'm thinking || should be &&. If the goal is for it to display as long as it's not in a specific channel AND it's not in the active channel AND it's not a specific nick. With OR, it will always display no matter what channel it's in as long as it's not a specific nick. Even adding parentheses, it will still always display in active as long as active isn't the specific channel and it's not a specific nick.


Invision Support
#Invision on irc.irchighway.net
Joined: Jan 2010
Posts: 26
V
vinyltm Offline OP
Ameglian cow
OP Offline
Ameglian cow
V
Joined: Jan 2010
Posts: 26
What i am basically trying to do is this: I have a bot running in multiple channels. I want a basic script that will notify a user if a key word is said. In this example i was using my username. The bot will notify the person the word was said in a private message. Now the problems i came across is while in your own channel you get flooded with PM's everytime the trigger is hit, so I want it to notice if the user is in the channel and to halt if they are.

Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
better to use $istok or $findtok instead of "iswm" because
if your Nick is bam and another is BamBoo then the condition if (*bam* iswm bamboo) return $true and that's wrong


WorldDMT
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
You might be right, I didn't really care about the topic here, just about the unclear condition smile


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
Originally Posted By: vinyltm
What i am basically trying to do is this: I have a bot running in multiple channels. I want a basic script that will notify a user if a key word is said. In this example i was using my username. The bot will notify the person the word was said in a private message. Now the problems i came across is while in your own channel you get flooded with PM's everytime the trigger is hit, so I want it to notice if the user is in the channel and to halt if they are.


do you mean you want like a Highlight
if someone mentions a nickname on a channel the bot will spy him and send a PM that contains to that nickname the word says?


WorldDMT

Link Copied to Clipboard