SRL Archive - Help and Support

Help With 1st script


canofpeople

2006-04-10 21:41:26

program Woodcutter;
{.include SRL\SRl.scar}

function FindTree:Boolean;
begin
Result:=False
SleepAndMoveMouse (1000+Random(4000))
x:=251
y:=166
If(FindColorSpiralTolerance(x,y,4690048,5,5,515,337,5))or
(FindColorSpiralTolerance(x,y,3892097,5,5,515,337,5))or
(FindColorSpiralTolerance(x,y,4485522,5,5,515,337,5))or
(FindColorSpiralTolerance(x,y,4690048,5,5,515,337,5))Then
begin
MMouse (x,y,0,0)
If(Option2('Chop down'))Then
begin
Result:=True
end;
end;
end;

procedure Setup;
begin
SetupSRL;
ActivateClient;
end;

procedure ChopTree;
begin
MMouse(x,y,0,0)
If(Option2('Chop down'))Then
begin
Mouse(x,y,0,0,true)
repeat
SleepAndMoveMouse(100+Random(300))
Wait(60000)
end;
end;


















{==========================Main Loop==================================}
begin
Setup;
repeat;
If(FindTree)Then
begin
ChopTree
end;
until(false)
end.







Anyone got any probs that they can see?

Pwnd

2006-04-10 22:00:41

Yes, but I am to tired to correct them. Add me on msn and I'll help out tomorrow.

[email]dirtywonker@yahoo.com[/email]
AIM: dirtywonker

weaselforce

2006-04-10 22:15:21

scar defines x and y as 1, it makes alot less coding… i know some things are a little messy, but i'm stilll new myself. GOOD START none the less. it looks kinda short

  Result:=False 
wtf is that for? theres nothing that produces a result.

well it looks kinda confusing to me, i cant really read whats going on.

read this for help with standards - http://www.villavu.com/forums/showthread.php?t=48

also in your main loop you have a "if..then" statement without a "else". if it cant find the tree the first time you should have it keep looking for one, not just give up.

how did you get those x and y values?

canofpeople

2006-04-10 22:25:03

From: weaselforce
scar defines x and y as 1, it makes alot less coding… i know some things are a little messy, but i'm stilll new myself. GOOD START none the less. it looks kinda short

  Result:=False 
wtf is that for? theres nothing that produces a result.

well it looks kinda confusing to me, i cant really read whats going on.

read this for help with standards - http://www.villavu.com/forums/showthread.php?t=48

also in your main loop you have a "if..then" statement without a "else". if it cant find the tree the first time you should have it keep looking for one, not just give up.

how did you get those x and y values?

it short its not done yet also got the xy by clickin point in middle of map so it will click tree nearest center

weaselforce

2006-04-10 22:34:13

ooo lol, that would have helped. I couldnt figure it out. but yea, definitely fix that x and y variable. just assign it a new one like p and r or something like treex:=251 treey:=166 (treex,treey,0,0)

canofpeople

2006-04-10 22:35:06

can you explain how?

masquerader

2006-04-10 23:58:11

From: weaselforce
scar defines x and y as 1, it makes alot less coding… i know some things are a little messy, but i'm stilll new myself. GOOD START none the less. it looks kinda short

  Result:=False 
wtf is that for? theres nothing that produces a result.

well it looks kinda confusing to me, i cant really read whats going on.

weaselforce: you do not make any sense :p
he is on the right track, and you are probably confusing him more

canofpeople: i would probably wait for pwned to help you, lol
im tired right now too :p

weaselforce

2006-04-11 03:57:13

lol i warned him on msn

i went to bed at 4 and got up at 9, get off my back :p

XxKanexX

2006-04-11 04:04:01

Standards :p

phantombmx

2006-04-11 16:56:46

lol i see my type of coding in there :p nice so far, you need to indent tho (thats what kane meant by standards).. ill indent it in a few minutes.. ;)

EDIT: heres the indented version.. makes it so much easier to read.. i also got rid of a few minor errors..

program Woodcutter;
{.include SRL\SRL.scar}

function FindTree:Boolean;
begin
Result:=False
SleepAndMoveMouse (1000+Random(4000))
x:=251
y:=166
If(FindColorSpiralTolerance(x,y,4690048,5,5,515,33 7,5))or
(FindColorSpiralTolerance(x,y,3892097,5,5,515,337, 5))or
(FindColorSpiralTolerance(x,y,4485522,5,5,515,337, 5))Then
begin
MMouse (x,y,0,0)
If(Option2('Chop down'))Then
begin
Result:=True
end;
end;
end;

procedure ChopTree;
begin
MMouse(x,y,0,0)
If(Option2('Chop down'))Then
begin
Mouse(x,y,0,0,true)
SleepAndMoveMouse(100+Random(300))
Wait(60000)
end;
end;

procedure Setup;
begin
SetupSRL;
ActivateClient;
end;

{==========================Main Loop==================================}

begin
Setup;
repeat;
If(FindTree)Then
begin
ChopTree
end;
until(false)
end.

canofpeople

2006-04-11 23:00:57

thanks but now i need a func boolean that can tell when im done with tree? any suggestions?