mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
I'd like to check if the user is in channel before the script starts.

I've it this way, but can't really think why this doesn't work for me :S

Code:
if (nick ison #help) { /runscript }
else { echo -a USER IS OFFLINE }


So far, this keeps coming back to me as "USER IS OFFLINE" even the nick are in the channel!

Any help - tia...

Joined: Nov 2009
Posts: 20
X
Ameglian cow
Offline
Ameglian cow
X
Joined: Nov 2009
Posts: 20
Quote:
if ($nick ison #help) { /runscript }
else { echo -a USER IS OFFLINE }


That's because you used nick instead of $nick identifier. So, as long as someone with the nickname nick joins the channel, you will get the echo.

Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Ah, so it should be something like ... (make colt45 as a nick)

Code:
if ($nick ison #help) && (colt45 == $nick) { /runscript }


That'd works? Let me try that now then .. if not, will come back ;P

Joined: Nov 2009
Posts: 20
X
Ameglian cow
Offline
Ameglian cow
X
Joined: Nov 2009
Posts: 20
The $nick identifier replaces the nickname of the triggerer of the script. In this example, whoever joined #Help will be $nick wink
so,
Code:
if ($nick ison #)
is enough

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: colt45
Ah, so it should be something like ... (make colt45 as a nick)

Code:
if ($nick ison #help) && (colt45 == $nick) { /runscript }


That'd works? Let me try that now then .. if not, will come back ;P

Code:
 if (($nick ison # && $v1 == colt45)) { runscript }

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
or
Code:
if (colt45 ison #) { runscript }

Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Sorry if I didn't make myself clearer frown

It's not a trigger from a user.

I'm trying to run a script so that one of my staff can use a trigger and then my script will send few instructions to specific users chosen.

What I need is that when the staff enters a trigger or something then my script will check if that user is actually online or not. If the user is ONLINE, it'll send a message to that user and if it's not online, it'll skip the script and go to the next nick chosen in my list.

I have approx 40+ users in my channel and i only want the staff to be able to use the trigger so that my script can send message to those people i trust (about 4 users).

It's weird that
Code:
if (colt45 ison #) { runscript }

didn't work frown

Example what I want this to do...

@Staff1
@Staff2
@Staff3
+user1
+user2
+user3
+user4
+user5
user6
user7
user8

Now, these staff can use the trigger for my script to run.
When my script starts to run, it'll check if these users are online or not, i.e. let's pick user1, user3 and user5.

If that user1 and user5 is online it'll get the message from myself but if that user3 is offline, so it should skip and proceed to the rest of the script.

Reason I'm asking for help with this because when user3 goes offline, it's showing me loads of No such nick/channel.

So therefore, i just want a script simply check if these users are online before sending them a message.

Hope you understand what I'm trying to do :s

TIA

Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Ahhhhh i think i know why it didn't work :S

Can someone help me how to fix that problem if I'm using scid 2?

Have 2 network running - need to check these users that are on network #2 :S

Thanks

==================
Never mind, i just figured it out myself! laugh

just that I need this to work
Code:
/scid 2 {
if (user ison #chan) { proceed script }
else { halt }
}

That works for me so far, if u can think of a better way - more than happy to use it.

Last edited by colt45; 28/03/10 10:14 PM.
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
?!!...

try this

Code:
if (#,$nick,oh) { ... }


WorldDMT
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
ChaCha, I think you missed a $nick:
Quote:
if ($nick(#,$nick,oh)) {

Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
yeah you'r right :p


WorldDMT

Link Copied to Clipboard