Home
2012-05-23 13:14:06
Hello, this function will find the world from WolrdScreen by using your Mouse Scroll Wheel.
You don't have to order worlds, nor it doesn't matter at what position the Runescape Scroll Wheel is, it will Scan the world from up to down and vice versa.
I tried to make the scrolling as human as possible.
I need suggestions etc what else to add. From what I see, it's finished.
I wanted to post here before I do pull request.
Un-comment code from below script to try it without SRL.
I haven't tested this with SMART yet.
~Home
You don't have to order worlds, nor it doesn't matter at what position the Runescape Scroll Wheel is, it will Scan the world from up to down and vice versa.
I tried to make the scrolling as human as possible.
I need suggestions etc what else to add. From what I see, it's finished.
I wanted to post here before I do pull request.
Un-comment code from below script to try it without SRL.
I haven't tested this with SMART yet.
(*
FindWorldScroll
~~~~~~~~~~~~~~~
.. code-block:: pascal
function FindWorldScroll(W :Integer) :Boolean;
Scrolls to area using scroll wheel and returns true if world was found.
..note::
by Home
Example:
.. code-block:: pascal
*)
function FindWorldScroll(W :Integer) :Boolean;
var
CurW, Dir, WX, WY, X, Y, I :Integer;
MousePoint :TPoint;
begin
if not WorldScreen then
Exit;
WS_CurrentWorld(CurW);
if (W = CurW) then
begin
Result := True;
WriteLn('Already on world ' + IntToStr(W));
Exit;
end;
if (W = 0) then
begin
srl_Warn('FindWorldScroll', 'World Number cannot be 0', warn_AllVersions);
Exit;
end;
Dir := - 1;
for I := 1 to RandomRange(100, 105) do
begin
If FindText(WX, WY, ' ' + IntToStr(W) + ' ', StatChars, 91, 138, 145, 436) then
begin
{Wait(RandomRange(100, 150));
If FindText(WX, WY, ' ' + IntToStr(W) + ' ', StatChars, 91, 138, 145, 436) then
begin
MMouse(WX + 80, WY, 20, 5);
Result := True;
Exit;
end;}
Result := True;
Exit;
end;
If CountColorTolerance(4807267, 684, 386, 697, 420, 66) > 420 then Dir := 1;
If Random(10) = 0 then
SleepAndMoveMouse(RandomRange(100, 350))
else
Wait(RandomRange(17, 23));
GetMousePos(X, Y);
MousePoint := Point(X, Y);
If Not PointInBox(MousePoint, IntToBox(75, 143, 691, 414)) then
MouseBoxEx(75, 143, 691, 414, 0, mouse_move);
Scrollmouse(0, 0, Dir);
if I > 30 then
If CountColorTolerance(4807267, 685, 155, 696, 186, 66) > 380 then
begin
srl_Warn('FindWorldScroll', 'World '+IntToStr(W)+' Can''t be found ', warn_AllVersions);
Exit;
end;
end;
end; ~Home