/* */ pattern='*!*@*piotrkow.tpnet.pl' name='Scanner' /* this is displayed on amirc window */ seconds=60 /* delay between scans */ portname='ScannerPort' exitname='t:ExitScanner.Now' options results call addlib('rexxsupport.library', 0, -30, 0) if show('p',portname) then do call open(1,exitname,'w') call close(1) exit end call openport(portname) do until exists(exitname) 'echo p=«'name'» Checking users' /* remove this line if you want */ 'GetUsers' users=result do u=1 to words(users) user=strip(translate(word(users,u),' ','@+')) "userhost" user host=result 'MatchUserHost' user'!'host pattern if rc=1 then call announce(user,host) end do s=1 to seconds*5 call delay(10) end end /* do while */ 'echo p=«'name'» Quitting' closeport(portname) call delete(exitname) exit announce: parse arg user,host if pos('«'host'»',announced)=0 then do announced=announced || '«'host'»' 'echo p=«'name'»' user 'is online at' host end return