mIRC Homepage
Posted By: vinyltm Limiting scripts by channel - 08/03/10 05:10 PM
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- }




Posted By: Tomao Re: Limiting scripts by channel - 08/03/10 05:34 PM
Quote:
on *:TEXT:*vinyltm*:#YourChannel: {
Replace #YourChannel to the one you want the event to work in.
Posted By: vinyltm Re: Limiting scripts by channel - 08/03/10 05:50 PM
what about if i dont want it to work in there. I want it to work in every room but mine.
Posted By: Tomao Re: Limiting scripts by channel - 08/03/10 06:10 PM
Quote:
on *:TEXT:*vinyltm*:#: {
if ($chan != #YourChannel) {
msg vinyltm SPYBOT $chan $nick : $1-
}
}
This will exclude your channel from being triggered.
Posted By: vinyltm Re: Limiting scripts by channel - 17/03/10 03:23 AM
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.
Posted By: RusselB Re: Limiting scripts by channel - 17/03/10 05:11 AM
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.
Posted By: asdfasdf Re: Limiting scripts by channel - 17/03/10 06:57 AM
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.
Posted By: RusselB Re: Limiting scripts by channel - 17/03/10 07:32 AM
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.
Posted By: vinyltm Re: Limiting scripts by channel - 18/03/10 09:12 PM
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.
Posted By: Tomao Re: Limiting scripts by channel - 18/03/10 09:59 PM
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
Posted By: Tomao Re: Limiting scripts by channel - 18/03/10 10:24 PM
I changed the last if statement using iswm operator instead.
Posted By: vinyltm Re: Limiting scripts by channel - 18/03/10 10:29 PM
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
Posted By: Wims Re: Limiting scripts by channel - 18/03/10 10:31 PM
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)) {
Posted By: Riamus2 Re: Limiting scripts by channel - 18/03/10 10:47 PM
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.
Posted By: vinyltm Re: Limiting scripts by channel - 18/03/10 11:00 PM
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.
Posted By: chacha Re: Limiting scripts by channel - 18/03/10 11:28 PM
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
Posted By: Wims Re: Limiting scripts by channel - 18/03/10 11:41 PM
You might be right, I didn't really care about the topic here, just about the unclear condition smile
Posted By: chacha Re: Limiting scripts by channel - 18/03/10 11:48 PM
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?
© mIRC Discussion Forums