PDA

View Full Version : [OGL Methods] clostest, extractIDs, etc



Obscurity
10-20-2014, 01:50 AM
Before you go further, realize that I will not be hand-holding. If you're too lazy to read up on these function, methods, and procedures, then I'm likely to be too lazy to help. My work is for people who want to learn. People who want to improve. Take time and read through them. Read the descriptions. Read the examples. These are powerful and, if you take the time to learn them, will cut your scripting time in half.

My scripts are designed for RuneScape 3. While most methods and such will work with Legacy, specific functions, such as obsGetPercentHealth(), will not be designed for Legacy. Period.

If you can think of anything that you'd like designed, something that already exists that you'd like to be easier, please post. I like a challenge and odds are I'll get it done.

The Simba file is attached. Examples are included, but commented out.

Method/function/procedure list (items in bold have been added or edited in the last release):
• adjustPosition()
• .closest()
• .closestTo()
• .delete()
• .distanceFrom()
• .extractColourID()
• .extractDimensions()
• .extractHeight()
• .extractID()
• .extractTID()
• .extractWidth()
• .furthest()
• getMousePoint()
• .indexes()
• .isBehindInterface()
• .isEmpty()
• .isInBox()
• .maxIndex()
• .minIndex()
• obsCanThreshold()
• obsCanThreshold()
• obsClickOption()
• obsGetActionBar()
• obsGetAbilityCooldown()
• obsGetAbilityKey()
• obsGetAbilityQue()
• obsGetActionBar()
• obsGetActionKey()
• obsGetActionSlotKey()
• obsGetAbilityColourID()
• obsGetAbilityKey()
• obsGetAdrenaline()
• obsGetAutoRetaliate()
• obsGetCameraAngle()
• obsGetCameraAngleE()
• obsGetChooseOption()
• obsGetCompassAngle()
• obsGetCompassAngleE()
• obsGetLifePoints()
• obsGetInventoryCount()
• obsGetInventoryItem()
• obsGetInventoryFull()
• obsGetInventorySlot()
• obsGetMiniMapBounds()
• obsGetMiniMapMiddle()
• obsGetPrayerPoints()
• obsGetRunEnergy()
• obsGetRunMode()
• obsGetSummoningPoints()
• obsLocalMap()
• obsLocalMapReverse()
• obsMiniMapClickAngle()
• obsSetAutoRetaliate()
• obsSetCameraAngle()
• obsSetChooseOption()
• obsSetCompassAngle()
• obsSetRunMode()
• .randomizePoint()
• .randomizePointEllipse()
• .toPoint()
• .toTPA()
• etc...

obscurityLibraryUpload.Simba:
24907 - Last updated: 2:18PM 01-27-2015

Incurable
10-20-2014, 02:24 AM
I have no idea who will find these useful and for what, but great work regardless. :D

Also, just fyi, [simba] tags enable code highlighting unlike the tags you're currently using. Should make your snippets easier to read. :)

Obscurity
10-21-2014, 03:38 AM
Couple of changes. I was retarded and made a couple errors. Mind you - I wrote the whole thing while offline and didn't test it at all. It's been tested now.

Changes:
• Added toPoint() methods. Odds are, these already exist, but these are to work with my closest() and other methods. For example:
models:=glGetModels(3246121294);
models[0].toPoint().closest(glGetModels([2973247522,4266457693,3167054540,1910331604,384671 3432]));
The above finds models with the ID 3246121294. It then retrieves another list of models and finds the closest to the first 3246121294 result.

I use this in my shitadel bot (I hate the citadel), for example. To find the closest root to the player, that's not the one you're standing beside, I use:
mouse(positionPlayer.closest(arrayOfRoots).toPoint ().closest(arrayOfRoots).randomizePoint(10),1);
First, it gets the closest root to positionPlayer. It then converts that glModel to a tPoint. It then gets the closest root to that point. Obviously my anti-ban is removed from the post for personal reasons. :-P.

• Made the glModel and glTexture methods convert the IDs to cardinals. As you know, integers/IDs, such as 3246121294, that are above 2B become negative. Therefore, things like:
models:=glGetModels([3246121294,2973247522,4266457693,3167054540,191033 1604,3846713432]);
for modelIndex:=0 to length(models)-1 do
writeLN(models[modelIndex]);

writeLN(models.extractID(3246121294));
Report incorrect values.

• Fixed errors in each of the closest(), extractColourID(), and extractID() methods.

• Added obscurityLibrary.Simba as an attachment to the original post.

Clarity
10-21-2014, 03:56 AM
Loving it, will definitely use in what I'm working on now.

Obscurity
10-21-2014, 04:02 AM
A lot more to come. I'll just be uploading them as I use them or as I need them. These methods are incredibly helpful with OGL - if anyone wants examples/samples as to how or why, let me know and I'll write a few up. :).

riwu
10-21-2014, 11:56 AM
Some tips:



function getMousePoint:tPoint;
var
mouseX,
mouseY:integer=0;
begin
getMousePos(result.x,result.y);
end;

You forgot to remove the 2 unused variables ;)

As you might have guessed, there's already a points sorting function in simba:
SortTPAFrom(var a: TPointArray; const From: TPoint)

One of the methods i use for sorting models:

function glModelArray.toMouseClosest(): glModelArray;
var
x, y, i, i2: Integer;
TPA: TPointArray;
begin
if Length(self) = 0 then
Exit;
if Length(self) = 1 then
Exit(self);

GetMousePos(x, y);
TPA:= self.toTPA;
SortTPAFrom(TPA, Point(x, y));
for i:=0 to High(TPA) do
for i2:=i to High(self) do
if TPA[i].equals(Point(self[i2].x, self[i2].y)) then
begin
swap(self[i], self[i2]);
Break;
end;

Result:= self;
end;


For your TPoint.randomizePoint() functions, you could simply specify the randomness in the Mouse() routine (look through all the overloaded Mouse() methods), or better yet use gauss clicking ;)

For retrieving the model/texture with the desired ID sometimes i just use

function glTextureArray.getIndex(ID: Integer): Integer;
var
highSelf, i: Integer;
begin
highSelf := High(self);
for i:= 0 to highSelf do
if self[i].ID = ID then
Exit(i);

Result := -1;
end;

function glTextureArray.contains(ID: Integer): Boolean;
begin
Result := self.getIndex(ID) > -1;
end;

function glModelArray.getIndex(IDs: TIntegerArray): Integer; overload;
var
i: Integer;
begin
for i:=0 to High(self) do
if InIntArray(IDs, self[i].ID) then
Exit(i);

Result := -1;
end;

then call the particular element in the array directly instead of having to assign new arrays.

Obscurity
10-21-2014, 09:29 PM
Cheers for looking through it! As I said, I'm new to Simba and SMART, etc. I've never used it for anything serious, though I've written some wicked PvM bots with it (such as boss hunters [Bandos, Tormented Demons, etc], Slayer, etc).

I appreciate you actually going through and analyzing it (which I gather you did, based on your first tip. :P. I'm not sure of built in functions or anything yet, such as SortTPAFrom(), so I've been writing my own for them. >.<

I'll post when I've made the changes!

EDIT: My main concern is performance. Clarity knows, as he's one of my best friends, that I'm an efficiency freak. Could a custom function/method out-perform things like SortTPAFrom()?

3Garrett3
10-21-2014, 09:41 PM
EDIT: My main concern is performance. Clarity knows, as he's one of my best friends, that I'm an efficiency freak. Could a custom function/method out-perform things like SortTPAFrom()?

I don't wanna get too off topic, but since you're OP and you mentioned it, it's pretty on topic I think.

You're using this for RS right? I've never really understood why people obsessed over efficiency in RS. There are extremely limited cases where you'll have HUGE arrays of data, and the actual limiting factor is almost always how long it takes to click something, or to move somewhere, or an RS animation. I wrote up a timer for my evergreen chopper which timed how long it took to find the tree and click on it. It took roughly 1s from detecting the tree was gone to clicking the new tree. It took ~1s just to move the mouse. The whole find colours, sort TPA, split TPA, sort ATPA, debug ATPA, etc all was in the time it took to write in the debug that the finder was starting and for my eyes to notice it happened.

So sure you might write a better way to sort TPAs, but unless you're clicking blades of grass and have 1TB of TPA data, you're not going to notice any performance issue in RS. I have a script now that runs 10,000s of iterations of data analysis in the blink of an eye, there's probably measurable time to do it, but nothing that effects RS performance at all.

Things like this are best approached with the 80/20 rule. 20% of the effort gets you 80% of the gains. The other 80% of the effort is only to get the final 20% gains. You've got some great code here, don't waste 80% of your time making ms gains in functions that exist when the actual RS time it takes is 2 seconds.

Olly
10-21-2014, 10:16 PM
EDIT: My main concern is performance. Clarity knows, as he's one of my best friends, that I'm an efficiency freak. Could a custom function/method out-perform things like SortTPAFrom()?

For TPA sorting you aren't going to make it faster due to compiled code (Simba's) vs non compiled (Lape).
There are things in Simba that you can outperform in Lape though.



So sure you might write a better way to sort TPAs, but unless you're clicking blades of grass and have 1MB of TPA data,


1MB is equal to a TPA length of 13,000. Not much :p

slacky
10-21-2014, 10:24 PM
EDIT: My main concern is performance. *..snip..*. Could a custom function/method out-perform things like SortTPAFrom()?
SortTPAFrom is efficent, there is close to no way to get any decent speedup there. At best with compiled and highly optimized code you would get it a few percent faster (considering random data). SortTPAFrom is also compiled (to machine code), so any interpreted sorting function (written in lape/simba) which does the same thing will never achieve the same speed.

You should look for bottlenecks elsewhere.


As a side-note:

...
Now, I needed some methods that returned the closest tPoint, glModel, or glTexture to a given tPoint. So:

