mIRC Home    About    Download    Register    News    Help

Print Thread
How do I use the ischan command? #250774 30/01/15 03:23 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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
}


Re: How do I use the ischan command? [Re: powerade661] #250775 30/01/15 04:03 PM
Joined: Jul 2006
Posts: 3,586
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,586
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: How do I use the ischan command? [Re: Wims] #250778 30/01/15 07:51 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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
}

Re: How do I use the ischan command? [Re: powerade661] #250779 30/01/15 08:08 PM
Joined: Jul 2006
Posts: 3,586
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,586
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?


Last edited by Wims; 30/01/15 08:14 PM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: How do I use the ischan command? [Re: Wims] #250780 30/01/15 08:45 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.

Re: How do I use the ischan command? [Re: powerade661] #250782 30/01/15 09:44 PM
Joined: Jul 2006
Posts: 3,586
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,586
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: How do I use the ischan command? [Re: Wims] #250784 30/01/15 10:17 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.

Last edited by powerade661; 30/01/15 10:20 PM.
Re: How do I use the ischan command? [Re: powerade661] #250785 30/01/15 10:48 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: How do I use the ischan command? [Re: Nillen] #250786 30/01/15 11:24 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
That is exactly what I was looking for. Thanks so much! #Nillenknowsbest laugh

Re: How do I use the ischan command? [Re: powerade661] #250810 31/01/15 11:23 AM
Joined: Jul 2006
Posts: 3,586
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,586
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!


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net