public calcid =-1 keystr="001021001201003" powershell("ps calc|kill") calcid =exec("calc.exe") CLKITEM(calcid, "関数電卓", CLK_MENU, False) for i=1 to 100 r=getR( i, 15 ) r=Zero2Fifteen(r) q=copy( keystr, r, 1 ) select q case "3"
case "2" out="Buzz" case "1" out="Fizz" case "0"
selend print out next sleep(10) function getR( x, y ) clkitem(calcid,"クリア",CLK_ACC) for j= 1 to length(x) fig=(copy(x,j,1)) clkitem(calcid,fig,CLK_ACC) next clkitem(calcid,"剰余",CLK_ACC) for j= 1 to length(y) fig=(copy(y,j,1)) clkitem(calcid,fig,CLK_ACC) next clkitem(calcid,"等号",CLK_ACC) kbd(vk_ctrl,down) kbd(vk_c) kbd(vk_ctrl,up) result=getstr(0) fend function plus( x, y ) clkitem(calcid,"クリア",CLK_ACC) for j= 1 to length(x) fig=(copy(x,j,1)) clkitem(calcid,fig,CLK_ACC) next clkitem(calcid,"加算",CLK_ACC) for j= 1 to length(y) fig=(copy(y,j,1)) clkitem(calcid,fig,CLK_ACC) next clkitem(calcid,"等号",CLK_ACC) kbd(vk_ctrl,down) kbd(vk_c) kbd(vk_ctrl,up) result=getstr(0) fend function mult( x, y ) clkitem(calcid,"クリア",CLK_ACC) for j= 1 to length(x) fig=(copy(x,j,1)) clkitem(calcid,fig,CLK_ACC) next clkitem(calcid,"乗算",CLK_ACC) for j= 1 to length(y) fig=(copy(y,j,1)) clkitem(calcid,fig,CLK_ACC) next clkitem(calcid,"等号",CLK_ACC) kbd(vk_ctrl,down) kbd(vk_c) kbd(vk_ctrl,up) result=getstr(0) fend
function isZero( x ) clkitem(calcid,"クリア",CLK_ACC) clkitem(calcid,"1",CLK_ACC) clkitem(calcid,"除算",CLK_ACC) for j= 1 to length(x) fig=(copy(x,j,1)) clkitem(calcid,fig,CLK_ACC) next clkitem(calcid,"等号",CLK_ACC) kbd(vk_ctrl,down) kbd(vk_c) kbd(vk_ctrl,up) result=pos("0 で割ることはできません",getstr(0)) fend
function Zero2Fifteen(r) result =plus(r,mult( isZero(r), 15 )) fend