SRL Archive - Help and Support

Need to speed this up...


gerauchert

2008-01-06 16:48:52

I made a stronghold of security gate question solver, but it is way too slow with the method I am using….

any suggestions?

Function AnswerGateQuestion: Boolean;
var
i: Integer;
Answer: TStringArray;
begin
if(not(LoggedIn))then
Exit;
begin
Answer := ['body','No','irus','nker','ecove','onths','amous','buse r','nly on the',
'port A','owhere','nbox','my pass','emora'];
if(IsTextInAreaEx(mcx1,mcy1,mcx2,mcy2,x,y,'timate',3,NPCChars,False,False,0,2,-1))then
begin
ClickToContinue;
end;
FTWait(2);
FindNormalRandoms;
ClickToContinue;
for i := 0 to 13 do
begin
if(IsTextInAreaEx(mcx1,mcy1,mcx2,mcy2,x,y,Answer[i],3,NPCChars,False,False,0,2,-1))then
begin
Mouse(x,y,1,1,True);
FTWait(3);
FindNormalRandoms;
ClickToContinue;
Result := True;
Exit;
end else
Result := False;
end;
end;
end;

R0b0t1

2008-01-06 16:58:50

Remove the random finding… You're talking with an NPC, and it should be fast enough that it won't encounter randoms. Also, when you are done talking, just check for randoms.

gerauchert

2008-01-07 00:22:00

Did that ;) thanks robot

still think its going to be about the same speed for finding the text though without those random checks because if it doesnt detect one of the answers it will skip that random check anyway…

Anyway to speed this bitch up? :D

mickaliscious

2008-01-07 03:41:44


Function AnswerGateQuestion: Boolean;
var
i: byte;
Answer: TStringArray;
begin
if not LoggedIn then Exit;
Answer := ['body','No','irus','nker','ecove','onths','amous','buse r','nly on the',
'port A','owhere','nbox','my pass','emora'];
if(IsTextInAreaEx(mcx1,mcy1,mcx2,mcy2,x,y,'timate',3,NPCChars,False,False,0,2,-1))then
ClickToContinue;
ClickToContinue;
for i := 0 to 13 do
if(IsTextInAreaEx(mcx1,mcy1,mcx2,mcy2,x,y,Answer[i],3,NPCChars,False,False,0,2,-1))then
begin
Mouse(x,y,1,1,True);
ClickToContinue;
Result := True;
Break;
end;
end;

Had a few useless begins and ends. Took out all the random checks. See if its any faster. If thats not fast enough I'd suggest searching a smaller area for the text.

gerauchert

2008-01-07 07:25:18

aight thanks man, ill test it out later today ;)

Santa_Clause

2008-01-07 11:25:11

Function AnswerGateQuestion: Boolean;
var
i: Integer;
Answer: TStringArray;
begin
if(not(LoggedIn))then
Exit;
begin
Answer := ['body','No','irus','nker','ecove','onths','amous','buse r','nly on the',
'port A','owhere','nbox','my pass','emora'];
if FindNPCChatText('timate') then
while ClickToContinue do
Wait(1);
for i := 0 to 13 do
if ClickNPCChatText(Answer[I]) then
begin
ClickToContinue;
Result := True;
Exit;
end;
end;
end;

I don't have SCAR so I edited it in the reply box. Sorry if I've made any obvious mistakes.

Markus

2008-01-07 12:23:06

One GetTextAtEx and then pos, or even faster, =

gerauchert

2008-01-07 16:57:13

thanks guys, sped it up alot with the ClickNPCChat

ill try GetTextAtEx at a later time Markus ;)

R0b0t1

2008-01-07 17:22:03

:o

You making a SoS completer?

gerauchert

2008-01-07 23:03:08

From: R0b0t1
:o

You making a SoS completer?


haha fuck that :rolleyes:

got a l337 minotaur power ranger that will bank at var west when outa food…

working good so far, just wanna speed up the gate question process (takes 12-30 seconds to complete each gate ugh)

@Markus

Tried the GetTextAtEx and it wont detect any of the answers….can you see if im doing anything wrong? I tried with and without outline and shadow as well…

Function AnswerGateQuestion: Boolean;
var
z: String;
i,x,y: Integer;
Answer: TStringArray;
begin
if(not(LoggedIn))then Exit;
z := GetTextAtEx(x,y,5,NPCChars,True,True,0,2,-1,9,False,tr_AlphaNumericChars);
Answer := ['body','No','irus','nker','ecove','onths','amous','buse r','nly on the',
'port A','owhere','nbox','my pass','emora'];
if (z = ('timate')) then
while ClickToContinue do
Wait(1);
ClickToContinue;
Wait(1000);
for i := 0 to 13 do
if(z = Answer[i])then
begin
Mouse(x,y,2,2,True);
ClickToContinue;
Result := True;
Exit;
end else
Result := False;
end;

R0b0t1

2008-01-08 18:50:11

You might be getting more text/less text.

gerauchert

2008-01-09 10:45:07

From: R0b0t1
You might be getting more text/less text.


care to elaberate?

Markus

2008-01-10 01:27:21

X and Y are coords where to look for the text, not variables.

R0b0t1

2008-01-11 19:40:39

Nope. They are variables that store location of where to search, and where it is found.

You must be include the "var" statement to be able to change a variables' content outside of the function.