1. ogLib

 Simba/Includes/ogLib/... By @Clarity;, @Obscurity; and @Ross; Last Updated: 2015-12-18

The ogLib is an OpenGL library designed by @Clarity;, @Obscurity; and @Ross;. Started as the obscurityLibrary, it is an alternative method of creating RuneScape 3 macros. Its advanced functions and procedures allow us to monitor OpenGL calls. With this, we can accurately interact with various interfaces, locate models, read text, and much more.

This library's focus is on speed and efficiency, not to look pretty. We will not sacrifice performance to make things easier to read or easier on the eyes. If you have an issue with this, feel free to use GLX, SRL, or some other botting method, because it won't change. This library works, and it works very well.

The ogLib is an ongoing project and is currently in its alpha stage. For this reason, various elements, such as in-depth mouse movements, have yet to be added. We are tackling the priority elements first, such as combat, interfaces, mapping, and more.

This thread is for all ideas, issues, and suggestions relating to the library itself. Keep in mind that Clarity and I will not be hand-holding. Using and understanding this library will take time and effort from you. Questions like, "How do I bury Dragon Bones using this library?" will go unanswered. But, for shits and giggles, it'd be as easy as:
Simba Code:
sendKeys(actionBar.getActionKey(dragonBonesID));//~ Or...mouse.click(inventory.getItem(dragonBonesID));//~ Or...mouse.rightClickOption(inventory.getItem(dragonBonesID),'Bury Dragon bones');

If you haven't already, check out the OpenGL - A Beginner's Scripting Tutorial thread posted by Clarity.

GLX - Simba/Plugins/...

ogLib - Simba/Includes/...

Core - Simba/Includes/ogLib/lib/core/...

Interfaces - Simba/Includes/ogLib/lib/interfaces/...

Misc - Simba/Includes/ogLib/lib/misc/...

Tools - Simba/Includes/ogLib/tools/...

To setup the extensions follow the steps below:
• Copy ogLib.sex into your Extensions folder.
• Enable: ogLib.sex.

The extension debug should look something like this:
Code:
      .  ..
.-..-.|  .|-.
-'-|'-''-'
-'

Current: 119
---Live: 120

Move: C:\Simba\Includes\ogLib
--To: C:\Simba\Includes\ogLib-tmp

Extract to: C:\Simba\Includes\

Write: C:\Simba\Includes\ogLib\version

Delete: C:\Simba\Includes\ogLib-tmp

Notice: Update completed succesfully
--Time: 891ms

.  ..
.-..-.|  .|-.
-'-|'-''-'
-'
Last edited by Obscurity; 01-04-2016 at 02:06 AM.

2. SRL Member
Join Date
May 2012
Posts
485
Mentioned
23 Post(s)
Quoted
227 Post(s)
Do you guys think the id's of textures/models etc will remain the same?
If so perhaps we could start with a database of the more common id's?

E:
Banking presets;
Why not make it send a key instead of clicking the buttons?

Could you perhaps add examples to the ge.simba, similar to the banking.simba?
Also a nice addition would be to be able to click a texture id while in the grand Exchange to sell it, with options for how many and what price to sell them at. Similar to what srl currently has.
Last edited by BraK; 11-07-2015 at 06:02 PM.

3. If you want to send keys, just put sendkeys into your code
The button clicking is an alternative to key sending which is one line of code and unnecessary for a separate include function, imo, since it would basically be a differently named copy of a Simba function.

4. Model and texture IDs have been the same as long as I've been using OGL.

I thought I had added a function for using the key to withdraw. Or, better yet, like actionBar.setAutoRetaliate() and a few other functions do and randomly choose between the key and a click.

Edit: The issue with creating a DB of IDs (which we started but abandoned) is that each item has multiple IDs. Take a blue d'hide body, for example. In your inventory, it has one ID. Throw it on your actionBar, it changes. Now look at it in the crafting progress screen, yet another ID. Etc. Not all items are like this, but many.

5. I love seeing group projects like this, it's one of the foundation principles at SRL. Great job on this project and I hope to see it go far; good luck to you both!

6. - Automated Message -
Fixed access violations, timeouts, and tolerances.