closest():
...
function tPoint.closest(aOP:tPointArray):tPoint;
var
aOPIndex:cardinal=0;
closestDistance,
distance:extended=2147483647;
begin
for aOPIndex to length(aOP)-1 do
begin
if ((distance:=sqrt(pow(aOP[aOPIndex].x-self.x,2)+pow(aOP[aOPIndex].y-self.y,2)))<closestDistance) and (not (distance=0)) then
begin
closestDistance:=distance;
result:=aOP[aOPIndex];
end;
end;
end;

...


Something like this would likely be around 2x faster then the above.
- Power is an expensive way to compute "x*x", use Sqr(x) or simply write "x*x".
- Sqrt is simply not needed. Squared euclidean is all you need for comparison.

function TPoint.Closest(Arr:TPointArray): TPoint;
var
idx:Int32;
closestDistance, distance: Double;
begin
if Length(Arr) = 0 then Exit();
closestDistance := Sqr(Arr[0].x-self.x) + Sqr(Arr[0].y - self.y);
Result := Arr[0];
for idx:=1 to High(Arr) do
begin
distance := Sqr(Arr[idx].x-self.x) + Sqr(Arr[idx].y - self.y);
if (distance < closestDistance) then
begin
closestDistance := distance;
Result := Arr[idx];
if closestDistance = 0 then Exit();
end;
end;
end;

3Garrett3
10-21-2014, 10:28 PM
1MB is equal to a TPA length of 13,000. Not much :p

Hey I just made up a random number there! I'm sure all of the other wisdom is correct though :p

Obscurity
10-21-2014, 10:48 PM
Is there already a sortGLMAFrom()? Or sortGLTAFrom()? Where they sort a glModelArray or glTextureArray by distance form a tPoint?

Also, is there already a built-in concat()?

Sorry if I'm asking dumb questions - I've always gone with custom functions/methods.

slacky
10-21-2014, 11:00 PM
Is there already a sortGLMAFrom()? Or sortGLTAFrom()? Where they sort a glModelArray or glTextureArray by distance form a tPoint?

Also, is there already a built-in concat()?

Sorry if I'm asking dumb questions - I've always gone with custom functions/methods.
You have yet to define this data-types for us.
If they are equal to TPointArray structure-wise, you can simply cast it to a TPointArray, and sort it using any TPA-sorting function, but I doubt this is the case.
So if not.. then you have to write it your self.

concat? as in combine/merge?
That depends on which datatype we are talking about.. If it's a TPA you could use CombineTPA. For anything else a simple call to SetLength and a call to MemMove is all you need (roughly), or you could use Insert(Arr2, Arr, Length(Arr));.


Also what is up with stacking a bunch of code in to one line for no reason? It only makes it harder to go through.
like, really??:

...
function glTexture.randomizePoint(randomizeByX:integer;rand omizeByY:integer):tPoint;overload;
var
halfRandomizeByX,
halfRandomizeByY:integer;
begin
result:=point(self.x+random((halfRandomizeByX:=cei l(randomizeByX/2))*-1,halfRandomizeByX),self.y+random((halfRandomizeBy Y:=ceil(randomizeByY/2))*-1,halfRandomizeByY));
end;

Why would you do that?

Clarity
10-21-2014, 11:22 PM
You have yet to define this data-types for us.

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

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

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


@Obs, Brandon wrote the original GLX includes so he might know more about whether these functions you're asking about exist.

riwu
10-21-2014, 11:49 PM
No there's definitely no function in simba to sort the ogl records directly.
You have to convert the records to tpa then sort it with SortTPAFrom()
This is what i do:

function glTextureArray.toTPA: TPointArray;
var
i, highGt: Integer;
begin
highGt:= High(Self);
SetLength(Result, highGt + 1);
for i:=0 to highGt do
Result[i]:= Point(Self[i].X, Self[i].Y);
end;

function glTextureArray.toTPA(ID: Integer): TPointArray; overload;
var
i, highGt, c: Integer;
begin
highGt:= High(Self);
SetLength(Result, highGt + 1);
for i:=0 to highGt do
if self[i].ID = ID then
begin
Result[c]:= Point(Self[i].X, Self[i].Y);
Inc(c);
end;

SetLength(Result, c);
end;

function glModelArray.toTPA: TPointArray;
var
i: Integer;
begin
SetLength(Result, Length(self));
for i:=0 to High(Self) do
Result[i]:= Point(Self[i].X, Self[i].Y);
end;

function glModelArray.toTPA(ID: Cardinal): TPointArray; overload;
var
i, highGm, c: Integer;
begin
highGm:= High(Self);
SetLength(Result, highGm + 1);
for i:=0 to highGm do
if self[i].ID = ID then
begin
Result[c]:= Point(Self[i].X, Self[i].Y);
Inc(c);
end;

SetLength(Result, c);
end;

function glModelArray.toTPA(ID: Cardinal; area: TBox): TPointArray; overload;
var
i, c: Integer;
begin
SetLength(Result, Length(self));
for i:=0 to High(Self) do
if (self[i].ID = ID) and PointInBox(Point(self[i].x, self[i].y), area) then
begin
Result[c]:= Point(Self[i].X, Self[i].Y);
Inc(c);
end;

SetLength(Result, c);
end;

All that would take less than 1 ms for most arrays taken from RS.

As you can see i'm an efficiency freak as well (i assign High(self) do a variable first to avoid the for loop having to repeated call it, though afterwards i learnt that lape already does this https://villavu.com/forum/showthread.php?t=110550 so it isnt actually necessary for lape, only for PS)


I don't wanna get too off topic, but since you're OP and you mentioned it, it's pretty on topic I think.

You're using this for RS right? I've never really understood why people obsessed over efficiency in RS. There are extremely limited cases where you'll have HUGE arrays of data, and the actual limiting factor is almost always how long it takes to click something, or to move somewhere, or an RS animation. I wrote up a timer for my evergreen chopper which timed how long it took to find the tree and click on it. It took roughly 1s from detecting the tree was gone to clicking the new tree. It took ~1s just to move the mouse. The whole find colours, sort TPA, split TPA, sort ATPA, debug ATPA, etc all was in the time it took to write in the debug that the finder was starting and for my eyes to notice it happened.

1s! u would laugh if i tell u sometimes i wrote almost double the code just to avoid having to call glGetModel()/glGetTextures() more than once to save about 30ms...

Obscurity
10-22-2014, 12:26 AM
Updated the Simba file again. Not quite finished, but is all I have time for tonight.

After I really like your function glModelArray.toTPA(ID:Cardinal):TPointArray;overlo ad;, riwu. Would you mind if I added it - credited, of course.

riwu
10-22-2014, 12:28 AM
Updated the Simba file again. Not quite finished, but is all I have time for tonight.

After I really like your function glModelArray.toTPA(ID:Cardinal):TPointArray;overlo ad;, riwu. Would you mind if I added it - credited, of course.
Sure np :)

Obscurity
10-24-2014, 07:50 PM
Updated yet again.

Changes:
• Added a number of distanceFrom() methods
• Added randomizePointEllipse(diameter:integer):tPoint;ove rload;
• Added randomizePointEllipse(diameterX:integer;diameterY: integer):tPoint;overload;
• Changed closest() and closestTo(). Neither will return an array, sorted by closest to furthest. Instead, if you wish to find the second/third/etc closest, use:
point(400,300).closest(arrayOfModels,1); //~ Second closest
arrayOfModels.closestTo(point(400,300),2); //~ Third closest
• Fixed issues where empty arrays were passed to methods such as glModelArray.closestTo(tPoint); or tPoint.closest(glTextureArray);


Various other changes. Just look at the examples in the Simba file.

Obscurity
11-15-2014, 10:11 PM
I noticed that GL_MMBounds() was not only out of date, but when updated with new texture IDs it would return incorrect results when the map is tall but skinny (less then roughly 250px wide). The reason for this was the background texture would change when made skinny.

So, I've added obsMiniMapBounds() and obsMiniMapBounds(glTextureArray) which will correctly locate the minimap, regardless of size.

Also added a number of other methods that I needed. Some of which being, isBehindInterface() which will tell you if a point, model, or texture is behind the abilityBar, minimap, inventory, chat, or other basic interfaces. Again, if some already exist, sorry. I know Clarity's already mentioned (and I removed) a few on Skype that already exist.

Edit:
I thought I'd mention... The reason a few of my functions require a glTextureArray or such passed, is because my scripts lately follow the pattern below:
• Retrieve all models and textures
• Build a set of variables based on those
• Perform actions based on the variables

For example, a bare script may look like:
var
modelArray:glModelArray;
textureArray:glTextureArray;
//~ Etc etc etc...

procedure lookForWarpedToroise;
var
closestWarpedTortoise:tPoint;
begin
closestWarpedTortoise:=obsMiniMapMiddle(textureArr ay).closest(YELLOW_DOT_ID); //~ MAIN POINT: I just retrieved textures under 1MS ago... So just reuse textureArray to find the minimap middle
mouse(closestWarpedTortoise.randomizePointEllipse( 10),1);
//~ Etc etc etc...

procedure buildVariables
begin
modelArray:=glGetModels(usefulModels);
textureArray:=glGetTextures(usefulTextures);

isSoulSplitting:=(not textureArray.extractID(SOUL_SPLIT_ID).isEmpty);
//~ Etc etc etc...

procedure mainLoop;
begin
buildVariables;

if (not has30Health) and (not isSoulSplitting) and hasPrayer then
action:=@activateSoulSplit
else if (not has30Health) and (not hasPrayer) and hasSuperRestore then
action:=@drinkSuperRestore
else if (not isOverloaded) then
action:=@drinkOverload
else if (not hasWarpedToroise) then
action:=@lookForWarpedToroise;
//~ Etc etc etc...

