Don't use this script.
It looks like you got the idea of how to set it up, but please before you do anything else, use SRL. Looking in mouseflag.scar for the mouse commands, such as mmouse and mouse.
Also look in inventory.scar for useitem, and the dtm and bitmap finding within the inventory.
If it just sits there it probably didn't find the bitmaps because colors change. Read a DTM tut (yohojo's) and make a DTM of the ore, using only the black (65536) outline because that never changes.
Now you can use finddtm to find the ore in the inventory, see example in wetclay below. Then you need to know which inventory spot it is in. Use CoordsToInvSpot for this. You put in the answer you get from finddtm, and it gives you a number 1-28 for the inventory spots. This number can be used by MouseItem, see inventory.scar. You give mouseitem the number and false to make it right click the ore. Now look in text.scar for something that clicks the option drop.
SCAR Code:
//Oppposite of itemcoords
function CoordsToInvSpot(gx,gy:integer):integer;
var col,row:integer;
begin
if ((gx>569) and(gx<600)) then col:=1;
if ((gx>611) and(gx<642)) then col:=2;
if ((gx>653) and(gx<684)) then col:=3;
if ((gx>695) and(gx<723)) then col:=4;
if ((gy>213) and(gy<244)) then row:=1;
if ((gy>249) and(gy<280)) then row:=2;
if ((gy>285) and(gy<316)) then row:=3;
if ((gy>322) and(gy<352)) then row:=4;
if ((gy>357) and(gy<387)) then row:=5;
if ((gy>393) and(gy<424)) then row:=6;
if ((gy>429) and(gy<459)) then row:=7;
result:=((row-1)*4)+col;
end;
procedure WetClay;
var ex,ey:integer;
begin
clickwell;
repeat
finddtm(dtmbucket,ex,ey,554, 205, 743, 465);
useitem(coordstoinvspot(ex,ey+10));
wait(200+random(100));
finddtm(dtmclay,ex,ey,554, 205, 743, 465);
useitem(coordstoinvspot(ex,ey));
claymade:=claymade+1;
players[currentplayer].integer1:= players[currentplayer].integer1+1;
setjug;
filljug;
until (countitemdtm(dtmclay)=0);
end;