We just went over how you cannot have a an alias inside an event...
And I just went over how you should be setting a variable on join and waiting for the on op event to trigger etc.


Code:
on me:*:join:#:set %justjoined $addtok(%justjoined,$chan,32)
on me:*:part:#:set %justjoined $remtok(%justjoined,$chan,32) | .timerlottery. $+ $chan off
on *:disconnect unset %justjoined | .timerlottery.* off
on *:op:#:{
 if ($opnick == $me) {
   if ($istok(%justjoined,$chan,32)) {
     $+(.timerlottery.,$chan) 0 60 lottery $safe($chan)
   }
   set %justjoined $remtok(%justjoined,$chan,32)
 }
}
alias lottery {
 var %winner $nick($1,$r(1,$nick($1,0)))
 var %point $gettok(5 10 20 30 40 50 60 70 80 150,$r(1,10),32)
 var %inisection $+($1,.,%winner)
 writeini -n Points.ini %inisection Points $calc($readini(Points.ini,%inisection,Points) + %point)
 msg $1 %winner wins %point points!
}
alias safe return $!decode( $encode($1-, m) ,m)
The $safe alias is required to prevent the /timer command from double evaluating the $chan value, which could result in an exploit (the value of $chan is not known since it can be any channel), read more here http://en.wikichip.org/wiki/mirc/msl_injection

This is untested but should work


#mircscripting @ irc.swiftirc.net == the best mIRC help channel