PDA

View Full Version : AutoColor help



The Kool Aid Man
11-27-2006, 02:50 AM
Heres what I have and when I testfind the DTM it finds it. but when it comes time to move the click ont he DTM it just goes to the edge of the screen. Heres a sample of how i have it setup.
Procedure ClickDTM;
var
Knife: integer;
KnifeColor: integer;
begin
Knife := DTMFromString('78DA638C66626078C600066240CC08C4E57 9B' +
'90C29503608309600D5DC67400120350C486A00F15C05BC') ;
If(FindDTM(Knife,x,y,823,408,100,650))Then
KnifeColor := GetColor(x,y);
Mouse(x,y,8,8,True);
wait(550+random(50));
end
end;

Junior
11-27-2006, 03:25 AM
var
Knife: integer;
KnifeColor: integer;

LoadDTM;
Begin
Knife := DTMFromString('78DA638C66626078C600066240CC08C4E57 9B' +
'90C29503608309600D5DC67400120350C486A00F15C05BC') ;
End;
//----------------------------
Procedure ClickDTM;
Begin
LoadDTM;
If(FindDTM(Knife,x,y,MIX1,MIY1,MIX2,MIY1))Then
//MIX1,MIY1,MIX2,MIY1 = inventory cords
MMouse(x,y,3,3) //forgot this, will move mouse to DTM.
If(IsUpTextMulti('nif','Kni','ife')Then
Begin // if you have 2 or more procedures after a then, you will need a begin
GetMousePos(x,y)
KnifeColor := GetColor(x,y);
Mouse(x,y,1,1,True);
wait(550+random(50));
FreeBitmap(Knife);
End Else
Writeln('Knife was not found, s0z pl0x!');
FreeBitmap(Knife); //will free the bitmap, saves up more space on SCAR
End;


Does that work?

Boreas
11-27-2006, 03:46 AM
//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;


finddtm(dtmofblackoutline,x,y,x1, y1,x2, y2);
useitem(coordstoinvspot(x,y+10));

Thats what I use for clicking items in inventory, where the dtm is the black outline with the parent dot being top of item.

The Kool Aid Man
11-27-2006, 04:13 AM
Still doesnt work I am making my DTM wrong any suggestions on how to make it?

like the points and area size

Boreas
11-27-2006, 04:16 AM
use the black outline. 65536, never changes

The Kool Aid Man
11-27-2006, 04:44 AM
use the black outline. 65536, never changes


Works Like a Charm!