Hey, guys, I've been stressing for the last hour over this code:
function mouseDrawBox(c)
if waitf>0
waitf = waitf - 1
endif
if c = 1 then ink rgb(0,0,0),0
if c = 2 then ink rgb(255,255,255),0
if c = 3 then ink rgb(255,0,0),0
if mouseclick() = 1 and waitf = 0 and draw = 0
oldMouseX = mousex()
oldMouseY = mousey()
draw = 1
endif
if draw = 1
drawing = 1
endif
if drawing = 1
oldMouseX2 = mousex()
oldMouseY2 = mousey()
newMouseX = oldMouseX + (oldMouseX + oldMouseX2) / 2
newMouseY = oldMouseY + (oldMouseY + oldMouseY2) / 2
line oldMouseX,oldMouseY,newMouseX,oldMouseY
line oldMouseX,oldMouseY,oldMouseX,newMouseY
dot newMouseX,newMouseY
if mouseclick() = 1
e = e + 1
if e>1 then e = 1
if e = 1 then waitf = 10
draw = 0
else
e = 0
endif
endif
endfunction
All I want is a box select command like "Age of Empires II" but where you click the mouse once and it starts up, then click it again to close the selective box. It's not like the Age of Empires one because you are not supposed to hold down the mouse. My problem is that I can open and start making the "box" (two lines and a dot) but when I click it off it will close but open a new one at the last mousex() and mousey() coordinates.
(hope that wasn't confusing)
Thanks
a.k.a. "flockhound"