PDA

View Full Version : How to detect text?



I Karma I
12-01-2006, 09:09 PM
How do you detect text like, you right click, then click Attack...? Also, if Attack isn't there it clicks cancel or moves the mouse away so the right-clicked box goes away.

Hey321
12-01-2006, 09:15 PM
i think it would be:

If (findtext(attack)) then
clicktext('attack')
else
clicktext('cancel')

I Karma I
12-01-2006, 10:57 PM
Ok, I am just trying to see if it right clicks a monk, then clicks attack, else cancel. Heres what I have:



program Fighter;
const
Monster=12172221;
Betweentime = 3;
Var x,y:Integer;
Procedure FindColor;
begin;
FindColorSpiral(x,y,Monster,5,5,760,495);
end;
Begin FindColor;
wait((Betweentime * 1000) + random(300))
If (findtext(attack)) then
getmousepos(x,y);
clickmouse(x,y,False);
clicktext('attack')
else
clicktext('cancel')
end.

And I get this error:


Line 12: [Error] (12:5): Unknown identifier 'findtext' in script XXXXXXXXXXXXXXX

What do I change?

Boreas
12-01-2006, 11:13 PM
How bout looking in TEXT.scar??????????????????

Hint:
ClickOption
ChooseOption
popup

TOB
12-01-2006, 11:13 PM
{.include srl\srl.scar}

SetupSRL;

And if this is the case just find use
IsUpText('Attack Monk');

I Karma I
12-01-2006, 11:19 PM
program Fighter;
{.include srl\srl.scar}
SetupSRL;
const
Monster=12172221;
Betweentime = 3;
Var x,y:Integer;
Procedure FindColor;
begin;
FindColorSpiral(x,y,Monster,5,5,760,495);
end;
Begin FindColor;
wait((Betweentime * 1000) + random(300))
If (findtext(attack)) then
getmousepos(x,y);
clickmouse(x,y,False);
clicktext('attack')
else
clicktext('cancel')
end.

Where do I put IsUpText('Attack Monk');

(I am newb at SCAR... but not scripting)

TOB
12-01-2006, 11:28 PM
program Fighter;
{.include srl\srl.scar}
const
Monster=12172221;
Betweentime = 3;

var
x,y:Integer;

function FindMonk: Boolean;
begin;
if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
Result:= True;
else
Result:= False;
end;

Begin
SetupSRL;
ActivateClient;
repeat
wait((Betweentime * 1000) + random(300));
if(FindMonk) then
begin
if (IsUpText('Attack Monk')) then
Mouse(x, y, 10, 10, True);
end;
until(not(LoggedIn))
end.

I Karma I
12-01-2006, 11:35 PM
program Fighter;
{.include srl\srl.scar} Const
Monster=12172221;
Betweentime = 3;

Var x,y:Integer;
Procedure FindColor;
function FindMonk: Boolean;
begin
if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
Result:= True;
else
Result:= False;
Begin
SetupSRL;
ActivateClient;
repeat
Begin FindColor;
wait((Betweentime * 1000) + random(300)) if(FindMonk) then if (IsUpText('Attack Monk') then
Mouse(x, y, 10, 10, True);
until (not(LoggedIn)) end.

New error:



Line 8: [Error] (8:1): 'BEGIN' expected in script


TY for help aswell.

Arr0w
12-02-2006, 08:57 AM
Fixed.


program Fighter;
{.include srl\srl.scar}
Const
Monster=12172221;
Betweentime = 3;

Var x,y:Integer;

function FindMonk: Boolean;
begin
if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
Result:= True;
else
Result:= False;
Begin
SetupSRL;
ActivateClient;
repeat
Begin FindColor;
wait((Betweentime * 1000) + random(300)) if(FindMonk) then if (IsUpText('Attack Monk') then
Mouse(x, y, 10, 10, True);
until (not(LoggedIn))
end.

TOB
12-02-2006, 09:08 AM
Kaldo, here is my version(this time fixed IN SCAR) make sure you delete all of your old one and paste this in exactly(which you failed to do the first time.)



program Fighter;
{.include srl\srl.scar}

const
Monster = 12172221;
Betweentime = 3;

function FindMonk: Boolean;
begin;
if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
Result:= True
end;

Begin
SetupSRL;
ActivateClient;
repeat
wait((Betweentime * 1000) + random(300));
if(FindMonk) then
begin
if (IsUpText('Attack Monk')) then
Mouse(x, y, 10, 10, True);
end;
until(not(LoggedIn))
end.

arr0w your's is broken to ;)

tarajunky
12-02-2006, 02:03 PM
Sorry, that won't work either. How is the UpText supposed to show 'Attack Monk' if you never move the mouse over there? :)



program Fighter;
{.include srl\srl.scar}

const
Monster = 12172221;
Betweentime = 3;

function FindMonk: Boolean;
begin;
if(FindColorSpiral(x,y,Monster,5,5,760,495)) then
Result:= True
end;

Begin
SetupSRL;
ActivateClient;
repeat
wait((Betweentime * 1000) + random(300));
if(FindMonk) then
begin
MMouse(x,y,2,2);
Wait(50);
if (IsUpText('Attack Monk')) then
Mouse(x, y, 10, 10, True);
end;
until(not(LoggedIn))
end.

TOB
12-02-2006, 04:01 PM
I thought I had typed in MMouse(x y, 5, 5); My mistake

m0u53m4t
12-02-2006, 06:33 PM
Try "popup". Thats what I use.

Boreas
12-02-2006, 06:38 PM
Yea I said that as soon I read "you right click, then click Attack" but nobody listens lol.

TOB
12-02-2006, 09:45 PM
I didn't listen because if the UpText says Attack Monk then there is no point in right clicking other than for the healing part.