mIRC Home    About    Download    Register    News    Help

Print Thread
#264403 27/11/18 03:06 AM
Joined: Mar 2015
Posts: 26
A
Anti Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2015
Posts: 26
Hello,
why raw event embedded in ON *:TEXT: don't go ?

I have this code :

ON *:TEXT:*:?:{

if ( server1 isin $server ) { echo -a $nick usa simosnap }
if ( server2 isin $server ) { whois $nick }

raw 311:*:{ echo -a $1- }

}

If I'm using server2 , I must check the $nick server ( I check the $nick irc server using whois $nick and parsing the output with raw 311:*:{....} ),
if he's using a particular server I must do a action, else another.

The problem is that it is not possible include raw inside a if-then ( and not even in another event ) , this give me a understood output, something like this ( for the code above ) :

mario-- has been idle 0secs, signed on Tue Nov 27 09:32:58
mario-- End of /WHOIS list.
-
311:*:{ Unknown command

How may I solve this problem ?


Last edited by Anti; 27/11/18 03:23 AM.
Anti #264404 27/11/18 03:27 AM
Joined: Feb 2011
Posts: 448
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 448
https://en.wikichip.org/wiki/mirc/on_events/on_text


https://en.wikichip.org/wiki/mirc/raw_events


You cannot have one event inside of another event.

I guess you want something like this:


Code:
ON *:TEXT:*:?:{

if ( server1 isin $server ) { echo -a $nick usa simosnap }
if ( server2 isin $server ) { whois $nick }

}

raw 311:*:{ echo -a $1- }

Joined: Mar 2015
Posts: 26
A
Anti Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2015
Posts: 26
Originally Posted By: KindOne
https://en.wikichip.org/wiki/mirc/on_events/on_text


https://en.wikichip.org/wiki/mirc/raw_events


You cannot have one event inside of another event.

I guess you want something like this:


Code:
ON *:TEXT:*:?:{

if ( server1 isin $server ) { echo -a $nick usa simosnap }
if ( server2 isin $server ) { whois $nick }

}

raw 311:*:{ echo -a $1- }


yes, I solved this , the events cannot be embedded.

But I have another problem with this code:
Code:

raw 311:*:{

  set $+(%,server,_,$2) $1-
  if (server_name isin $+(%,server,_,$2)) { timer 1 10 msg $2 $read(C:\mIRC\testi\6b.txt) }
  else { timer 1 10 msg $2 $read(C:\mIRC\testi\6-skype.txt) }
}



This piece of code execure ever else statement , and not if. And I don't understand why.

$2 is the nick_name of the user.
Excuse me per my ignorance, but I amn't expert with
mIRC scripting.

Thanks for you help



Last edited by Anti; 28/11/18 01:34 AM.
Anti #264421 28/11/18 01:50 AM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
You are simply appending things together to create a text string which happens to begin with a percent sign, and not checking the contents of the variable. It's the difference between:

Code:
//if (       $+($,version)    > 7) echo -a match | else echo -a not match $v1 vs $v2
vs
//if ( $eval($+($,version),2) > 7) echo -a match $v1 vs $v2



People sometimes use $() in place of $eval() but that can be a little harder to read.

Joined: Mar 2015
Posts: 26
A
Anti Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2015
Posts: 26

Thank you for your answer.

What is the difference between $eval , $ and [[]] .
It's the same or there is some difference ?

In the mIRC help this isn't explained.



Last edited by Anti; 28/11/18 10:00 PM.
Anti #264441 29/11/18 12:14 AM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127

Anti #264482 04/12/18 08:12 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Originally Posted By: Anti
Originally Posted By: KindOne
https://en.wikichip.org/wiki/mirc/on_events/on_text


https://en.wikichip.org/wiki/mirc/raw_events


You cannot have one event inside of another event.

I guess you want something like this:


Code:
ON *:TEXT:*:?:{

if ( server1 isin $server ) { echo -a $nick usa simosnap }
if ( server2 isin $server ) { whois $nick }

}

raw 311:*:{ echo -a $1- }


yes, I solved this , the events cannot be embedded.

But I have another problem with this code:
Code:

raw 311:*:{

  set $+(%,server,_,$2) $1-
  if (server_name isin $+(%,server,_,$2)) { timer 1 10 msg $2 $read(C:\mIRC\testi\6b.txt) }
  else { timer 1 10 msg $2 $read(C:\mIRC\testi\6-skype.txt) }
}



This piece of code execure ever else statement , and not if. And I don't understand why.

$2 is the nick_name of the user.
Excuse me per my ignorance, but I amn't expert with
mIRC scripting.

Thanks for you help




You can use this instead:

If (server_name isin $1-) { ... }

No need to check the variable you have just set to $1- as $1- is still available.

Also, unless you know exactly what the contents of the text file you are trying to read are going to be, you should use the ‘n’ flag in $read() as otherwise there is a danger that mIRC will evaluate the contents.

$read(...,n)

There is a double-danger in your code as you’re using /timers, which evaluate everything twice. So you should use $!read(...,n) as this will prevent any evaluation problems.


Link Copied to Clipboard