Bobzilla69
2010-10-09 11:17:24
Hey,
I decided to make functions that can detect what quest have been completed started and handed in, it only works for F2P quests.
its just a quickly made script, i am sure it can be greatly improved, i tried to comment in some ideas for it.
i know it has no real use in SRL, but i made it as i am making a quest runner and this way you can automatically do quests that you have not done.
have not tested this with S.M.A.R.T, to test simply log player in and run script
Main think i need to do is make it so that it can list complete quest name, for now it only list the search text which is shortened version of quest name
Edit: Forgot to say that i think they have there own text, i am using StatsChars for now but certain character are not detected so it might be different?
I decided to make functions that can detect what quest have been completed started and handed in, it only works for F2P quests.
its just a quickly made script, i am sure it can be greatly improved, i tried to comment in some ideas for it.
i know it has no real use in SRL, but i made it as i am making a quest runner and this way you can automatically do quests that you have not done.
have not tested this with S.M.A.R.T, to test simply log player in and run script
Main think i need to do is make it so that it can list complete quest name, for now it only list the search text which is shortened version of quest name
Edit: Forgot to say that i think they have there own text, i am using StatsChars for now but certain character are not detected so it might be different?
program GetQuests;
{$I SRL\SRL.scar}
var
Total, J, x, y, ArrayLength:integer;
Quests, CompletedQuests, StartedQuests, IncompleteQuests:TStringArray;
Function GetQuests:Boolean; //dont need it to return anything (could change it to return TStringArray and only return selected item, i.e. completed quests)
var
I, Ci, Ii, Si:integer;
Text:String;
begin
Ci:= 0;
Ii:= 0;
Si:= 0;
for I:=0 to High(Quests) do
begin
Text:= Quests[I];
if (I = 6 )or(I = 12) or (I = 18)then //scroll every 7 7,14, 21, 28, 35, 42
begin
WriteLn('scrolling');
GetMousePos(x, y);
//Wait(70);
ScrollMouse(x, y, -1);
wait(70);
ScrollMouse(x, y, -1);
//wait(70);
end;
//Completed Quests, using stats chars as they match closely if not exactly
if FindTextTpaEx( 65280, 5, MIX1, MIY1, MIX2, MIY2, x, y, Text, 'StatChars', Nothing) then
begin
CompletedQuests[Ci] := Text;
inc(Ci);
end;
//started quests
if FindTextTpaEx(65535, 5, MIX1, MIY1, MIX2, MIY2 , x, y, Text, 'StatChars', Nothing) then
begin
StartedQuests[Si] := Text;
inc(Si);
end;
//incomplete quests
if FindTextTpaEx( 255, 5, MIX1, MIY1, MIX2, MIY2 , x, y, Text, 'StatChars', Nothing) then
begin
IncompleteQuests[Ii] := Text;
inc(Ii);
end;
end;
end;
Procedure QuestTest;
begin
GameTab(tab_Quest);
Writeln('Checking that filter is not active');
if FindColorTolerance(x, y, 1796131, MIX1, MIY1, MIX2, MIY2, 5) then //bottom of tick
begin
Writeln('Filter detected, unticking');
Mouse(x, y, 3, 3, True);
Wait(500);
end else
Writeln('Filter not detected');
//best way to do it for now, as hovering over quest will hide state of quest
MMouse(730, 333, 5, 5);
//array of all quests, but shortened some name due to text not matching. means searching has to follow array
Quests:= ['Black Knights', 'The Blood Pact', 'Assistant', 'Demon Slayer', 'Doric', 'Dragon Slayer', 'Ernest the Chicken', 'Goblin', 'Gunnar', 'Catcher', 'The Knight', 'Myths of the', 'Treasure', 'Prince Ali Rescue', 'The Restless Ghost', 'Rune Mysteries', 'Shield of Arra', 'Away', 'Unstable Foundations', 'ire Slayer']
ArrayLength:= High(Quests) + 1; //add one as it starts at 0
SetLength(CompletedQuests, ArrayLength); //makes all arrays the length of the quests
SetLength(StartedQuests, ArrayLength); //this need to be changed its ineffective
SetLength(IncompleteQuests, ArrayLength);
GetQuests;
Writeln('');
WriteLn('Total Number of Free quest to search : ' + inttostr(ArrayLength));
Writeln('Quest that have Been Completed ');
Writeln('');
for J:=0 to High(CompletedQuests) do
begin
if CompletedQuests[J] = '' then Break; //breaks when entry is empty
inc(Total);
Writeln(CompletedQuests[J])
end;
Writeln('');
Writeln('Quest that have Been Started ');
Writeln('');
for J:=0 to High(StartedQuests) do
begin
if StartedQuests[J] = '' then Break;
inc(Total);
Writeln(StartedQuests[J])
end;
Writeln('');
Writeln('Quest that have Not Been Started ');
Writeln('');
for J:=0 to High(IncompleteQuests) do
begin
if IncompleteQuests[J] = '' then Break;
inc(Total);
Writeln(IncompleteQuests[J])
end;
end;
begin
SetupSRL; //cant use full names all time, so have to shorten but still be specific
ActivateClient;
Wait(5000);
QuestTest;
Writeln('Total number of quests found : ' +IntToStr(Total)+'/'+IntToStr(ArrayLength));
end.