I as running bots on a shitty laptop and old video card. Every time glGetModels/Textures was called, it added up and slowed it down drastically (Clarity knows). So, from then on (despite now using a desktop with dual GTX 760s now) I refuse to call them more then I have to.

Clarity
11-15-2014, 10:57 PM
For example, my mainLoop might look like:
buildVariables;

if (not has30Health) and hasPrayer then
action:=@enableSoulSplit
else if (not has30Health) and (not hasPrayer) and hasSuperRestore then
action:=@drinkSuperRestore
else if (not isOverloaded) then
action:=@drinkOverload;
//~ etc...
Rorariipretty much any PvM leak uh oh uh oh.

Obscurity
11-15-2014, 11:13 PM
You would know, my fighters are much more advanced. ;).

riwu
11-15-2014, 11:58 PM
Almost the entire glx include is outdated...last update was 3 months ago.
Even the texture id for compass (which is used for gl_LoggedIn) is outdated, new ID is 147885 (the one in include is 147839)

I've pretty much remade the entire include, removing functions i dont ever use and adding/updating functions like

function glTextureArray.getIndex(ID: Integer): Integer;
var
i: Integer;
begin
for i:= 0 to High(self) do
if self[i].ID = ID then
Exit(i);

Result := -1;
end;

function glTextureArray.contains(ID: Integer): Boolean;
begin
Result := self.getIndex(ID) > -1;
end;

function GL_LoggedIn(gt: glTextureArray): Boolean; overload;
begin
Result:= gt.contains(147885);
end;

Obscurity
11-16-2014, 06:33 AM
Yeah, I've got those added as well. The way I build my useful variables is... I have a file which contains useful IDs similar to:
__glTextureMapArray:=[
3786240,//~ Background
147839,//~ Compass
147885,//~ Compass
237147,//~ Corner
386460,//~ Corner
3570,//~ Dot
1275,//~ Flag
63371 //~ World map
];
__glTextureFiremakingArray:=[
1396788,//~ Choose A Tool title
118575,//~ Elder logs
128520,//~ Log (Add to bonfire)
122910,//~ Magic logs
116280,//~ Maple logs
116280,//~ Yew logs
62985,//~ Baby dragon bones
62985,//~ Big bones
52275,//~ Bones
52275,//~ Burnt bones
84405,//~ Dagannoth bones
84405,//~ Dragon bones
84405,//~ Frost dragon bones
52275,//~ Monkey bones
84405,//~ Our bones
52275,//~ Wolf bones
105570 //~ Wyvern bones
];
//~ Etc etc etc...
...Which I include in most scripts. And then I use:
insert(__glTextureBankArray,usefulTextures);
insert(__glTextureFiremakingArray,usefulTextures);
insert(__glTextureMapArrayusefulTextures);
That way, if an ID changes (like the compass has recently), one edit fixes all my scripts.



Anyhow, another update today - added a furthest() method. Works the same as closest, only backwards. For example:
furthestDot:=obsMiniMapMiddle().furthest(textureAr ray.extractID(3570));
writeLN('The furthest dot from the player is at: ',toStr(furthestDot));
//~ ----------------------------------------
furthestDot:=obsMiniMapMiddle().furthest(textureAr ray.extractID(3570),2);
writeLN('The third furthest dot from the player is at: ',toStr(furthestDot));


Also updated a number of the closest, closestTo, etc to accept a wider range of parameters. I believe previously, closestTo() only accepted TPA.

Obscurity
12-10-2014, 12:20 AM
Another update! All new or edited methods, functions, or procedures have been bolded in the first post.

I realize some of these exist, such as obsGetPercent*(), but mine are strictly OpenGL and do not read text from the screen.

The biggest mention of this update is obsMinimapClickAngle() and obsMakeCompass.

obsMakeCompass() functions much like GL_MakeCompass(). However, I don't think I need to mention why obsMakeCompass() is better then GL_MakeCompass(), but... GL_MakeCompass() presses and holds a directional key over and over, 50MS at a time, until it reaches the desired angle. Need I say more?

obsMinimapClickAngle() is my favorite procedure to date. To describe it, I'll simply copy it's notes from the SIMBA file:
{
========================================
NOTE: The obsMinimapClickAngle
procedures clicked a specified angle on
the minimap. If angleRelative is true,
the specified angle is offset by the
camera's current position.

Angle | Click
0 | North
90 | West
180 | South
270 | East
360 | North

EXAMPLES:
----------------------------------------
writeLN('Walking somewhere south with a 90 degress tolerance...');
obsMinimapClickAngle(180,90);
----------------------------------------
writeLN('Walking somewhere up-left (regardless of current camera angle [angleRelative=false]) with a 45 degress tolerance...');
obsMinimapClickAngle(45,45,false);
========================================
}

The first example from above will click anywhere in the green in the following screenshot. The second is red. Note the compass direction:
http://puu.sh/docYs/928be3afe0.png

It chooses a random point on the angle you provide, and walks your character to that point. it is careful not to click the buttons, such as world map.

.extractColourID() now allows you to specify a colour tolerance.

EDIT: Can I get the title changed to:
[OGL] Methods/Functions/Procedures



Enjoy!

cosmasjdz
12-10-2014, 09:15 AM
Another update! All new or edited methods, functions, or procedures have been bolded in the first post.



Nice stuff!

I was just wondering if for example there is a way to find for example frost dragon bone by open gl texture id if it is covered by for example other player or frost dragon. Or something similar accurately. Since traditional methods in some areas i am working in makes alot of mess especially in crowded ones. Tried to count damage done to get if my drop then count drop position on screen and if it doesnt see it in few seconds then roate screen... finding items covered would defitenely help alot.

Frement
12-10-2014, 09:26 AM
Nice stuff!

I was just wondering if for example there is a way to find for example frost dragon bone by open gl texture id if it is covered by for example other player or frost dragon. Or something similar accurately. Since traditional methods in some areas i am working in makes alot of mess especially in crowded ones. Tried to count damage done to get if my drop then count drop position on screen and if it doesnt see it in few seconds then roate screen... finding items covered would defitenely help alot.

Since the item would still be rendered under the other items, you should be able to find it just fine with the texture id.

Obscurity
12-10-2014, 10:53 PM
It's very easy! I've never been to Frost dragons, but I'll head down there to get some IDs.

Edit:
A snip of code to show how you could go about doing it:
getClientDimensions(clientWdth,clientHeight);
centerPoint:=point(round(clientWidth/2),round(clientHeight/2));

allModels:=glGetModels();
frostDragons:=allModels.extractID(311122604);
frostDragonBones:=allModels.extractID([189892155,3879831768]); //~ Model ID changes on hover.

closestDragonToCenter:=centerPoint.closest(frostDr agons);
closestBonesToCenter:=centerPoint.closest(frostDra gonBones);

closestDragonToMouse:=getMousePoint().closest(fros tDragons);
closestBonesToMouse:=getMousePoint().closest(frost DragonBones);

vClickOption(closestDragonToCenter.randomizePointE llipse(30),['Attack Frost dragon','Attack *Frost dragon']);
vClickOption(closestBonesToMouse.randomizePointEll ipse(15),['Take Frost dragon bones']);

