This is a simple version of a function I use.
If you ID all your sprites you want to use in a sequence, say 20 to 30 for example, then simply call function
clickbutton(20,30);
It will then return the ID of the sprite clicked on.
int clickbutton(int spritestart,int spriteend)
{
int Mouse_over_sprite = 0,SC=0;
for(SC=spritestart;SC<=spriteend;sb++)
{
if (dbMouseX() >=dbSpriteX(SC) && dbMouseX() <=dbSpriteX(SC) + dbSpriteWidth(SC) && dbMouseY()>=dbSpriteY(SC) && dbMouseY()<=dbSpriteY(SC)+dbSpriteHeight(SC))
{
Mouse_over_sprite = SC;
}
}
if (dbMouseClick())return Mouse_over_Sprite;
return 0;
}
Didn't have time to test this, but it was taken from a working function which also used the arrow keys and highlighted sprites when you are over them.