mIRC Home    About    Download    Register    News    Help

Print Thread
Script issue with comparisons... Why? #210857 27/03/09 06:21 AM
Joined: Mar 2009
Posts: 1
A
Amun Offline OP
Mostly harmless
OP Offline
Mostly harmless
A
Joined: Mar 2009
Posts: 1
This does not work:
on *:CONNECT: {
if ($me == sas) || ($me == squatchy)
{
if ($server == chicago.us.p2pirc.org) {
/nsp2p | /j supertorrents | /j stmusic | /j pre
}
}
}

However, this does:

on *:CONNECT: {
if ($me == sas) || ($me == squatchy) && ($server == chicago.us.p2pirc.org) {
nsp2p
j #supertorrents
j #stmusic
j #pre
}

Am I just not seeing it? If I remove the nickname checking part in the first one, it works fine... But not with it in it.

Re: Script issue with comparisons... Why? [Re: Amun] #210860 27/03/09 09:50 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
The reason the first one won't work is that a bracket is misplaced.
Quote:
on *:CONNECT: {
if ($me == sas) || ($me == squatchy)
{

Should be:
Quote:
on *:CONNECT: {
if ($me == sas) || ($me == squatchy) {

Re: Script issue with comparisons... Why? [Re: Amun] #210882 28/03/09 12:25 AM
Joined: Feb 2007
Posts: 75
T
Trixar_za Offline
Babel fish
Offline
Babel fish
T
Joined: Feb 2007
Posts: 75
Yes the bracket and I can see you've programmed in C smile

May I just suggest that you use $network instead of $server, it's more flexible because it the same for all servers in the network, which helps if you connect to the round ribbon address (irc.whatever.com) instead of directly to a certain server (bleh.whatever.com).

Just thought that would help smile - later


GigIRC Network Admin
irc.gigirc.com
Re: Script issue with comparisons... Why? [Re: Amun] #210883 28/03/09 01:31 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You might be interested in looking at some other syntax rules that differ from C http://kthx.net/ftb/#34


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Script issue with comparisons... Why? [Re: argv0] #210897 28/03/09 09:31 PM
Joined: Feb 2007
Posts: 75
T
Trixar_za Offline
Babel fish
Offline
Babel fish
T
Joined: Feb 2007
Posts: 75
Also I'll add to argv0's link's list of difference, that mIRC scripts don't like TAB. One time I spent hours looking for the error in my script, which I just couldn't find, only to discover that I used TAB instead of spacebar with a few lines of code.


GigIRC Network Admin
irc.gigirc.com