Obscurity
12-14-2014, 10:52 PM
I've noticed that after a while, obsCompassDeg() starts to return the same value regardless of the angle of the minimap. Is anyone else having these issues? After looking into it, I found that it's glxMapCoords() that seems to be getting "stuck". :(.

function obsCompassDeg():integer;
var
angle:extended;
mapX,
mapY:array[0..3] of single;
begin
glxMapCoords(mapX,mapY);
angle:=arcTan2(mapY[3]-mapY[0],mapX[3]-mapX[0]);
if angle>0 then
result:=round(angle*360/(2*pi))
else
result:=round((2*pi+angle)*360/(2*pi));
end;

The angle of the minimap (as seen above) differs from the angle of the 3D world. I would just use gl_compassDeg(), but it can be off by as much as 10 degrees (from what I've seen) because it doesn't at all look at the minimap or the compass. I have functions to walk x-amount of squares in various directions, walk in the direction of various dots, etc, that rely on it being precise.

To fix it, I'd have to close SMART and relaunch the client. Thought it was a bit strange. :/.

Edit: Reverted back to GLX.dll v3.6 to see if it'll work. Guess we'll see. :).
Edit 2: Nope. Might it be from going in and out of a minigame which has a new map so often? I have it always displaying the gl_compassDeg() and my obsCompassDeg(). Eventually, and I don't know why, glxMapCoords() starts to return the correct information again...

Brandon
12-15-2014, 05:36 AM
I've noticed that after a while, obsCompassDeg() starts to return the same value regardless of the angle of the minimap. Is anyone else having these issues? After looking into it, I found that it's glxMapCoords() that seems to be getting "stuck". :(..


I would suggest to stay away from doing the calculations yourself (unless you want to learn how they are actually done)..


{*
Calculates the Euler Angles in Radians from the ModelView Matrix in the specified row
or column major order.

Calculates the pitch, yaw, roll of the game camera.
*}
Procedure glEulerAngles(var X, Y, Z: Double; ModelView: array [0..15] of single; RowMajor: Boolean);
begin
if (RowMajor) then
begin
X := FixRad(ArcTan2(ModelView[6], ModelView[10]));
Y := FixRad(ArcTan2(-ModelView[8], sqrt(pow(ModelView[0], 2) + pow(ModelView[1], 2))));
Z := FixRad(ArcTan2(ModelView[1], ModelView[0]));
end else
begin
X := FixRad(ArcTan2(ModelView[9], ModelView[10]));
Y := FixRad(ArcTan2(-ModelView[8], sqrt(pow(ModelView[0], 2) + pow(ModelView[4], 2))));
Z := FixRad(ArcTan2(ModelView[4], ModelView[0]));
end;
end;

{*
Returns the current compass angle in Degrees and Radians.
NOTE: Uses the COMPASS texture internally.
*}
Procedure GL_CompassAngle(var DA, RA: Single);
var
TL, BL, BR, TR: FloatPoint; //TopLeft, BottomLeft, BottomRight, TopRight of the compass texture.
Begin
If (Not GL_LoggedIn) Then Exit;
GL_GetMapCoords(TL, BL, BR, TR);
RA := FixRad(ArcTan2(TR.Y - TL.Y, TR.X - TL.X));
DA := FixD(Degrees(RA));
End;

{*
Returns the compass angle in degrees.
NOTE: Uses the CAMERA angles internally.
*}
Function GL_CompassDeg: Integer;
var
X, Y, Z: Double;
begin
glEulerAngles(X, Y, Z, GLXMatrices^, True);
Result := Round(Degrees(Z));
end;

Obscurity
12-15-2014, 12:43 PM
Again, you're missing what I need. My functions interact with the actual minimap and depend on the angle of the actual map image. So, for these functions at least, glEulerAngles() and gl_compassDeg() are useless to me because they aren't 100% accurate to the minimap - like gl_compassAngle() is. But even gl_compassAngle() uses glxMapCoords(), which is what ends up getting stuck - just returning the same position even if it changes. It fixes after some time, but I'm unsure as to what causes it because I don't have time to watch it for two hours at a time. I know how to do basic trig to get the angle of the minimap from the two top points.

I've sent my scripts to some friends and asked them if it's also doing it to them. Still waiting on a reply. It may only be my computer, who knows. Just curious as to what could be causing it.

Brandon
12-15-2014, 05:51 PM
Again, you're missing what I need. My functions interact with the actual minimap and depend on the angle of the actual map image. So, for these functions at least, glEulerAngles() and gl_compassDeg() are useless to me because they aren't 100% accurate to the minimap - like gl_compassAngle() is. But even gl_compassAngle() uses glxMapCoords(), which is what ends up getting stuck - just returning the same position even if it changes.


I don't think I missed any points..

glEulerAngles was designed to get the exact camera angle (down to 15 decimal places) from the game (same angle displayed by your compass AND map).

At max height, it seems to always have the compass angle correct afaik.. At the lowest height, the angles are flipped. It is actually supposed to be the same accuracy as the map because the map is actually applied the same matrix transformation.

The only reason the map is more "reliable" (not accurate) is because it works at any camera height. I wasn't able to figure out the relationship between the angles and the height for glCompassAngle (which sometimes throws the angle off by a 1-5 degrees).. TOO MUCH math involved.



CompassHeight (Max - 65.053 deg from floor):
CompassDeg (X, Y, Z):

0deg: 65.0537253622628 358.814165052872 1.07537657735905
90deg: 89.260411234006 312.03851248133 88.2931485771235
180deg: 115.286564608444 358.615368311296 178.747763300624
270deg: 90.1881102037367 47.9243745800853 269.562655218025


CompassHeight (Mid - 25.708 deg from floor):
CompassDeg (X, Y, Z):

0deg 25.708402243652 358.813011089521 0.514896232340037
90deg 93.5895140640883 284.592436159732 93.7173202476157
180deg 154.90307702799 358.704081833244 179.450348465341
270deg 90.8989343453904 67.1392468241707 269.008672761468



CompassHeight (Low - 13.762 deg from floor):
CompassDeg (X, Y, Z):

0deg: 13.7624148875505 1.69169652884413 359.597596807979
90deg: 77.9527238194348 283.654247204305 77.5930785465022
180deg: 166.486754945655 355.694293448629 178.99462624173
270deg: 87.8507577921787 77.1021010565408 272.207848194156



Notice that the more you rotate it, the angles are swapped at nodes or troughs on the sin/cos graphs.

I didn't figure out the relationship but other than the height, the angles are usually 100% correct and the exact same as that of the map (since the same transformations are applied to the map)..


Hence why I suggested using that instead. I forget that the height affects the angle and assumed that your script ran at max height throughout its lifetime.

However, describe what you mean by "STUCK".. Is it frozen? Does it freeze the script? Or does it just display the wrong angles because I can't replicate either one..


MessageBox = What the plugin is sending to Simba.
1: http://i.imgur.com/55f0PfM.png
2: http://i.imgur.com/xmFMwRo.png

What Simba received:
3: http://i.imgur.com/F6IKvOC.png


I've ran around RS and changed angles and every time.. it's correct (not "stuck").. What plugin version are you using? 3.7 doesn't have any problems.

A work around or backup would be to grab the "Compass Texture" and apply the same calculations as is applied to the map/map coords.

Obscurity
12-15-2014, 08:30 PM
It doesn't freeze the script, no. It will run fine for a good half hour or so, returning the correct values. Then, all of a sudden, it's as if it doesn't notice that the map is being rotated or moved. The script continues to run, but the arrays of 4 singles used for TL, BL, BR, TR don't change despite it being rotated. It tends to happen when going in and out of things like Pest Control.

It's strange behavior - I can't think of a cause for it. What makes it even more strange is that it ends up fixing itself like 15-30 minutes later.

The way I know it fixed itself is I ended up using gl_compassDeg() for the script while debugging glxMapCoords().

I tried using 3.7 and 3.6.



While I have you here, can you perhaps explain how to use your compass height functions? I didn't have much time to dive too far into them, but I noticed that rotating the map left and right would affect the value returned by gl_compassHeightDeg() by as much as 97 degrees. Am I misunderstanding the purpose of the function? Sorry. :P.

Edit: As for your work-around, how do I get the TL, BL, BR, TR of a texture? All I've been using is glGetTextures() which seems to only give the bounding area of the texture. Again, sorry, but I've not dealt with Simba/SMART/your GLX plugin.

Brandon
12-15-2014, 09:44 PM
The way I know it fixed itself is I ended up using gl_compassDeg() for the script while debugging glxMapCoords().
I tried using 3.7 and 3.6.


I guess you can't use the regular textures because their bounding box isn't registered. I only hooked their vertices and their sizes and calculated the TBox using that. Some textures are rendered specially like the Map (float coords vs. integer coords). The compass used to be "int coords" but it's probably float coords now and since only the map hook uses float coords, the compass texture won't show up. So my work around is a failure.


-----------------

Well that's weird indeed. It should never do return bad values so long as the map is being rendered (and you are using BOTH: https://github.com/Brandon-T/GLX/releases/tag/3.7 .dll's from there).. If it cannot find the map for some reason OR it finds the map but the ID isn't what it expects, it will fail.. That's the only time it would ever fail and I've never seen that before..

EDIT:

I just replicated it.. Give me a second to see what's causing it.

Obscurity
12-15-2014, 10:51 PM
Well, I figured out what fixes it - loading a new map. For example, if it's stuck and a PC game starts, it fixes. Or if it's stuck and the game ends, it also seems to fix.

How do I go about printing the pixels, image and bind? I'll get that to you as soon as I can. I wish I'd catch it as it happens... Because if I saw that it happens as soon as the game starts or ends, then I could say it's caused sometime during loading a new map.

Unrelated, if you'd like to include my obsMakeCompass() (name it gl_makeCompass() if you want) in your miniMap.simba, feel free:
{
========================================
NOTE: The obsMakeCompass function moves
the camera to a desired angle with a
given tolerance. The angle can also be
a string: North, North-West, etc. This
string is not case-sensitive and can use
a space rather then a hyphen. If the
camera sucecssfully reaches the desired
angle by the timeOut, the function
returns true.

Angle | Facing
0 | North
90 | West
180 | South
270 | East
360 | North

EXAMPLES:
----------------------------------------
writeLN('Randomly rotating the camera south-east...'));
obsMakeCompass(225);
----------------------------------------
writeLN('Randomly rotating the camera south-west...'));
obsMakeCompass('south-west');
----------------------------------------
writeLN('Randomly rotating the camera...'));
obsMakeCompass();
----------------------------------------
writeLN('Randomly rotating the camera anywhere east...'));
obsMakeCompass('east',180);
========================================
}

function obsMakeCompass(desiredAngle:single=random(360);com passTolerance:integer=45;timeOut:integer=random(50 00,10000)):boolean;
var
angleDistance,
currentAngle:single;
leftIsDown,
rightIsDown:boolean;
timeStart:integer;
begin
timeOut:=getSystemTime+timeOut;
timeStart:=getSystemTime;
angleDistance:=shortestArcDeg(gl_compassDeg(),desi redAngle);
while (abs(angleDistance:=shortestArcDeg(gl_compassDeg() ,desiredAngle))>compassTolerance) and (getSystemTime<timeOut) do
begin
leftIsDown:=isKeyDown(37);
rightIsDown:=isKeyDown(39);
if (angleDistance<0) then
begin
if rightIsDown then
begin
keyUp(39);
if (not leftIsDown) then
wait(random(250));
end;
if (not leftIsDown) then
keyDown(37);
end
else
begin
if leftIsDown then
begin
keyUp(37);
if (not rightIsDown) then
wait(random(250));
end;
if (not rightIsDown) then
keyDown(39);
end;
end;
if isKeyDown(37) then
keyUp(37);
if isKeyDown(39) then
keyUp(39);
result:=abs(angleDistance:=shortestArcDeg(gl_compa ssDeg(),desiredAngle))<=compassTolerance;
end;

