mIRC Homepage
Posted By: colt45 Check before running the script... - 27/03/10 10:52 PM
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...
Posted By: XperTeeZ Re: Check before running the script... - 27/03/10 11:08 PM
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.
Posted By: colt45 Re: Check before running the script... - 27/03/10 11:21 PM
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
Posted By: XperTeeZ Re: Check before running the script... - 28/03/10 01:48 AM
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
Posted By: Tomao Re: Check before running the script... - 28/03/10 06:10 AM
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 }
Posted By: RusselB Re: Check before running the script... - 28/03/10 07:19 AM
or
Code:
if (colt45 ison #) { runscript }
Posted By: colt45 Re: Check before running the script... - 28/03/10 09:41 PM
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
Posted By: colt45 Re: Check before running the script... - 28/03/10 09:57 PM
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.
Posted By: chacha Re: Check before running the script... - 28/03/10 10:28 PM
?!!...

try this

Code:
if (#,$nick,oh) { ... }
Posted By: Tomao Re: Check before running the script... - 28/03/10 11:23 PM
ChaCha, I think you missed a $nick:
Quote:
if ($nick(#,$nick,oh)) {
Posted By: chacha Re: Check before running the script... - 29/03/10 12:15 AM
yeah you'r right :p
© mIRC Discussion Forums