SRL Archive - Includes, Plugins, and Snippets

ogLib


Obscurity

2015-04-04 18:48:45

[TABLE="ALIGN:CENTER"][TR][TD][/TD][TD]
Simba/Includes/ogLib/…
By @Clarity;, @Obscurity; and @Ross;

Last Updated: 2015-12-18[/TD][/TR][/TABLE]

[INDENT=1][TABLE="ALIGN:CENTER,WIDTH:100%"]
[TR]
[TD]
Table Of Contents
[/TD]
[TD]
[RIGHT]Related Links[/RIGHT]
[/TD]
[/TR]
[TR]
[TD="COLSPAN:2"]


[/TD]
[/TR]
[TR]
[TD]
[INDENT=1][JUMPTO=introduction]Introduction[/JUMPTO]
[JUMPTO=requirements]Requirements[/JUMPTO][/INDENT]
[INDENT=2][JUMPTO=glx]GLX[/JUMPTO]
[JUMPTO=ogLib]ogLib[/JUMPTO][/INDENT]
[INDENT=1][JUMPTO=setup]Setup[/JUMPTO]
[JUMPTO=fileList]File List[/JUMPTO][/INDENT]
[INDENT=2][JUMPTO=core]Core[/JUMPTO]
[JUMPTO=interfaces]Interfaces[/JUMPTO]
[JUMPTO=misc]Misc[/JUMPTO]
[JUMPTO=tools]Tools[/JUMPTO][/INDENT]
[INDENT=1][JUMPTO=updateExtension]Update Extension[/JUMPTO][/INDENT]
[/TD]
[TD]
[RIGHT] Beginner's Tutorial
ID Highlight Tool
OpenGL Plugins[/RIGHT]
[/TD]
[/TR]
[/TABLE][/INDENT]



[INDENT=1][ANCHOR=introduction]Introduction[/ANCHOR]

[/INDENT]

[INDENT=2]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:
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.[/INDENT]



[INDENT=1][ANCHOR=requirements]Requirements[/ANCHOR]

[/INDENT]

[INDENT=2][ANCHOR=glx]GLX[/ANCHOR] - Simba/Plugins/…

[/INDENT]

[INDENT=3][/INDENT]

[INDENT=2][ANCHOR=ogLib]ogLib[/ANCHOR] - Simba/Includes/…

[/INDENT]

[INDENT=3][/INDENT]



[INDENT=1][ANCHOR=setup]Setup[/ANCHOR]

[/INDENT]

[INDENT=2]
  • Download Simba/Plugins/ProSocks.dll
  • Download and run Simba/Scripts/[ATTACH]27083[/ATTACH]
[/INDENT]



[INDENT=1][ANCHOR=fileList]File List[/ANCHOR]

[/INDENT]

[INDENT=2][ANCHOR=core]Core[/ANCHOR] - Simba/Includes/ogLib/lib/core/…

[/INDENT]

[INDENT=3][/INDENT]

[INDENT=2][ANCHOR=interfaces]Interfaces[/ANCHOR] - Simba/Includes/ogLib/lib/interfaces/…

[/INDENT]

[INDENT=3][/INDENT]

[INDENT=2][ANCHOR=misc]Misc[/ANCHOR] - Simba/Includes/ogLib/lib/misc/…

[/INDENT]

[INDENT=3][/INDENT]

[INDENT=2][ANCHOR=tools]Tools[/ANCHOR] - Simba/Includes/ogLib/tools/…

[/INDENT]

[INDENT=3][/INDENT]



[INDENT=1][ANCHOR=updateExtension]Update Extension[/ANCHOR]

[/INDENT]

[INDENT=2]To setup the extensions follow the steps below:
  • Copy [ATTACH]27082[/ATTACH] into your Extensions folder.
  • On your menubar, select View > Extensions.
  • Enable: ogLib.sex.

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

Read: C:\Simba\Includes\ogLib\version

Download: oglib/ogLib_version

Current: 119
---Live: 120

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

Download: oglib/ogLib.tar.bz2

Extract to: C:\Simba\Includes\

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

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

Notice: Update completed succesfully
--Time: 891ms

