Page 1 of 9 123 ... LastLast
Results 1 to 25 of 220

Thread: OpenGL plugins

  1. #1
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default OpenGL plugins

    Hooks Plugin (bin folder contains the plugins):
    https://github.com/Brandon-T/GLX


    Windows Only (Colour - C++): https://github.com/Brandon-T/GLX-Colour/releases

    Windows & Linux (Colour - C): http://www.mediafire.com/download/ba...c6g1/libGL.zip

    GLX Include:
    https://github.com/Brandon-T/SRL-GLX


    Most of Simba's functions ported to C++ (pretty OLD code):
    https://github.com/Brandon-T/PurelyCPP/tree/master/src


    Extras:

    OpenGL Walking algorithm by Bart (Master-BB) in C++.. Ported to RS3 and written in Pascal/Lape by me:
    Simba Code:
    {$include_once GLX/GLXCore.Simba}
    {$include_once GLX/Misc/Map.Simba}
    {$include_once GLX/Misc/Smart.Simba}
    {$include_once GLX/Misc/Graphics.Simba}
    {$include_once GLX/Mouse.Simba}
    {$include_once GLX/Login.Simba}
    {$include_once GLX/Text.Simba}
    {$include_once GLX/Bank.Simba}
    {$include_once GLX/Inventory.Simba}


    {* Get's the bounds of the minimap *}
    Function GL_GetMMBounds: TBox;
    var
      I: Integer;
      Background, Corners: glTextureArray;
    Begin
      Background := glGetTextures(3786240);
      Corners := glGetTextures(386460);
      If (Length(Background) < 1) or (Length(Corners) < 1) Then Exit;

      For I := 0 To High(Background) Do
        If (PointInBox(Point(Corners[0].X, Corners[0].Y), Background[I].Bounds)) then
        Begin
          Result := Background[I].Bounds;
          Exit;
        End;
    End;

    type FPoint = record
      X, Y: Single;
    end;

    Function ToFPoint(X, Y: Single): FPoint;
    Begin
      Result.X := X;
      Result.Y := Y;
    End;


    {* Get's the coordinates on the screen where the map is rendered *}
    Procedure GL_GetMapCoords(var TL, BL, BR, TR: FPoint);
    var
      X, Y: Array[0..3] of single;
    begin
      GLXMapCoords(X, Y);
      TL := ToFPoint(X[0], Y[0]);
      BL := ToFPoint(X[1], Y[1]);
      BR := ToFPoint(X[2], Y[2]);
      TR := ToFPoint(X[3], Y[3]);
    end;

    {* Projects our player position onto the Map. Essentially getting our position within the current map with 100% accuracy *}
    Function GetLocalPos: TPoint;
    var
      Player: TPoint;
      TL, BL, BR, TR: FPoint;
      PPX, PPY, PPZ: Double;
      TVX, TVY, BVX, BVY: Double;
    Begin
      If (Not GL_LoggedIn) Then Exit;
      GL_GetMapCoords(TL, BL, BR, TR);
      Player := MiddleBox(GL_GetMMBounds); //Player is always in the middle of the MM. Map is drawn around the player.

      TVX := TR.X - TL.X;
      TVY := TR.Y - TL.Y;
      BVX := BL.X - TL.X;
      BVY := BL.Y - TL.Y;
      PPX := Player.X - TL.X;
      PPY := Player.Y - TL.Y;
      PPZ := (TVX * BVY) - (TVY * BVX);
      Result.X := Round(((PPX * BVY) - (PPY * BVX)) * 512.0 / PPZ);
      Result.Y := Round(((PPY * TVX) - (PPX * TVY)) * 512.0 / PPZ);
    End;


    {* Project our position onto the minimap. Does not work if the map is rotated. To do so, simply reverse the above/previous algorithm *}
    Function LocalPosToMM(Pos: TPoint): TPoint;
    var
      Me: TPoint;
      DX, DY: Integer;
    Begin
      Me := GetLocalPos;
      DX := Pos.X - Me.X;
      DY := Pos.Y - Me.Y;

      Me := MiddleBox(GL_GetMMBounds);
      Result.X := Me.X + DX;
      Result.Y := Me.Y + DY;
    End;

    var
      T: TSmart;
      P: TPoint;
      X, Y, Map: Integer;
    begin
      ClearDebug;
      T.Create(1350, 650, '', ['OpenGL32.dll']);
      GLXMapHooks(T.CurrentClient);
      glDebug(GL_MODE_HUD, 386460, 0, 0, T.Width, T.Height);
      T.GetGraphics().Clear;
      P := GetLocalPos;
      TerminateScript();
    end.


    Original Algorithm cleaned up:
    C++ Code:
    void MapLog::CalculatePosition(int &x, int &y)
    {
        struct Point{double X, Y;};
        Point Player = {MMCX, MMCY};
        Point TopLeft = {X[0], Y[0]}, TopRight = {X[3], Y[3]}, BottomLeft = {X[1], Y[1]};

        double TopVectorX = TopRight.X - TopLeft.X;
        double TopVectorY = TopRight.Y - TopLeft.Y;

        double BottomVectorX = BottomLeft.X - TopLeft.X;
        double BottomVectorY = BottomLeft.Y - TopLeft.Y;

        double PlayerPVectorX = Player.X - TopLeft.X;
        double PlayerPVectorY = Player.Y - TopLeft.Y;

        double perP1 = (PlayerPVectorX * BottomVectorY) - (PlayerPVectorY * BottomVectorX);
        double perP2 = (PlayerPVectorY * TopVectorX) - (PlayerPVectorX * TopVectorY);
        double perP3 = (TopVectorX * BottomVectorY) - (TopVectorY * BottomVectorX);
        x = std::round((perP1 * 512.0d) / perP3);
        y = std::round((perP2 * 512.0d) / perP3);
    }
    Last edited by Brandon; 08-10-2014 at 04:05 AM.
    I am Ggzz..
    Hackintosher

  2. #2
    Join Date
    Nov 2012
    Location
    USA
    Posts
    153
    Mentioned
    1 Post(s)
    Quoted
    33 Post(s)

    Default

    I'm curious as to what the ban rates on this are, how detectable is it/are they currently doing detection?

    Is this Windows specific, or will it run under Linux?

  3. #3
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    hot dang, Christmas already

    Creds to DannyRS for this wonderful sig!

  4. #4
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by DrChill View Post
    I'm curious as to what the ban rates on this are, how detectable is it/are they currently doing detection?

    Is this Windows specific, or will it run under Linux?

    Banrates on something that loads the same way the game loads OpenGL? It exports all the same functions as the OpenGL32.dll in your System32.dll. Even with Hooks, it doesn't overwrite anything, doesn't touch the VTables, nothing. Just loads as usual and "intercepts" data. That data is still passed as normal to your Original OpenGL32.dll location at C:/Windows/System32. It writes to a shared memory location and Simba reads from that.

    According to the library procs for all OS's I can think of, loading the same library twice returns the address of the original. This takes advantage of that by loading when Smart loads. Any dll called "OpenGL32.dll" that is loaded thereafter, the load proc will return the address of mine since it loaded first.

    You can read up on how the loading works here: http://villavu.com/forum/showthread....57#post1097257
    The basics still apply.

    The serialization changed drastically.. but this is the "Concept" of how events/signals works.. Smart does the same but using non-blocking sockets.


    Picture above is pretty Silly but I couldn't explain it to ppl at the time like the above picture did lol.
    It's pretty much fully cross platform since it's opengl and I used little Winapi (for events). Removing the WinAPI or #IFDEF-ing it will make it 100% cross platform. I just gotta boot up a linux machine, install a nice development environment (gcc, g++, etc) and work on that.. Just been lazy is all.

    P.S. You can check out here for more Reverse Engineering craps: http://villavu.com/forum/showthread.php?t=100266 <-- Can be used to Hide dll's and other files in any process but there is no need.
    Last edited by Brandon; 07-23-2013 at 06:47 AM.
    I am Ggzz..
    Hackintosher

  5. #5
    Join Date
    Jan 2012
    Posts
    369
    Mentioned
    6 Post(s)
    Quoted
    91 Post(s)

    Default

    Thank you Brandon! Will look at it soonish.

  6. #6
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

  7. #7
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Sweet I may just come back to RS

  8. #8
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    @Brandon

    Could u provide a testscript?

    Can't get it to work
    Last edited by Sjoe; 07-23-2013 at 04:50 PM.

    Creds to DannyRS for this wonderful sig!

  9. #9
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    @Brandon

    Could u provide a testscript?

    Can't get it to work


    There is no test script. You don't have to do anything. All you do is tell Smart to load it and that's it. There is no setup or anything.
    I am Ggzz..
    Hackintosher

  10. #10
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    There is no test script. You don't have to do anything. All you do is tell Smart to load it and that's it. There is no setup or anything.
    Yeah I dunno where to start

    Creds to DannyRS for this wonderful sig!

  11. #11
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    Yeah I dunno where to start
    It's a smart param change. instead of passing '' at the end, pass 'OpenGl32' instead.

  12. #12
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Tried using this testscript
    I got GLHook.simba from your smart-overhaul

    But GLCommunication opens up with this error:
    Code:
    [Error] C:\Simba\Includes\GLHook/GLCommunication.Simba(142:10): Unknown identifier 'GLHGeTTextures' at line 141
    Compiling failed.
    Simba Code:
    {$DEFINE SMART8}
    {$DEFINE GLHOOK}
    {$I GLHook/GLHook.Simba}

    var
      IDs: Array Of Cardinal;
    begin
      ClearDebug;
      Smart_Plugins := 'OpenGL32.dll';
      SetupSRL;
      SmartSetOperatingMode(0);

      if (NOT GLHSetup(ToStr(SMART_CURRENTCLIENT))) THEN
      Begin
        Writeln('Failed to Setup GLHook. Please Check your Installation.');
        TerminateScript;
      End;

      SmartSetOperatingMode(1);
      GLHSetDebug(True, False, 0);
      SmartSetMouseInput(True);
      SmartSetKeyInput(True);

      GLHEnabledFilter(0, True);                  //Models
      GLHEnabledFilter(1, True);                  //Fonts
      GLHEnabledFilter(2, False);                 //Textures

      //Displays debugging for all models, textures, fonts.. Changing the dimensions filters models/textures/fonts by that are.
      GLHFilterModelsArea(0, 0, 765, 553);
      GLHFilterFontsArea(0, 0, 765, 553);
      GLHFilterTexturesArea(0, 0, 765, 553);

      GLHDrawTextureHud(507195);  //Draw this ID on the hud. Should display the RS compass.
    end.

    Creds to DannyRS for this wonderful sig!

  13. #13
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Lol.. COLOUR ONLY atm.
    I stated the plugin on OP does NOT have a setup. Not sure what you are setting up. Also only works with Smart v8.2. Not sure how come you're using the old smarts :l
    Pascal script is dead. SRL is going to be running in Lape so you shouldn't try to run old scripts with the new plugin..


    Atm, the only thing I have written for my own include is:

    Simba Code:
    {$loadlib libsmartremote}

    type TSmart = record
      __CurrentClient: Integer;
      __Width, __Height: Integer;
      __ForceNew: Boolean;
    end;

    Procedure TSmart.Create;
    Begin
      Self.Create(1024, 768, ['']);
    End;

    Procedure TSmart.Create(Width, Height: Integer; Plugins: TStringArray); overload;
    Begin
      Self.Create(Width, Height, 's', Plugins);
    End;

    Procedure TSmart.Create(Width, Height: Integer; InitSequence: String; Plugins: TStringArray); overload;
    var
      Params: TStringArray;
    Begin
      Self.__Width := Width;
      Self.__Height := Height;

      If (Not Self.__ForceNew And Self.Pair()) then
        Exit;

      Params := self.GetSmartParams();
      If (Length(Params) <> 2) then
      begin
        Writeln('** Failed To Grab Smart Parameters **');
        Writeln('** Please check your internet connection/firewall **');
        TerminateScript;
        Exit;
      end;

      Self.__CurrentClient := SmartSpawnClient(Replace(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], Width, Height, InitSequence, '', '', Implode(',', Plugins));

      If (Self.__CurrentClient > 0) Then
      begin
        try
          SetEIOSTarget('libsmartremote', ToStr(__CurrentClient));
          Writeln('Loading SMART: ' + Params[0] + Params[1]);
        except
          WriteLn('** Fatal Error: Pairing Clients; Terminating Script **');
          TerminateScript;
        end;
      end else
        begin
          Writeln('** Smart Cannot Spawn Clients **');
          TerminateScript;
        end;
    End;

    Function TSmart.CurrentClient: Integer;
    Begin
      Result := Self.__CurrentClient;
    End;

    Function TSmart.GetSmartParams: TStringArray;
    var
      Params: TStringArray;
      Page: String;
    Begin
      Page := Between('<iframe id="game" src="', '"', GetPage('http://www.runescape.com/c=lWWmqzNvQ8k/game.ws?beta=1&j=1'));
      Params := Explode(',', Page);
      Result := Params;
    End;

    Function TSmart.SmartGetClientIDs: TIntegerArray;
    var
      I, Count: Integer;
    Begin
      Count := SmartGetClients(True);
      SetLength(Result, Count);
      If (Count > 0) Then
        For I:= 0 to Count - 1 do
          Result[I] := SmartClientID(I);
    End;

    Function TSmart.Pair: Boolean;
    var
      I, Count: Integer;
      IDs: TIntegerArray;
    Begin
      IDs := SmartGetClientIDs;
      Count := Length(IDs);
      If (Count > 0) Then
        For I:= 0 To Count - 1 Do
          If SmartPairClient(IDs[I]) then
          begin
            SetEIOSTarget('libsmartremote', ToStr(IDs[I]));
            Writeln('Paired with SMART[' + ToStr(IDs[I]) + ']');
            Result := True;
            Exit;
          end;
    End;


    And I use it like:

    Simba Code:
    {$I Smart.Simba}

    var
        Smart: TSmart;
    begin
        Smart.Create();

       //Or: Smart.Create(Width, Height, ['']);
       //OR: Smart.Create(Width, Height, ['OpenGL32.dll']);

    //etc..
    end.

    It is object oriented and the TSmart acts as a class. You guys can look at SRL-6 on github. The above is totally unrelated but it is what I personally use. SRL-6 loads smart differently.

    For the hook plugin which no one else has except myself and Kasi (has part), I use:
    Simba Code:
    {$loadlib GLX}


    type glTexture = record
      ID: Integer;
      ColourID: Integer;
      X, Y: Integer;
      Bounds: TBox;
    end;

    type glModel = record
      ID: Cardinal;
      TID: Integer;
      X, Y: Integer;
    end;

    type glChar = record
      I: Integer;
    end;

    type glText = record
      I: Integer;
    end;


    type
      glCharArray = array of glChar;
      glModelArray = array of glModel;
      glTextureArray = array of glTexture;

    type pModel = ^glModel;
    type pglTexture = ^glTexture;

    type TGL = record
      I: Integer;
    end;

    Procedure Pointer.Inc(Size: Int64);
    Begin
      Self := Self + Size;
    End;


    Function TGL.GetTextures: glTextureArray;
    var
      Size: Integer;
      Ptr: Pointer;
    Begin
      Result := [];
      Ptr := GLXTextures(Size);
      SetLength(Result, Size);

      For I := 0 To Size - 1 Do
      Begin
        Result[I] := glTexture(Ptr^);
        Ptr.Inc(sizeof(glTexture));
      End;
    End;

    Function TGL.GetTextures(ID: Integer): glTextureArray; overload;
    var
      Size: Integer;
      Ptr: Pointer;
    Begin
      Result := [];
      //Ptr := GLHGetTexturesByID(ID, Size);
      SetLength(Result, Size);

      For I := 0 To Size - 1 Do
      Begin
        Result[I] := glTexture(Ptr^);
        Ptr.Inc(sizeof(glTexture));
      End;
    End;

    Function TGL.GetTextures(Box: TBox): glTextureArray; overload;
    var
      Size: Integer;
      Ptr: Pointer;
    Begin
      Result := [];
      //Ptr := GLHGetTexturesByArea(Box, Size);
      SetLength(Result, Size);

      For I := 0 To Size - 1 Do
      Begin
        Result[I] := glTexture(Ptr^);
        Ptr.Inc(sizeof(glTexture));
      End;
    End;


    Function TGL.GetModels: glModelArray;
    var
      Size: Integer;
      Ptr: Pointer;
    Begin
      Result := [];
      //Ptr := GLHGetModels(Size);
      SetLength(Result, Size);

      For I := 0 To Size - 1 Do
      Begin
        Result[I] := glModel(Ptr^);
        Ptr.Inc(sizeof(glModel));
      End;
    End;


    All of which is subject to change because the only plugin that is finished is the colour one..
    Last edited by Brandon; 07-23-2013 at 06:46 PM.
    I am Ggzz..
    Hackintosher

  14. #14
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    kk then I'll settle with colours.

    Creds to DannyRS for this wonderful sig!

  15. #15
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Updated OP to include the plugin with Hooks and example usage for Lape.

    It's a bare-minimum include but everything should be there that is needed.

    Functions:

    Simba Code:
    GLXGetTextures      //Gets a list of textures displayed on screen. Aka Items, Buttons, Interfaces, etc..
    GLXGetModels        //Gets a list of models displayed on screen. Aka NPCs, Players, Characters, Rocks, Doors, Buildings, Pets, Familiars, etc..
    GLXGetChars         //Gets font characters displayed on screen. Text, menu text, player chat, mouse-over text, skill-levels, etc..
    GLXCompass          //Gets the compass angle. Angle at which the compass is rotated.
    GLXEulerAngles      //Gets the pitch, yaw, and roll. All X, Y, Z angles of each plane with the player at the center of the map.
    GLXCameraPos        //Gets the current position of the camera. Camera's translation. Aka player position within the current map.
    GLXCameraHeight     //Gets the current height of the camera. 0 = lowest angle. Aka the angle looking directly ahead of you. >= 65 = Highest angle. Aka the angle looking down on your character. Anything else is inbetween angle.
    GLXMapToImage       //Returns the current map that you are standing in. Used for glSPS walking or whatever else.. This image must be freed after being used!

    //TODO:
    Remove Shadows from fonts and split them up into proper text..
    Split fonts by colours for identifying which text is which color..
    Write useable include for scripters.. Aka glOpenBank, glInvFull, glLoginPlayer, etc..
    I am Ggzz..
    Hackintosher

  16. #16
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Seem to load everything fine, just that once I hit the login screen, I get hit with a flashing screen (possible warning for epileptic's)

    Super nice though, if I may say so Brandon, NiceWork

    Edit: Had loaded in DirectX first time around. Switch settings to OGL, closed, re-ran it (loaded in OGL second time around)
    Edit: Disabling SMART manually makes it stop flashing
    Last edited by Le Jingle; 07-26-2013 at 01:26 AM.

  17. #17
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Seem to load everything fine, just that once I hit the login screen, I get hit with a flashing screen (possible warning for epileptic's)

    Super nice though, if I may say so Brandon, NiceWork

    Edit: Had loaded in DirectX first time around. Switch settings to OGL, closed, re-ran it (loaded in OGL second time around)
    Edit: Disabling SMART manually makes it stop flashing
    Disable the capture.

  18. #18
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Updated OP.. Pretty good so far. At least it's a start for a functioning include.. Just needs a bit more work and it'll be able to write full on scripts for RS3.
    I am Ggzz..
    Hackintosher

  19. #19
    Join Date
    Feb 2006
    Location
    Berkeley, CA
    Posts
    1,837
    Mentioned
    52 Post(s)
    Quoted
    60 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Seem to load everything fine, just that once I hit the login screen, I get hit with a flashing screen (possible warning for epileptic's)

    Super nice though, if I may say so Brandon, NiceWork

    Edit: Had loaded in DirectX first time around. Switch settings to OGL, closed, re-ran it (loaded in OGL second time around)
    Edit: Disabling SMART manually makes it stop flashing
    It sounds like you're not loading the plugin properly. Remember to pass the name of the plugin as the last argument to SmartSpawnClients and then the plugin will configure SMART automatically.

  20. #20
    Join Date
    May 2012
    Location
    Wisconsin, USA
    Posts
    105
    Mentioned
    1 Post(s)
    Quoted
    47 Post(s)

    Default

    Thanks for the work you're putting in on this @Brandon. I've attempted to set this up and run it, but am running into a couple issues. First, what I've done:

    1. Installed and updated SIMBA v992
    2. Installed SRL 5
    3. Updated to SMART 8.2
    4. Downloaded the GLX.zip and extracted the dll and .so file to the plugin folder and the other files straight into the includes folder.
    5. Modified SmartSpawnClients putting 'OpenGL32' as the last param


    Next, I opened Simba and copy / pasted your test_script from your first post and hit ctrl-F9 using the PS interpreter and got this error:
    Code:
    C:\Simba\Scripts\glxtest.simba(2:1): Unable to register function Function GLXMap(var Width, Height: Integer; var X, Y: array[0..3] of Single): Pointer; at line 1
    I thought perhaps I needed to use the Lape interpreter, so I switched, hit ctrl-F9 and got this error:
    Code:
    Unknown declaration "FixRad" at line 7, column 10 in file "C:\Simba\Includes\GLX\Misc\Map.Simba"
    Do I need to use SRL6 for this? Do I need to use Simba v1.0?

  21. #21
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by loragnor View Post
    Thanks for the work you're putting in on this @Brandon. I've attempted to set this up and run it, but am running into a couple issues. First, what I've done:

    1. Installed and updated SIMBA v992
    2. Installed SRL 5
    3. Updated to SMART 8.2
    4. Downloaded the GLX.zip and extracted the dll and .so file to the plugin folder and the other files straight into the includes folder.
    5. Modified SmartSpawnClients putting 'OpenGL32' as the last param


    Next, I opened Simba and copy / pasted your test_script from your first post and hit ctrl-F9 using the PS interpreter and got this error:
    Code:
    C:\Simba\Scripts\glxtest.simba(2:1): Unable to register function Function GLXMap(var Width, Height: Integer; var X, Y: array[0..3] of Single): Pointer; at line 1
    I thought perhaps I needed to use the Lape interpreter, so I switched, hit ctrl-F9 and got this error:
    Code:
    Unknown declaration "FixRad" at line 7, column 10 in file "C:\Simba\Includes\GLX\Misc\Map.Simba"
    Do I need to use SRL6 for this? Do I need to use Simba v1.0?
    use simba 1.0, http://l0.lt is wiz's buildbot
    also use srl6 if you have to.. keep in mind there's a separate OGL include...

  22. #22
    Join Date
    May 2012
    Location
    Wisconsin, USA
    Posts
    105
    Mentioned
    1 Post(s)
    Quoted
    47 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    use simba 1.0, http://l0.lt is wiz's buildbot
    Thank you for the reply and link. I've downloaded Simba 1.0 and installed it. There is no facility for extension management?

    Next I downloaded SRL6 and put it in the Includes->SRL folder.

    Then I ran the test script but got the error:
    Code:
    Exception in Script: Error loading plugin C:\Simba\Plugins\GLX64.dll
    However, I cannot find a GLX64.dll in Brandon's github.


    Quote Originally Posted by Le Jingle View Post
    also use srl6 if you have to.. keep in mind there's a separate OGL include...
    This has me a bit puzzled. Is this located somewhere else? It is not included in Brandon's GLX include folder.

  23. #23
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by loragnor View Post
    Thank you for the reply and link. I've downloaded Simba 1.0 and installed it. There is no facility for extension management?

    Next I downloaded SRL6 and put it in the Includes->SRL folder.

    Then I ran the test script but got the error:
    Code:
    Exception in Script: Error loading plugin C:\Simba\Plugins\GLX64.dll
    However, I cannot find a GLX64.dll in Brandon's github.



    This has me a bit puzzled. Is this located somewhere else? It is not included in Brandon's GLX include folder.

    You need Simba x32. Runescape cannot run in x64 JVM anyway so it's a waste of time for me to provide an x64 plugin. You can however, compile the plugin to x64 if you wish. It'll work just fine.


    Also, the following is a copy of my working Barbarian fisher

    Simba Code:
    {$include_once GLX/GLXCore.Simba}
    {$include_once GLX/Misc/Map.Simba}
    {$include_once GLX/Misc/Smart.Simba}
    {$include_once GLX/Misc/Graphics.Simba}
    {$include_once GLX/Mouse.Simba}
    {$include_once GLX/Login.Simba}
    {$include_once GLX/Text.Simba}
    {$include_once GLX/Bank.Simba}
    {$include_once GLX/Inventory.Simba}

    const
      MyID = 648933015; //ID of your player.

    var
      T: TSmart;

    Function FindFishingSpot: TPoint;
    var
      TPA: TPointArray;
      I, X1, Y1, X2, Y2: Integer;
      FishingSpots: glModelArray;
    Begin
      FishingSpots := glGetModels(2648051121);
      Insert(glGetModels(203893359), FishingSpots);
      Insert(glGetModels(2948843458), FishingSpots);
      SetLength(TPA, Length(FishingSpots));
      For I := 0 To High(FishingSpots) Do
      Begin
        TPA[I] := Point(FishingSpots[I].X, FishingSpots[I].Y);
      End;

      GLXViewPort(X1, Y1, X2, Y2);
      SortTPAFrom(TPA, Point((X2 - X1) div 2, (Y2 - Y1) div 2));
      If (Length(TPA) > 0) then
        Result := TPA[0]
      else
        Result := Point(-1, -1);
    End;

    Function HasFeathersBait: Boolean;
    Begin
      Result := (Length(glGetTextures(80835, 2302754, 5)) > 0) or (Length(glGetTextures(36720, 460033, 5)) > 0);
    End;

    Function GetFishBoxes(Area: TBox): TBoxArray;
    var
      I, J: Integer;
      Textures: glTextureArray;
    Begin
      Textures := glGetTextures(Area);
      SetLength(Result, Length(Textures));

      For I := 0 To High(Textures) do
      Begin
        If ((Textures[I].ID = 49470) and SimilarColors(Textures[I].ColourID, 1118479, 5))
        or ((Textures[I].ID = 45900) and SimilarColors(Textures[I].ColourID, 724234, 5))
        or ((Textures[I].ID = 62220) and SimilarColors(Textures[I].ColourID, 1249296, 5)) then
        begin
          Result[J] := Textures[I].Bounds;
          Inc(J);
        end;
      End;
      SetLength(Result, J);
    End;

    Procedure DropAll;
    var
      I: Integer;
      Fish: TBoxArray;
    Begin
      While(True) Do
      Begin
        Fish := GetFishBoxes(GL_InvBounds);
        If (Length(Fish) < 1) Then Exit;

        For I := 0 To High(Fish) Do
        Begin
          MouseBox(Fish[I], MOUSE_RIGHT);
          GL_ChooseOptionMulti(['Drop', 'rop', 'Dro']);
        End;
      End;
    End;

    Procedure MarkTime(var T: Integer);
    Begin
      T := GetSystemTime;
    End;

    Function TimeFromMark(T: Integer): Integer;
    Begin
      Result := GetSystemTime - T;
    End;

    function WaitFindMe(ID: Cardinal; WaitPerLoop, MaxTime: Integer): Boolean;
    var
      T: Integer;
    begin
      T := GetSystemTime + MaxTime;
      while (GetSystemTime < T) do
      begin
        if (Length(glGetModels(ID)) > 0) then
        begin
          Result := True;
          Exit;
        end;
        Wait(WaitPerLoop);
      end;
    end;

    function WaitNotFindMe(ID: Cardinal; WaitPerLoop, MaxTime: Integer): Boolean;
    var
      T: Integer;
    begin
      T := GetSystemTime + MaxTime;
      while (GetSystemTime < T) do
      begin
        if (Length(glGetModels(ID)) < 1) then
        begin
          Result := True;
          Exit;
        end;
        Wait(WaitPerLoop);
      end;
    end;

    Procedure MainLoop;
    var
      P: TPoint;
      MeBox, AnimBox: TBox;
      X1, Y1, X2, Y2: Integer;
    Begin
      GLXViewPort(X1, Y1, X2, Y2);
      MeBox := IntToBox(((X2 - X1) div 2) - 30, ((Y2 - Y1) div 2) - 30, ((X2 - X1) div 2) + 30, ((Y2 - Y1) div 2) + 30);
      AnimBox := IntToBox(MeBox.X1 + 10, MeBox.Y1 + 10, MeBox.X2 - 10, MeBox.Y2 - 10);

      While(True) Do
      Begin
        If (Not GL_LoggedIn) Then Exit;
        If (GL_InvFull) Then DropAll;
        If (Not HasFeathersBait) Then Exit;

        If WaitFindMe(MyID, 50, 1500) Then
        Begin
          P := FindFishingSpot;
          writeln('Finding Fishing Spot: ' + ToStr(P));
          If ((P.X > 0 and P.Y > 0)) Then
          Begin
            Mouse(P, 5, 5, MOUSE_RIGHT);
            If (GL_ChooseOptionMulti(['Use-rod Fishing spot', 'Use-rod', 'rod Fishing spot'])) Then
              WaitNotFindMe(MyID, 50, 2500);
          End;
        End;
      End;
    End;

    begin
      ClearDebug;
      T.Create(1350, 650, '', ['OpenGL32.dll']);
      GLXMapHooks(T.CurrentClient);
      glDebug(GL_MODE_Models, 0, 0, 0, T.Width, T.Height);
      T.GetGraphics().Clear;
      //writeln(glGetModels(IntToBox(702, 306, 755, 356)));
      DropAll;
      MainLoop;
      TerminateScript();
    end.
    Last edited by Brandon; 07-31-2013 at 11:36 AM.
    I am Ggzz..
    Hackintosher

  24. #24
    Join Date
    May 2012
    Location
    Wisconsin, USA
    Posts
    105
    Mentioned
    1 Post(s)
    Quoted
    47 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    You need Simba x32. Runescape cannot run in x64 JVM anyway so it's a waste of time for me to provide an x64 plugin. You can however, compile the plugin to x64 if you wish. It'll work just fine.
    This was the secret to my success. Thank you. Installed the 32-bit version and it was a snap. I'm looking forward to playing with this.

  25. #25
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

Page 1 of 9 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •