SRL Archive - Help

Anybody feel like revising this?


wantonman

2011-12-28 20:50:08


program new;
{$i srl/srl.scar}



procedure MM_WalkToTree;//clicks the spot on the minimap where maple trees are behind the bank
var
x,y:integer;
begin
if
FindColorTolerance(x,y,999274,570,10,700,100,5)then
wait(500+random(200));
Mouse(x,y,15,15,true);
end;





procedure ChopWood; //searches until finds maple tree and then it will click the given coordinate
var
x,y:integer;
begin
repeat
FindColorTolerance(x,y,1714513,1,1,520,340,5);
FindColorTolerance(x,y,1780821,1,1,520,340,5);
FindColorTolerance(x,y,1319748,1,1,520,340,5);
FindColorTolerance(x,y,1187643,1,1,520,340,5);
until(true);
wait(3000+random(1000));
Mouse(x,y,15,15,true);
end;





procedure IFFind; //If finds that the closest tree you copped down by searching for the stump after a tree has been cut
var //then after it see that, it will call the chopwood procedure again (a noob loop?)
Stump1,Stump2,x,y:integer;
begin
Stump1 := BitmapFromString(3, 2, 'meJzzTG7ySGwAIveEOggCAED+BvA=');
Stump2 := BitmapFromString(3, 2, 'meJyTd0+RdYqDIxn7SAApbARz');
if
FindBitmapSpiralTolerance(Stump1,x,y,180,60,380,260,5)
or
FindBitmapSpiralTolerance(Stump2,x,y,160,60,360,260,5)
then
ChopWood;
FreeBitmap(Stump1);
FreeBitmap(Stump2);
end;






Procedure Fletch; // checks if your inventory is full before going on, when it fids that it is full it will
begin //click the first log in inventory and will click fletch all into bows(u)
if
InvFull then
wait(500+random(100));
MouseItem(1,true);
wait(500+random(100));
Mouse(295,435,10,10,true);
wait(500+random(100));
Mouse(260,430,10,10,true);
end;








Procedure WalkBank; //chcks untill it finds a bow in the last inventory slot before proceding
var //when it is found then i will click bank icon on minimap
BankSymbol,BowBmp,x,y:integer;
begin
BankSymbol := BitmapFromString(9, 6, 'meJw7cOCA28Ktk7995fVLg5AQtGDB' +
'ggNIUooX3kMEIQAiBRGEkEB0AAaAUhBZCEI2EFkW2VhkvWhSAACUWEo=');

BowBmp := BitmapFromString(4, 2, 'meJwLj0qpa57ExMBgYO0MJOMSczp6' +
'5wAZAFO0Bjk=');
repeat
if
FindBitmapSpiral(BowBmp,x,y,685,430,725,460) then
FindBitmap(BankSymbol,x,y);
until(true)
wait(500+random(100));
Mouse(x,y,15,15,true);
FreeBitmap(BankSymbol);
FreeBitmap(BowBmp);
end;









begin
ClearDebug(); //im not using smart atm because i am testing and i find this easier
SetupSRL();
ActivateClient;
sleep(1000);
playsound('chord'); //lets me know that client is fuly activated and the r client is fully active
MM_WalkToTree;
sleep(8500+random(1000));
ChopWood;
Repeat
IFFind;
until(InvFull);
Fletch;
WalkBank;
end.









its tricky for me to figure out how to get it stable… perhaps in the hands of a pro they can teach me!!!






im totally sorry i forgot to mention that its a seers village maple choper / longbow fletcher/ banker… erra not quite yet…

ill put comments so i can be more clear, and sorry about the crappy post with no info!! yikes!!

YoHoJo

2011-12-28 20:52:06

Whatever the hell that it, it's very ghetto-ly made and not worth revising…
You aren't even telling us what it is, who made it, what it does, etc…

Flight

2011-12-28 20:53:33

I highly highly highly suggest taking a look at this, instead:
http://villavu.com/forum/showthread.php?t=44942

wantonman

2011-12-28 21:47:04

Okay I edited my post sorry for the inconvenience..

jakeyboy29

2011-12-28 21:48:44

http://www.youtube.com/watch?v=-d6b1yn-YhQ


wot da fuk

Brandon

2011-12-28 22:07:52

I just want to know what this is:


procedure ChopWood; //searches until finds maple tree and then it will click the given coordinate
var
x,y:integer;
begin
repeat
FindColorTolerance(x,y,1714513,1,1,520,340,5);
FindColorTolerance(x,y,1780821,1,1,520,340,5);
FindColorTolerance(x,y,1319748,1,1,520,340,5);
FindColorTolerance(x,y,1187643,1,1,520,340,5);
until(true);
wait(3000+random(1000));
Mouse(x,y,15,15,true);
end;
It's never going to chop wood.. No point calling all those FindColorTolerance if your not going to do something after the colour is found..

wantonman

2011-12-28 22:40:23

that searches for the colors on a maple tree untill it finds one, then it stops searching and clicks x,y// could be wrong…

jakeyboy29

2011-12-28 22:47:28

some
if
and
then
's are needed

legoace

2011-12-30 21:35:21

You need to look at some of the structure of proper Pascal scripts. Try looking at some scripts others have posted and pick up the structure from them.

Few immediate pointers:
every begin has to have an end
Whenever you want to do multiple lines because of a decision (i.e. if "this color found" then "do these lines"), you need to use this structure:

if (condition = true) then
begin
line1;
line2;
etc;
if (anotherCondition = true) then
begin
nestedifline1;
nestedifline2;
etcagain;
end;
end;