Page 8 of 8 FirstFirst ... 678
Results 176 to 197 of 197

Thread: OpenGL - A Beginner's Scripting Tutorial

  1. #176
    Join Date
    Feb 2014
    Posts
    84
    Mentioned
    0 Post(s)
    Quoted
    28 Post(s)

    Default

    Quote Originally Posted by Obscurity View Post
    Update ProSocks
    Thank you kind sir, now I feel dumb I was struggling to figure out what I did wrong and it was so simple.

  2. #177
    Join Date
    Feb 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hitac View Post
    The "Attachment 26861" for automatic installation is invalid.

    Quote Originally Posted by Obscurity View Post
    Thanks, @Hitac; I'll have a look when I get home from work.
    Just in case you forgot it's still broken

  3. #178
    Join Date
    Jun 2016
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Doesn't the exported function "SMARTPluginInit" in OpenGL32.dll raise detection issues?

  4. #179
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by Sup m8 View Post
    Doesn't the exported function "SMARTPluginInit" in OpenGL32.dll raise detection issues?
    @Brandon; would know more about this than I would. I was under the impression the plugin only exported functions from the original.
    Last edited by Clarity; 06-06-2016 at 04:57 AM.

  5. #180
    Join Date
    Nov 2011
    Location
    Norway
    Posts
    203
    Mentioned
    4 Post(s)
    Quoted
    100 Post(s)

    Default

    Can't for the life of me grab the reticule ID for monsters. Tried the ID tool and ogl.getModels();

    Doublechecked to see if I have the reticule setting turned on and it is. I can grab any ID fine, but the reticule one does not get printed in the debug. Tested to see if I can grab the reticule ID for troll brutes used in the OP, can't find it eventhough I kill a couple of trolls forcing the reticule to pop. The script works fine at troll brutes so I don't think anything is outdated.

    Any ideas?

  6. #181
    Join Date
    Apr 2015
    Location
    FireFox
    Posts
    528
    Mentioned
    10 Post(s)
    Quoted
    227 Post(s)

    Default

    Quote Originally Posted by Aufi View Post
    Can't for the life of me grab the reticule ID for monsters. Tried the ID tool and ogl.getModels();

    Doublechecked to see if I have the reticule setting turned on and it is. I can grab any ID fine, but the reticule one does not get printed in the debug. Tested to see if I can grab the reticule ID for troll brutes used in the OP, can't find it eventhough I kill a couple of trolls forcing the reticule to pop. The script works fine at troll brutes so I don't think anything is outdated.

    Any ideas?
    Just use his as IDs are mostly universal.
    Scripting with ogLib

  7. #182
    Join Date
    Nov 2011
    Location
    Norway
    Posts
    203
    Mentioned
    4 Post(s)
    Quoted
    100 Post(s)

    Default

    Quote Originally Posted by srlMW View Post
    Just use his as IDs are mostly universal.
    I later realized that target reticules is the red circle, not the box above the NPCs... I think I was a little bit too excited when attempting to get my first script going + I was sleep deprived.

    I appreciate the response though

  8. #183
    Join Date
    Jul 2016
    Posts
    156
    Mentioned
    2 Post(s)
    Quoted
    81 Post(s)

    Default

    Great guide. Very nice of you to take the time to create this!

  9. #184
    Join Date
    Mar 2015
    Posts
    438
    Mentioned
    21 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by Aufi View Post
    I later realized that target reticules is the red circle, not the box above the NPCs... I think I was a little bit too excited when attempting to get my first script going + I was sleep deprived.

    I appreciate the response though
    Simba Code:
    function tCombat.hasTarget():boolean;
      var
        funcPointer:pointer;
        funcPointerSize:uInt32=0;
      begin
        funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1));
        if funcPointer<>nil then
          for 0 to funcPointerSize div 3 do
            begin
              if (funcPointer^=14280) and ((funcPointer-216)^=7750) then
                begin
                  result:=true;
                  break;
                end;
              funcPointer:=funcPointer-36;
            end;
        exit(result);
      end;

    This is already built in. I believe it looks for the lock icon on the box that appears above the NPCS. If memory serves correct, it has to be unlocked. (Don't take this for fact I'm going off memory from long ago)

    Edit: Also for your reference, that NPC Box would be picked up as a texture which is why it is not appearing under models.
    Last edited by Clutch; 07-04-2016 at 01:48 AM.

  10. #185
    Join Date
    Nov 2011
    Location
    Norway
    Posts
    203
    Mentioned
    4 Post(s)
    Quoted
    100 Post(s)

    Default

    Quote Originally Posted by Clutch View Post
    Simba Code:
    function tCombat.hasTarget():boolean;
      var
        funcPointer:pointer;
        funcPointerSize:uInt32=0;
      begin
        funcPointer:=glTextures(funcPointerSize)+(36*(funcPointerSize-1));
        if funcPointer<>nil then
          for 0 to funcPointerSize div 3 do
            begin
              if (funcPointer^=14280) and ((funcPointer-216)^=7750) then
                begin
                  result:=true;
                  break;
                end;
              funcPointer:=funcPointer-36;
            end;
        exit(result);
      end;

    This is already built in. I believe it looks for the lock icon on the box that appears above the NPCS. If memory serves correct, it has to be unlocked. (Don't take this for fact I'm going off memory from long ago)

    Edit: Also for your reference, that NPC Box would be picked up as a texture which is why it is not appearing under models.
    The issue I'm running into with combat.hasTarget is that it will try to click on dying monsters. I haven't been able to write/figure out a smart solution for that yet. Could use a timer of course but would rather have a snappy script that switches to a new monster as soon as the one you have killed as some death animations can be really slow.

    But you are right about the box being a texture rather than a model, rookie mistakes

  11. #186
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    The ProSocks link in the OP needs updating. Still links to v0.3.
    Solar from RiD.

  12. #187
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    Quote Originally Posted by Solar View Post
    The ProSocks link in the OP needs updating. Still links to v0.3.
    Fixed! Thanks. .

    Quote Originally Posted by Aufi View Post
    The issue I'm running into with combat.hasTarget is that it will try to click on dying monsters.
    You could store your current target's coordinates. If combat.hasTarget() changes, find make sure the new monster has a new X,Y.
    Last edited by Obscurity; 07-05-2016 at 04:26 PM.




    Skype: obscuritySRL@outlook.com

  13. #188
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    Just a small error in the OP that I noticed while reading through. In step 9 of part 5 there is this line in the script sample;

    if trollBrutes.isEmpty() or clientCenter.closest(trollBrutes)[0].isVisible() then

    Shouldn't it be "or not"?


    Also, is there a reason why in SMART I am unable to switch from DX to OGL? (I used the example script in step 11 to spawn SMART.)
    Solar from RiD.

  14. #189
    Join Date
    Jun 2012
    Posts
    586
    Mentioned
    112 Post(s)
    Quoted
    296 Post(s)

    Default

    Hi @Solar;

    Make sure your OpenGL plugins are up to date. Also, if it's an issue with the client crashing and sometimes just refusing to enter OpenGL mode, check this out and tell me if it's relevant.
    @Clarity;, check out the Step 9, Part 5 thing. :P.




    Skype: obscuritySRL@outlook.com

  15. #190
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    Quote Originally Posted by Obscurity View Post
    Hi @Solar;

    Make sure your OpenGL plugins are up to date. Also, if it's an issue with the client crashing and sometimes just refusing to enter OpenGL mode, check this out and tell me if it's relevant.
    @Clarity;, check out the Step 9, Part 5 thing. :P.
    Unfortunately that doesn't seem relevant for me. (I'm on quite an old desktop.)
    I tried using the browser and can at least get OGL in FireFox, although even this needed me to change drivers.
    I have re-downloaded the plugins using the links in the OP of this thread, so they should be up-to-date.

    And I have tried deleting the jagex cache folder.
    Solar from RiD.

  16. #191
    Join Date
    Nov 2011
    Location
    Norway
    Posts
    203
    Mentioned
    4 Post(s)
    Quoted
    100 Post(s)

    Default

    Tried reinstalling Simba/running as administrator, Solar? Pretty weird issue.

  17. #192
    Join Date
    Feb 2012
    Location
    UK
    Posts
    909
    Mentioned
    10 Post(s)
    Quoted
    191 Post(s)

    Default

    Always run Simba as admin and I haven't reinstalled SMART or Simba.
    I'm just going to give up here. Spent too much time on it now.
    Solar from RiD.

  18. #193
    Join Date
    Dec 2016
    Posts
    49
    Mentioned
    0 Post(s)
    Quoted
    22 Post(s)

    Default

    Is it possible to use SRL-6 and OGL in the same script? I was thinking of something more combat related - it'd be easier to get NPC models versus unique colors.

    Edit: @Clarity; - Spammer came in so I figured nobody would see this. Thoughts on the above?

    I was thinking of working on a slayer script for example. From what I'm reading on the forums walking with OGL is based off static x, y positions (I haven't tried OGL yet so I may be wrong) and doesn't compare color which I presume would make it inferior to SPS - specifically during a long walk to a task.
    Last edited by BlitzKrieger; 12-20-2016 at 02:35 AM.

  19. #194
    Join Date
    Apr 2016
    Posts
    126
    Mentioned
    1 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by BlitzKrieger View Post
    Is it possible to use SRL-6 and OGL in the same script? I was thinking of something more combat related - it'd be easier to get NPC models versus unique colors.

    Edit: @Clarity; - Spammer came in so I figured nobody would see this. Thoughts on the above?

    I was thinking of working on a slayer script for example. From what I'm reading on the forums walking with OGL is based off static x, y positions (I haven't tried OGL yet so I may be wrong) and doesn't compare color which I presume would make it inferior to SPS - specifically during a long walk to a task.
    I think it's possible

  20. #195
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by BlitzKrieger View Post
    Is it possible to use SRL-6 and OGL in the same script? I was thinking of something more combat related - it'd be easier to get NPC models versus unique colors.

    Edit: @Clarity; - Spammer came in so I figured nobody would see this. Thoughts on the above?

    I was thinking of working on a slayer script for example. From what I'm reading on the forums walking with OGL is based off static x, y positions (I haven't tried OGL yet so I may be wrong) and doesn't compare color which I presume would make it inferior to SPS - specifically during a long walk to a task.
    Hi Blitz,
    Apologies for the late reply, you likely have found the answer to your question by now.
    You can use both includes together via the following code at the top of the script:

    Simba Code:
    {$DEFINE SRLCOMPATIBILITY}
    {$i SRL-6/SRL.simba}
    {$i SPS/lib/SPS-RS3.Simba}
    {$i ogLib/lib/core/core.Simba}

    Others may disagree with me but I have found SPS to be unreliable, limited, and buggy. I believe it has gotten worse ever since the minimap became more shaded/textured (compare current RS3 minimaps to current OSRS minimaps to see what I mean). Perhaps I have just grown accustomed to using OGL walking for everything. I have used OGL walking for extremely long walks across the game world without issues. As long as you have an understanding of how/when the X/Y coordinates change, e.g. how the grid resets every time a new map square is loaded, you should have no problem

    OGL walking is also wonderful for making sure you have reached a very specific tile destination. For instance, the tile a player ends up in after completing an agility obstacle has a set X, Y coordinate depending on where the script starts. Similarly, the player ends up somewhere else if they fail the obstacle, so you could easily figure that out.

    Simba Code:
    if minimap.getLocalPosition().equals(point(34, 64)) then
      agilityObstacleComplete := true;

    While I know you aren't trying to do an agility script, this can be used for plenty of other things, I've used local position checks frequently in PvM/bossing scripts due to their simplicity.

  21. #196
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by wamekolysu View Post
    It's hard to find the IDs on trees as it puts the Tree and stump model on top of each other so you have to decipher through the debug lines and hope you get it right..
    Alternatively you can compare model searches with the tree visible and chopped down, and see which ID is missing in the latter scan.

Page 8 of 8 FirstFirst ... 678

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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