% Tools and functions loop mousewhere (mx,my,mb) if mb= 1 and mx > 10 and mx < 100 and my > 10 and my < 100 then tool :="pencil" elsif mb=1 and mx > 290 and mx < 900 and my > 10 and my < 460 then if tool="pencil" then drawdot (mx,my,7) end if end if end loop