This is what I have so far, once isVisible and mouse.scroll gets pushed to the GitHub, i'll start adding the filters and what not to actually start quick hopping. Also thinking about adding global variables for each and every ogl.getTextures/ogl.get(whatever) so it can easily be updated in the future, but I have a feeling most of my code will end up getting revamped in some way. Just leme know what you want me to do from here.
Of course this isn't final, I know I need to add some failsafes to clickYes, I've kinda just smashed it together since I've been awake for 15-ish hours now and I need some sleep. Will do some cleanup tomorrow, maybe.
Simba Code:
(*
quickHopGetInter
~~~~~~~~~~~~~~~
.. code-block:: pascal
function quickHopGetInter(debug: boolean=false): tBox;
Grabs the quick hop interface and it's dimensions in a tBox.
Core of the quick hop functions
.. note::
- by Twinki
- Last updated: 5/9/2015 by Twinki
Example:
.. code-block:: pascal
smart.__Graphics.DrawBox(quickHopGetInter, false, clRed);
*)
function quickHopGetInter(debug: boolean=false): tBox;
Var
i: Integer;
funcPoint: tPoint;
funcTPA: TPointArray;
funcTXA: glTextureArray;
begin
funcTXA := ogl.getTextures([48960, 53040]);
for i:=0 to high(funcTXA) do
begin
funcPoint := Point(funcTXA[i].X, funcTXA[i].Y);
funcTPA.addIndex(funcPoint, 0);
end;
if(funcTPA.getBounds.X1>0) then
begin
if(debug) then
smart.__Graphics.DrawBox(funcTPA.getBounds);
result := funcTPA.getBounds;
end;
end;
(*
quickHopGetWorlds
~~~~~~~~~~~~~~~
.. code-block:: pascal
function quickHopGetWorlds(debug: boolean=false): TIntegerArray;
Finds and returns each world number in the quick Hop Interface.
.. note::
- by Twinki
- Last updated: 5/9/2015 by Twinki
Example:
.. code-block:: pascal
WriteLn(quickHopGetWorlds(true));
Will return found worlds
*)
function quickHopGetWorlds(debug: boolean=false): TIntegerArray;
Var
i, funcFoundWorld: Integer;
funcBox, funcWorldBox: tBox;
funcPoint: tPoint;
funcTPA: TPointArray;
funcTXA: glTextureArray;
funcFoundWorlds: TIntegerArray;
begin
funcTXA := ogl.getTextures(13504, quickHopGetInter(debug));
for i:=0 to high(funcTXA) do
begin
funcPoint := Point(funcTXA[i].X, funcTXA[i].Y);
funcTPA.addIndex(funcPoint, 0);
funcBox := funcTXA[i].bounds;
funcWorldBox := intToBox(funcBox.X1, funcBox.Y1, funcBox.X2+60, funcBox.Y2);
funcFoundWorld := ogl.getChars(funcWorldBox).toInteger;
if(debug) and (funcWorldBox.X1>0) then
begin
smart.__Graphics.DrawBox(funcWorldBox);
smart.__graphics.DrawText('World: '+toStr(funcFoundWorld), 'smallChars', point(funcWorldBox.X2 ,funcWorldBox.Y2), clWhite);
end;
funcFoundWorlds.addIndex(funcFoundWorld, 0);
end;
result := funcFoundWorlds;
funcFoundWorlds.isInArray(1);
end;
(*
quickHopCanHop
~~~~~~~~~~~~~~~
.. code-block:: pascal
function quickHopCanHop(world: Integer=0): boolean;
Returns true/false if the world specificed is on screen
.. note::
- by Twinki
- Last updated: 5/9/2015 by Twinki
Example:
.. code-block:: pascal
if(quickHopCanHop(100)) then
WriteLn('We can hop');
*)
function quickHopCanHop(world: Integer=0): boolean;
begin
result := quickHopGetWorlds().isInArray(world);
end;
(*
quickHopGetConfirmBox
~~~~~~~~~~~~~~~
.. code-block:: pascal
function quickHopGetConfirmBox(debug: boolean=false): tbox;
Grabs the quick hop confirmation box
.. note::
- by Twinki
- Last updated: 5/9/2015 by Twinki
Example:
.. code-block:: pascal
smart.__Graphics.DrawBox(quickHopGetConfirmBox, false, clRed);;
*)
function quickHopGetConfirmBox(debug: boolean=false): tbox;
Var
i: Integer;
funcBox: tBox;
funcPoint: tPoint;
funcTPA: TPointArray;
funcTXA: glTextureArray;
begin
funcBox := intToBox(quickHopGetInter(debug).X1, quickHopGetInter().Y1, quickHopGetInter().X2, quickHopGetInter().Y2-40);
funcTXA := ogl.getTextures(14280, funcBox);
for i:=0 to high(funcTXA) do
begin
funcPoint := Point(funcTXA[i].X, funcTXA[i].Y);
funcTPA.addIndex(funcPoint, 0);
if(debug) then
smart.__Graphics.DrawText('X '+toStr([i]), smallChars, funcPoint, clLime);
end;
if(funcTPA.getBounds.X1>0) then
begin
if(debug) then
smart.__Graphics.DrawBox(funcTPA.getBounds);
result := funcTPA.getBounds;
end;
end;
(*
quickHopClickYes
~~~~~~~~~~~~~~~
.. code-block:: pascal
function quickHopClickYes(): boolean;
Clicks the Yes button on the quick hop confirmation box
.. note::
- by Twinki
- Last updated: 5/9/2015 by Twinki
Example:
.. code-block:: pascal
quickHopClickYes();
*)
function quickHopClickYes(): boolean;
Var
yesButton: glTextureArray;
clickPoint: TPoint;
begin
if(ogl.getChars(quickHopGetConfirmBox).contains('Areyousureyouwant')) then
begin
yesButton := ogl.getTextures([89246, 89248, 91275], [10775317, 10775316], [quickHopGetConfirmBox]);
if not(yesButton.isEmpty) then
begin
clickPoint := clientCenter.closest(yesButton)[0].randomizePointEllipse(5);
mouse.click(clickPoint);
end;
end;
end;