jacob1:
Change line 25 to this:
if x>-1 and y>-1 and x<612 and y<384 and x>=mgl.cliprect.x1 and y>=mgl.cliprect.y1 and x<=mgl.cliprect.x2 and y<=mgl.cliprect.y2 and not(mgl.getpixel(x,y)==t) then
(changing clientrect to cliprect and adding mgl. before getpixel)