Log in

View Full Version : click color and invantory clicking



stupedspam
01-13-2007, 01:54 AM
like the title says im having truble with these. i dont know any thing so mabe a sample srl script will help. people say i need to stop asking for scripts and start asking for help to make so here i am.
--what i am trying to do--
*trying to click clay in inventory and then click water jug (for making clay soft) i know that i could use cords. but there very dectible and thats how i got 1 of my chars banned. so yea plz help me out if you can. thx!!

Boreas
01-13-2007, 02:06 AM
supporting function needed
//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;
dtms I used, you can make your own, use the black outline
dtmClay:= DTMFromString('78DA8DD1310E8040084451F0FED730AEBB6 62' +
'51AA3261ECE29B5FA5030CD2BC8E0319855B7FFF8672B5799 09CC' +
'2E338239650A983B611E9919CC25D3C01C324BC274305D660 3536' +
'5024C49DCD312FF0AEEE70542881365');

dtmbucket:= DTMFromString('78DA6374676260B8C6800618914820ED045 47' +
'39B801A7BA09AC704D43800D5BC21A0C603A8E61301350140 356F' +
'09A80904AA7949404D1050CD7DFC6A00CD610993');
fresh from my clay wetter
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;

stupedspam
01-13-2007, 06:35 PM
ok now how would i put includes and what includes do i need...also could some one show me how to make the setup so i dont get "identifier expected". thanks for the scripts above,but i need some more sadly.

Boreas
01-13-2007, 07:01 PM
The only include you need is SRL, if you don't have it, see the first link in section 3 of my FAQ (link to FAQ in sig).

To use the include in your script, put {.include srl/srl.scar} right below program, and setupsrl; as the first thing in your main loop. More info on this can be found in links in my FAQ. To do this automatically, make text file called newscript.txt, containing

program New;
{.include SRL/SRL.scar}

begin
SetupSRL;
end.

and save it you scar directory, more info in this TUT. (http://www.villu-reborn.com/showthread.php?t=5650)


If this is confusing look at section 1 of my FAQ.
program New;
{.include SRL/SRL.scar}

//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;

procedure LoadDTMS;
begin
dtmClay:= DTMFromString('78DA8DD1310E8040084451F0FED730AEBB6 62' +
'51AA3261ECE29B5FA5030CD2BC8E0319855B7FFF8672B5799 09CC' +
'2E338239650A983B611E9919CC25D3C01C324BC274305D660 3536' +
'5024C49DCD312FF0AEEE70542881365');

dtmbucket:= DTMFromString('78DA6374676260B8C6800618914820ED045 47' +
'39B801A7BA09AC704D43800D5BC21A0C603A8E61301350140 356F' +
'09A80904AA7949404D1050CD7DFC6A00CD610993');
end;

begin
SetupSRL;
LoadDTMS;
WetClay;
end.

stupedspam
01-13-2007, 07:42 PM
ok... now that i put include and mainloop thing at the end i get unknow identifier 'dtmbucket' in script... it also does that for the dmtclay..would bitmaps be easer to use?? Thanks for the help so far too.

Boreas
01-13-2007, 07:43 PM
oops forgot

var dtmbucket, dtmclay:integer;

put that below the include line

stupedspam
01-13-2007, 08:08 PM
now i have unknow identifier 'claymade' in script...should i make a report and add that to report or add that to the var?

Boreas
01-14-2007, 03:42 AM
that's just what I did, if you want it in your report, you need to make a global variable, and have the report use that variable, otherwise you can just take out that line