mIRC Home    About    Download    Register    News    Help

Print Thread
$eval #96175
30/08/04 08:45 AM
30/08/04 08:45 AM
Joined: Feb 2004
Posts: 119
Logan, Utah (USA)
D
da_hype Offline OP
Vogon poet
da_hype  Offline OP
Vogon poet
D

Joined: Feb 2004
Posts: 119
Logan, Utah (USA)
can anyone explain $eval to me.. and give me an example. thanks

Re: $eval #96176
30/08/04 09:31 AM
30/08/04 09:31 AM
Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
FiberOPtics Offline
Hoopy frood
FiberOPtics  Offline
Hoopy frood

Joined: Feb 2004
Posts: 2,019
Leuven, Belgium
Hi,

this Message Board has a Search function. You can always find alot of information, with different examples, by doing a query in the database.

You could check out this little introduction to $eval by Hammer

If there's any more questions, you can check out all the search results, or ask in this thread, I'll be glad to help.

Greets


Gone.
Re: $eval #96177
30/08/04 01:15 PM
30/08/04 01:15 PM
Joined: Feb 2004
Posts: 119
Logan, Utah (USA)
D
da_hype Offline OP
Vogon poet
da_hype  Offline OP
Vogon poet
D

Joined: Feb 2004
Posts: 119
Logan, Utah (USA)
dude.. i've checked. and i hammer's example this don't work

Code:
alias test { 
  var %b = 2,%c = 10,%d
  var %a = %b
  var %b = %c
  var %c = %d
  var %d = 27
  .echo -s $eval(%a,1) 
  .echo -s $eval(%a,2)
  .echo -s $eval(%a,3)
  .echo -s $eval(%a,4)
}

Re: $eval #96178
30/08/04 03:17 PM
30/08/04 03:17 PM
Joined: Dec 2002
Posts: 2,962
Norwich, UK
S
starbucks_mafia Offline
Hoopy frood
starbucks_mafia  Offline
Hoopy frood
S

Joined: Dec 2002
Posts: 2,962
Norwich, UK
What's there to explain? For $eval(code, N), code will be evaluated N times.
eg.
var %b = $ $+ version
var %a = % $+ b

echo -a $eval(%a, 0) echoes the text '%a'
echo -a $eval(%a, 1) echoes the text '%b'
echo -a $eval(%a, 2) echoes the text '$version'
echo -a $eval(%a, 3) echoes the text '6.16'


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: $eval #96179
30/08/04 03:40 PM
30/08/04 03:40 PM
Joined: Dec 2002
Posts: 145
Trois-Rivières, Canada
G
gemeau50 Offline
Vogon poet
gemeau50  Offline
Vogon poet
G

Joined: Dec 2002
Posts: 145
Trois-Rivières, Canada
Hammer's example didn't work for me either.

Here is a script I made to detect clones. I added these three lines which should demonstrate what you are looking for:

echo 04 -a $eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),0)
echo 04 -a $eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),1)
echo 04 -a $eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),2)


Clones sur $chan:{
var %i = 1
echo -a $chr(160)
echo 13 -at ***CLONES SUR $chan
while (%i <= $nick(#,0)) {
if ($ialchan($address($nick($chan,%i),2),$chan,0) > 1) {
var %y = 1
if ($eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),2) != 1) {
var %clones1 = 1
echo -a $chr(160)
while (%y <= $ialchan($address($nick($chan,%i),2),$chan,0)) {
echo 04 -a *** $ialchan($address($nick($chan,%i),2),$chan,%y).nick $gettok($ialchan($address($nick($chan,%i),2),$chan,%y),2,33)
inc %y
}
set % $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64) 1
echo 04 -a $eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),0)
echo 04 -a $eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),1)
echo 04 -a $eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),2)
}
}
inc %i
}
if (%clones1 != 1) {
echo -a $chr(160)
echo 13 -at *** IL N'Y A AUCUN CLONE SUR LE CANAL $chan
}
echo -a $chr(160)
unset %clones*
}


Using these clones as example:
*** coucou!grandalf@122-64-2.dr.cgocable.ca
*** koukou!grandalf@122-64-2.dr.cgocable.ca

echo 04 -a $eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),0) ==
% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64)

echo 04 -a $eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),1) ==
%clones_122-64-2.dr.cgocable.ca

echo 04 -a $eval(% $+ clones_ $+ $gettok($address($nick($chan,%i),2),2,64),2) == 1


Hope this will clarify it for you