function obsMakeCompass(desiredAngleString:ansiString;compa ssTolerance:integer=10;timeOut:integer=random(5000 ,10000)):boolean;overload;
var
angleDistance,
currentAngle,
desiredAngle:single;
leftIsDown,
rightIsDown:boolean;
timeStart:integer;
begin
desiredAngleString:=replace(lowerCase(desiredAngle String),' ','-',[0,1]);
case desiredAngleString of
'north':desiredAngle:=0;
'north-west':desiredAngle:=45;
'west':desiredAngle:=90;
'south-west':desiredAngle:=135;
'south':desiredAngle:=180;
'south-east':desiredAngle:=225;
'east':desiredAngle:=270;
'north-east':desiredAngle:=315;
end;
timeOut:=getSystemTime+timeOut;
timeStart:=getSystemTime;
angleDistance:=shortestArcDeg(gl_compassDeg(),desi redAngle);
while (abs(angleDistance:=shortestArcDeg(gl_compassDeg() ,desiredAngle))>compassTolerance) and (getSystemTime<timeOut) do
begin
leftIsDown:=isKeyDown(37);
rightIsDown:=isKeyDown(39);
if (angleDistance<0) then
begin
if rightIsDown then
begin
keyUp(39);
if (not leftIsDown) then
wait(random(250));
end;
if (not leftIsDown) then
keyDown(37);
end
else
begin
if leftIsDown then
begin
keyUp(37);
if (not rightIsDown) then
wait(random(250));
end;
if (not rightIsDown) then
keyDown(39);
end;
end;
if isKeyDown(37) then
keyUp(37);
if isKeyDown(39) then
keyUp(39);
result:=abs(angleDistance:=shortestArcDeg(gl_compa ssDeg(),desiredAngle))<=compassTolerance;
end;
Just thought I'd offer. :P. If it passes the desired angle for any reason, it'll change direction keys. The main difference is that it holds the keys, rather then press for ~50MS until it reaches.

Brandon
12-15-2014, 11:55 PM
Well, I figured out what fixes it.

There's nothing that fixes it in Simba.. I was an idiot and assumed that the map was the only thing rendered with GL_UNPACK_ROW_LENGTH set to 512.. But it's not (it used to be)..

It turns out they unpack the chatbox with 512 bytes all at once (so it mistook the chatbox id for the map id and since the chatbox disappears, voila.. no more map angles).. I patched the map hook but I also added a new hook (no changes to anyone's code required)..

The new hook is for animated textures as I described above.. You should now be able to glGetTexture on the "compass needle", "high alchemy flames", "login cursor", and anything that uses textures.. As of this post, the compass is: `glGetTextures(37222, 657159, 7);` w: 51, h:51. You can calculate its angles with all the givens (though, you shouldn't need to anymore).

Release: https://github.com/Brandon-T/GLX/releases/tag/3.7
Code: https://github.com/Brandon-T/GLX/commit/147c8d6be66d8469528446aa3c40d93b9e9049fa

It's still v3.7 as it was just a patch and a simple hook.


Hopefully I didn't break anything in the process (let me know if I did and if the angles are updated when the map rotates)..

I doubt you need the help with math but just in case:

{*
Calculates the compass angle based on the compass texture(not the map [similar, if not the same, result]).
PI / 4 is the angle of the diagonal at rest state (angle 0 or 360).

Returns -1 upon failure (because 0 <= angle_success < 360 || 0 <= angle_success < 2PI)..
*}
Procedure gl_CompassNeedleAngle(var DA, RA: Single);
var
tex: glTextureArray;
begin
RA := -1;
DA := -1;
tex := glGetTextures(37222, 657159, 10);
if (length(tex) > 0) then
begin
RA := FixRad(ArcTan2(tex[0].Bounds.Y2 - tex[0].Bounds.Y1, tex[0].Bounds.X2 - tex[0].Bounds.X1) - (PI / 4));
DA := FixD(Degrees(RA));
end;
end;

Obscurity
12-16-2014, 12:23 AM
Awesome, Brandon, thanks! I will certainly let you know!

Edit: So far so good! It's working great. If it does happen again, I'll let you know, but it'd usually have happened by now. The biggest angle difference I've seen so far between the minimap and the needle texture it 2 degrees, which is great!

Also good news with the animated textures. I was looking for the texture for qued abilities (spinner). I just went with the circle-shaped background instead. :P.

Thanks again, mate!

Edit 2: Another great thing about the animated textures... It now includes cooldown textures, making it possible to determine if an ability is ready. ;).

Obscurity
12-19-2014, 10:26 PM
Another update!

Changes listed below...

The most notable change is obsAbilityIsOnCooldown(). After Brandon updated the OpenGL plugin to include animated textures (https://github.com/Brandon-T/GLX/releases/tag/3.7), cooldowns can now be detected. The function ignores spaces and is not case sensitive. Therefore, any of the following are valid:
isOnCooldown:=obsAbilityIsOnCooldown('rApIdFiRe');
isOnCooldown:=obsAbilityIsOnCooldown('guthix''s blessing');

The ability must be visible - either on your ability bar or powers window.

Another set of big updates are the minimap functions and methods: obsLocalMap(), .obsLocalMap(), and obsLocalMapReverse(). Simply calling obsLocalMap() will give your player's location on the currently loaded minimap, regardless of camera angle. The method, .obsLocalMap(), will return the position of any point or texture on the currently loaded minimap. So, for example:
dotArray:=glGetTextures(3570);
dotPosition:=glGetTextures()[0];
playerPosition:=obsLocalMap();
if playerPosition.x<dotPosition.x then
writeLN('dotArray[0] is west of your player.');
if playerPosition.y<dotPosition.y then
writeLN('dotArray[0] is south of your player.');

Similar to the obsLocalMap() function and method, the obsLocalMapReverse() function allows you to specify a point on the minimap and get it's position on screen. So, if you knew a tree spawns on the 20th,45th tile of the minimap, you would find the area to click with:
obsLocalMapReverse(point(20,45),true);

The true converts the X,Y to squares in the 3D world. Every square east you walk, for example, your minimap position changes by +4px. The true simpy divides the X,Y by 4.

Another change was to the obsMiniMapClickAngle() and obsMakeCompass() functions/procedures. You can now specify a string direction. For this, I'll simply copy the notes in the SIMBA file for obsMiniMapClickAngle():
{
========================================
NOTE: The obsMinimapClickAngle
procedures clicked a specified angle on
the minimap. If angleRelative is true,
the specified angle is offset by the
camera's current position.

Angle | Click
0 | North
45 | North-West
90 | West
135 | South-West
180 | South
225 | South-East
270 | East
315 | North-East
360 | North

EXAMPLES:
----------------------------------------
writeLN('Walking somewhere south with a 90 degress tolerance...');
obsMinimapClickAngle(180,90);
----------------------------------------
writeLN('Walking somewhere up-left (regardless of current camera angle) with a 45 degress tolerance...');
obsMinimapClickAngle(45,457,false);
----------------------------------------
writeLN('Walking somewhere north-east...');
obsMinimapClickAngle('NoRtH-EaSt');
----------------------------------------
writeLN('Walking somewhere north-east with a 90 degree tolerance...');
obsMinimapClickAngle('south west',90);
========================================
}

The obsCompassDeg() function has an optional useNeedle parameter. If set to true, it'll use the angle of the needle texture. If false, it'll use the angle of the actual map image. As you can see above, these won't be off by much.

As always, any other added or updated function, method, or procedure is bolded in the original post.

Obscurity
12-21-2014, 12:58 AM
Sorry... Fixed a few errors with my last update. Had a few typos in the script. Also added obsAbilityIsQued(). Redownload from the original post.

Clarity
12-21-2014, 03:10 AM
3Garrett3 Ross serajin

Ross
12-21-2014, 03:16 AM
3Garrett3 Ross serajin

Hi!

Obscurity
12-21-2014, 05:54 AM
Sorry again... Haha. A bit of free time today, so adding functions as I think of them. Updated the attachment with obsGetAbilityKey(), obsGetAbilityBarNumber(), and obsGetAbilityBarNumberString().

They're self explanatory, but just in-case, I'll copy the notes from the SIMBA file:
{
========================================
NOTE: The obsGetAbilityKey functions
return the key required to activate the
desired ability via the actionbar.

EXAMPLES:
----------------------------------------
abilityBarKey:=obsGetAbilityKey('rApIdFiRe');
if abilityBarKey<>'' then
sendKeys(abilityBarKey,60+random(60),60+random(60) );
========================================
}
{
========================================
NOTE: The obsGetAbilityBarNumber and
obsGetAbilityBarNumberString functions
return the current ability bar number as
an integer or string, respectively.

EXAMPLES:
----------------------------------------
abilityBarNumber:=obsGetAbilityBarNumber();
if abilityBarNumber<>4 then
writeLN('Switching to abilitybar 4...');
========================================
}

Also edited the way the other ability functions work.


Cheers.

serajin
12-22-2014, 02:22 PM
3Garrett3 Ross serajin

You rang?

3Garrett3
12-22-2014, 08:49 PM
3Garrett3 Ross serajin

Yes?

Obscurity
01-14-2015, 12:49 AM
Several big updates. All added or edited items have been bolded in the first post. I'm just going to copy the notes and descriptions for the added items from the Simba file.

You'll notice that some are similar to ones provided in the standard GLX includes. Let me explain.

GL_InvCount will detect any non-background texture over the inventory as an item. Therefore, things like right click menus, monster health bars, etc would give false counts. The obs functions narrow the search further and give accurate results.

obsClickOption is very similar to its GLX counterpart. However, its GLX equivalent failed to hide the menu under certain circumstances. These being if the menu took the entire height of the client or if the right click was too close to the top or bottom of the client, that moving it slightly upwards would fail to hide it. obsClickOption uses a unique method for hiding the menu. Think about it like drawing a tic-tac-toe type grid around the menu and moving the mouse to an available square. The click area on the menu, with GLX, didn't account for the full menu, only the bounds of the word(s) supplied.

The GL_CompassHeightDeg... IDK. This function would return incorrect values if the camera wasn't facing 100% north. obsCompassHeight correctly returns the camera height in angles. The following image best describes it:
http://puu.sh/etVVt/09c26b779a.png


{
========================================
NOTE: The obsActionBarKey function
returns which key is required to
activate the specified action.

EXAMPLES:
----------------------------------------
keyToPress:=obsActionBarKey(3);
writeLN('To activate the fourth ability, press '+keyToPress);
========================================
}

{
========================================
NOTE: The obsActionBarActionKey function
returns which key is required to
activate the specified action, given a
texture ID and/or colourID.

EXAMPLES:
----------------------------------------
keyToPress:=obsActionBarActionKey(126225);
writeLN('To break the teleport tab, press '+keyToPress);
========================================
}

{
========================================
NOTE: The obsClickOption function right
clicks a specific point and searches for
the desired menu item. If no match is
found, it'll thyen hide the menu.

EXAMPLES:
----------------------------------------
keyToPress:=obsActionBarActionKey(126225);
writeLN('To break the teleport tab, press '+keyToPress);
========================================
}

{
========================================
NOTE: The obsCompassHeight and
obsCompassHeightE functions return the
micurrent angle of the camera. This is a
value from 0 to 90. Keep in mind that in
most cases, the camera can not exceed 52
and can not reach 0.

EXAMPLES:
----------------------------------------
cameraAngle:=obsCompassHeight();
writeLN('The camera is currently at '+toStr(cameraAngle)+' degrees.');
========================================
}

{
========================================
NOTE: The obsGetAbilityColourID function
returns an ability's colour ID, given
it's name. It was written to be used by
functions within the obscurityLibrary
and is not recommended elsewhere.

EXAMPLES:
----------------------------------------
colourID:=obsGetAbilityColourID('rApIdFiRe');
abilityTexture:=glGetTextures(137700,colourID,2);
========================================
}

{
========================================
NOTE: The obsInventoryCount function
returns the total number of items being
carried by the player.

EXAMPLES:
----------------------------------------
carriedItems:=obsInventoryCount();
writeLN('The player is carrying '+toStr(carriedItems)+' items.');
========================================
}

{
========================================
NOTE: The obsInventoryFindItem functions
returns a glTextureArray of inventory
items matching the specified ID(s) and
colourID(s).

EXAMPLES:
----------------------------------------
itemList:=obsInventoryFindItem(92055);
if (not itemList.isEmpty()) then
begin
writeLN('Clicking the 1st found item...');
mouse(itemList[0].toPoint(),1);
end;
========================================
}

{
========================================
NOTE: The obsInventoryFull function
returns whether or not the player's
inventory is currently carrying 28
items.

EXAMPLES:
----------------------------------------
inventoryIsFull:=obsInventoryFull();
if inventoryIsFull then
writeLN('The player currently has a full inventory.');
========================================
}

{
========================================
NOTE: The obsInventoryItem function
returns the glTexture of the item
occupying the specified inventory slot.
Keep in mind that inventory items go
from 0 to 27.

EXAMPLES:
----------------------------------------
item3:=obsInventoryItem(3);
if item3.id=92055 then
writeLN('The item in the fourth slot is a flask.');
========================================
}

{
========================================
NOTE: The obsMakeCompassHeight function
moves the camera to a desired height
with a given tolerance. If the camera
sucecssfully reaches the desired height
by the timeOut, the function returns
true.

EXAMPLES:
----------------------------------------
writeLN('Raisijng the camera to 45 degrees...'));
obsMakeCompassHeight(45);
----------------------------------------
writeLN('Lowering the camera to 15 degrees...'));
obsMakeCompassHeight(15);
----------------------------------------
writeLN('Randomly positioning the camera...'));
obsMakeCompassHeight();
========================================
}