ObscuritySRL updated on Apr 6, 2015 - 14e82b1

Fixed function timeouts and access violations caused by nil^.

Made function timeouts customizable with ogl.setTimeOut() and ogl.setDefaultTimeout().

7. - Automated Message -
Fixed possible access violations

ClaritySRL updated on Apr 8, 2015 - ad5412e

Fixed possible access violations caused by ogl.getChars(), ogl.getModels() and ogl.getTextures() methods.

- Automated Message -
Modified .contains() functions.

ClaritySRL updated on Apr 8, 2015 - 570c952

Modified tCardinalArray.contains() and tIntegerArray.contains().

Last edited by Justin; 04-09-2015 at 02:58 AM.

8. - Automated Message -
Removed duplicate function

ClaritySRL updated on Apr 8, 2015 - 4965c2f

Removed TIntegerArray.contains(), as it now exists in method.simba
- Automated Message -
Added mainScreen method and fixed mouse methods.

ObscuritySRL updated on Apr 8, 2015 - db8c628

horizontal and vertical camera position.

Fixed mouse.rightClickOption() incorrectly calling glxViewPort(). This
may not fix the right click bug for all - be patient.

Last edited by Justin; 04-09-2015 at 02:57 AM.

9. - Automated Message -
Added map positioning, normal distribution, etc.

ObscuritySRL updated on Apr 9, 2015 - e0156fb

Added minimap.getLocalPosition(). This method will return the position
of the player, a point, or a texture on the map.

Added normalRandom(), normalRandomE(). This, like gauss, will return a
random number biased toward the median, using the central limit theorem.

Fixed glMapCoords() to not cache results if all coordinates are equal,

10. - Automated Message -
Fixed mouse.rightClickOption() and other tweaks.

ObscuritySRL updated on Apr 11, 2015 - 144daee

The mouse.rightClickOption() should no longer fail if the desired text

ogl.getTimeout() should now return the correct value.

Also, countDown.setTime() is now a function and not a procedure. It will
return the uInt32 passed to it - useful for resetting multiple timers
with the same value.

11. SRL Member
Join Date
May 2012
Posts
485
Mentioned
23 Post(s)
Quoted
227 Post(s)
I assume this does not work with the player manager just yet, right?
But I notice the functions in the login.simba should allow one to login with their account.

12. The login.simba is very much a work in progress. Currently, with it, you can only:
- Check if the login interface exists
- Get the username that's currently typed
- Get the status of the remember checkbox
- Set the status of the remember checkbox

13. - Automated Message -
Fixed ogl char, model, and texture methods.

ObscuritySRL updated on Apr 12, 2015 - e014073

Fixed the ogl.getChars(), ogl.getModels(), and ogl.getTextures(). As
pointed out by Clutch, they were returning incorrect results.
ogl.getModels(), for example, would only return the first result.
ogl.getTextures() would duplicate results.
Fail-safed methods and added visibility checks.

ObscuritySRL updated on Apr 12, 2015 - f395542

Previously, calling various methods with empty arrays, such as
glModelArray.closestTo(tPoint), would throw an error. All methods now
have fail-safes for such times.

All isBehindInterface() methods have been removed and replaced with
isVisible().

Added glModelArray.getVisible() and tPointArray.getVisible(). These will
return an array of models or points from the arrays that are not behind
an interface.

Last edited by Clarity; 04-13-2015 at 01:45 AM.

14. - Automated Message -
Added dialogue type, bug fixes, etc.

ObscuritySRL updated on Apr 14, 2015 - eed81f4

Added the dialogue type. This is the interface that contains things like
NPC chat, options while talking to NPC and interacting with other
object, etc.

actionBar.setQuickPrayer() was right clicking the prayer button. This
has been fixed.

Added and modified some reverse() methods for arrays. This also applies
to string, making "ogLib" become "biLgo".

15. - Automated Message -
New TSmart.GetParams

ClaritySRL updated on Apr 15, 2015 - 226e759

Due to Jagex changes to RS launching, getParams has been updated and SMART will load successfully again.

16. SRL Junior Member
Join Date
Aug 2009
Location
Posts
596
Mentioned
0 Post(s)
Quoted
55 Post(s)
Doesn't appear to be compatible with SRL. Shame. Would be nice to leverage the two together.

