mIRC Home    About    Download    Register    News    Help

Print Thread
#190398 20/11/07 10:51 AM
P
Prof
Prof
P
I make a script like this:

Code:
on *:JOIN:#:{
   if ($nick != $me) notice $nick Welcome to #
   :error
   if ($error) write report.txt ERROR: $error
}


but the script doesn't report anything when the script got any error

what's the problem?

#190405 20/11/07 01:32 PM
Joined: Dec 2002
Posts: 1,999
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,999

Originally Posted By: Prof

what's the problem?


I don't see an error. Put an error in there and it will work...

Code:

on *:JOIN:#: {
  if ($nick <!= $me) notice $nick Welcome to #
  :error
  if ($error) write report.txt ERROR: $error
}


You should get an unknown operator error from that code.

RoCk #190462 21/11/07 06:50 AM
P
Prof
Prof
P
Sorry, that script just an example

Actually my script is like this:

Code:
on *:JOIN:#:{
   if ($nick != $me) greetuser # $nick
   :error
   if ($error) write report.txt ERROR: $error
}


My greetuser alias sometimes doesn't work, so I want to know what's the error with that alias

Thanks

#190465 21/11/07 07:55 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
From what you've shown, it looks to me that the problem is in your greetuser alias. Post that and we might be able to figure out why it sometimes doesn't work.

As a suggestion, you can reduce your script to
Code:
on !*:join:#:{ greetuser # $nick }

The ! in the prefix section of the ON JOIN event means "anyone but me"

RusselB #190625 23/11/07 12:53 PM
P
Prof
Prof
P
Thanks for your suggestion, RusselB

I've found the problem in greetuser alias, but I still want to know why the error handling doesn't work for me?

How to make it works?

#190786 26/11/07 06:06 AM
Joined: Jan 2007
Posts: 1,155
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,155
You don't see an error because there is no error in the join event.

If the nick is not you it sends info to your greetuser alias.

Where's the error??

Now if you are having trouble with your alias I suggest using echo's to check each line. I obviously dont echo every single line, I usually have an idea where the error is.

I'll start with ...


alias greetuser {

echo -a GREETUSER 1= $1 2= $2 3= $3 etc.

}

This will tell me what the alias is getting for $1-

Or you can simply put an echo in front of line so you can see exactly the information you are getting for that line.


Link Copied to Clipboard