The Mayor
01-14-2015, 01:32 AM
Obscurity; what's the latest with the fps issues when using OGL, especially when you interact with multiple areas?

Obscurity
01-14-2015, 02:24 AM
http://puu.sh/eulh1/f1047629c0.png
When I was using my old 7870s, my FPS would slowly drop from ~30 down to less then 5. I had similar issues on my laptop. Both AMD cards. I've upgraded and now remain around 30 with SMART in OpenGL. Though, in the JagexLauncher, I'm always maxed.

Clarity
01-14-2015, 04:08 AM
Although personally since recent plugin updates I've never experienced the FPS issues. Most prior FPS issues were due to bad scripting style/memory management anyway.

Obscurity
01-18-2015, 05:26 AM
Not a major update in terms of new functions. However, I've renamed a few for consistency.

New functions include things like:
• obsGetAutoRetaliate()
• obsGetRunEnergy()
• obsGetRunMode()
• obsSetAutoRetaliate()
• obsSetRunMode()
Etc.

A few methods have also been expanded to work with other data types, such as .extractID() and extractColourID() working with glCharArrays.

Obscurity
01-19-2015, 02:55 PM
A heads up... I started on my first public release last night. I have dozens of private scripts that I write for friends, but this will be a public OGL obsLividFarm. :-). Built entirely from I obscurityLibraryUpload, you'll see it tonight!

uhit
01-19-2015, 03:04 PM
A heads up... I started on my first public release last night. I have dozens of private scripts that I write for friends, but this will be a public OGL obsLividFarm. :-). Built entirely from I obscurityLibraryUpload, you'll see it tonight!

Oh god, the hype <3

Obscurity
01-20-2015, 03:42 AM
Had to rewrite a lot of methods, such as .isBehindInterface(), because textures not visible apparently now cover the screen. So, my obsLividFarm will be delayed a day...

However! Here's a teaser:

https://www.youtube.com/watch?v=pahazEyo3yE&feature=youtu.be

uhit
01-20-2015, 05:10 PM
Had to rewrite a lot of methods, such as .isBehindInterface(), because textures not visible apparently now cover the screen. So, my obsLividFarm will be delayed a day...

However! Here's a teaser:

https://www.youtube.com/watch?v=pahazEyo3yE&feature=youtu.be

Looks very juicy <3

Can we get an ETA on a OGL tutorial, or is that classified information ;)

Clarity
01-20-2015, 05:13 PM
Looks very juicy <3

Can we get an ETA on a OGL tutorial, or is that classified information ;)

Not really, lol. I finished the first draft this morning. Expecting that Obscurity will have stuff to add before it gets posted though.

Obscurity
01-20-2015, 05:23 PM
Yessir! Though, I might be at work until late - so Skype it to me and I'll TeamViewer my PC if I have to view it. Might clock out after 8, we'll see. :-P.

Obscurity
01-21-2015, 01:37 AM
Small update. Since Jagex's release of the clock, .isBehindInterface() has been acting all strange. For some reason, textures usually used for interface backgrounds are spanning across various areas of the client - though not visible. This makes the method think a point, texture, or model is behind an interface when it actually isn't.

So, I had to take a different approach, other then checking if the point was behind a background texture...

Now, it grabs all top corner textures. It then correctly groups them into pairs, matching the top-left to the top-right. It then looks for all bottom corner textures. It, again, correctly pairs them together and then partners them with the corresponding top corners. From here it's a simple .isInBox().

That said, sorry if the methods have been faulty since last Monday.

Apart from that, a few things have been added so that I can make my obsLividFarm public. :).

kingarabian
01-21-2015, 06:31 AM
OSRS does not have OGL capability right?

Harrier
01-21-2015, 07:14 AM
OSRS does not have OGL capability right?
No, but then resizeable comes out it might.

Olly
01-21-2015, 08:08 AM
No, but then resizeable comes out it might.

They're doing that? interesting...

kingarabian
01-21-2015, 08:17 AM
They're doing that? interesting...

Yeah along with 08 graphics. Gonna be up for polling this year I think.


No, but then resizeable comes out it might.

Thanks for the clarification :).

Harrier
01-21-2015, 10:28 AM
They're doing that? interesting...
Yup, since osrs is tiny when on a 4k monitor atm.

Please note, I'm assuming they are using opengl for it since they've been devving it for 5-6 months.

Obscurity
01-22-2015, 01:33 AM
Added .extractTID().

KeepBotting
01-22-2015, 02:37 AM
Obscurity, thanks to you, OpenGL has blown up around here lately :) I plan to try my hand at scripting with obscurityLibrary after the aforementioned OpenGL tutorial is written.

Obscurity
01-22-2015, 05:31 PM
Awesome! It has some great potential and I look forward to what people can come up with!

Though, I'd thank Clarity before myself; This library was very much built around his needs and requests. :-P. He's also the one to get me hooked on it. Lol.

As always, if there's anything anyone needs or wants added to it, run it by me. I've only added what we've needed so far, but we're just two people. :-).

Obscurity
01-23-2015, 01:37 AM
Added obsGetChooseOption() and obsSetChooseOption(). The explanations are below:
{
========================================
NOTE: The obsGetChooseOption function
returns a string array of available
option selections. For example, an
option while speaking to a banker is,
"I'd like to check my PIN settings."
Results are lowercase with spaces and
special characters removed.

EXAMPLES:
----------------------------------------
availableOptions:=obsGetChooseOption();
writeLN('The available options are:');
writeLN(availableOptions);
========================================
}
{
========================================
NOTE: The obsSetChooseOption function
selects an option, if it exists, by
either pressing the relative button or
clicking it. Options are not case
sensitive and special characters will
be ignored.

EXAMPLES:
----------------------------------------
availableOptions:=obsGetChooseOption();
if availableOptions.contains('seeyouaround') then
obsSetChooseOption('SeE yOu ArOuNd!@#$');
========================================
}

The options these are referring to are...
http://puu.sh/eTvaZ/ecf94c9ee1.png

An example usage could be encouraging Pauline in just two lines!
if obsClickOption(pointPauline,'Encourage Drained Pauline Polaris') then
obsSetChooseOption(['Come on, youre doing so well.','Extraordinary!','Keep going! We can do this!','Lokar will really appreciate this.','Look at all the produce being made.','Youre doing a fantastic job.']);
...since obsClickOption returns true if the right click option was found and clicked. Therefore, Pauline was, indeed, drained, as her right click otherwise excludes that word.

