SRL Archive - OSR Help

TreeChopping


brandel

2012-05-13 14:36:33

Hey, cud anyone take a quick look on this script and figure out why it won't chop maples? It just hovers them and I've tried all different colors. I'm a newbie to this :(

Thanks

nokkasiili

2012-05-13 14:43:47

Didnt read code but it sounds your uptext is wrong.

Glassir

2012-05-13 14:52:35

should it be;

function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
begin
MMouse(x, y, 6, 6);
If WaitUpText('aple', 1000+Random(200)) Then // aple here instead of Uptext
begin
Result:=True;
GetMousePos(x, y);
If RClick Then


try that. thats copied from line 19-26 but its only line 22 there was a change.



yes that should work now. you need to remember to put it in ' ' so that this is what it looks for in the uptext. :)

Element17

2012-05-13 14:57:03

I don't believe RClick is anything…

brandel

2012-05-13 15:00:03

From: Glassir
should it be;

function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
begin
MMouse(x, y, 6, 6);
If WaitUpText('aple', 1000+Random(200)) Then // aple here instead of Uptext
begin
Result:=True;
GetMousePos(x, y);
If RClick Then


try that. thats copied from line 19-26 but its only line 22 there was a change.



yes that should work now. you need to remember to put it in ' ' so that this is what it looks for in the uptext. :)


Tried it, wasn't the problem. Or atleast not the only one :(

From: 14578
I don't believe RClick is anything…


What do you suggest me to write instead?

Glassir

2012-05-13 15:07:03

just leave out the Rclick section.. try this

function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
begin
MMouse(x, y, 6, 6);
If WaitUpText('aple', 1000+Random(200)) Then
begin
Result:=True;
GetMousePos(x, y);
Begin
Mouse(x, y, 0, 0, True);
Wait(150+Random(100));
FFlag(0);
end;
end;
end;

brandel

2012-05-13 15:13:19

From: Glassir
just leave out the Rclick section.. try this

function CheckAndClick (UpText, Option:String; x, y:Integer; RClick:Boolean):Boolean;
begin
MMouse(x, y, 6, 6);
If WaitUpText('aple', 1000+Random(200)) Then
begin
Result:=True;
GetMousePos(x, y);
Begin
Mouse(x, y, 0, 0, True);
Wait(150+Random(100));
FFlag(0);
end;
end;
end;


Tried it, same problem. Mouse is all over the tree but it won't click. Go behind Seers' Village bank and try it out and you'll se what I mean :(

putonajonny

2012-05-13 15:13:29

Line 132:
    If(IsUpTextMultiCustom(['hop, aple, ree'])) then
should be:
    If(IsUpTextMultiCustom(['hop', 'aple', 'ree'])) then
however it would be even better if it was:
    If(WaitUpTextMulti(['hop', 'aple', 'ree'], 200+Random(500))) then

Glassir

2012-05-13 15:15:51

From: putonajonny
Line 132:
    If(IsUpTextMultiCustom(['hop, aple, ree'])) then
should be:
    If(IsUpTextMultiCustom(['hop', 'aple', 'ree'])) then
however it would be even better if it was:
    If(WaitUpTextMulti(['hop', 'aple', 'ree'], 200+Random(500))) then



cant believe i missed that! i have spent the last couple of days furiously scripting to learn everything and that was one of the problems i had! :L

brandel

2012-05-13 15:22:05

From: putonajonny
Line 132:
    If(IsUpTextMultiCustom(['hop, aple, ree'])) then
should be:
    If(IsUpTextMultiCustom(['hop', 'aple', 'ree'])) then
however it would be even better if it was:
    If(WaitUpTextMulti(['hop', 'aple', 'ree'], 200+Random(500))) then


This changed it from "Cannot find tree" to "Tree has been found" but it still refuses to actully chop.