. ..
.-..-.| .|-.
`-'`-|'-''`-'
`-'
[/INDENT]

Thomas

2015-04-05 07:16:29

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.

Clarity

2015-04-05 13:20:09

If you want to send keys, just put sendkeys into your code :p
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.

Obscurity

2015-04-05 15:07:22

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.

Flight

2015-04-06 09:47:10

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!

Obscurity

2015-04-07 20:45:31

[RIGHT]- Automated Message -[/RIGHT]
Fixed access violations, timeouts, and tolerances.


ObscuritySRL updated on Apr 6, 2015 - 14e82b1

Fixed function timeouts and access violations caused by nil^.

Added angle tolerance.

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




« Download ZIP »

Clarity

2015-04-08 12:26:50

[RIGHT]- Automated Message -[/RIGHT]
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.




« Download ZIP »


[RIGHT]- Automated Message -[/RIGHT]
Modified .contains() functions.


ClaritySRL updated on Apr 8, 2015 - 570c952

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




« Download ZIP »

Obscurity

2015-04-08 13:55:42

[RIGHT]- Automated Message -[/RIGHT]
Removed duplicate function


ClaritySRL updated on Apr 8, 2015 - 4965c2f

Removed TIntegerArray.contains(), as it now exists in method.simba


[RIGHT]- Automated Message -[/RIGHT]
Added mainScreen method and fixed mouse methods.


ObscuritySRL updated on Apr 8, 2015 - db8c628

Added mainScreen.setDegrees(). This function simultaneously adjusts the
horizontal and vertical camera position.

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




« Download ZIP »

Clarity

2015-04-09 20:12:00

[RIGHT]- Automated Message -[/RIGHT]
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,
or the map was not found, or the function timed out.




« Download ZIP »

Obscurity

2015-04-11 02:08:41

[RIGHT]- Automated Message -[/RIGHT]
Fixed mouse.rightClickOption() and other tweaks.


ObscuritySRL updated on Apr 11, 2015 - 144daee

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

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.




« Download ZIP »

Thomas

2015-04-11 09:42:44

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.

Obscurity

2015-04-11 15:07:14

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

Clarity

2015-04-12 21:40:54

[RIGHT]- Automated Message -[/RIGHT]
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.




« Download ZIP »

Obscurity

2015-04-14 23:38:46

[RIGHT]- Automated Message -[/RIGHT]
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".




« Download ZIP »

Clarity

2015-04-15 07:47:09

[RIGHT]- Automated Message -[/RIGHT]
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.




« Download ZIP »

Bixby Sayz

2015-04-15 08:19:52

Doesn't appear to be compatible with SRL. Shame. Would be nice to leverage the two together.

Clarity

2015-04-15 08:27:13

From: 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 :p ).

Bixby Sayz

2015-04-15 08:41:23

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.

Clarity

2015-04-15 09:46:11

From: 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.

Brotein

2015-04-15 09:49:30

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.

Ross

2015-04-15 10:04:32

From: 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.

Clarity

2015-04-15 10:11:31

From: 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.


From: 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 :)

Clutch

2015-04-15 10:19:24

From: 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.

Edit: Just read your post @Clarity; sorry!

Obscurity

2015-04-15 15:27:32

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.

BeatlesFanGirl

2015-04-15 16:55:18

omg can't wait

Obscurity

2015-04-15 22:32:27

[RIGHT]- Automated Message -[/RIGHT]
Added dialogue methods.


ObscuritySRL updated on Apr 15, 2015 - 95421ed

Dialogue options can now be retrieved into a tStringArray using
dialogue.getOptions().

The title of the dialogue box can now reliably be read using
dialogue.getTitle(). Previously, this wouldn't work due to seemingly
random texture IDs.

dialogue.setOption() now supports an array of strings - selecting the
first match that it finds.

Changed the default cache time from 60MS to 150MS.




« Download ZIP »

Clutch

2015-04-16 11:07:28

From: Obscurity
[RIGHT]- Automated Message -[/RIGHT]
Added dialogue methods.


ObscuritySRL updated on Apr 15, 2015 - 95421ed





« Download ZIP »


Diaglogues working flawlessly thus far!

Obscurity

2015-04-16 11:11:48

Awesome, glad to hear it! :).

Ross

2015-04-17 09:01:34

Request for production.getProduct/setProduct to account for Members only content.

Obscurity

2015-04-17 10:01:16

Yeah, sorry about that. I completely forgot (since I was writing it on P22P) that F2P have a few extra textures for membership badges.

Brotein

2015-04-17 11:46:24

I've been having an issue with the behavior of ogl.getModels();

So in this situation I am trying to find the model with the ID: 2744849415


I know there are 3 beam models, only 2 have uptext, and only the closest one to the left(in the pic) can be clicked on the other you can't reach(far right).

ClientCenter: ({X = 400, Y = 300})

If I print out the models…
[{ID = 2744849415, TID = 2, X = 801, Y = 616},  <-- Rightmost beam, has uptext, out of reach IGNORE THIS ONE
{ID = 2744849415, TID = 3, X = 566, Y = 385}, <-- Leftmost beam, has uptext, WE WANT TO CLICK ON THIS ONE
{ID = 2744849415, TID = 2, X = 607, Y = 385}] <-- Middle beam, no uptext, ignore this one

The model we want to click on is {ID = 2744849415, TID = 3, X = 566, Y = 385} but when I use…
p := clientCenter.closest(ma)[0].randomizePointEllipse(ellipseSize);
It will bring the point to {ID = 2744849415, TID = 2, X = 607, Y = 385} which is the middle beam…

If I create a search box and search for it like
ogl.getModels(intToBox(520, 355, 600, 400));
I get the following as a result…
...
{ID = 2744849415, TID = 3, X = 566, Y = 385}
...

So our model(amongst others) shows up in the search box, and only once just as it should.


But if I call…
ogl.getModels(2744849415, intToBox(520, 355, 600, 400));
I get
[{ID = 2744849415, TID = 2, X = 607, Y = 385}]

So you see, it is somehow grabbing the middle beam from the printout earlier, despite it existing outside the search bounds, and ignoring the one that exists inside of the search box. Both exist in the world at the same time, the IDs aren't changing, the printouts look exactly as they do. When closest is called, it returns the middle one but only sometimes as the other times it will work fine. When it isn't working properly, I still can see all 3 models(in the printout and onscreen debug) so it's not that the ID is changing. I'm not sure what I'm doing wrong or what's wrong but I can teamviewer this.

Obscurity

2015-04-17 12:18:11

Can hardly see it on my phone, but are the beams arrows in the picture?

Brotein

2015-04-17 13:33:52

From: Obscurity
Can hardly see it on my phone, but are the beams arrows in the picture?


Sorry here is a picture better showing it,

1: {ID = 2744849415, TID = 3, X = 566, Y = 385}
2: {ID = 2744849415, TID = 2, X = 607, Y = 385}
...

Obscurity

2015-04-17 14:10:35

From: Brotein
Sorry here is a picture better showing it,

1: {ID = 2744849415, TID = 3, X = 566, Y = 385}
2: {ID = 2744849415, TID = 2, X = 607, Y = 385}
...


Looking at the model printout in your first post, I don't think the one you have labelled as right-most is what you think it is. Its Y coord is offscreen and double the others.

In any case, I'll head there now to check.

Edit:
Alright - one thing y'all have to remember about OpenGL is model IDs can change. I don't mean that one day they'll be 123456789 and then next it'll be 987654321. Certain things cause a model's ID to change. These things are: hovering the mouse over them, camera angle, etc. However, most things, if they even have multiple IDs, will only have two. Not many do. Common things that do are drops or items that you can take.

In your case, the board model is changing between tCardinalArray([1444537558,2744849415]).

Careful though, the houses east of the course also has the same models used for their window sills.

ogl.getModels(tCardinalArray([2744849415,1444537558])).closestTo(ogl.getClientMidPoint())[0];

Clarity

2015-04-17 21:45:58

[RIGHT]:: Automated Message ::[/RIGHT]
Removed several ogl methods, optimizations, etc.


ObscuritySRL updated on Friday, April 17, 2015

511 additions, 809 deletions.

Removed several overloaded ogl.getChars(), ogl.getModels(), and
ogl.getTextures() methods and shrank others. They've also been rewritten
for optimization. The same goes for glCharArray.getChars(), etc.

Tweaked various interface methods. Particularly, the dialogue.


A total of 2 files were affected:



« Download ZIP »

Ross

2015-04-18 10:40:22

Request:

mouse.didClick():boolean;
returns true based on red textures on click, or false based on yellow.


could probably just implement it into mouse.click; though.

Twinki

2015-04-18 21:58:08

I keep getting these errors:

Paired with SMART[1504]
glxMapHooks was successful.
Error: Access violation
Execution failed.
The following bitmaps were not freed: [0]

It happens most of the time, but i'm still able to run a script every now and then.

Obscurity

2015-04-19 00:13:01

From: Twinki
I keep getting these errors:

Paired with SMART[1504]
glxMapHooks was successful.
Error: Access violation
Execution failed.
The following bitmaps were not freed: [0]

It happens most of the time, but i'm still able to run a script every now and then.


It's an error with glxMapHooks().

Once you've hooked a SMART window once, you can go into core/core.simba and comment out:
    if glxMapHooks(smart.ID) then
begin
writeLN('glxMapHooks was successful.');
result:=true;
end
else
writeLN('glxMapHooks was successful.');

Keep in mind that if you spawn another SMART, you're going to have to un-comment it for the first hook.

Ross

2015-04-20 18:36:02

From: Ross
Request:

mouse.didClick():boolean;
returns true based on red textures on click, or false based on yellow.


could probably just implement it into mouse.click; though.


Additional requests to add to this:
Add optional wait time to rightClickOption
Add function glCharArray.parseInt(), glCharArray.parseAlpha(), and glCharArray.alphaNumeric() back to include


You guys are awesome, thank you!

Obscurity

2015-04-20 18:42:13

Yeah, Clarity mentioned that I overwrote when he copied the parse methods from obsLib. I'll rewrite them and upload them when I'm home from TO.

Twinki

2015-04-20 21:39:11

From: Obscurity
Yeah, Clarity mentioned that I overwrote when he copied the parse methods from obsLib. I'll rewrite them and upload them when I'm home from TO.


Also, actionbar.setRegenerate(true) will sometimes be off by several pixels.

Obscurity

2015-04-20 22:06:21

From: Twinki
Also, actionbar.setRegenerate(true) will sometimes be off by several pixels.


That's odd. Unless I have the wrong texture ID (which I doubt), I have the set width and height to the same as that of the quick prayer and auto-retaliate (26). Does those miss? Fairly certain I used the actual texture dimensions.

Edit: Also putting this here so that I don't forget tomorrow when I can script again - I'm going to add a glModel/glTexture.click() and glModel/glTexture.rightClickOption().

Edit: Going to make ogl.getChars() automatically account for shadows. This should make things easier on yous, when you're not having to deal with strings that are PPrreessEEnntteerrttooCChhaatt.

Will also be working on glCharArray.parseAlpha(), parseAlphaNumeric(), parseInt(), and toString(). The toString() will automatically add spacing.

Twinki

2015-04-20 22:45:27

From: Obscurity
That's odd. Unless I have the wrong texture ID (which I doubt), I have the set width and height to the same as that of the quick prayer and auto-retaliate (26). Does those miss? Fairly certain I used the actual texture dimensions.

Edit: Also putting this here so that I don't forget tomorrow when I can script again - I'm going to add a glModel/glTexture.click() and glModel/glTexture.rightClickOption().

Edit: Going to make ogl.getChars() automatically account for shadows. This should make things easier on yous, when you're not having to deal with strings that are PPrreessEEnntteerrttooCChhaatt.

Will also be working on glCharArray.parseAlpha(), parseAlphaNumeric(), parseInt(), and toString(). The toString() will automatically add spacing.


It will sometimes be a bit lower than the button, click, and nothing happens. It might be a RS related issue.

Ross

2015-04-21 00:37:18

Posting to remind you:

ogl.getChars().toInteger();
ogl.getChars().contains('');

Clutch

2015-04-21 22:13:45

Can't get OGL scripts to run, can't get debug to show up..
They start up fine, but when I choose enable nothing occurs.

Windows 8.1 Java 7 update 76. Smart launches fine no errors.
A/v and firewall disabled
Gave full control to all users for Simba and Java
UAC is off
All windows updates have been applied
Drivers are updated
Quadruple checked settings in-game.
Set Simba to run as Administrator

Suggestions?

Ross

2015-04-21 23:31:50

From: Clutch
Can't get OGL scripts to run, can't get debug to show up..
They start up fine, but when I choose enable nothing occurs.

Windows 8.1 Java 7 update 76. Smart launches fine no errors.
A/v and firewall disabled
Gave full control to all users for Simba and Java
UAC is off
All windows updates have been applied
Drivers are updated
Quadruple checked settings in-game.
Set Simba to run as Administrator

Suggestions?


You're probably in DirectX, happens to me all the time.

Clutch

2015-04-21 23:41:05

From: Ross
You're probably in DirectX, happens to me all the time.


Not that you want to look at pictures but - 99.99% sure I have exact same settings as the guide. New machine old machines blown… I'm grasping at thorns at this point.
[ATTACH=CONFIG]25688[/ATTACH][ATTACH=CONFIG]25688[/ATTACH]

Ross

2015-04-22 17:59:49

current requests:
mouse.didClick()
mouse.rightClickOption(blah, blah, menuWait: Integer)
TString.contains('')
ogl.getChars().toInteger();

in addition:
bank.close();
bank.openPresetInterface();
bank.closePresetInterface();
bank.presetInterfaceLoadPreset(integer); needs a better name

Twinki

2015-04-22 22:45:33

From: Ross
current requests:
mouse.didClick()
mouse.rightClickOption(blah, blah, menuWait: Integer)
TString.contains('')
ogl.getChars().toInteger();

in addition:
bank.close();
bank.openPresetInterface();
bank.closePresetInterface();
bank.presetInterfaceLoadPreset(integer); needs a better name


To add onto this:

ogl.getUptext(uptext)

Rename inventory.getItemCount to inventory.countItems
Quick Hop Worlds support (In the esc menu)
Lodsestone Support

Ross

2015-04-22 22:46:03

From: Twinki
To add onto this:

ogl.getUptext(uptext)


seconded!

Obscurity

2015-04-22 23:37:09

This isn't an update post, honest!
mouse.rightClickOption(blah, blah, menuWait: Integer)
TString.contains('')
ogl.getChars().toInteger()
ogl.getChars().toInteger()
ogl.getChars().contains()
glCharArray.parseAlpha()
glCharArray.parseAlphaNumeric()
glCharArray.parseInt()
glCharArray.toString()

Etc.

https://github.com/ObscuritySRL/ogLib

I've been meaning to add uptext but literally keep forgetting. It's highly recommended to not use hover text with OGL as it can screw with certain methods like combat target information. But, as it seems to be highly requested, I'll account for that and write mouse.getHoverText().

Twinki

2015-04-22 23:51:39

From: Obscurity
This isn't an update post, honest!
mouse.rightClickOption(blah, blah, menuWait: Integer)
TString.contains('')
ogl.getChars().toInteger()
ogl.getChars().toInteger()
ogl.getChars().contains()
glCharArray.parseAlpha()
glCharArray.parseAlphaNumeric()
glCharArray.parseInt()
glCharArray.toString()

Etc.

https://github.com/ObscuritySRL/ogLib

I've been meaning to add uptext but literally keep forgetting. It's highly recommended to not use hover text with OGL as it can screw with certain methods like combat target information. But, as it seems to be highly requested, I'll account for that and write mouse.getHoverText().


Awww yisssss.

Obscurity

2015-04-27 13:15:09

From what I hear, pretty much all of our functions are going to need updating. Bad time to be working double shifts, but will try after work tonight I guess?

If people's could start trying different functions (actionBar, combat, and such primarily), and start a list of what no longer works would be helpful. :P. Should just be updating IDs/colourIDs/dimensions.

Brotein

2015-04-28 10:31:43

*Edit*

Never mind, the files copied weird :p

Obscurity

2015-05-06 04:42:31

[RIGHT]:: Automated Message ::[/RIGHT]
Added mouse.getTooltip() and other model methods.


ObscuritySRL updated on Wednesday, May 06, 2015

163 additions, 50 deletions.

Added a temporary fix to access violations. ogl.setup() now has a third,
optional, parameter. If set to false, it will not call glxMapHooks().
Keep in mind that this must be called once per SMART. This is only
temporary until GLX itself is updated.

Added glModelArray.getModels() methods. These now account for TID - a
model's triangle count.

Calling mouse.getTooltip() will now return what is labelled at
"Mouseover text" in the RuneScape graphics options.

Small dialogue changes.


A total of 4 files were affected:



« Download ZIP »

Gu3st...

2015-05-07 21:34:09

Stickified :)

Clarity

2015-05-08 00:29:36

From: Zyt3x
Stickified :)

Thank you so much, Zyt3x!

Obscurity

2015-05-08 05:18:01

Cheers, Zyt3x!

Pushed a fairly important update to ogLib as well today - would recommend everyone update. See below:
https://github.com/ObscuritySRL/ogLib/commit/29b2fbd0b5c72fd55ef393b5cd14c6c4e7710623

adc

2015-05-08 19:02:57

Not sure if this is the right place to post for technical help, but when running a script (Edit: I should specify that I mean when running a script using ogLib; scripts that do not use ogLib compile and work flawlessly), it compiles properly - however, it attempts to load something (Java, I assume), and crashes out with this message:

http://puu.sh/hGpFy/dd4a8fc0ef.png

I'm running JDK 8u45; I have Java, but it doesn't seem to be the type it wants. Is there a way to specify this?

grats

2015-05-08 19:17:59

From: adc
Not sure if this is the right place to post for technical help, but when running a script, it compiles properly - however, it attempts to load something (Java, I assume), and crashes out with this message:

http://puu.sh/hGpFy/dd4a8fc0ef.png

I'm running JDK 8u45; I have Java, but it doesn't seem to be the type it wants. Is there a way to specify this?


You're right, the "unofficial development" section isn't the right place to ask for help with smart/java/simba.

adc

2015-05-08 19:19:36

From: grats
You're right, the "unofficial development" section isn't the right place to ask for help with smart/java/simba.


For a script running ogLib, when every other script works properly and my Java installation is fine? Perhaps I could have been more clear and informative, but there's no reason to be snarky about it friend.

The Mayor

2015-05-09 01:41:46

From: adc
For a script running ogLib, when every other script works properly and my Java installation is fine? Perhaps I could have been more clear and informative, but there's no reason to be snarky about it friend.


Because ogLib is hard coded to use Java 7 for some reason. IIRC there is code in the include to search for your Java path but it isn't used.

Obscurity

2015-05-09 01:44:35

I thought @Clarity made it search for the correct Java path a few weeks ago? Around the time he changed smart.simba?

Maybe I overwrote it - will fix it. Sorry.

Twinki

2015-05-09 03:07:27

Got some more requests, hopefully these are fairly simple.

isBehindInterface or isVisable
Will return true/false if it cannot see whatever model/texture/char is on the screen. For example, http://i.gyazo.com/8340d61a69902417e00d41561c3423ee.png (ogl.getChars) gets the World 28 characters, even though you can't actually see them on the screen. If you try to mouse over it and click it, it won't work because it's behind something.

mouse.scroll(direction)
Will simply scroll up or down

Port over the, very useful, types from SRL-6 (srl-6\lib\utilities\types). I've been using them on my own, and I just can't work without them.

Could really use these for the hopWorld interface I've been working on:



I kind wana make a little include file for quick hopping, try to contribute a bit. But i'm not sure if i'm up for it, or experienced enough.

Obscurity

2015-05-09 04:46:30

Yes yes yes!

I was going to add mouse.scroll(), but it slipped my mind lately. Cheers for the reminder!

I'm very happy to see what you've come up with! That's very cool and exciting to see that others are also making awesome progress with OGL!

As I told Justin - I'll accept all contributions that people are willing to provide. It isn't easy writing all of this. :P. With my schedule lately, I need it. Though, I hope you wouldn't get upset or offended if I updated/tweaked/rewrote it once I had time?

I've literally only ever used color/SRL once. It was Clarity's shitadel root chopper. I immediately stopped it and never used Simba for anything until Clarity showed me GLX. That said, I'll take a look at the types and such as you suggested.

I don't mean that as a diss to SRL - just the fact that I had to have a specific layout, titlebars, locked interface, etc. Irked me. :P.



Add me to Skype, mate!

Twinki

2015-05-09 05:03:49

From: Obscurity
Yes yes yes!

I was going to add mouse.scroll(), but it slipped my mind lately. Cheers for the reminder!

I'm very happy to see what you've come up with! That's very cool and exciting to see that others are also making awesome progress with OGL!

As I told Justin - I'll accept all contributions that people are willing to provide. It isn't easy writing all of this. :P. With my schedule lately, I need it. Though, I hope you wouldn't get upset or offended if I updated/tweaked/rewrote it once I had time?

I've literally only ever used color/SRL once. It was Clarity's shitadel root chopper. I immediately stopped it and never used Simba for anything until Clarity showed me GLX. That said, I'll take a look at the types and such as you suggested.

I don't mean that as a diss to SRL - just the fact that I had to have a specific layout, titlebars, locked interface, etc. Irked me. :P.



Add me to Skype, mate!


I'm totally fine with you editing it or fixing it up, i'm not a experienced developer and i'm sure it might end up being a bit sloppy. I've been trying to get some sort of Goldfarm going and I have a method that needed quick hopping, so I decided to give it a shot and that's the result.

Here's the functions I wrote up so far, and yes I kinda took from your programming in the include >.<



function quickHopGetInter(debug: boolean=false): tBox;
Var
i: Integer;
funcBox: tBox;
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);
//if(debug) then
//smart.__Graphics.DrawText('X '+toStr([i]), smallChars, funcPoint, clLime);
end;
if(debug) then
smart.__Graphics.DrawBox(funcTPA.getBounds);
if(funcTPA.getBounds.X1>0) then
result := funcTPA.getBounds;
end;


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);
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);
if(debug) then
smart.__Graphics.DrawBox(funcWorldBox);
funcFoundWorld := ogl.getChars(funcWorldBox).toInteger;
if(debug) then
smart.__graphics.DrawText('World: '+toStr(funcFoundWorld), 'smallChars', point(funcWorldBox.X2 ,funcWorldBox.Y2), clWhite);
funcFoundWorlds.addIndex(funcFoundWorld, 0);
end;
result := funcFoundWorlds;
end;

The types utilities can be easily ported, I only had to comment out one line that used SRL-6's Debug in tBox, but others I just removed several functions. When I was doing the functions that's what I relied on the most, since it makes it so much easier to manipulate arrays/tboxs/tpoints/ATPA's/ETC…

I need to go through, clean it up a bit and remove the debug issues where it'll terminate the script, i'd also like to have several different functions for getting the Players on the world, the location/minigame of the world, and the ping. I've of course got more work to do.

But yeah, I'm loving the power OGL has. I don't think i'd ever be able to do such a thing with SRL/Pure Color.

Obscurity

2015-05-09 05:11:38

It would be easy for me to do a isVisible() for elements of the same type - two textures for example. This is because if something appears later in the array and its bounds cover the centerpoint of what you're checking, then yes it's behind something.

Those two textures you're searching for, are those the stars?

Twinki

2015-05-09 07:38:57

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.





(*
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;

Thomas

2015-05-10 03:21:23

I'm unsure if this is included, but a waittypefunc would be rather usefull?
On iPhone atm, but something like this would remove the need of some timers.

If lootmodel array is not empty
Repeat
Click closest models
Until waittypefunc lootmodelarray is empty (1000, 5000)
So it checks if its empty every second for up to 5 seconds then repeats.

Obscurity

2015-05-10 03:34:10

Couldn't you just do:
while length(modelArray:=ogl.getModels(cardinalArray)) do
mouse.click(modelArray.closestTo(ogl.getClientMidPoint())[0]);

Thomas

2015-05-10 03:49:58

From: Obscurity
Couldn't you just do:
while length(modelArray:=ogl.getModels(cardinalArray)) do
mouse.click(modelArray.closestTo(ogl.getClientMidPoint())[0]);


Yes, but wont you need a countdown timer for that? So it doesn't spamclick the model?

Obscurity

2015-05-10 03:53:33

That would have to be something done in the script itself, not ogLib:

while length(loot:=ogl.getModels(IDs)) do
if canLoot.isFinished() then
begin
mouse.click(loot.closestTo(ogl.getClientMidPoint())[0].randomizePointEllipse(20));
canLoot.setTime(random(250,750));
end;

Thomas

2015-05-10 03:58:17

From: Obscurity
That would have to be something done in the script itself, not ogLib:

while length(loot:=ogl.getModels(IDs)) do
if canLoot.isFinished() then
begin
mouse.click(loot.closestTo(ogl.getClientMidPoint())[0].randomizePointEllipse(20));
canLoot.setTime(random(250,750));
end;


Yes, I know. But the waittypefunc is a Srl function AFAIK, and I was suggesting it as another method besides the setTime option.

Fr3akNL

2015-05-10 13:52:58

!subscribe

Obscurity

2015-05-10 14:06:32

The !subscribe was for PM. :-P. Script monitors PM, I have to manually add from posts. Added!

Twinki

2015-05-11 11:52:46

After playing around with records/types I was finally able to get the functions in the right 'format' for the Lib, the only thing really needed to easily just drop this in with the rest is the extra Types utilities from SRL-6, my functions here would have to be completely re-written without them.

I think I've done what I can until you get glTexture.isVisible completed and pushed, also I think a general ogl.isLoading(): boolean would be pretty handy, will just return true if 'Loading Please Wait' is on screen, very simple to do.

Everything seems to work just as I'd like it to. Still have some more to go, but so far I'm quite enjoying myself, and a bit proud :P.


(*
Quick Hop interaction
======

Contains functions used for the Quick Hop Interface

*)

{$include_once srl-6/lib/utilities/types/tbox.simba}
{$include_once srl-6/lib/utilities/types/tpoint.simba}
{$include_once srl-6/lib/utilities/types/tpointarrays.simba}
{$include_once srl-6/lib/utilities/types/integerarrays.simba}

type quickHopFuncs=record
cb, bounds:tBox;
worlds:TIntegerArray;
debug: boolean;
end;

Var
quickHop: quickHopFuncs;


Const// Left/Right Top/Bottom
QUICKHOP_INTERFACE_TEXTURES := [53040, 48960]; // Side Textures
QUICKHOP_STAR_TEXTURE := 13504; // Grey Star Texture
QUICKHOP_CONFIRMBOX_TEXTURE := 14280; // Textures surrounding the Hop Confirm Box
QUICKHOP_BUTTON_TEXTURES := [89246, 89248, 91275]; // Yes/No Button Textures NOTE: The No button uses the same texture, but a different colour pallete
QUICKHOP_YESBUTTON_COLORIDS := [10775317, 10775316]; //Yes Button Color ID's

(*
quickHop.setDebug
~~~~~~~~~~~~~~~
Enables/Disables Drawing debug for the quickHop Functions

Example:
quickHop.setDebug(true);
*)
procedure quickHop.setDebug(d: boolean=false);
begin
self.debug := d;
end;

(*
quickHop.getInterface
~~~~~~~~~~~~~~~

.. code-block:: pascal

function quickHop.getInterface(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

if(quickHop.getInterface) then
smart.__Graphics.DrawBox(quickHop.bounds, false, clRed);

*)

function quickHop.getInterface(): boolean;
Var
i: Integer;
funcPoint: tPoint;
funcTPA: TPointArray;
funcTXA: glTextureArray;
begin
funcTXA := ogl.getTextures(QUICKHOP_INTERFACE_TEXTURES);
for i:=0 to high(funcTXA) do
begin
funcPoint := Point(funcTXA[i].X, funcTXA[i].Y);
funcTPA.addIndex(funcPoint, 0);
end;
if (not funcTXA.isEmpty) then
begin
if(self.debug) then
smart.__Graphics.DrawBox(funcTPA.getBounds);
self.bounds := funcTPA.getBounds;
exit(true);
end;
end;

(*
quickHop.getWorlds
~~~~~~~~~~~~~~~

.. code-block:: pascal

function quickHop.getWorlds(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

if(quickHop.getWorlds) then
WriteLn(quickHop.worlds);

*)
function quickHop.getWorlds(): boolean;
Var
i, funcFoundWorld: Integer;
funcBox, funcWorldBox: tBox;
funcPoint: tPoint;
funcTPA: TPointArray;
funcTXA: glTextureArray;
funcFoundWorlds: TIntegerArray;
begin
if(self.getInterface) then
begin
funcTXA := ogl.getTextures(QUICKHOP_STAR_TEXTURE, self.bounds);
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(self.debug) and (funcFoundWorld>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;
if(not funcFoundWorlds.isEmpty) then
begin
self.worlds := funcFoundWorlds;
exit(true);
end;
end;
end;

(*
quickHop.canHop
~~~~~~~~~~~~~~~

.. code-block:: pascal

function quickHop.canHop(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(quickHop.canHop(100)) then
WriteLn('We can hop');

*)
function quickHop.canHop(world: Integer): boolean;
begin
if(self.getWorlds) then
result := self.worlds.isInArray(world);
end;

(*
quickHop.scroll
~~~~~~~~~~~~~~~

.. code-block:: pascal

function quickHop.scroll(world: Integer): boolean;

Scrolls up or down until the desired world is on screen

.. note::

- by Twinki
- Last updated: 5/9/2015 by Twinki

Example:

.. code-block:: pascal

quickHop.scroll(50);

*)
function quickHop.scroll(world: Integer): boolean;
Var
funcPoint: tPoint;
direction: string;
time: LongWord;
begin
time := (getSystemTime() + 25000);
if(self.getWorlds) then
if(not self.canHop(world)) then
begin
if(self.worlds[0]<(world)) then
direction := 'down'
else
direction := 'up';

funcPoint := self.bounds.getMiddle().rand(20);
while (not self.canHop(world)) do
begin
mouse.scroll(funcPoint, direction);
Wait(randomRange(10, 65));
if (getSystemTime()>time) then
exit(false);
end;
if(self.canHop(world)) then
exit(true);
end
else
exit(true);
end;

(*
quickHop.getConfirmBox
~~~~~~~~~~~~~~~

.. 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

if(quickHop.getConfirmBox) then
smart.__Graphics.DrawBox(quickHop.cb, false, clRed);;

*)
function quickHop.getConfirmBox(): boolean;
Var
i: Integer;
funcBox: tBox;
funcPoint: tPoint;
funcTPA: TPointArray;
funcTXA: glTextureArray;
begin
if(self.getInterface) then
begin
funcBox := intToBox(self.bounds.X1, self.bounds.Y1, self.bounds.X2, self.bounds.Y2-40);
funcTXA := ogl.getTextures(QUICKHOP_CONFIRMBOX_TEXTURE, funcBox);

for i:=0 to high(funcTXA) do
begin
funcPoint := Point(funcTXA[i].X, funcTXA[i].Y);
funcTPA.addIndex(funcPoint, 0);
if(self.debug) then
smart.__Graphics.DrawText('X '+toStr([i]), smallChars, funcPoint, clLime);
end;

if(not funcTPA.isEmpty) then
begin
if(self.debug) then
smart.__Graphics.DrawBox(funcTPA.getBounds);
self.cb := funcTPA.getBounds;
exit(true);
end;
end;
end;

(*
quickHop.clickYes
~~~~~~~~~~~~~~~

.. code-block:: pascal

function quickHop.clickYes(): 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

quickHop.clickYes();

*)
function quickHop.clickYes(): boolean;
Var
yesButton: glTextureArray;
clientCenter, clickPoint: TPoint;
begin
if(self.getConfirmBox) then
begin
if(ogl.getChars(self.cb).contains('Areyousureyouwant')) then
begin
yesButton := ogl.getTextures(QUICKHOP_BUTTON_TEXTURES, QUICKHOP_YESBUTTON_COLORIDS, [self.cb]);
if not(yesButton.isEmpty) then
begin
clientCenter := ogl.getClientMidPoint();
clickPoint := clientCenter.closest(yesButton)[0].randomizePointEllipse(5);
mouse.click(clickPoint);
end;
end;
end;
end;

Obscurity

2015-05-11 12:08:01

Not quite simple to do with OGL. The loading screen stalls OGL the second it appears.

I've not really used types like those for OGL. You can see them in types.simba. The only reason though is that because OGL, from what I hear, is much faster then SRL and, since you're already retrieving all textures and chars anyways, you can do everything in one call.

I do like it though! I've not seen anyone else make functions like those! :-).

As for the left/right textures - be careful. Make sure those textures aren't also used in the combat interface, options, etc.

Twinki

2015-05-11 12:16:36

From: Obscurity
Not quite simple to do with OGL. The loading screen stalls OGL the second it appears.

I've not really used types like those for OGL. You can see them in types.simba. The only reason though is that because OGL, from what I hear, is much faster then SRL and, since you're already retrieving all textures and chars anyways, you can do everything in one call.

I do like it though! I've not seen anyone else make functions like those! :-).

As for the left/right textures - be careful. Make sure those textures aren't also used in the combat interface, options, etc.


I'll probably add another failsafe to getInterface, perhaps just get the World Select Text at the top left of the interface. And it made more sense in my head to have the custom type that contained the bounds and such. Perhaps i'll move off it, not really sure. First time experimenting with such things.

Hmph, i'm not really sure what to do then for the loading screen. I guess I can rely strictly on 20-30 second waits until you get that sorted.

StickToTheScript

2015-05-18 18:57:10

Hey guys, not too sure what the problem is here, but for some reason, after I stop a script, Simba decides to freeze right after giving me the error:

Exception TLPThread.Destroy: Access violation

It happens a lot and I will have to open simba again (after force closing cuz it stallz) and then I am forced to open a new client.

Sometimes, im just never able to get a script running….

Obscurity

2015-05-21 22:29:21

[RIGHT]:: Automated Message ::[/RIGHT]
Core and Interface Additions and Fixes.


ObscuritySRL updated on Thursday, May 21, 2015

187 additions, 248 deletions.

Removed unnecessary writeLN() in debug.

Added abbreviation methods for integers. someInt.abbreviate() will
return "123.5K" where someInt equals 123456.

Fixed glCharArray.toString() to more accurately detect spacing. Also
added an optional parameter for special cases to manually specify
spacing.

Fixed mouse.rightClickOption(). It should now be much faster, reliable,
and correctly account for sub-menus.

Added fonts to chat.getChat(). Also made it easier to add fonts in the
future, if needed.

Added standard protection prayers to combat.hasBuff(). It should also
now correctly distinguish between similar icons.

Added a wider variety of interfaces to dialogue methods.
dialogue.hasDialogue() and dialogue.getPrompt() should now recognize
more interfaces, such as the "Warning: a game is currently in progress"
window at Soul Wars.

Added a failsafe to minimap.getLocalPosition() to prevent access
violations when attempting to get your position while the map isn't
visible or is currently loading a new area.


A total of 8 files were affected:



« Download ZIP »

Obscurity

2015-05-25 20:51:45

[RIGHT]:: Automated Message ::[/RIGHT]
Important Combat, Minimap, and Dialogue Changes.


ObscuritySRL updated on Monday, May 25, 2015

190 additions, 102 deletions.

Added glModel.randomizePoint() and glTexture.randomizePoint(). These do
not change the coordinates of the objects, but rather return a tPoint.

Added a mouse.click() for tBoxes. For example:
mouse.click(someTexture.bounds);
The method will choose a random point within the box.

Changed combat.getTarget() and combat.getTargetID() to filter more
incorrect IDs.

Added fonts to various dialogue methods.

Most importantly, added minimap.getScreenPosition(). This functions the
opposite of minimap.getLocalPosition().

minimap.getLocalPosition() converts an onscreen point (or your player
position if left empty) to a point relative to the minimap.
minimap.getScreenPosition() converts a map coordinate to a point
onscreen. For example:
mouse.click(minimap.getScreenPosition([50,65]));
Will walk you to 50,65 on the map!


A total of 5 files were affected:



« Download ZIP »







Edit - I made this in an attempt to explain the changes:

Lucidity

2015-05-25 21:44:43

Thanks for this obscurity. needed the mouse.click tbox function

Ross

2015-05-26 15:07:48


actionbar.getAdrenaline() does not return the correct amount (not sure if it does in a different layout), for instance this returns a value of 104.

edit: also requesting TPoint.furthest(TPoint) and variations as they don't currently exist, only furthestFrom() which does not include Tpoint.furthestFrom().

Ross

2015-05-27 23:11:13

'taverly':
begin
funcColourID:=2831683;
funcID:=112804;
end;
correct spelling is 'Taverley' in lodestone.simba.


also, not really necessary but since you have an include for it you might want to change minimap.clickHomeTeleport() to lodestone.clickHomeTeleport() or include the former in the lodestone.clickTeleport() function.

Ross

2015-05-28 17:42:12

minimap.clickResetCamera(); misses the compass sometimes (1 out of 10 times-ish).


Sorry for the spam, doing a lot of slayer work atm.

Obscurity

2015-05-28 19:09:04

I'll reduce the radius for minimap.clickResetCamera().

Thanks for pointing out Taverley.

As I explained on Skype, the Home Teleport button is on the minimap - hence why it's a minimap method. :P.

For the actionBar.getAdrenaline(), Clarity told me about that bug a long time ago. I completely forgot about it. It should be as simple as changing an integer.

Again, as explained in Skype, I'm stuck in another city for a while, so give me time.

Twinki

2015-05-29 13:15:02

Was bored this morning and really felt like I needed to contribute something, so I decided to go and take a look what all needed to be changed in all the SRL-6 utilities, turns out very little. So I went ahead and ported everything over.

Only thing that I changed from ogLib was that I ripped out these:

type Timer = record
Time: Int64;
end;

procedure Timer.Start;
begin
Time := GetSystemTime;
end;

procedure Timer.Reset;
begin
Time := 0;
end;

function Timer.TimeElapsed: Integer;
begin
Result := GetSystemTime - Time;
end;

From internals.simba, and ported it over to time.simba. It's still Timer, and it works just the same way with more functions added. Here's the new functions for it:

(*
Timer
~~~~~~~~~~~

.. code-block:: pascal

type Timer = record
time, startTime: LongWord;
paused: Boolean;
end;

Timer type which is usefull for loops, timing and writing progress reports.

.. note::

- by Bart de Boer
*)
type
Timer = record
name: string;
time, startTime, __prevMark: UInt64;
paused: Boolean;
end;

(*
Timer.start
~~~~~~~~~~~~~~~~~

.. code-block pascal

procedure Timer.start();

Starts the timer. Can also be used when paused to continue where it left.

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

MyScriptTimer.start();
*)
procedure Timer.start();
begin
Self.__prevMark := getTickCount64(); // used for adding time after a pause

// if it hasn't been started yet
if (not Self.paused) then
begin
Self.startTime := getTickCount64();
Self.time := 0;
end;

Self.paused := False;
end;

(*
Timer.reset
~~~~~~~~~~~~~~~~~

.. code-block pascal

procedure Timer.reset();

Stops the timer and resets it to zero.

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

MyScriptTimer.reset();
*)
procedure Timer.reset();
begin
Self.paused := False;
Self.time := 0;
Self.startTime := 0;
Self.__prevMark := 0;
end;

(*
Timer.pause
~~~~~~~~~~~~~~~~~

.. code-block pascal

procedure Timer.pause();

Pauses the timer. It can be continued with start().

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

MyScriptTimer.pause();
TakeABreak(90000);
MyScriptTimer.start();
*)
procedure Timer.pause();
begin
Self.time := Self.time + (getTickCount64() - Self.__prevMark);
Self.paused := True;
end;

(*
Timer.getTime
~~~~~~~~~~~~~~~~~~~

.. code-block pascal

function Timer.getTime(): LongWord;

Gets the time from the timer. Returns zero if the timer was not set.

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

MyScriptTimer.start();
repeat
DoStuff;
until(MyScriptTimer.getTime() > 60000);

*)
function Timer.getTime(): LongWord;
begin
if not Self.paused then
Result := Self.time + (getTickCount64() - Self.__prevMark)
else
Result := Self.time;
end;

(*
Timer.getTotalTime
~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block pascal

function Timer.getTotalTime(): LongWord;

Gets the time from the timer including the time it was paused. Returns zero if
the timer was not set.

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

BreakTime := MyTimer.getTotalTime() - MyTimer.getTime();

*)
function Timer.getTotalTime(): LongWord;
begin
if (Self.startTime > 0) then
Result := getTickCount64() - Self.startTime;
end;

So really all that changed from SRL-6 was the name. The function names are a bit different from what they were in internals, and credits to Bart de Boer. There is one function in PixelShift that used a Timer, so just keep that in mind.

Other than that, just download this extract it in ogLib/lib and throw

{$include_once ogLib\lib\utilities\utilities.simba} in core at the very top, and {$include_once ogLib/lib/utilities/types/tbox.simba} under {$include_once ogLib/lib/core/mouse.simba}

Also, I included color and pixelshift for any use they may be in any script, believe it or not there were several instances I could have used OGL in conjunction with Pixelshift for even more accuracy (For example, if the player is animating). Although, they can easily be taken out if you guys don't find any use for them.

I could overall kinda revamp some of these functions, remove what isn't needed (like TBox.getColor) and simplify most of it (Such as TBox.getMidPoint to TBox.MidPoint, or TBox.Height, ETC..) if you want, I've been pretty bored recently and have nothing better to do.

Ross

2015-05-30 11:49:51

minimap.clickHomeTeleport()'s radius is a bit too large, sometimes misses.

glCharArray.contains('') is not working.


From: Twinki

I added one new mouse function:


procedure mouse.move(funcPoint:tPoint);
begin moveMouse(funcPoint.x,funcPoint.y);end;

Just something simple to have, was finding that getTooltip was kinda useless since you can only mouse.click.


ogLib doesn't use mouse movements at the moment. you can do mouse.click(tpoint, 2); to have the mouse hover over an area.

Twinki

2015-05-30 14:17:04

From: Ross
minimap.clickHomeTeleport()'s radius is a bit too large, sometimes misses.

glCharArray.contains('') is not working.




ogLib doesn't use mouse movements at the moment. you can do mouse.click(tpoint, 2); to have the mouse hover over an area.


Gotchya, just updated the utilities.

Lucidity

2015-05-30 14:33:49

You could just do moveMouse(x, y); instead of adding a new function

Twinki

2015-05-30 14:35:24

From: Bly
You could just do moveMouse(x, y); instead of adding a new function


True, but I figured mouse.move could be used by others, as I said I found I had issues multiple times where I just needed to move the mouse and use getToolTip. Just something that could be easily simplified for many and would only take up two lines.

Obscurity

2015-05-31 21:59:14

[RIGHT]:: Automated Message ::[/RIGHT]
Support for CodeHints, Function List and More!


ObscuritySRL updated on Sunday, May 31, 2015

2059 additions, 2170 deletions.

ogLib has been restructured to support Simba's code hints and code
completion features. Additionally, formatting has been improved to allow
the function list to display all include methods.

Access violation issues have been fixed in core.simba. You should no
longer experience any when trying to pair to SMART clients or run
scripts in general.

Added actionBar.rightClickFamiliarOption().


A total of 25 files were affected:



« Download ZIP »





Edit: I can not take credit for this update. @Clarity did all of the heavy lifting but was unable to push the update, so sent it to me to upload.

Also, I have good news. Coming soon, hopefully before the next update, should come an auto-updater. I've put a lot of thought into how it'll work and found that Simba has the functionality for everything required. So, in the hopefully near future, you won't have to manually download and extract each update!

Twinki

2015-05-31 22:30:48

From: Obscurity

Also, I have good news. Coming soon, hopefully before the next update, should come an auto-updater. I've put a lot of thought into how it'll work and found that Simba has the functionality for everything required. So, in the hopefully near future, you won't have to manually download and extract each update!


Before that happens, I would like a Java Path Grabber and a Variable for setting the SMART UserAgent :)

Also, thoughts on my port of SRL-6's Types utilities?

Justin

2015-06-01 01:44:52

From: Twinki
Before that happens, I would like a Java Path Grabber and a Variable for setting the SMART UserAgent :)

Also, thoughts on my port of SRL-6's Types utilities?


I've added the Java path grabber and the ability to edit SMART's useragent. Just waiting for Clarity/Obscurity to review and push.

https://github.com/SRLJustin/ogLib/commit/855358a8ca736c504a8fd4a4409979b05769ca18

Obscurity

2015-06-01 12:29:39

Will be home after 3:30PM EST - but it's my anniversary today so can't guarantee I'll get time online. If I can, I'll push.

I thought you were able to, though. :-P.

Ross

2015-06-01 23:24:38

Overriden dialogue.setOption(), mouse.getTooltip(), and chat.getChat() without using fonts since RS updates them way too much.

function tDialogue.setOption(funcOption: array of string): boolean;
override;
var
funcBounds: tBox;
funcCharPointer, funcTexturePointer: pointer;
funcCharPointerIndex, funcCharPointerSize, funcOptionIndex, funcTexturePointerIndex, funcTexturePointerSize: uInt32 = 0;
funcText: ansiString;
begin
funcTexturePointer := glTextures(funcTexturePointerSize) + (36 * (funcTexturePointerSize - 1));
if funcTexturePointer <> nil then
begin
funcCharPointer := glFonts(funcCharPointerSize) + (48 * (funcCharPointerSize - 1));
if funcCharPointer <> nil then
begin
for funcOptionIndex to high(funcOption) do
funcOption[funcOptionIndex] := replace(lowercase(funcOption[funcOptionIndex].reverse()), ' ', '', [rfReplaceAll]);
for funcTexturePointerIndex to funcTexturePointerSize - 1 do
begin
if funcTexturePointer ^ = 65800 then
begin
funcBounds := [(funcTexturePointer + 20) ^, (funcTexturePointer + 24) ^, (funcTexturePointer + 28) ^, (funcTexturePointer + 32) ^];
funcText := '';
for funcCharPointerIndex to funcCharPointerSize - 1 do
begin
if pointInBox([(funcCharPointer + 8) ^, (funcCharPointer + 12) ^], funcBounds) then
funcText := funcText + char((funcCharPointer + 16) ^)
else if funcText <> '' then
begin
for funcOptionIndex := 0 to high(funcOption) do
begin
if pos(funcOption[funcOptionIndex], lowercase(funcText)) > 0 then
begin
if random(2) then
sendKeys(toStr(0 + (funcCharPointer - 80) ^ - 47), 30 + random(30), 30 + random(30))
else
clickMouse(normalRandom(funcBounds.x1, funcBounds.x2), normalRandom(funcBounds.y1, funcBounds.y2), 1);
result := true;
break;
end;
end;
break;
end;
funcCharPointer := funcCharPointer - 48;
end;
if ((funcTexturePointer := funcTexturePointer - 108) ^ <> 65800) or result then
break;
end
else
funcTexturePointer := funcTexturePointer - 36;
end;
end;
end;
exit(result);
end;

function tmouse.getTooltip(): string;
override;
var
funcID: int32;
funcBounds: tBox;
funcPointer: pointer;
funcPointerIndex, funcPointerSize: uInt32 = 0;
begin
funcPointer := glTextures(funcPointerSize) + (36 * (funcPointerSize - 1));
if funcPointer <> nil then
begin
for funcPointerIndex to funcPointerSize div 5 do
begin
if funcPointer ^ = 15878 then
begin
funcBounds := [(funcPointer - 88) ^, (funcPointer - 84) ^, (funcPointer + 28) ^, (funcPointer + 32) ^];
break;
end;
funcPointer := funcPointer - 36;
end;
if funcPointerIndex < funcPointerSize div 5 then
begin
funcPointer := glFonts(funcPointerSize) + (48 * (funcPointerSize - 1));
if funcPointer <> nil then
begin
for funcPointerIndex := 0 to funcPointerSize div 2 do
begin
if pointInBox([(funcPointer + 8) ^, (funcPointer + 12) ^], funcBounds) then
begin
if (result <> '') and (single((funcPointer + 68) ^) - (single((funcPointer + 20) ^) + integer((funcPointer + 40) ^)) <> 1) then
result := ' ' + result;
result := char((funcPointer + 16) ^) + result;
end
else if result <> '' then
break;
funcPointer := funcPointer - 96;
end;
end;
end;
end;
exit(result);
end;

function tChat.getChat(funcFilterTimeStamp: boolean = false): tStringArray;
override;
var
funcBounds: tBox;
funcID: int32;
funcPointer: pointer;
funcPointerIndex, funcPointerSize, funcResultIndex: uInt32 = 0;
funcText: string;
begin
funcPointer := glTextures(funcPointerSize) + (36 * (funcPointerSize - 1));
if funcPointer <> nil then
begin
for funcPointerIndex to funcPointerSize - 1 do
begin
if (funcID := funcPointer ^) = 20400 then
begin
funcBounds := [(funcPointer - 16) ^, (funcPointer - 12) ^, (funcPointer + 28) ^, (funcPointer + 32) ^];
funcPointer := funcPointer - 72;
funcPointerIndex := funcPointerIndex + 1;
end
else if funcID = 24990 then
break
else
funcPointer := funcPointer - 36;
end;
if funcPointerIndex <> funcPointerSize then
begin
funcPointer := glFonts(funcPointerSize) + (48 * (funcPointerSize - 1));
if funcPointer <> nil then
begin
setLength(result, funcPointerSize);
for funcPointerIndex := 0 to funcPointerSize div 2 do
begin
if pointInBox([(funcPointer + 8) ^, (funcPointer + 12) ^], funcBounds) then
begin
if result[funcResultIndex] <> '' then
begin
if 0 + (funcPointer + 12) ^ - (funcPointer + 108) ^ > 10 then
begin
if funcFilterTimeStamp then
result[funcResultIndex] := replaceRegExpr('\[\d{2}:\d{2}:\d{2}\] ?', result[funcResultIndex], '', false);
funcResultIndex := funcResultIndex + 1;
end
else if single((funcPointer + 116) ^) - (single((funcPointer + 20) ^) + integer((funcPointer + 40) ^)) <> 0 then
result[funcResultIndex] := ' ' + result[funcResultIndex];
end;
if (funcPointer + 16) ^ <> 160 then
result[funcResultIndex] := char((funcPointer + 16) ^) + result[funcResultIndex]
else
result[funcResultIndex] := ' ' + result[funcResultIndex];
end
else if result[funcResultIndex] <> '' then
begin
if funcFilterTimeStamp then
result[funcResultIndex] := replaceRegExpr('\[\d{2}:\d{2}:\d{2}\] ?', result[funcResultIndex], '', false);
break;
end;
funcPointer := funcPointer - 96;
end;
setLength(result, funcResultIndex + 1);
result := result.reverse();
end;
end;
end;
exit(result);
end;

Obscurity

2015-06-02 12:24:12

Call chat.getChat() with a tooltip over your chat area. Or get/setOptions with any kind of interface over it.

That's why I use texture IDs.

Ross

2015-06-02 14:19:57

From: Obscurity
Call chat.getChat() with a tooltip over your chat area. Or get/setOptions with any kind of interface over it.

That's why I use texture IDs.


I think that's impossible to do unless click through interfaces is checked in settings, which it shouldn't be. Also I'd prefer chat.getChat() failing due to that error over failing because the right fonts aren't included in the function, since the former can be fixed by moving the mouse whereas the latter can't be fixed at all.

Obscurity

2015-06-02 15:53:32

Simple - support all fonts. Add a case. If someone finds a new one, add it. They're not randomly generated IDs. Things affect them. Like I said, even the environment your in (Ascension and GWD for example) affects models and textures.

It's not impossible. Have your chat on the right side of your mouse and hover your mouse over an inventory item of NPC to the left of it.

Twinki

2015-06-03 00:23:49

Sadly, still getting Access Violation issues :(

[ogLib] Setup initiated.
[ogLib] Setup successful.
Error: Access violation
Execution failed.
The following bitmaps were not freed: [0]

Ross

2015-06-03 00:44:14

From: Twinki
Sadly, still getting Access Violation issues :(

[ogLib] Setup initiated.
[ogLib] Setup successful.
Error: Access violation
Execution failed.
The following bitmaps were not freed: [0]


Keep spamming F9.

Twinki

2015-06-03 01:13:35

From: Ross
Keep spamming F9.


Yup, it'll eventually work.

@Obscurity Also, doing a bit of testing with my quickHop stuff, it doesn't seem glTexture.isVisible is working. Or perhaps i'm just being dumb.




function tQuickHop.getWorlds(): boolean;
Var
i, funcFoundWorld: Integer;
funcWorldBox: tBox;
funcPoint: tPoint;
funcTXA: glTextureArray;
funcFoundWorlds: TIntegerArray;
begin
if(self.getInterface) then
begin
funcTXA := ogl.getTextures(QUICKHOP_STAR_TEXTURE, self.bounds);
for i:=0 to high(funcTXA) do
begin
if(not funcTXA[i].isVisible) then
begin
WriteLn('nupe');
Continue;
end;
funcWorldBox := intToBox(funcTXA[i].bounds.X1, funcTXA[i].bounds.Y1, funcTXA[i].bounds.X2+60, funcTXA[i].bounds.Y2);
funcFoundWorld := ogl.getChars(funcWorldBox).toInteger();
if(self.debug) and (funcFoundWorld>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;
if(not funcFoundWorlds.isEmpty) then
begin
self.worlds := funcFoundWorlds;
exit(true);
end;
end;
end;

I also tried tPoint.isVisible, still nothing.

Obscurity

2015-06-03 09:59:44

Because it doesn't account for texture order yet. It still simply returns false if it appears in the bounds of an interface.

Ross

2015-06-03 11:32:11

The loop in this function was broken. Here's the fixed version, can you put in next commit?

function inventory.clickItem(funcID:array of int32):boolean;overload;
var
funcContinue:boolean;
funcPointer:pointer;
funcIDIndex,
funcPointerIndex,
funcPointerSize:uInt32=0;
funcX,
funcY:int32;
begin
funcPointer:=glTextures(funcPointerSize);
{if funcPointerSize<1 then
exit();}
for funcPointerIndex to funcPointerSize-1 do
begin
if funcPointer^=88625 then
funcContinue:=true
else if funcContinue then
break;
funcPointer:=funcPointer+36;
end;
if funcPointerIndex=funcPointerSize then
exit();
for funcPointerIndex to funcPointerSize-1 do
begin
if funcPointer^=73440 then
break;
for funcIDIndex:=0 to high(funcID) do
begin
if funcPointer^=funcID[funcIDIndex] then
begin
clickMouse(random((funcX:=(funcPointer+12)^)-15,funcX+15),random((funcY:=(funcPointer+16)^)-15,funcY+15),1);
result:=true;
exit(result);
end;
if result then
break;
end;
if result then
break;
funcPointer:=funcPointer+36;
end;
exit(result);
end;

Lucidity

2015-06-20 02:07:48

Noticed there wasn't an option to a mouse.scroll in a tBox, only a tPoint. Found it quite useful to use to zoom the screen out
function tMouse.scroll(funcBox:tBox;funcDirection:string):boolean; overload;
var
funcScroll:int32;
begin
if execRegExpr('^(d(own)?)$',funcDirection) then
funcScroll:=1
else if execRegExpr('^(u(p)?)$',funcDirection) then
funcScroll:=-1;
if funcScroll then
begin
scrollMouse(random(funcBox.x1,funcBox.x2),random(funcBox.y1,funcBox.y2),funcScroll);
result:=true;
end;
end;

Edit :

I've also shortened the radius for clickAction, it was clicking the near outside of the abilities, this will click more inside.

function tActionBar.clickAction(funcID:int32):boolean;
var
funcPointer:pointer;
funcPointerSize:uInt32=0;
funcX,
funcY:int32;
begin
funcPointer:=glTextures(funcPointerSize);
{if funcPointerSize<1 then
exit();}
for 0 to funcPointerSize-1 do
begin
if funcPointer^=9900 then
begin
if (funcPointer+180)^=funcID then
begin
if(funcPointer+288)^<>6443 then
begin
clickMouse(random((funcX:=(funcPointer+12)^)-12,funcX+12),random((funcY:=(funcPointer+13)^)-12,funcY+12),1);
result:=true;
end;
break;
end
else
funcPointer:=funcPointer+360;
end
else if funcPointer^=11475 then
break
else
funcPointer:=funcPointer+36;
end;
exit(result);
end;

Twinki

2015-06-20 08:57:19

@Clarity @Obscurity Haven't seen an update in awhile, any news?

Obscurity

2015-06-20 15:47:26

From: Twinki
@Clarity @Obscurity Haven't seen an update in awhile, any news?


Hi, Twinki.

We've been adding to/fixing ogLib a lot over the past few weeks, but we've had personal projects and other jobs keeping us busy.

I have a few things to check out before I push another update, and after I finish this last job - issues with some production methods, actionBar methods, etc have been brought up that I've gotta look into. :P.

Obscurity

2015-07-21 20:57:19

[RIGHT]:: Automated Message ::[/RIGHT]
All New ActionBar, Fixed Dialogue, Etc


ObscuritySRL updated on Tuesday, July 21, 2015

621 additions, 745 deletions.

Added ogl.debug().

Updated type debug methods to be more consistent and quick.

Added the integer.isBetween() method. It simply returns true if the
integer specified falls between two others.

Added mouse.click(glTexture). This will click a within the bounds of a
specified texture.

Added constants for glChar, glModel, and glTexture sizes. See below for
reasoning.

Completely redid all actionBar methods. While suffering a very slight
drop in performance, the benefit comes with readability. The methods
should be more reliable, resulting in fewer access violations. Also, if
the GL types are updated in the future, actionBar.simba will not require
an update!

Added chat.getAlwaysOnMode() and chat.setAlwaysOnMode(). These retrieve
and set the always on chat modes respectively.

Fix dialogue methods from yet another update. Methods such as
dialogue.getOptions() and dialogue.setOptions() should now work
correctly.


A total of 7 files were affected:



« Download ZIP »





Edit:
I'd like everyone who scripts using ogLib to take glance over actionBar.simba. Compare it to this older actionBar.simba. It's been heavily updated with a new coding style.

What are your opinions? I decided to only update one interface for now before getting your reactions and opinions. Despite the very slight drop in performance - anywhere from 10-300MS every 10K calls, depending on the function - this should make it more update friendly. Changes to the glChar/Texture types will not require an update to actionBar. :).

I'd like to thank @bonsai; for showing me a few tricks (most not yet added - but soon). :).

KeepBotting

2015-07-21 21:33:03

From: Obscurity
Added chat.getAlwaysOnMode() and chat.setAlwaysOnMode(). These retrieve
and set the always on chat modes respectively.


Gah! I've been trying to puzzle out a way to do this with color for the past hour or so… nice work :)

Also @Obscurity; have you read my PM?

Obscurity

2015-07-21 22:16:55

From: KeepBotting
Gah! I've been trying to puzzle out a way to do this with color for the past hour or so… nice work :)

Also @Obscurity; have you read my PM?


Will now. I figured my PMs were from myself auto-PMing updates (as I get the PM also). Lol.