Obscurity
01-27-2015, 07:22 PM
Because of strange behaviours with textures being duped and drawn in odd places at odd sizes (see here (https://villavu.com/forum/showthread.php?t=104932&page=7&p=1327180#post1327180)), .extractDimensions(), .extractHeight(), and .extractWidth() have been added. For now, they only accept integers, but I plan on making something like .extractWidth('<25') an option.

Patriq
01-28-2015, 09:54 PM
Cant wait to use this :D When is that tutorial coming?

Obscurity
01-29-2015, 02:48 AM
Not sure, TBH. My schedule hasn't exactly aligned with Clarity's yet. We'll likely get in contact by the end of this weekend, I'd hope. Will prod him about it. :).

Patriq
01-29-2015, 09:24 AM
Thank you very much!

Obscurity
01-31-2015, 02:34 AM
I'm going to apologize in advance for this post... Lol. With some upcoming changes to plugins/etc, I've decided it's time to optimize the obscurityLibraryUpload.

What does this mean to you? Well, I've always focused on usability. I wanted my functions and things to be as easy to use as possible. This won't change. However, a number of methods will be changed. For example, glModelArray.closestTo(glModel) and all of its overloads will no longer return a single tPoint. It'll return a tPointArray, sorted by distance from glModel. This, of course, is only one example. Sorry!

I also wanted the library to be easy to read. This sacrificed performance. This is no longer a sacrifice I'm willing to make. The obscurityLibraryUpload is to help you use the OpenGL plugins. It doesn't have to be pretty, but if it's not the absolute fastest it can be then it'll render the upcoming changes to the plugin pointless. If your curious how to do something in OpenGL, perhaps something that the library does, I'm sure you'll be able to find it in our tutorial.

Now that you know that you've got some updating to do to your scripts, here's some good news. I've been making great progress in adding new functions, methods, and procedures that I'm excited to release. Things like realistic camera movement. Currently, I've only released obsSetCameraAngle() and obsSetCompassAngle(); You can only move either horizontal or vertical. obsSetView(compassAngle,cameraAngle) changes that! On top of that, the existing functionality will be much faster. The size of the library will also be much smaller.



Anyways, you can expect to see these changes this weekend! :).

Patriq
01-31-2015, 03:53 AM
Gratz on the SRL Member! :D
By the way how can we debug model ids? I really want to give OpenGL a try, cant expect for the tutorial to come out! :D

Obscurity
01-31-2015, 04:18 AM
Thanks! :D.

After you load SMART, use:
vDebug('M'); //~ Models
vDebug('N'); //~ None
vDebug('T'); //~ Textures

Only one can be used at a time. Or, if you prefer, you can use glDebug().

Clarity
01-31-2015, 06:02 AM
That members though.
Now don't let the community down.

NKN
01-31-2015, 06:03 AM
That members though.
Now don't let the community down.

He'll be like the other 20 auto-members, afk for the rest of his life.

Patriq
01-31-2015, 01:16 PM
He'll be like the other 20 auto-members, afk for the rest of his life.

Please dont! I find being a member a big responsibility. Please don't let us down! :D

Patriq
01-31-2015, 02:32 PM
Thanks! :D.

After you load SMART, use:
vDebug('M'); //~ Models
vDebug('N'); //~ None
vDebug('T'); //~ Textures

Only one can be used at a time. Or, if you prefer, you can use glDebug().

Dont I need DemiseGLZ.simba to do that? Where can I find it?

Obscurity
01-31-2015, 07:31 PM
vDebug() is DemizeGLZ, yes. But it simply calls glDebug() from GLXCore:

procedure VDebug(S: String);
begin
case S of
'N': glDebug(GL_MODE_NONE, 0, 0, 0, 0, 0, 0, 1350, 670);
'T': glDebug(GL_MODE_TEXTURES, 0, 0, 0, 0, 0, 0, 1350, 670);
'M': glDebug(GL_MODE_MODELS, 0, 0, 0, 0, 0, 0, 1350, 670);
end;
end;

Patriq
01-31-2015, 08:35 PM
But where can I find DemizeGLZ? Cant seem to find it anywhere!

Obscurity
01-31-2015, 08:49 PM
I'll have to prod Clarity. He sent it to me months ago. I don't believe we use it for much, though. We're in the process of fading it out.

Clarity, do you still have the download link for Demize?

Obscurity
02-08-2015, 06:30 AM
Thought I'd update everyone, since I'm constantly asked in PM and on Skype...

Firstly, the tutorial. Clarity and I have been hard at work on this. We were going to release it before this weekend, but ran into some unexpected changes. See below.

The obscurityLibrary will not exist shortly. I'm getting rid of it. Instead, and I'm sure Brandon won't mind, I'm redesigning it and the OpenGL includes (fazing out the DemiseGL). As he mentioned in his post in the OpenGL Plugin thread, it's old and needs updating. That way, we'll hopefully take a load off him and Clarity and I will be happy to handle the includes.

That said, OpenGL will be formatted very similar to SRL. Take the following example:
actionBar.getCurrentBar(); //~ OGL
TRSActionBar.getCurrentBar(); //~ SRL
This is to aide people who are currently familiar with SRL with using OpenGL.

Other functions will be changed to:
ogl.getChars();
ogl.getColourTolerance();
ogl.setColourTolerance();
ogl.setDebugMode();
//~ Etc...

We've also got an auto-updater, thanks to Kevin, so you won't have to come to this thread every time you want to update... Especially since it will be split into core.simba, type.simba, etc.

I'm very happy with the changes. I've noticed much better performance and hope you will all be just as pleased once it's released. :).

Ross
02-08-2015, 11:08 AM
Thought I'd update everyone, since I'm constantly asked in PM and on Skype...

Firstly, the tutorial. Clarity and I have been hard at work on this. We were going to release it before this weekend, but ran into some unexpected changes. See below.

The obscurityLibrary will not exist shortly. I'm getting rid of it. Instead, and I'm sure Brandon won't mind, I'm redesigning it and the OpenGL includes (fazing out the DemiseGL). As he mentioned in his post in the OpenGL Plugin thread, it's old and needs updating. That way, we'll hopefully take a load off him and Clarity and I will be happy to handle the includes.

That said, OpenGL will be formatted very similar to SRL. Take the following example:
actionBar.getCurrentBar(); //~ OGL
TRSActionBar.getCurrentBar(); //~ SRL
This is to aide people who are currently familiar with SRL with using OpenGL.

Other functions will be changed to:
ogl.getChars();
ogl.getColourTolerance();
ogl.setColourTolerance();
ogl.setDebugMode();
//~ Etc...

We've also got an auto-updater, thanks to Kevin, so you won't have to come to this thread every time you want to update... Especially since it will be split into core.simba, type.simba, etc.

I'm very happy with the changes. I've noticed much better performance and hope you will all be just as pleased once it's released. :).

This is awesome! Any idea on ETA to sate some appetites?

Obscurity
02-08-2015, 05:51 PM
Well it depends... Would y'all be happy with a very basic release - ie. able to get chars, models, textures, and some of what the obscurityLibrary has now - or would you prefer to wait until we have something a little more advanced?

Patriq
02-08-2015, 08:03 PM
Well it depends... Would y'all be happy with a very basic release - ie. able to get chars, models, textures, and some of what the obscurityLibrary has now - or would you prefer to wait until we have something a little more advanced?

Give us a taste please :)

Obscurity
02-13-2015, 02:55 PM
Alright. :-). Sent it to a few people over Skype last night and it got amazing reviews so far, so will throw it on Github later tonight.

There's not a whole lot in it so far in terms of interface interactions, but it has actionBar, inventory, etc. actionBar.clickAbility('slice'), actionBar.setRegenerate(true/false), actionBar.setAutoRetaliate(true/false), actionBar.clickFamiliarAction(), actionBar.setActionBar(1-5), y'know. You'll see, and I don't think you'll be disappointed. ^^.

It also now supports the vertical actionBar.

Obscurity
02-13-2015, 11:51 PM
https://github.com/ObscuritySRL/ogl

Just threw some up quickly, as I have company coming soon. It'll be moved to another later, once I get things set up with Kevin - that's whn it'll have the auto-updater/etc.

To create an OpenGL client, include lib\core\core.simba and use:
ogl.setup(clientWidth,clientHeight);
If no width or height is specified, it'll use the defaults which are found in core.ini, if it exists. If not, it defaults to 800x600.

Something else to be found in core.ini is the default colour tolerance. This is used for things like finding characters and textures by colour. It can be changed by:
ogl.setColourTolerance(someNumber);
The default is 4. If you'd like to change the default colour tolerance, by saving it to the ini, use:
ogl.setDefaultColourTolerance(someNumber);

To save the current dimensions and colour tolerance, use:
ogl.save();

If you want to debug models or textures or such:
ogl.setDebugMode('2');
ogl.setDebugMode('m');
ogl.setDebugMode('model');
ogl.setDebugMode('models');
For example.

Other then that, just check out the includes. The ones like actionBar and inventory have examples provided. If you need help with anything else, or using the library, let me know.

We have a bit more, but that's all I'm comfortable releasing until I recreate an OGL library thread and have the walk-through finished. :P.

Ross
02-14-2015, 12:24 AM
http://puu.sh/fSSQ9/f379e2ac21.png

Obscurity
02-14-2015, 01:36 AM
Haha, just give it to Clarity - since he's my partner. :-P. Appreciate it though, mate.

Obscurity
03-02-2015, 03:04 AM
A quick update for y'all.

Though the plugin is undergoing a massive update, I wasn't happy with the current speeds of glxFonts(), glxModels(), and glxTextures(). Running tests on multiple machines, these functions, which are used to grab the data relevant to the specific function, were very slow. They averaged 3.5s on newer machines, and 4.7s on older machines per 100 calls!

