mIRC Home    About    Download    Register    News    Help

Print Thread
Check before running the script... #219749 27/03/10 10:52 PM
Joined: Nov 2003
Posts: 79
C
colt45 Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Nov 2003
Posts: 79
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...

Re: Check before running the script... [Re: colt45] #219751 27/03/10 11:08 PM
Joined: Nov 2009
Posts: 20
X
XperTeeZ Offline
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.

Re: Check before running the script... [Re: XperTeeZ] #219752 27/03/10 11:21 PM
Joined: Nov 2003
Posts: 79
C
colt45 Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Nov 2003
Posts: 79
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

Re: Check before running the script... [Re: colt45] #219759 28/03/10 01:48 AM
Joined: Nov 2009
Posts: 20
X
XperTeeZ Offline
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

Re: Check before running the script... [Re: colt45] #219764 28/03/10 06:10 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
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 }

Re: Check before running the script... [Re: Tomao] #219766 28/03/10 07:19 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
or
Code:
if (colt45 ison #) { runscript }

Re: Check before running the script... [Re: RusselB] #219778 28/03/10 09:41 PM
Joined: Nov 2003
Posts: 79
C
colt45 Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Nov 2003
Posts: 79
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

Re: Check before running the script... [Re: colt45] #219779 28/03/10 09:57 PM
Joined: Nov 2003
Posts: 79
C
colt45 Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Nov 2003
Posts: 79
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.
Re: Check before running the script... [Re: colt45] #219780 28/03/10 10:28 PM
Joined: Feb 2009
Posts: 133
C
chacha Offline
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
?!!...

try this

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


WorldDMT
Re: Check before running the script... [Re: chacha] #219782 28/03/10 11:23 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
ChaCha, I think you missed a $nick:
Quote:
if ($nick(#,$nick,oh)) {

Re: Check before running the script... [Re: Tomao] #219784 29/03/10 12:15 AM
Joined: Feb 2009
Posts: 133
C
chacha Offline
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
yeah you'r right :p


WorldDMT