17. Originally Posted by Bixby Sayz
Doesn't appear to be compatible with SRL. Shame. Would be nice to leverage the two together.
I'll put it in eventually. This will be one of ogLib's later updates when all the other types/convenience functions are completed. As of now Obscurity and I have been able to accomplish pretty much anything without need for color/SPS/SRL-6 - hence why I haven't gotten around to adding this in. SRL Compatibility does exist in the old GLX includes if you would prefer that right now

Obviously it can't hurt to have both together, so I'd never say no to this! SRL-6 has some great math stuff, and of course color for whenever you feel like using it instead of textures/models (although I personally wouldn't ).
Last edited by Clarity; 04-15-2015 at 12:33 PM.

18. SRL Junior Member
Join Date
Aug 2009
Location
Posts
596
Mentioned
0 Post(s)
Quoted
55 Post(s)
I'm going to play with it if I ever get it going on my test machine.

I'll have to browse the source and see if you have hardwired the java version in there somewhere. It will pair to an existing SMART (created using SRL) just fine. Try to launch with no existing SMART it chokes trying to find Java 7 when I have Java 8 on my test machine. Fun and games lol.

19. Originally Posted by Bixby Sayz
I'm going to play with it if I ever get it going on my test machine.

I'll have to browse the source and see if you have hardwired the java version in there somewhere. It will pair to an existing SMART (created using SRL) just fine. Try to launch with no existing SMART it chokes trying to find Java 7 when I have Java 8 on my test machine. Fun and games lol.
Noted, we'll update the java path function so that no longer occurs. It is located in smart.simba.

20. SRL Junior Member
Join Date
Jan 2012
Location
Long Island, NY
Posts
413
Mentioned
5 Post(s)
Quoted
95 Post(s)
Sorry if this is the wrong place to post but is it possible to add in support to detect animation data? It would be useful for skilling scripts to see when a player is performing a certain animation, or an alternative to detecting if any action is being performed(!idle), or to make something more intricate.

Thanks for the release though, I remember playing around with the OGL plugin years ago and wondering why no one developed it like this.

21. Originally Posted by Brotein
Sorry if this is the wrong place to post but is it possible to add in support to detect animation data? It would be useful for skilling scripts to see when a player is performing a certain animation, or an alternative to detecting if any action is being performed(!idle), or to make something more intricate.

Thanks for the release though, I remember playing around with the OGL plugin years ago and wondering why no one developed it like this.
Different "animation" for every player depending on what they are wearing unfortunately.

22. Originally Posted by Brotein
Sorry if this is the wrong place to post but is it possible to add in support to detect animation data? It would be useful for skilling scripts to see when a player is performing a certain animation, or an alternative to detecting if any action is being performed(!idle), or to make something more intricate.

Thanks for the release though, I remember playing around with the OGL plugin years ago and wondering why no one developed it like this.
Originally Posted by Ross
Different "animation" for every player depending on what they are wearing unfortunately.
Yes, OGL models are based on worn attire (overall shape of your object/triangle count usually), so you can do this indirectly for certain activities like fishing and mining, when you stop wielding a sword/shield to begin mining a rock, for example.

We'd prefer it if scripting tips/etc are asked in the tutorial thread, only so more people can see it and learn

23. Originally Posted by Brotein
Sorry if this is the wrong place to post but is it possible to add in support to detect animation data? It would be useful for skilling scripts to see when a player is performing a certain animation, or an alternative to detecting if any action is being performed(!idle), or to make something more intricate.

Thanks for the release though, I remember playing around with the OGL plugin years ago and wondering why no one developed it like this.
If you look at the public woodcutting section I go over this in the setup instructions. Not ideal, but it's very little work for the accuracy ogLib brings. At the very least it'll give you an idea on some situations where your Model ID changes and you can use that respectively for fail-safes and accurate detection.

24. Won't be home for a bit - what did Jagex change that required that update?

Edit: Scratch that - apparently Git is fairly easy to use on a mobile. :-P.

25. Registered User
Join Date
Apr 2015
Posts
3
Mentioned
0 Post(s)
Quoted
0 Post(s)
omg can't wait