That said, if in a single loop you had it watch health and prayer, make sure auto-retaliate is enabled, check to see if your fighting, check overload and other buffs, etc... You're looking at dozens of calls. That's why previously I had functions like obsGetLifePoints() accept a glTextureArray. That way, you could grab all relevant fonts, models, and textures at the beginning of the loop and use that data.

Well, I dislike that approach. It's sloppy and requires duplicates of each function, method, or procedure. So, I added caching. Let me explain.

How often do you really need to grab data off screen? If you're watching your prayer, do you really need an accurate number to the 1-2ms? Unlikely. Keeping that in mind, I rewrote glx...() functions to glFonts(), glModels(), glTextures().

These functions save the data returned for 60ms by default. This is customizable with ogl.setCacheTime(int32). To change the default time, the time loaded with ogl.setup(), use ogl.setDefaultCacheTime(int32).

To give you an idea of the increase in performance bonuses, I was able to execute 1000 calls of bank.getTab() in under 15ms on an average machine. Previously, this would have taken well over 50s. While rapidly monitoring the results, the change wasn't noticeable the the human eye... Or mine at least.

Anyways, I've added some more interfaces and some other things to the Git. The library is lacking the most important function, menu.clickOption() (right click > select option), but that's taking a fair bit of time for me and I just get annoyed and move on to something else.

Cheers guys! A lot more to come! Got a lot in the works, but have to test and fool-proof it. :).

the bank
03-02-2015, 09:46 PM
A quick update for y'all.

Though the plugin is undergoing a massive update, I wasn't happy with the current speeds of glxFonts(), glxModels(), and glxTextures(). Running tests on multiple machines, these functions, which are used to grab the data relevant to the specific function, were very slow. They averaged 3.5s on newer machines, and 4.7s on older machines per 100 calls!

That said, if in a single loop you had it watch health and prayer, make sure auto-retaliate is enabled, check to see if your fighting, check overload and other buffs, etc... You're looking at dozens of calls. That's why previously I had functions like obsGetLifePoints() accept a glTextureArray. That way, you could grab all relevant fonts, models, and textures at the beginning of the loop and use that data.

Well, I dislike that approach. It's sloppy and requires duplicates of each function, method, or procedure. So, I added caching. Let me explain.

How often do you really need to grab data off screen? If you're watching your prayer, do you really need an accurate number to the 1-2ms? Unlikely. Keeping that in mind, I rewrote glx...() functions to glFonts(), glModels(), glTextures().

These functions save the data returned for 60ms by default. This is customizable with ogl.setCacheTime(int32). To change the default time, the time loaded with ogl.setup(), use ogl.setDefaultCacheTime(int32).

To give you an idea of the increase in performance bonuses, I was able to execute 1000 calls of bank.getTab() in under 15ms on an average machine. Previously, this would have taken well over 50s. While rapidly monitoring the results, the change wasn't noticeable the the human eye... Or mine at least.

Anyways, I've added some more interfaces and some other things to the Git. The library is lacking the most important function, menu.clickOption() (right click > select option), but that's taking a fair bit of time for me and I just get annoyed and move on to something else.

Cheers guys! A lot more to come! Got a lot in the works, but have to test and fool-proof it. :).

Have you pushed this update?

Obscurity
03-02-2015, 10:15 PM
It's in my GitHub, yes.

Keep in mind, obscurityLibrary (referred to from now-on as obsLib) is entirely separate from this new OGL library (oglLib). The obsLib was just me beginning to venture into OGL. After countless hours of OGL scripting and researching, I had compiled a list of things that needed changed or updated. Thus, the obsLib was no longer enough, leading to the oglLib project with Clarity and myself.

The oglLib lacks several of the functions the obsLib has. As mentioned, things like right clicking options and such. These will be added as I get time.


Also, slightly important, I have a bet running with a friend - that mouse movements will never affect ban rates. Because the oglLib isn't officially published yet and is only in testing, there are no mouse movements. Though, I've botted over 50M ranged XP on one account, got a 200M skill on an account, etc with no movements... So if you'd like mouse movements added, you'll have to do them yourself, for now anyways. Easy enough, as it's a simple copy and paste.

3Garrett3
03-02-2015, 10:45 PM
It's in my GitHub, yes.

Keep in mind, obscurityLibrary (referred to from now-on as obsLib) is entirely separate from this new OGL library (oglLib). The obsLib was just me beginning to venture into OGL. After countless hours of OGL scripting and researching, I had compiled a list of things that needed changed or updated. Thus, the obsLib was no longer enough, leading to the oglLib project with Clarity and myself.

The oglLib lacks several of the functions the obsLib has. As mentioned, things like right clicking options and such. These will be added as I get time.


Also, slightly important, I have a bet running with a friend - that mouse movements will never affect ban rates. Because the oglLib isn't officially published yet and is only in testing, there are no mouse movements. Though, I've botted over 50M ranged XP on one account, got a 200M skill on an account, etc with no movements... So if you'd like mouse movements added, you'll have to do them yourself, for now anyways. Easy enough, as it's a simple copy and paste.

"No mouse movement" meaning "the mouse doesn't move to the target, it just clicks" or "afk everything because the mouse doesn't do anything"? I assume the first one? If so, it would be neat to know that the mouse doesn't have to move, Jagex only logs where we click. I thought the general consensus around here what that ClickMouse was a pretty bannable thing. Interesting indeed.

I know I bug you too often on Skype probably, but what kind of ETA do you have before the oglLib is ready for public consumption?

Obscurity
03-02-2015, 11:27 PM
You can start using it now, TBH. A lot of people already are - I help them on Skype. :P. It's already capable of advanced bots - especially if you copy over obsClickOption(). All you really need is to be able to get fonts, models, and textures - the rest is really just a bonus. ;).

But yes, none of my bots that I run use mouse movements now - literally just clickMouse(). As Clarity will tell you, I'm running Pest Control, gold farmers, GWD and sometimes TD bots 24/7... So I'm pretty much convinced that it's nothing to worry about.

I don't expect people to take my word for it though - I wouldn't risk it if I'd heard it from someone else. But you have to consider things like touch-screens (I play on my touch screen laptop), TeamViewer (I'll occasionally play through it at work), mousekeys, etc. Ever been banned for using those? :P.

My thoughts on the matter closely match Brandon's - Why waste time tracking and monitoring movements and such... If it became a big enough problem, detect the client.

3Garrett3
03-02-2015, 11:56 PM
You can start using it now, TBH. A lot of people already are - I help them on Skype. :P. It's already capable of advanced bots - especially if you copy over obsClickOption(). All you really need is to be able to get fonts, models, and textures - the rest is really just a bonus. ;).

But yes, none of my bots that I run use mouse movements now - literally just clickMouse(). As Clarity will tell you, I'm running Pest Control, gold farmers, GWD and sometimes TD bots 24/7... So I'm pretty much convinced that it's nothing to worry about.

I don't expect people to take my word for it though - I wouldn't risk it if I'd heard it from someone else. But you have to consider things like touch-screens (I play on my touch screen laptop), TeamViewer (I'll occasionally play through it at work), mousekeys, etc. Ever been banned for using those? :P.

My thoughts on the matter closely match Brandon's - Why waste time tracking and monitoring movements and such... If it became a big enough problem, detect the client.

I'm going to have to get some of this Skype help someday soon, I'm dying to try making a few crazy scripts that color would be harder to use for.

the bank
03-04-2015, 02:29 PM
Just something small but


if glxMapHooks(smart.ID) then
writeLN('glxMapHooks was successful.')
else
writeLN('glxMapHooks was successful.');

Ross
03-04-2015, 02:48 PM
Just something small but


if glxMapHooks(smart.ID) then
writeLN('glxMapHooks was successful.')
else
writeLN('glxMapHooks was successful.');

Doesn't look like will solve anything :P

the bank
03-04-2015, 03:25 PM
Doesn't look like will solve anything :P

That's the point I'm making. That is code from his setup function.

Clarity
03-04-2015, 03:27 PM
Guess we forgot to push that typo fix. Thanks for the reminder :)

nero_dante
03-05-2015, 05:53 AM
Mouse movement shouldn't increase ban rates, because I'm very sure you have one random person i the world playing Runescape on a touchscreen.

Obscurity
03-07-2015, 06:27 AM
I play a lot on my touchscreen laptop. It's fantastic once you get the hang of it. I'd actually prefer it to playing normal. :P.

Obscurity
03-14-2015, 08:53 PM
Added some interfaces, like combat, some very basic GE functions, and such. Also finished production.

function production.clickMake():boolean;
function production.hasChooseATool():boolean;
function production.hasProduction():boolean;
function production.getProduct():int32;
function production.getProgress():int32;
function production.hasProgress():boolean;
function production.setProduct(funcProduct:int32):boolean;
function production.setTool(funcTool:int32):boolean;

Etc... Cheers. :).

Edit: Suppose I should explain what each does... So I'll just quote my Skype message to Clarity:
http://puu.sh/gwC7E/63632d2d77.png
production.setTool(1);
Would chose the knife.

http://puu.sh/gwCbf/a35281f57d.png
production.setProduct(2);
Would chose the wooden stock.

production.getProduct();
Would return 3 (Shieldbow [u]).

production.clickMake();
Would click the Fletch button.


With the progress screen:
production.hasProgress();
Would return if a progress window currently exists.

production.getProgress();
Would return 0-100.


Click/Set functions return true if any action was taken. For example:
production.setProduct(2);
Would return true if it was needed to set the 3rd product. It would be false if no 3rd product was found or the 3rd product was already selected.

Ross
03-14-2015, 11:26 PM
...

Good stuff.

I know that starting at 0 is a very code-y thing to do and OGL is supposed to be for intermediate coding, but SRL-6 typically either starts at 1 for most things (i.e. backpack slots) or uses variable names. Just tossing that out, dunno if it's something worth changing.

Clarity
03-28-2015, 08:57 AM
Our tutorial has been posted here: https://villavu.com/forum/showthread.php?t=112486