rem Scribble .... Rev 2.2 rem Screensaver version rem A J Tooth // April 2004 rem Revised February/June 2006 on error if (err=17) then quit *FLOAT64 rem Screensaver preamble rem +++++++++++++++++++++++++++++++++++++++++++++++++++++ if instr(@cmd$, "/c") then sys "MessageBox", 0, "This screen saver has no options.", "", 48 quit endif Preview% = instr(@cmd$, "/p") if Preview% then sys "SetWindowLong", @hwnd%, -16, &50000000 hparent% = valmid$(@cmd$, Preview%+2) sys "SetParent", @hwnd%, hparent% sys "SetWindowLong", @hwnd%, -8, hparent% sys "GetClientRect", hparent%, ^V% XScreen% = X% YScreen% = Y% sys "MoveWindow", @hwnd%, 0, 0, XScreen%, YScreen%, 0 else sys "SetWindowLong", @hwnd%, -16, &16000000 sys "GetSystemMetrics", 0 to XScreen% sys "GetSystemMetrics", 1 to YScreen% sys "SetWindowPos", @hwnd%, -1, 0, 0, XScreen%, YScreen%, 0 endif vdu 26 : colour 15 : colour 128 : cls sys "ShowWindow", @hwnd%, 1 mouse X0%,Y0%,B0& off rem +++++++++++++++++++++++++++++++++++++++++++++++++++++ rem Setup proc_setup repeat Cnt%+=1 : if Cnt%>100000 then Cnt%=0 : Flp%=-Flp% : cls rem Update the position proc_update rem Change colour proc_cols if Cnt% mod 300 = 0 then *REFRESH rem Special Screensaver exit if Preview%=0 then if inkey(2)<>-1 then quit if (inkey(-1) or inkey(-2) or inkey(-3) or inkey(-99)) then quit mouse Xx%,Yy%,Bb& sys "Sleep",5 if (Xx%<>X0% or Yy%<>Y0% or Bb&>0) then quit endif endif until false *REFRESH ON quit end rem end of Program +++++++++++++++++++++++++++++++++++++++++++++ rem +++++++++++++++++++++++++++++++++++++++++++++++++++++++ rem Setup def proc_setup local i& dim Col&(3),f%(5) Cnt%=0 : Flp%=1 x%=rnd(XScreen%) : y%=rnd(YScreen%) for i&=1 to 3 Col&(i&)=rnd(255) next i& rem*REFRESH OFF @vdu%!248=1 endproc rem ++++++++++++++++++++++++++++++++++++++++++++++++++++++ def fn_limit(Zz%,Stp%,Xt%) Zz%+=Stp% if Zz%<0 then Zz%=Xt% if Zz%>Xt% then Zz%=0 =Zz% rem ++++++++++++++++++++++++++++++++++++++++++++++++++++++ rem Update the position def proc_update local k& for k&=1 to 5 f%(k&)=rnd(3)-2 next k& rem Update x% and y% x%=fn_limit(x%,f%(1),XScreen%) y%=fn_limit(y%,f%(2),YScreen%) endproc rem +++++++++++++++++++++++++++++++++++++++++++++++++++++++ rem Change colour def proc_cols local t& for t&=1 to 3 if Flp%>0 then Col&(t&)+=f%(2+t&) else Col&(t&)+=f%(t&) if Col&(t&)>255 then Col&(t&)=0 if Col&(t&)<0 then Col&(t&)=255 next t& colour 10,Col&(1),Col&(2),Col&(3) : gcol 10 line 2*x%,2*y%,2*x%+1,2*y%+1 endproc rem +++++++++++++++++++++++++++++++++++++++++++++++++++++++