Log in

View Full Version : Anybody feel like revising this?



wantonman
12-29-2011, 01:50 AM
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)the n
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,26 0,5)
or
FindBitmapSpiralTolerance(Stump2,x,y,160,60,360,26 0,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' +
'ggNIUooX3kMEIQAiBRGEkEB0AAaAUhBZCEI2EFkW2VhkvWhSA ACUWEo=');

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
12-29-2011, 01:52 AM
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
12-29-2011, 01:53 AM
I highly highly highly suggest taking a look at this, instead:
http://villavu.com/forum/showthread.php?t=44942

wantonman
12-29-2011, 02:47 AM
Okay I edited my post sorry for the inconvenience..

jakeyboy29
12-29-2011, 02:48 AM
http://www.youtube.com/watch?v=-d6b1yn-YhQ


wot da fuk

Brandon
12-29-2011, 03:07 AM
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
12-29-2011, 03:40 AM
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
12-29-2011, 03:47 AM
some if and then's are needed

legoace
12-31-2011, 02:35 AM
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;