SRL Archive - SRL Suggestions

WaitNPCCHat


NKN

2012-04-21 21:58:29

I wasn't sure if there was anything like this, I couldn't find any, so I modified one of the other functions to wait, pretty simple, but it'd be easier if there was one already in the SRL function. From function "FindNPCChatText"

function WaitOnText(txt: TStringArray; action: fnct_ActionOptions; time:Integer): boolean; //Gotten from SRL includes, just decided to change it around
var
x, y, finaltime: integer;
chars: TStringArray;
begin
chars := [UpChars, CharsNPC];
finaltime := GetSystemTime + Time;
while(finaltime > GetSystemTime) do
begin
if (findTextEx(x, y, txt, chars, MCX1, MCY1, MCX2, MCY2)) then
begin
case action of
Move: MMouse(x, y, 6, 3);
ClickLeft: Mouse(x, y, 6, 3, mouse_Left);
ClickRight: Mouse(x, y, 6, 3, mouse_Right);
end;

result := true;
exit;
end;
end;
end;

putonajonny

2012-04-30 16:49:49

You should just put action as an integer, then do this:

function WaitOnText(txt: TStringArray; action, time : Integer): boolean; //Gotten from SRL includes, just decided to change it around
var
x, y, finaltime: integer;
chars: TStringArray;
begin
chars := [UpChars, CharsNPC];
finaltime := GetSystemTime + Time;
while(finaltime > GetSystemTime) do
begin
if (findTextEx(x, y, txt, chars, MCX1, MCY1, MCX2, MCY2)) then
begin
Mouse(x, y, 6, 3, Action);
Result := true;
exit;
end;
end;
end;

Though tbh why don't you just do:
While(not AreTalking)do
Wait(200+Random(200));

///findTextEx etc etc...

Abu

2012-05-01 11:46:04

      case action of
Move: MMouse(x, y, 6, 3);
ClickLeft: Mouse(x, y, 6, 3, mouse_Left);
ClickRight: Mouse(x, y, 6, 3, mouse_Right);
end;

Wouldn't that move the mouse to x and y with a randomness of (6, 3), then left click with another randomness of (6 ,3) and then right-click with yet another randomness of (6, 3)?

Thus resulting in weird, buggy mouse movements?

NKN

2012-05-01 15:52:28

No.
You type action in when you call it.

So you type


Move
Clickleft
Clickright
And it uses the one you picked.

Sin

2012-05-01 16:24:22

I believe I made this a while back.
It's in my Firemaker.

NKN

2012-05-01 16:51:42

Oh. It was suggested already?

My bad.

Abu

2012-05-01 16:55:16

From: NKN
No.
You type action in when you call it.

So you type


Move
Clickleft
Clickright
And it uses the one you picked.


Oh right now sure how I missed that :duh:

From: NKN
Oh. It was suggested already?

My bad.


I don't think he suggested it, just made one in his script.

Correct me if I'm wrong.