mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2015
Posts: 168
P
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
}


Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2015
Posts: 168
P
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
}

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2015
Posts: 168
P
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.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2015
Posts: 168
P
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.
Joined: Dec 2013
Posts: 779
N
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
Joined: Jan 2015
Posts: 168
P
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

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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!


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard