mIRC Homepage
Posted By: powerade661 How do I use the ischan command? - 30/01/15 03:23 PM
Here is what I have so far.

Code:
on *:TEXT:points?:#: {
  if (%chan ischan #aguilar612) {
    msg $chan Points are used for giveaways you earn them every 5 minutes. You can check your points by typing !points2 :)  
  }
}
else {
  msg $chan This command is not available in your channel
}

Posted By: Wims Re: How do I use the ischan command? - 30/01/15 04:03 PM
ischan is an operator, not a command, /msg is a command.
%chan is a variable, I think you typoed and you meant $chan, the identifier referring to the channel the event triggered on (you have correctly $chan inside the else statement).
The ischan operator is meant to be used to check if you have a channel window opened with that name.
Note that it doesn't mean that you are on the channel, it's possible to get a channel window opened without being on that channel, if you want to check that you are on a channel, use the ison operator.
Posted By: powerade661 Re: How do I use the ischan command? - 30/01/15 07:51 PM
Ok well am I using this correctly?

Code:
on *:TEXT:points?:#: {
  if ($nick !ison #aguilar612) {
  msg $chan Points are used for giveaways you earn them every 5 minutes. You can check your points by typing !points2 :) } 
}
else {
  msg $chan This command is not available in your channel
}
Posted By: Wims Re: How do I use the ischan command? - 30/01/15 08:08 PM
It depends on what you want to do, the syntax of the code is correct (well the closing } for the event is missing, could be that it's there in your code), but what it does might not be what you want.
It listens on any channel for a message which start with "points" followed by only one character, any character (like "points@" or "points!" or "pointsa"). The ? is a wildcard character and match any character one time (the matchtext of events use a wildcard match by default).
Supposing someone is typing a message matching your expression, you then check the nickname isn't on the channel #aguilar612 and send one message if he isn't, otherwise send a different message.

What do you want to do?

Posted By: powerade661 Re: How do I use the ischan command? - 30/01/15 08:45 PM
That's exactly what I want it to do. I want it to say that specific message and if they are on a another channel display another message that says something else but is similar to the first message. If they are not on that channel this it says "this command isn't available on your channel" But it's not working and I was hoping I could get help to get it working.
Posted By: Wims Re: How do I use the ischan command? - 30/01/15 09:44 PM
What I described in my post and what you are describing now are different things, it's still unclear to me what you really want to do, I don't like guessing at this point.
Please state very clearly what you want to do with all the different variations and without using the word 'it' in your sentences.
Posted By: powerade661 Re: How do I use the ischan command? - 30/01/15 10:17 PM
What I am wanting to do is if a username is on a specific channel it says a specific message. This is what I have so far. The issue with this is if they type in "points?" it doesn't show anything. I want to make it so that if a username on #aguilar612 types in points? that it displays that specific message below.

Code:
on *:TEXT:points?:#: {
  if ($nick !ison #aguilar612) {
  msg $chan Points are used for giveaways you earn them every 5 minutes. You can check your points by typing !points2 :) } 
}
else {
  msg $chan This command is not available in your channel
}
on *:TEXT:points?:#: {
  if ($nick !ison #ewansmith05) {
    msg $chan Points are used for giveaways you earn them every 5 minutes. You can check your points by typing !points1 :)
  }
  else { 
    msg $chan This command is not available in your channel
  }

  on *:TEXT:points?:#: {
    if ($nick !ison #omg_its_jayj){
    msg $chan Points are used for giveaways you earn them every 5 minutes. You can check your points by typing !points3 :)
  }
}
else {
  msg $chan This command is not available in your channel
}




So I think the code means if any username is on #aguilar612 and that command is typed, it displays that message. Am I wrong about this? I hope I have been less vague with this post, I apologize if I haven't.
Posted By: Nillen Re: How do I use the ischan command? - 30/01/15 10:48 PM
Those events won't trigger at all, since they all trigger on the first event in the scriptfile.

What it appears that you're looking for is something like this:
Code:
on *:text:!test:#: { 
if (# == #chan1) msg # Example nr 1, on #
elseif (# == #chan2) msg # Example nr 2, on #
elseif (# == #chan3) msg # Example nr 3, on # 
else msg # Example nr 4, on all other channels
}
Posted By: powerade661 Re: How do I use the ischan command? - 30/01/15 11:24 PM
That is exactly what I was looking for. Thanks so much! #Nillenknowsbest laugh
Posted By: Wims Re: How do I use the ischan command? - 31/01/15 11:23 AM
It was still confusing because you meant to use the channel the event triggered on, you didn't meant to check if the nickname triggering the event is on a specific channel (though obviously, he is at least on the channel the event triggered on). It's a chance Nillens's assumptions were correct!
© mIRC Discussion Forums