SRL Archive - Test corner

[GLHook] DemiseScythe's OGL Tutorial


DemiseScythe

2014-04-16 18:53:16

DemiseScythe's OGL Tutorial
By DemiseScythe



Chapter 1: Introduction to OGL.


Section 1: OGL Introduction.

Some of you might be familiar with the full capabilities of the OpenGL plugin developed by Brandon. For those who aren't, OGL is just another style of Runescape botting such as color, reflection and injection. Unlike the Java types, OGL doesn't modify game data at all making this style just as detectable as color and/or Smart itself. The GLX plugin allows the user to intersect the graphical data sent to your graphic card from Runescape so it can only see what is being displayed on the screen. However, the safety of this method far makes up for the inconvenience of only seeing displayed data and with a well designed script you will look just like another human player. I have personally managed to bot over 170M experience using OGL without bans so it is a safe method compared to reflection or injection and way more reliable than color. You could imagine the GLX plugin being your eyes, the script being your brain, Simba being your body and SMART being your hands; then you should be able to code a script that can play the game in the same manner as humans do. When a human plays he gets visual feedback from the screen and reacts accordingly using the knowledge stored in his brain and his hands to control your player. In the same manner, the GLX plugin will tell Simba what it sees and your script will respond with the encoded procedures that can be carried out by Smart to control your player.

Section 2: OGL Data.

Most 3-dimensional models, icons or images in Runescape has an unique OGL ID that is calculated based on its shape. Items with the same shape such as Uncut Gems can be differentiated by their ColorIDs which are calculated based on the color of the pixels in the image. The GLX plugin allows you to obtain these IDs as well as other information such as compass angle, text, equipment and even animations that include tools. Once a model or texture is detected by giving the plugin its OGL ID to the plugin, the following information becomes available to the user:

For Textures, the following Array is generated:
[{ID = 11270, COLOURID = 2362638, FULLCOLOURID = 5912620, X = 398, Y = 250, BOUNDS = {X1 = 390, Y1 = 242, X2 = 406, Y2 = 258}}]
For Models, the following Array is generated:
[{ID = 572370030, TID = 24, X = 123, Y = 412}]


For Textures or Images one can find their ID and ColorID as well as its X, Y position and the Bounds of the image. For Models one can find their ID as well as the X, Y position where the object stands. FullColorID and T[exture]ID are not necessary for identification. Using the IDs and their position we can detect, differentiate and locate objects or models on the screen allowing scripting to be possible.

Section 3: OGL Potential.

Some of you might be wondering just how powerful OGL really is. Based on the data the plugin returns above, OGL doesn't seem to be able to do a lot of fancy things like reflection/injection can. If you got the scripting ability, time, effort and will, OGL is capable of making a full Slayer script or any other script you can think of. Keep in mind that the complexity of the script is relative to the time and effort needed to develop it. Below are some nice mementos of my Slayer script which are meant to display the potential OGL scripting can have:

Video: http://www.youtube.com/watch?v=FDjAsnEZOuM

Images:








Section 4: OGL Requirements.

In order to run the OGL include and operate the plugin efficiently, your interpreter needs to be in Lape mode. As such you will need to know how to code Lape although you can script in a Pascal-like fashion as long as your code compiles. You should use a different Simba install folder for OGL to keep your folders separate and prevent compatibility lost with SRL6 and Brandon's includes. Something like C:\Simba\ and C:\SimbaOGL\ is fine. You need the correct plugins, my customized version of Brandon's include, and my DemiseGLZ include in the C:\SimbaOGL\ folder. I have only tried it in Windows so I am unsure how well it will run on other OS. Finally, you will need to rearrange your interphases but I will elaborate more on that later.

Section 5: OGL Installation.

To install and use OGL you must use Simba on a separate folder. Copy your Simba folder into the same place where it is installed and rename the copy to "SimbaOGL" Then delete the plugins and include folders and extract the contents of the download rar file to the SimbaOGL folder. Open the Simba.exe in the SimbaOGL folder and turn off the updater to prevent Simba SRL from updating and replacing your GLHook plugin with the regular OGL plugin. If an update happened, re-extract to overwrite again. Set the interpreter to Lape and the test script should work.

File Download: http://puu.sh/8ADqd.rar Updated: 5/5/14

I used to have a .pdf file with pictures but got deleted along with my old server so if I can get a copy of it from XoL. I'll upload it here. The general instructions provided above are not great but the pdf explanation is. If he doesn't have it either, I will add a better installation instruction.

Note: To open .simba files using the OGL install, you need to open \SimbaOGL\Simba.exe and go to File > Open > FileName.simba since this is the only way in which the .simba file will open using the correct folder due to association issues in the Windows OS.

Section 6: DemiseGLZ Include.

The DemiseGLZ include is a simplified version of my personal DemiseGLX include that has functions necessary to simplify OGL scripting. This include is necessary since my code is incompatible with SRL6. It contains simple functions normally found in SRL such as TypeSend, all the login procedures including time sensitive world choosing, some boolean functions, working FindFlag, custom functions to generate and define bounds as well as to draw them, printing functions, item/model finding and interaction, XPcounter, level stats and a new makecompass. The functions are self-explanatory but feel free to ask if there are any questions on usage. All functions are tested except the pin since I am in the process of adding the pin on my account so I can check it but it should work.


Chapter 2: Obtaining OGL Data.


Section 1: Screen Areas.

Finally, we have reached the interesting part of this tutorial. Here is where you will actually learn how to code with OGL efficiently. The first concept that you need to grasp is that the screen is divided into Areas to simplify scripting. Just like back in the day when we had MainScreen, Minimap, Chatbox and Inventory areas, I have partitioned the screen into useful sections. First, in RS you should adjust one present of your interphases to look as below so that you can use my OGL include with it. No transparency and try to keep the inventory at 4x7 dimensions while making it half the height of the screen. The chat box should show 4 lines of text. Finally lock the interphases and thin the title bars. Your screen should look more or less than mine and the draw function should draw the areas on your screen correctly. Keep in mind I run OGL at 1350 x 760 dimensions but my test script should load SMART in those directions so that you can set your interphases this way and everything should work correctly.

http://puu.sh/8cscQ.jpg


These TBoxes can be fed to most functions making scripting incredibly efficient. The SS refers to the largest rectangular main screen area and you should look for models only in this area. The SZ is a smaller square version of SS centered around the player avatar and it can be useful to detect models near the player. The SM refers to the Minimap area and is it helpful to search for icon textures. There are two special constants SMCX and SMCY which are the x and y coordinates of the center of the Minimap. The ST refers to the Tab area above the Inventory and it is helpful to search for tab textures. The SI refers to the Inventory area and it is helpful to search for item textures. The SC refers to the Chat box area and it is helpful to search for text in it. SB[1] through SB[12] refer to the boxes around the 12 action bar slots in case someone wants to search for textures inside some of these. The only two areas that do not appear in this picture are the Bank related areas. SBM can be searched to find item textures inside the bank window and SBI can be searched to find item textures in the inventory that appears next to the bank window. Those are all the areas that you need to learn and they are not that difficult. Overtime, they will become second nature to you and you will be able to script efficiently.

Section 2: Visual Approach.

As the title suggest, you are able to collect OGL IDs using a Visual approach. Now I will bring your attention to the procedure VDebug(S: String); This command can be use to enable or disable the display of real time OGL IDs on the screen. When the parameter entered is 'N', it will remove the IDs as they can make it hard to see the screen although disabling Debug in SMART is another option. 'M' will display all Model IDs and 'T' will display all Textude IDs. There are limitations to this approach since all it displays is the main OGL ID and not all of the data. For texture finding and interaction, the ColorID is also needed but these IDs can be fed into the Printing functions allowing you to efficiently collect data. Another issue is that sometimes the ID will overlap making them hard to read. At that point the only approach you can do is the printing one.



All models with the same shape will have the same ID as seen in the picture above but overlapping models can lead to overlapping IDs which can be problematic as I explained above. The OGL plugin will still be able to see all the IDs without problem but we won't be able to read any of them at one time.

Section 3: Printing Approach.

Other than the Visual approach, OGL ID's can be found using functions. These functions will print the full Texture or Model arrays into the debug box of Simba where information can be read and copied for scripting purposes. The functions relevant to this section are the following:

(*ID Scripting Tools*)
{VDebug('N');{}
{VPrintTextures(X1, Y1, X2, Y2);{}
{VPrintModels(X1, Y1, X2, Y2);{}
{Writeln(glGetTextures(11270));{}
{Writeln(glGetModels(572370030));{}

VPrintTextures and VPrintModels can be activated by removing the initial { and running the script. It will print all textures inside the bounds passed to it in X1, Y1, X2, Y2 format. However, this method is to be used in conjunction with the Visual approach. Say for example we see the following ID's on our screen and we want to know all the ID's and OGL data for the models present:



By Making a feeding the VPrintModels(461, 191, 763, 323); the corners of a box around these IDs, all of their information will be printed in the Debug.

Paired with SMART[7864]
{ID = 3774227809, TID = 16, X = 472, Y = 218}
{ID = 3168196654, TID = 20, X = 751, Y = 252}
{ID = 2615586268, TID = 20, X = 751, Y = 252}
{ID = 2079256770, TID = 20, X = 751, Y = 252}
{ID = 4390934, TID = 24, X = 491, Y = 256}
{ID = 572370030, TID = 24, X = 660, Y = 264}
Successfully executed.

There are a few things to be learned from this. First, we can observe the readable Model IDs on the screen were printed as well as those from the Models in the overlapping item pile. It is nice being able to get IDs that are overlapping in a different manner, but this approach exposes an obscure flaw on the plugin's capabilities which I've previously mentioned. Although this is RS's fault and not the plugin's itself. There are actually 5 items in that pile but the plugin can only see three of them: The arrow, and two of the runes. This is because the runes have the same shape and only the most valuable items will show when they are all dropped in the same place. In this case the screen shows the rune arrow, the astral rune and since the plugin can only see what you would see with your eyes. The maximum amount Models' information on an item pile that you can obtain have been determined to be four from testing aslong as at least a part of each of the items is visible. Fortunately for us, RS places the most valuable items at the top and once an item is looted, the 5th item becomes the 4th and then visible to the plugin. This same printing approach can be used for Textures, for example look at the following inventory of the above mentioned items:



By feeding VPrintTextures(1158, 365, 1339, 460) to the script, we receive the following code:

Paired with SMART[7864]
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1173, Y = 382, BOUNDS = {X1 = 1153, Y1 = 364, X2 = 1193, Y2 = 400}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1222, Y = 382, BOUNDS = {X1 = 1202, Y1 = 364, X2 = 1242, Y2 = 400}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1271, Y = 382, BOUNDS = {X1 = 1251, Y1 = 364, X2 = 1291, Y2 = 400}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1320, Y = 382, BOUNDS = {X1 = 1300, Y1 = 364, X2 = 1340, Y2 = 400}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1173, Y = 418, BOUNDS = {X1 = 1153, Y1 = 400, X2 = 1193, Y2 = 436}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1222, Y = 418, BOUNDS = {X1 = 1202, Y1 = 400, X2 = 1242, Y2 = 436}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1271, Y = 418, BOUNDS = {X1 = 1251, Y1 = 400, X2 = 1291, Y2 = 436}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1320, Y = 418, BOUNDS = {X1 = 1300, Y1 = 400, X2 = 1340, Y2 = 436}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1173, Y = 454, BOUNDS = {X1 = 1153, Y1 = 436, X2 = 1193, Y2 = 472}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1222, Y = 454, BOUNDS = {X1 = 1202, Y1 = 436, X2 = 1242, Y2 = 472}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1271, Y = 454, BOUNDS = {X1 = 1251, Y1 = 436, X2 = 1291, Y2 = 472}}
{ID = 88625, COLOURID = 1782589, FULLCOLOURID = 1847612, X = 1320, Y = 454, BOUNDS = {X1 = 1300, Y1 = 436, X2 = 1340, Y2 = 472}}
{ID = 19635, COLOURID = 131072, FULLCOLOURID = 262913, X = 1175, Y = 382, BOUNDS = {X1 = 1157, Y1 = 366, X2 = 1193, Y2 = 398}}
{ID = 132855, COLOURID = 4802351, FULLCOLOURID = 4933937, X = 1224, Y = 382, BOUNDS = {X1 = 1206, Y1 = 366, X2 = 1242, Y2 = 398}}
{ID = 132855, COLOURID = 4735814, FULLCOLOURID = 4867397, X = 1273, Y = 382, BOUNDS = {X1 = 1255, Y1 = 366, X2 = 1291, Y2 = 398}}
{ID = 104295, COLOURID = 1446413, FULLCOLOURID = 1315084, X = 1322, Y = 382, BOUNDS = {X1 = 1304, Y1 = 366, X2 = 1340, Y2 = 398}}
{ID = 132855, COLOURID = 5262412, FULLCOLOURID = 5262667, X = 1175, Y = 418, BOUNDS = {X1 = 1157, Y1 = 402, X2 = 1193, Y2 = 434}}
Successfully executed.

Note that a lot of the code is from the texture of what we humans see as slots but they can be ignored since they are not what we want. Thus ignoring all the 88625 IDs, we now focus on just the actual IDs and ColorIDs for the textures we want. Using the X and Y data, we can see that for example {ID = 104295, COLOURID = 1446413, FULLCOLOURID = 1315084, X = 1322, Y = 382, BOUNDS = {X1 = 1304, Y1 = 366, X2 = 1340, Y2 = 398}} belongs to the Coal. We now know where the OGL ID and ColorID for the Coal texture and will be able to use these IDs to detect and interact with Coal in the future. The presence of Texture IDs will also become extremely useful when it comes to walking as even NPC dots and Minimap icons have Texture IDs as seen below.



All that is left is to talk to the last bit of the ID scripting tools. The most useful ways to use Writeln(glGetTextures(11270)); and Writeln(glGetModels(572370030)); is to use them in one of the following manners:

- OGL ID - Give it an OGL ID as a parameter and it will print all the arrays for visible Items or Models depending on which function was used that have that same OGL ID. This can be helpful to quickly gather the ColorID of a Texture with a Visually obtained Texture OGL ID or to count how many different times does this ID appear on the screen as well as where.

- OGL ID/TBOX - Give it an OGL ID followed by one of the Screen Areas to get all of the Model or Texture data for that specific ID in an specific area of the screen.

- TBOX - Simply feed it a Screen Area to get all of the Model or Texture data found inside that specific area.

Thus we obtain the following results:

Writeln(glGetTextures(3786240));
Paired with SMART[7864]
[{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 1246, Y = 165, BOUNDS = {X1 = 1147, Y1 = 4, X2 = 1346, Y2 = 327}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 1246, Y = 512, BOUNDS = {X1 = 1147, Y1 = 359, X2 = 1346, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 68, Y = 607, BOUNDS = {X1 = 4, Y1 = 549, X2 = 132, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 196, Y = 607, BOUNDS = {X1 = 132, Y1 = 549, X2 = 260, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 324, Y = 607, BOUNDS = {X1 = 260, Y1 = 549, X2 = 388, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 452, Y = 607, BOUNDS = {X1 = 388, Y1 = 549, X2 = 516, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 539, Y = 607, BOUNDS = {X1 = 516, Y1 = 549, X2 = 563, Y2 = 666}}]
Successfully executed.

Writeln(glGetTextures(3786240, SC));
Paired with SMART[7864]
[{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 68, Y = 607, BOUNDS = {X1 = 4, Y1 = 549, X2 = 132, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 196, Y = 607, BOUNDS = {X1 = 132, Y1 = 549, X2 = 260, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 324, Y = 607, BOUNDS = {X1 = 260, Y1 = 549, X2 = 388, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 452, Y = 607, BOUNDS = {X1 = 388, Y1 = 549, X2 = 516, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 539, Y = 607, BOUNDS = {X1 = 516, Y1 = 549, X2 = 563, Y2 = 666}}]
Successfully executed.

Writeln(glGetTextures(SC));
Paired with SMART[7864]
[{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 68, Y = 607, BOUNDS = {X1 = 4, Y1 = 549, X2 = 132, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 196, Y = 607, BOUNDS = {X1 = 132, Y1 = 549, X2 = 260, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 324, Y = 607, BOUNDS = {X1 = 260, Y1 = 549, X2 = 388, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 452, Y = 607, BOUNDS = {X1 = 388, Y1 = 549, X2 = 516, Y2 = 666}},
{ID = 3786240, COLOURID = 661280, FULLCOLOURID = 661280, X = 539, Y = 607, BOUNDS = {X1 = 516, Y1 = 549, X2 = 563, Y2 = 666}},
{ID = 65081, COLOURID = 131587, FULLCOLOURID = 66050, X = 26, Y = 644, BOUNDS = {X1 = 4, Y1 = 622, X2 = 48, Y2 = 666}},
{ID = 65081, COLOURID = 131587, FULLCOLOURID = 66050, X = 541, Y = 644, BOUNDS = {X1 = 519, Y1 = 622, X2 = 563, Y2 = 666}},
{ID = 9122, COLOURID = 3559773, FULLCOLOURID = 4548727, X = 14, Y = 563, BOUNDS = {X1 = 6, Y1 = 555, X2 = 22, Y2 = 571}},
{ID = 1582, COLOURID = 1708804, FULLCOLOURID = 7822865, X = 34, Y = 563, BOUNDS = {X1 = 26, Y1 = 555, X2 = 42, Y2 = 571}},
{ID = 1405, COLOURID = 526603, FULLCOLOURID = 1382683, X = 54, Y = 563, BOUNDS = {X1 = 46, Y1 = 555, X2 = 62, Y2 = 571}},
{ID = 11475, COLOURID = 3357759, FULLCOLOURID = 2567728, X = 74, Y = 563, BOUNDS = {X1 = 66, Y1 = 555, X2 = 82, Y2 = 571}},
{ID = 6534, COLOURID = 1975334, FULLCOLOURID = 2106921, X = 94, Y = 563, BOUNDS = {X1 = 86, Y1 = 555, X2 = 102, Y2 = 571}},
{ID = 7464, COLOURID = 2304299, FULLCOLOURID = 2172713, X = 114, Y = 563, BOUNDS = {X1 = 106, Y1 = 555, X2 = 122, Y2 = 571}},
{ID = 2566, COLOURID = 790288, FULLCOLOURID = 1646112, X = 134, Y = 563, BOUNDS = {X1 = 126, Y1 = 555, X2 = 142, Y2 = 571}},
{ID = 699, COLOURID = 788482, FULLCOLOURID = 4535304, X = 154, Y = 563, BOUNDS = {X1 = 146, Y1 = 555, X2 = 162, Y2 = 571}},
{ID = 3222, COLOURID = 3022855, FULLCOLOURID = 6573326, X = 174, Y = 563, BOUNDS = {X1 = 166, Y1 = 555, X2 = 182, Y2 = 571}},
{ID = 1565, COLOURID = 724495, FULLCOLOURID = 1777955, X = 194, Y = 563, BOUNDS = {X1 = 186, Y1 = 555, X2 = 202, Y2 = 571}},
{ID = 2582, COLOURID = 1053976, FULLCOLOURID = 2304556, X = 513, Y = 563, BOUNDS = {X1 = 505, Y1 = 555, X2 = 521, Y2 = 571}},
{ID = 3146, COLOURID = 1251354, FULLCOLOURID = 1712163, X = 533, Y = 563, BOUNDS = {X1 = 525, Y1 = 555, X2 = 541, Y2 = 571}},
{ID = 2040, COLOURID = 1643012, FULLCOLOURID = 7560213, X = 553, Y = 563, BOUNDS = {X1 = 545, Y1 = 555, X2 = 561, Y2 = 571}},
{ID = 24990, COLOURID = 8947083, FULLCOLOURID = 8618118, X = 149, Y = 657, BOUNDS = {X1 = 143, Y1 = 652, X2 = 156, Y2 = 662}},
{ID = 10120, COLOURID = 462097, FULLCOLOURID = 462097, X = 555, Y = 614, BOUNDS = {X1 = 547, Y1 = 601, X2 = 563, Y2 = 628}},
{ID = 10120, COLOURID = 462097, FULLCOLOURID = 462097, X = 555, Y = 598, BOUNDS = {X1 = 547, Y1 = 596, X2 = 563, Y2 = 601}},
{ID = 10120, COLOURID = 462097, FULLCOLOURID = 462097, X = 555, Y = 630, BOUNDS = {X1 = 547, Y1 = 628, X2 = 563, Y2 = 633}},
{ID = 8160, COLOURID = 5652498, FULLCOLOURID = 5652498, X = 555, Y = 615, BOUNDS = {X1 = 547, Y1 = 601, X2 = 563, Y2 = 629}},
{ID = 7966, COLOURID = 5455377, FULLCOLOURID = 4929809, X = 555, Y = 598, BOUNDS = {X1 = 547, Y1 = 596, X2 = 563, Y2 = 601}},
{ID = 7497, COLOURID = 4732688, FULLCOLOURID = 4929553, X = 555, Y = 631, BOUNDS = {X1 = 547, Y1 = 629, X2 = 563, Y2 = 634}},
{ID = 8109, COLOURID = 1053198, FULLCOLOURID = 3878419, X = 555, Y = 588, BOUNDS = {X1 = 547, Y1 = 580, X2 = 563, Y2 = 596}},
{ID = 70, COLOURID = 197121, FULLCOLOURID = 3878419, X = 555, Y = 641, BOUNDS = {X1 = 547, Y1 = 633, X2 = 563, Y2 = 649}},
{ID = 20400, COLOURID = 2043447, FULLCOLOURID = 2043447, X = 2, Y = 600, BOUNDS = {X1 = 0, Y1 = 553, X2 = 4, Y2 = 648}},
{ID = 20400, COLOURID = 2043447, FULLCOLOURID = 2043447, X = 565, Y = 600, BOUNDS = {X1 = 563, Y1 = 553, X2 = 567, Y2 = 648}},
{ID = 28550, COLOURID = 1120285, FULLCOLOURID = 659219, X = 11, Y = 659, BOUNDS = {X1 = 0, Y1 = 648, X2 = 22, Y2 = 670}},
{ID = 28550, COLOURID = 1120285, FULLCOLOURID = 659219, X = 556, Y = 659, BOUNDS = {X1 = 545, Y1 = 648, X2 = 567, Y2 = 670}},
{ID = 3060, COLOURID = 1714224, FULLCOLOURID = 2306619, X = 2, Y = 551, BOUNDS = {X1 = 0, Y1 = 549, X2 = 4, Y2 = 553}},
{ID = 3060, COLOURID = 1714224, FULLCOLOURID = 2306619, X = 565, Y = 551, BOUNDS = {X1 = 563, Y1 = 549, X2 = 567, Y2 = 553}},
{ID = 24480, COLOURID = 1648689, FULLCOLOURID = 2175289, X = 305, Y = 551, BOUNDS = {X1 = 48, Y1 = 549, X2 = 563, Y2 = 553}}]
Successfully executed.

This covers the main methods as far as ID collection is concerned. As you all can see, that is quite a bit of data and the real question here is what to do with it. I will cover more on making use of this data on the next chapter as there are a bit more things to discuss.

Section 4: Additional Data.

In addition to all the data that regards Textures and Models as explained above, there is also ways to visually detect worn equipment and animation like humans do, flawless text recognition that do not depend on OCR, and even compass angle detection. First lets discuss animation detection. Your character will always have the same OGL ID as long as you don't change the worn items. Your standing, walking, running, resting, and hand melee ID will always be just dependent on what you are wearing. If you try to fish, your ID will change into your fishing ID as seen in the picture below:



On the left is the regular standing OGL ID for my avatar based on the equipment it is wearing and on the right it is its fishing model ID. As you expected, both as different and now we should discuss why. Your avatar OGL ID is based on the shape and color of all the pieces connected to the avatar. On the right, the fishing rod is now part of your avatar and changes the ID in the same way wielding a 2h sword would. Same concept applies for woodcutting hatches, mining picks so in theory as long as the animation modifies what your character wields, it should be constant, detectable and specific to the action associated with it. Then I can look for the time when the fishing ID disappears and the regular appears in order to determine my avatar has stopped fishing and is now just standing around. If you want to use something like this for your script, you need to setup a standard set of items to wear so that all script users share their avatar OGL IDs with you. Of course a standard will lead to false positives so this is only really useful as far as personal scripts are concerned or if you only search right where your avatar ID is since RS will always show your ID/model above everyone or everything standing under you. When a lot of people fish in one spot, you only see yourself unless someone pulls up one of those dressing booths but since your fishing rod is still visible, your ID should be visible and still the same. Equipment detecting works in the same manner, in the picture below I am just changing from a Dragon Full Helm to a Rune Full Helm but just that manages to change the IDs as seen:



Thus if your script relies in switching between a set of items, you can detect if and which items are equipped simply by comparing the overall IDs for the various combinations. This concept might seem a bit alien at first but play around while having VDebug('M'); turned on and you will get a better grasp of it in no time. Text recognition is hard to understand so let's look at the following function:

function VGetOverallXP: Cardinal;
var
T: glTextureArray;
S: TStringArray;
begin
if (not(GL_LoggedIn)) then
begin
Result := 1000;
Exit;
end;
T := glGetTextures(48705, SS);
if (Length(T) > 0) then
begin
S := glCharsToText(glGetChars(IntToBox(T[0].X-82, T[0].Y-10, T[0].X-13, T[0].Y+10)));
if (Length(S) > 0) then
begin
if (Length(ExtractFromStr(S[0], Numbers)) > 0) then
begin
Result := StrToInt64(ExtractFromStr(S[0], Numbers));
Exit;
end;
end;
end;
Result := 1000;
end;

To read text, you need a TStringArray defined. Then you got to find a way to get the coordinates around of what you want to read in either a dynamic fashion as seen above or just hard code them into glCharsToText(glGetChars(X1, Y1, X2, Y2))); and pass them to the TStringArray. You should get the text returned to you in an array. You may then print the array to see what you are reading and then use the text data collected. There are way more complex ways to use Text and you can see a bit of that in the VSelectWorld function where I actually use a glTextArray and glCharsToTexts(glGetChars(IntToBox(X1, Y1, X2, Y2))) but then you should have to access text using glTextArray[index].text and it gets a lot more complicated in no time. The reason why I used the more complicated version on that function is because a glTextArray also stores the X and Y of the text and probably the bounds. This way not only do I see the world number but I know where in the screen it is located so that I can select it. Compass angle is detectable but if you are interested in it you are probably trying to change the compass angle to some specific value. Using VMakeCompass(Degrees); you can easily change the angle to any value between 0 and 360 degrees going counter clockwise from North(0, 360). It has a tolerance of 13 which allows the script enough time to slow down and not go past the desired degree. It will check your compass angle and if the desired is 13 or less away from the actual angle, it will not move. If it isn't, it will move the in the closest direction to the desired angle. Feel free to play with this function a bit so that you get how it works. That is all I can say at this time in regards to detecting different types of data using OGL. There are way more complex ways of collecting data as seen in my Slayer script but a lot of those are just clever thinking and building more advanced functions from the simple functions included in DemiseGLZ.simba and from the modified Brandon include.


Chapter 3: Using OGL Data.


Section 1: Finding Textures.

There isn't much to say in terms of finding textures. I have simplified the whole process to one function:

function VFindItem(ID, CID: Cardinal; Area: TBox): Boolean;
function VFindItem(ID, CID, Tol: Cardinal; Area: TBox): Boolean; overload;

In this case, the third parameter is optional in the event you want to add some tolerance to the detection. The default tolerance value is 5. The Area parameter takes any of the Screen Areas where you want to search for the texture. As long as you know an Item's OGL ID and ColorID, you will be able to detect its presence. For Coal, the OGL ID is 104295 and the ColorID is 1446413. If we Coal in the inventory and run the following function in our BaseScript we should get True being printed and False if there isn't any Coal in the inventory.

(*Script Start*)
Writeln(VFindItem(104295, 1446413, SI));
TerminateScript;
end.

Paired with SMART[4608]
True
Successfully executed.

Section 2: Finding Models.

Likewise, Model detection has been reduced to the following function where only the SS and SZ areas are relevant:

function VFindModel(ID: Cardinal; Area: TBox): Boolean; 

If we look at the cow farm near Lumbridge on 'M' OGL debug mode we will see the cows having the following OGL IDs:



By running the following code we can detect if there is a Cow visible near our player on the screen inside the SZ screen area. Pretty simple right but this ability is extremely useful when using Map Icons to walk. By checking for nearby model IDs, one can check if the avatar did walk where it was intended to walk. If the cow is inside, this function will return True and False if the cow is nowhere near it.

Writeln(VFindModel(3352153657, SZ));

Paired with SMART[4608]
True
Successfully executed.

Section 3: Finding Text.

This is a fun and interesting one. I find out which task I have to do by simply reading text. In this case, it is easier to show an example function from my private include and review the relevant part:

function VConfirmTask: Boolean;
var
I: Integer;
T: TStringArray;
begin
if VClickItem(VV[43], VV[44], SI, Mouse_Right, V[6]) then
begin
Wait(350 + Random(50));
T := glCharsToText(glGetChars(SC));
if Between('our ', ' ass', T[1]) = V[7] then
begin
Result := True;
Exit;
end;
end;
if VClickItem(VV[45], VV[46], SI, Mouse_Right, V[6]) then
begin
Wait(350 + Random(50));
T := glCharsToText(glGetChars(SC));
if Between('our ', ' ass', T[1]) = V[7] then
begin
Result := True;
Exit;
end;
end;
end;

If we look at a task assignment text message, we find the following text:



This function grabs text as mentioned in the previous chapter using glCharsToText(glGetChars(SC)); which returns all the text in the chat box in the form of an array. Index 0 is the line where your avatar types and has its name. [1] is the first line from your name and so on. By using if Between('our ', ' ass', T[1]) = 'current' then I am checking if the word current is between Your and assignment on the first line of the chat box defined by T[1] in this case. All the rest of the function just right-clicks either a Slayer ring or Slayer gem and selects the 'Kills-left' option. Forcing the above line to appear in the bottom line of the chat box. Likewise, as long as you have the chat box text in an array, you can easily search or modify the strings by using the String functions included in Simba:



The best part about this is that unlike color, this doesn't rely on fonts and you won't have to constantly try different fonts to find the right one nor have to specify text color, spacing and all those bothersome details that are required with color. This text finding is 100% reliable and can lead to the construction of some pretty solid scripts.

Section 4: Texture Interaction.

If we look at Monkfish and obtain its data as mentioned in the previous chapter, we will find out that their OGL ID is 102255 and their ColorID is 2235674. By using the following function, we can then interact with Monkfish in our inventory:

function VClickItem(ID, CID: Cardinal; Area: TBox; Click: Integer; Option: String = 'Cancel'): Boolean;  
function VClickItem(ID, CID, Tol: Cardinal; Area: TBox; Click: Integer; Option: String = 'Cancel'): Boolean; overload;

By using either case of my simplified function we now try the following cases with several Monkfish in our inventory:

VClickItem(102255, 2235674, SI, Mouse_Left); - Will left-click a Monkfish eating it.

VClickItem(102255, 2235674, SI, Mouse_Right); - Will right-click a Monkfish and choose the Cancel option.

VClickItem(102255, 2235674, SI, Mouse_Right, 'Drop'); - Will right-click a Monkfish and choose the Drop option.

VClickItem(102255, 2235674, 25, SI, Mouse_Right, 'Drop'); - Will have the same effect as the previous case.

From this we learn a few things. First, it will always choose the texture or model closest to the top right corner or (0,0). Second, the tolerance appears to have no effect on this function but items that have the same shape such as Iron ore and Coal will have the same Texture OGL ID but different ColorID. We can take advantage of this by giving because by giving it a high tolerance value, we can basically force the script to interact with the texture regardless of its color.

Section 5: Model Interaction.

Referring back to Section 2 and the cows on the farm. We will write code that interacts with the cows using the following function:

function VClickModel(ID: Cardinal; Area: TBox; Click: Integer; Option: String = 'Cancel'): Boolean;  
function VClickModel(ID: Cardinal; Area: TBox; Click: Integer; Option: TStringArray): Boolean; overload;

The functions are identical with the only difference being the optional 4th parameter being able to be either a string or a tstringarray. Thus we can have a few cases taking place:

VClickModel(3352153657, SS, Mouse_Left); - Will left-click the Cow if it is on the SS screen area.

VClickModel(3352153657, SS, Mouse_Right); - Will right-click the Cow and choose the Cancel option.

VClickModel(3352153657, SS, Mouse_Right, 'Attack); - Will right-click the Cow and choose the Attack option leading your avatar to attack.

VClickModel(3352153657, SS, Mouse_Right, ['Attack', 'Cow']); - Will have the same effect as the previous case.

Trying each of those should give you a feel for what this function is capable of doing. Of course it will click under the model sometimes since the ID is actually at the base of the model. Combat scripts should create an attack function similar to my VClickModel where the Y in the mouse function has a set amount subtracted making Smart click higher where the actual model is. Depending on the size and height of the model, this value can be anywhere from 0 to 25 pixels and for Gargoyles, it can be as high as 20 since if you visit them you will realize they are actually flying over their ID as seen below.



This is all there is to interacting with Models. By looking through the actual function code, you can get a better idea of how to create advanced functions.


Chapter 4: Application A - Iron Power Miner.


Section 1: ID Collection.

In order to make a script we will need to collect some OGL ID data first. We need the texture data for the Iron ore/uncut gems and the model data for the Iron rocks. By going into the 'T' debug mode and dragging a mined Iron ore into SS, we can clearly read its OGL ID:



We then run that OGL ID with the proper function to obtain that texture's ColorID:

Writeln(glGetTextures(104295, SI));

Paired with SMART[6228]
[{ID = 104295, COLOURID = 1643021, FULLCOLOURID = 1511692, X = 1175, Y = 382, BOUNDS = {X1 = 1157, Y1 = 366, X2 = 1193, Y2 = 398}}]
Successfully executed.

Now we know that the OGL ID of Iron ore is 104295 and the ColorID is 1643021. Last we need to get the ID of the ore rocks by going into 'M' debug mode:




Keep in mind that IDs for stationary models are angle dependent in the same way a stair looks different from the front and from the side. Made sure to collect the ID's from the Angle in which the script will run. We got two different ID's for rocks with ore and notice as seen in the second picture that these ID's change when the rock has been mined out and this is what we want. We now know that the ID is the same for all rocks and the two possibilities are 2718818122 and 366615370. We might also want to collect the Uncut Gem ID and ColorID but the process is pretty much the same and optional at this time.

Section 2: Mining Procedure.

function VMineIron: Boolean;
begin
repeat
if not VClickModel(2718818122, IntToBox(604, 318, 746, 406), Mouse_Right, 'Iron') then
VClickModel(366615370, IntToBox(604, 318, 746, 406), Mouse_Right, 'Iron');
Wait(350 + Random(50));
until (GL_InvCount > 2) or (not(GL_LoggedIn));
end;

The mining procedure is pretty simple. Since it is faster to drop ores while the rocks respawn instead of mining 28 and dropping the inventory. We want our procedure to stop mining after it has at least three objects in the inventory. We could use Mouse_Left to just left-click the rocks but flying butterflies will get in the way and mess up the script so it is safer this way. If it doesn't find the first two rocks, it will right-click the right rock and choose the Iron option. Since 'Mine Iron ore rocks' is at the top, this option will get chosen by default at the mention of the object's name.

Section 3: Dropping Procedure.

function VDropIron: Boolean;
begin
repeat
VClickItem(104295, 1643021, SI, Mouse_Right, 'Drop');
until (GL_InvEmpty) or (not(GL_LoggedIn));
end;

That is all there is to the drop function. It will look for Iron ores in the SI or Inventory area and right-click on the item. It will then chose the 'Drop' option to drop the Iron ore. One thing to notice between the two above functions is that you need to include a wait for the VClickModel choice but the VClickItem already has a Wait included so that it isn't needed. Of course you need to include other lines inside the loop of this function that has the Gem IDs so that those are drop in the event they are mined.

Section 4: Script Completion.

function VMineIron: Boolean;
begin
repeat
if not VClickModel(2718818122, IntToBox(604, 318, 746, 406), Mouse_Right, 'Iron') then
VClickModel(366615370, IntToBox(604, 318, 746, 406), Mouse_Right, 'Iron');
Wait(350 + Random(50));
until (GL_InvCount > 2) or (not(GL_LoggedIn));
end;

function VDropIron: Boolean;
begin
repeat
VClickItem(104295, 1643021, SI, Mouse_Right, 'Drop');
until (GL_InvEmpty) or (not(GL_LoggedIn));
end;

begin
(*Initiation*)
ClearDebug;
Smart.Create(1350, 670, '', ['OpenGL32.dll']);
GLXMapHooks(Smart.ID);
VSettings;
VLogInPlayer;
VBounds;
VDrawBounds;
VSpin;
(*ID Scripting Tools*)
{VDebug('M');{}
{VPrintTextures(1158, 365, 1339, 460);{}
{VPrintModels(461, 191, 763, 323);{}
{Writeln(glGetTextures(104295, SI));{}
{Writeln(glGetModels(572370030));{}
(*Script Start*)
repeat
VMineIron;
VDropIron;
until (not(GL_LoggedIn));
TerminateScript;
end.

In less than 20 lines of code I've managed to create a perfectly working Iron power miner. The beauty of OGL scripting is the simplicity of the code. It doesn't have Antirandom or other fancy stuff but that isn't needed. If you test this script there is never any inactive period for the avatar since it is constantly mining and dropping. This simple script is stable enough to run the full 5 hours with the exception of getting an uncut gem from mining. By grabbing the OGL ID for an uncut gem, the ColorID for one of them and raising the tolerance to some ridiculous value like 500, the script will drop any gem it finds in addition to the iron ores allowing this script to run to the 6 hour limit. Add the 6 hour fix and this can run for days. Of course it is missing a few fancy things such as a progress report and settings. I will add those tomorrow an publish a fully terminated script with all the bangles and whistles. As a bonus I will make it cut the gems before dropping them for free crafting experience.



Polishing the script a little with bug fixes, a progress report and 6 hour fix. We obtain the following completed product. To use, stand in the middle of the rocks as shown above and hit play. Have best pick equipped or in tool belt.





program DemiseMiner;
{$DEFINE SMART}
{$include_once GLX/GLXCore.Simba}
{$include_once GLX/Misc/Map.Simba}
{$include_once GLX/Misc/Smart.Simba}
{$include_once GLX/Misc/Graphics.Simba}
{$include_once GLX/Mouse.Simba}
{$include_once GLX/Login.Simba}
{$include_once GLX/Text.Simba}
{$include_once GLX/Bank.Simba}
{$include_once GLX/Inventory.Simba}
{$include_once GLX/Timing.Simba}
{$include_once GLX/Minimap.Simba}
{$include_once GLX/Interfaces.Simba}
{$include_once Demise/DemiseGLZ.Simba}

(*========DemiseMiner========*)
(*========OGL Edition========*)
(*========Version 1.0========*)

var
MT, SXP: Cardinal;

procedure VSettings;
begin
(*Preferences:*)
PlayersName := '';
PlayersPass := '';
BankPin := '1234';
(*Favorite Worlds*)
World[1] := 1;
World[2] := 1;
World[3] := 1;
World[4] := 1;
World[5] := 1;
World[6] := 1;
World[7] := 1;
World[8] := 1;
end;

function VTicket: Boolean;
begin
Result := VClickItem(125205, 5718564, SI, Mouse_Left);
end;

function VMineIron: Boolean;
var
XP, Minutes: Integer
begin
repeat
if not VClickModel(2718818122, IntToBox(604, 318, 746, 406), Mouse_Right, 'Iron') then
VClickModel(366615370, IntToBox(604, 318, 746, 406), Mouse_Right, 'Iron');
Wait(300 + Random(50));
XP := VGetOverallXP - SXP;
Minutes := Round((GetSystemTime - MT)/60000);
if (Minutes = 0) then
Minutes := 1;
ClearDebug;
Writeln('Demise Miner GLX V1.0');
Writeln('Mining Experience Earned: ' + IntToStr(XP));
Writeln('Time Passed: ' + IntToStr(Minutes) + ' Minutes');
Writeln('Mining Xp/Hr: ' + IntToStr(Round((XP*60)/Minutes)));
until (GL_InvCount > 2) or (not(GL_LoggedIn));
end;

function VDropIron: Boolean;
begin
repeat
VClickItem(104295, 1643021, SI, Mouse_Right, 'Drop');
VClickItem(91290, 329256, 400, SI, Mouse_Right, 'Drop');
until (GL_InvEmpty) or (not(GL_LoggedIn));
end;

begin
(*Initiation*)
ClearDebug;
Smart.Create(1350, 670, '', ['OpenGL32.dll']);
GLXMapHooks(Smart.ID);
VSettings;
VLogInPlayer;
VBounds;
VDrawBounds;
VSpin;
(*Script Start*)
VTicket;
MT := GetSystemTime;
SXP := VGetOverallXP;
repeat
repeat
VMineIron;
VTicket;
VDropIron;
until (not(GL_LoggedIn));
SMARTkillClient(Smart.ID);
Smart.Create(1350, 670, '', ['OpenGL32.dll']);
GLXMapHooks(Smart.ID);
VLogInPlayer;
VBounds;
VSpin;
until (not(GL_LoggedIn));
VSoundBase('End');
TerminateScript;
end.

Sjoe

2014-04-16 18:57:42

nice :) looking forward for this

Rich

2014-04-16 19:01:06

From: Sjoe
nice :) looking forward for this


Ditto. Going to be a good read!

The Mayor

2014-04-17 03:40:30

Looking good :) Dang that 200k slayer XP :p

Clarity

2014-04-18 15:38:48

Oh my god…
As safe as color? Count me in.

The Mayor

2014-04-18 16:45:10

Starting to get interesting!

rj

2014-04-18 16:50:17

can't wait to see that 'walking procedure' part

The Mayor

2014-04-18 20:50:34

From: DemiseScythe
The presence of Texture IDs will also become extremely useful when it comes to walking as even NPC dots and Minimap icons have Texture IDs as seen below.


I can see this being useful for the OpenGL minimap disappearing glitch.

E: Do I need to get some other plugins from somewhere? (I'm running BaseScript)

Exception in Script: Plugin(GLX64) has not been found


DemiseScythe

2014-04-18 21:22:06

From: The Mayor
I can see this being useful for the OpenGL minimap disappearing glitch.

E: Exception in Script: Plugin(GLX64) has not been found (running BaseScript)


I've yet to see the minimap disappear on me as that technically shouldn't happen on a system with good amounts of resources available. You need to open the SMART file in the Misc folder and edit the java path at line 46 to your 32-bit javaw.exe I personally just uninstalled 64-bit java to get rid of that issue. I would also make sure your have turned the autoupdate off. Try that and let me know if you still experience the issue, both plugins: Open GLX.dll and OpenGL32.dll are of the 32-bit binary type and should be used with Smart running in 32-bit java.

Turpinator

2014-04-18 21:30:06

Wut? Bambi actually doing something for the community? Someone check her IP to make sure she hasnt been hacked.

The Mayor

2014-04-18 21:42:28

From: DemiseScythe
I've yet to see the minimap disappear on me as that technically shouldn't happen on a system with good amounts of resources available. You need to open the SMART file in the Misc folder and edit the java path at line 46 to your 32-bit javaw.exe I personally just uninstalled 64-bit java to get rid of that issue. I would also make sure your have turned the autoupdate off. Try that and let me know if you still experience the issue, both plugins: Open GLX.dll and OpenGL32.dll are of the 32-bit binary type and should be used with Smart running in 32-bit java.


I think it is the 32-bit path already :( I probably need that PDF that XoL has got

DemiseScythe

2014-04-18 22:08:41

From: The Mayor
I think it is the 32-bit path already :( I probably need that PDF that XoL has got


I haven't tried this with Windows 8 but it should work. Have you tried temporarily uninstalling Java 64 bit to see if that clears the issue? I can see the sps plugins which tell me that you did not do a clean install into your Simba OGL folder. You do not have to and should not do a clean install. Just delete the plugins and include folders and add the ones included in the SimbaOGL.rar

Also a quick note on using Windows. You got 2 folders with the Simba installation files:

C:\\Simba\ and C:\\SimbaOGL\

Simba is installed to C:\\Simba\ and all .simba files are associated to that install and will open using that simba folder. If you open Simba file inside C:\\SimbaOGL\ or anywhere else on your computer, it will open using the C:\\Simba\ install which has the wrong plugins. If you are going for a dual install, you need to open Simba.exe inside the C:\\SimbaOGL\ and go to File > Open > BaseScript.simba since that will open BaseScript.simba with the C:\\SimbaOGL\ install. There after, you can just do File > Open Recent… > BaseScript.simba to quickly open that file. I think this is what is messing you up. Try it and let me know.

Fixed the installation instructions. Start from scratch following them and it should work.

The Mayor

2014-04-18 23:02:45

From: DemiseScythe
I think this is what is messing you up. Try it and let me know.

Fixed the installation instructions. Start from scratch following them and it should work.


Yea that was it, the files were associated to the old C:\Simba folder. Now it compiles but smart won't spawn.


** Smart Cannot Spawn Clients **
Successfully executed.

I uninstalled java and installed the latest 32-bit only. The path on line 46 is correct so I don't know why Self.__Target is equal to 0. Could be a Win8 thing?


Self.__Target := SmartSpawnClient('C:\Program Files (x86)\Java\jre7\bin\javaw.exe', Replace(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], Width, Height, InitSequence, '', '-XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30', Implode(',', Plugins));

E: I can still spawn smarts using SRL6 fine.

DemiseScythe

2014-04-18 23:19:46

From: The Mayor
Yea that was it, the files were associated to the old C:\Simba folder. Now it compiles but smart won't spawn.


** Smart Cannot Spawn Clients **
Successfully executed.

I uninstalled java and installed the latest 32-bit only. The path on line 46 is correct so I don't know why Self.__Target is equal to 0. Could be a Win8 thing?


Self.__Target := SmartSpawnClient('C:\Program Files (x86)\Java\jre7\bin\javaw.exe', Replace(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], Width, Height, InitSequence, '', '-XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30', Implode(',', Plugins));

E: I can still spawn smarts using SRL6 fine.


Extract and overwrite the plugins again. If that still doesn't result in a spawned Smart. I would send Brandon an email about that and maybe he can help you spawn Smart. Just because the script compiles, it doesn't mean that the plugins are correct. I remember when I was new with OGL how painful it was to get my computer to be happy with OGL but since it easily adapts to it. I managed to grab an 8 month old Simba install folder, add new plugins and it booted Smart right away with OGL working. There is some weird Lape bug that happens when using the double __Text way of writing things so it might be that. I am way past my bed time so I will stop here for today. Good luck trying to get that resolved.

[XoL] I would really appreciate it if you sent me a copy of the pdf that has all the setup instructions. I am working on fixing my server and after I finish this tutorial, I will get the script running and give you a new key =).

[XoL]

2014-04-18 23:28:53

DEMISE you are alive?! I have been searching far and wide for you, lol. Ill hyu with a PM!

The Mayor

2014-04-19 00:50:05

From: DemiseScythe
Extract and overwrite the plugins again


BAM, that fixed it!

I copied over my original plugins from C:\Simba\Plugins to C:\SimbaOGL\Plugins, and not the ones I downloaded from your attachment above. Smart spawned but it wasn't grabbing the OGL data, so I copied over your OpenGL32.dll and it works. This is the openGL minimap glitch, but it looks like you can still grab all the npc/symbol data so shouldn't screw up walking like SPS.

http://puu.sh/8exCI.png

DemiseScythe

2014-04-19 14:18:57

From: The Mayor
BAM, that fixed it!

I copied over my original plugins from C:\Simba\Plugins to C:\SimbaOGL\Plugins, and not the ones I downloaded from your attachment above. Smart spawned but it wasn't grabbing the OGL data, so I copied over your OpenGL32.dll and it works. This is the openGL minimap glitch, but it looks like you can still grab all the npc/symbol data so shouldn't screw up walking like SPS.

http://puu.sh/8exCI.png


That is great. OGL scripts will be completely unaffected by it since all walking uses are icons. My SMART plugin is from before Windows 8 so idk if the new version has compatibility fixes. I'll continue with the tutorial in a couple hours.

Frement

2014-04-19 14:29:09

From: DemiseScythe
That is great. OGL scripts will be completely unaffected by it since all walking uses are icons. My SMART plugin is from before Windows 8 so idk if the new version has compatibility fixes. I'll continue with the tutorial in a couple hours.


You can has the chunk of the loaded minimap, keeping a record of these hashes could be used to get the loaded chunk, and position can be calculated from the draw position, versus the top left corner of the chunk in the database (should contain a record of position in the top left corner).

DemiseScythe

2014-04-19 22:12:19

That concludes Chapter 3 of this tutorial. I will write the last two chapters tomorrow which applies everything I've talked about in this tutorial to make an actual OGL scripts. With them you will be able to see some more tricks that I use while scripting.

Clarity

2014-04-19 22:13:03

Just fired it up, tested out the model/texture debugging…and I can't wait to make some scripts with this. One question, the model IDs don't ever change (e.g. IDs cycle when RS is updated or a new client is spawned)? If so, this just became my new obsession. Incredible contribution to the community!

Re humanism: IDs are being recognized behind the inventory/minimap, but I suppose that won't matter if the script is done so that it only reacts to IDs seen within the SS bounds. Really cool to feel like I'm using some injection/reflection debugger when it's really not.

Edit: Because I noticed bank slots/invent slots are all the same texture ID (e.g. 88625 in the picture) I tried to make a new visual debug mode that didn't include them, but it seems I'd have to edit the plugin for that.

DemiseScythe

2014-04-19 22:20:24

From: Clarity
Just fired it up, tested out the model/texture debugging…and I can't wait to make some scripts with this. One question, the model IDs don't ever change (e.g. IDs cycle when RS is updated or a new client is spawned)? If so, this just became my new obsession. Incredible contribution to the community!


OGL IDs are permanent. The only way they can change is if the RS developers actually make new Sprites/Textures/Models so unless they change the graphics for a certain NPC, item or do an area makeover the IDs shouldn't change. Monster NPCs are a different story. Since same monsters have have multiple designs like Cows having different colors they each get their own ID even though they are the same NPC. Some monsters like Bloodvelds do weird things such as change IDs after you kill one or two. But they always start at the same ID before you attack and switch to the same ID afterwards. Thus I just coded the IDs before and after attacking them getting around this issue and my script will recognize either case.

Edit: It shows Model IDs behind the interphases because the models are actually being rendered, the interphases are just 0% transparent and hiding them. It shouldn't be a problem since we will only interact with models inside the SS bounds hence the reason why I invented and defined this Screen Area.

Yes but it is not that simple, I wouldn't worry about them. Just use the priting approach to get around it as I explained. Another thing you can do is while in 'T' mode, drag an item off the inventory over the SS area. You should be able to see its ID without background stuff getting in your way. Then print its OGL data using that visually obtained ID to get all the information belonging to it.

Clarity

2014-04-19 22:27:50

Awesome, thanks for explaining that! Looking forward to the rest of the tutorial.
E: Yeah. I'm a newb to this kind of thing so I appreciate the explanations.

The Mayor

2014-04-19 22:49:25

@Clarity better get started on that dung script

Clarity

2014-04-19 22:52:34

From: The Mayor
@Clarity better get started on that dung script

It'd be embarrassing to not start now.

But I'm doing this first :D


This is frickin' brilliant…all you need to tell what attack style the monster is using is different model IDs, I had been spending hours trying to think of weird pixelshift methods to figure it out.


DemiseScythe

2014-04-19 22:59:34

From: The Mayor
@Clarity better get started on that dung script


It is possible if an MMtoMS like function is used to help with room identification. Hardest part is differentiating between the IDs from one room and the other. I'll also be extremely hard without the fancier OGL finding methods I've created since my color scripting days but good luck. Anything is possible with OGL.

Edit: What are those supposed to be?

Clarity

2014-04-19 23:10:57

From: DemiseScythe
Edit: What are those supposed to be?


Glacors, they fluctuate between 3-4m gp/hr and are a solid 800k magic XP/hr. You get about 90 kills per hour, 3 charms (usually blue) per trip.

http://runescape.wikia.com/wiki/Money_making_guide/Killing_glacors

They have a special attack that halves HP which was really making color scripting difficult for them since detecting the special projectile (different from their standard attacks) was tricky. Now it's just another ID.

And yeah, I already had a strategy for room differentiation and understanding of the DG's floor plan. Hopefully there are different IDs for things like the emote puzzle, but you say IDs are based on equipped items so perhaps not.

DemiseScythe

2014-04-19 23:14:44

From: Clarity
Glacors, they fluctuate between 3-4m gp/hr and are a solid 800k magic XP/hr. You get about 90 kills per hour, 3 charms (usually blue) per trip.

http://runescape.wikia.com/wiki/Money_making_guide/Killing_glacors

They have a special attack that halves HP which was really making color scripting difficult for them since detecting the special projectile (different from their standard attacks) was tricky. Now it's just another ID.


That still sounds scary. I am maxed and I have still died 3-4 times on a slayer task with my script on its third version. If they aren't aggresive it isn't that bad, the worst is when they are. I have only really killed TDS.

Clarity

2014-04-19 23:18:14

From: DemiseScythe
That still sounds scary. I am maxed and I have still died 3-4 times on a slayer task with my script on its third version. If they aren't aggresive it isn't that bad, the worst is when they are. I have only really killed TDS.


Non-aggressive :) The game only lets you fight one at a time as well, so it's a pretty safe area as long as you are paying attention (and a script with good failsafes/checks should accomplish that).

DemiseScythe

2014-04-19 23:31:45

From: Clarity
Non-aggressive :) The game only lets you fight one at a time as well, so it's a pretty safe area as long as you are paying attention (and a script with good failsafes/checks should accomplish that).


Sounds like an interesting challenge. I will learn to kill them and code myself a version. You can code yours and learn through it. We could compare the script's efficiency once they are done. People never read threads past the first and last page. So here is a little bonus for those who do:

6-hour fix example:
(*========OGL Edition========*)
(*========Version 2.3========*)

var
AT, SXP, XPMod, LapGoal, Laps: Integer;

procedure VSettings;
begin
end;

function VGnomeAdvanced: Boolean;
var
T: glModelArray;
AXP: Integer;
begin
VMakeCompass(0);
repeat
AXP := VGetAgilityXP;
repeat
T := glGetModels(4390934, SS);
if Length(T) > 0 then
Mouse(T[0].X+10, T[0].Y, 1, 1, Mouse_Right);
until GL_WaitOption('Log', 300) or (not(GL_LoggedIn));
VMakeCompass(189);
Mouse(685, 180, 1, 1, Mouse_Move);
VFlag;
repeat
Wait(50 + Random(25));
until (VGetAgilityXP > AXP) or (not(GL_LoggedIn));
AXP := VGetAgilityXP;
Mouse(702, 180, 1, 1, Mouse_Left);
VFlag;
repeat
Wait(50 + Random(25));
until (VGetAgilityXP > AXP) or (not(GL_LoggedIn));
AXP := VGetAgilityXP;
repeat
T := glGetModels(691262085, SZ);
if Length(T) > 0 then
Mouse(T[0].X, T[0].Y+5, 1, 1, Mouse_Right);
until GL_WaitOption('Climb', 300) or (not(GL_LoggedIn));
VFlag;
repeat
Wait(50 + Random(25));
until (VGetAgilityXP > AXP) or (not(GL_LoggedIn));
AXP := VGetAgilityXP;
repeat
T := glGetModels(3621496568, SZ);
if Length(T) > 0 then
Mouse(T[0].X+10, T[0].Y, 1, 1, Mouse_Right);
until GL_WaitOption('Climb', 300) or (not(GL_LoggedIn));
VFlag;
Mouse(430, 230, 1, 1, Mouse_Move);
repeat
Wait(50 + Random(25));
until (VGetAgilityXP > AXP) or (not(GL_LoggedIn));
AXP := VGetAgilityXP;
repeat
T := glGetModels(3757550601, SS);
if Length(T) > 0 then
Mouse(T[0].X+15, T[0].Y, 1, 1, Mouse_Right);
until GL_WaitOption('Run', 300) or (not(GL_LoggedIn));
VMakeCompass(30);
VFlag;
Mouse(700, 70, 1, 1, Mouse_Move);
repeat
Wait(50 + Random(25));
until (VGetAgilityXP > AXP) or (not(GL_LoggedIn));
AXP := VGetAgilityXP;
repeat
VMakeCompass(30);
VMakeCompass(0);
T := glGetModels(347181813, SS);
if Length(T) > 0 then
Mouse(T[0].X+15, T[0].Y-22, 1, 1, Mouse_Right);
until GL_WaitOption('Swing', 300) or (not(GL_LoggedIn));
VMakeCompass(0);
VFlag;
repeat
Wait(50 + Random(25));
until (VGetAgilityXP > AXP) or (not(GL_LoggedIn));
AXP := VGetAgilityXP;
repeat
T := glGetModels(3849310599, SZ);
if Length(T) > 0 then
Mouse(T[0].X, T[0].Y+10, 1, 1, Mouse_Right);
until GL_WaitOption('Jump', 300) or (not(GL_LoggedIn));
VFlag;
repeat
Wait(50 + Random(25));
until (VGetAgilityXP > AXP) or (not(GL_LoggedIn));
if (not(VHitpoints(75))) then
Exit;
Inc(Laps);
XP := VGetAgilityXP - SXP;
Minutes := Round((GetSystemTime - AT)/60000);
ClearDebug;
Writeln('DemiseAgility GLX V1.0');
Writeln('Laps: ' + IntToStr(Laps));
Writeln('Agility Experience Earned: ' + IntToStr(XP));
Writeln('Time Passed: ' + IntToStr(Minutes) + ' Minutes');
Writeln('Agility Xp/Hr: ' + IntToStr(Round(((XP+XPMod)*60)/Minutes)));
until (Laps >= LapGoal) or (not(GL_LoggedIn));
end;

begin
ClearDebug;
T.Create(1350, 670, '', ['OpenGL32.dll']);
GLXMapHooks(T.CurrentClient);
VDebug('N');
VSettings;
VLogInPlayer;
VBounds;
VSpin;

Laps := 0;
XPMod := 0;
LapGoal := 350;
AT := GetSystemTime;
SXP := VGetAgilityXP;
repeat
VGnomeAdvanced;
SMARTkillClient(T.CurrentClient);
T.Create(1350, 670, '', ['OpenGL32.dll']);
GLXMapHooks(T.CurrentClient);
VLogInPlayer;
VBounds;
VSpin;
IncEx(LapGoal, 350);
IncEx(XPMod, 725);
until (not(GL_LoggedIn));
VSoundBase('End');
TerminateScript;
end.

It is a bit outdated and it shouldn't compile, at least with DemiseGLZ which has the VGetAgilityXP removed. Changing that to VGetOverallXP is equivalent. It gets the idea through though. If you implement that loop, you will be able to make your script last past the 6 hours. OGL starts to get a little bit buggy around 5 hours because the memory builds up due to memory leaks so I prefer to voluntarily kill SMART every 5 hours and start fresh. Stopping the script on my terms also makes sure it terminates where I want it to and not in the middle of a lap where the whole cycle can get messed up at least in an agility script. I should fix this, I still need 99 Agility and this was stable 56k/hr.

Clarity

2014-04-20 01:56:12

For anyone making combat scripts, this is a useful addition to the DemiseGLZ include:


function VGetPrayerPercent: Integer;
var
H: glTextureArray;
S, T: TStringArray
begin
if (not(GL_LoggedIn)) then
begin
Result := 50;
Exit;
end;
H := glGetTextures(61688, 2894399, 5);
if (Length(H) < 1) then
S := glCharsToText(glGetChars(IntToBox(880, 598, 959, 628)))
else
S := glCharsToText(glGetChars(IntToBox(H[0].X+10, H[0].Y-15, H[0].X+115, H[0].Y+1)));
if (Length(S) > 0) then
begin
ExplodeWrap('/', S[0], T);
if (Length(T) > 1) then
begin
if (Length(ExtractFromStr(T[0], Numbers)) > 0) and (Length(ExtractFromStr(T[1], Numbers)) > 0) then
begin
Result := Round((StrToInt(ExtractFromStr(T[0], Numbers))*100) / StrToInt(ExtractFromStr(T[1], Numbers)));
Exit;
end;
end;
end;
Result := 50;
end;
Basically GetHPPercent with slight changes. Could ultimately make a more general function so that someone could just have VGetPercent(PRAYER) or VGetPercent(LIFEPOINTS);
Probably making that soon actually since I also need a way to detect adrenaline percent.

Also changed the mouse functions to use the more updated humanWindMouse.

The Mayor

2014-04-20 06:46:58

If you're making a combat script you should check out Mark's ogl script

Clarity

2014-04-20 07:46:13

From: The Mayor
If you're making a combat script you should check out Mark's ogl script

Ah thanks man!
Just made a rorarii script, really liking the profits.

I'm paranoid about human realism though and there don't seem to be any antiban functions in the includes, so the script looks very bot-like mouse-wise. Gonna try making some custom ones for this.

Random notes:
Models that are the same shape but different colors seem to have the same IDs (keystones), and it also seemed to depend on the floor they were on? Not sure if that's an accurate conclusion.
Glacors and their minions all have the same ID, which presented a big problem. Working on a way to overcome that now.

DemiseScythe

2014-04-20 08:37:53

From: Clarity
Ah thanks man!
Just made a rorarii script, really liking the profits.

I'm paranoid about human realism though and there don't seem to be any antiban functions in the includes, so the script looks very bot-like mouse-wise. Gonna try making some custom ones for this.

Random notes:
Models that are the same shape but different colors seem to have the same IDs (keystones), and it also seemed to depend on the floor they were on? Not sure if that's an accurate conclusion.
Glacors and their minions all have the same ID, which presented a big problem. Working on a way to overcome that now.


Lightning is different in each floor type leading to different IDs. Instead of 'Attack' if you use 'Glacor' it will only attack when it right-clicks a Glacor. Also, I suggest you add your functions to your own include script since it is much easier for everyone to have the same DemiseGLZ.simba than different versions. If they want to use your script, just provide your script plus the necessary includes.

Clarity

2014-04-20 18:02:25

Yeah, I've been doing that. Been making some overload functions for your existing ones. There are a number of situations where the basic mouse/etc functions don't quite perform what's needed (very situational, not your fault at all).

My color rorarii script was about 1k lines and less reliable, rewritten OGL version is ~350 lines and flawless. Thanks!


15 min later
About 30m profit so far since starting to write the script last night.

The Mayor

2014-04-20 18:16:33

Is it possible to use SRL6 and GLX include at the same time?

E: Clarity, 85k per line :p

Clarity

2014-04-20 19:35:44

From: The Mayor
Is it possible to use SRL6 and GLX include at the same time?

E: Clarity, 85k per line :p

Yeah a combination would be ideal, although idk if it works that way. I have run into many instances so far where SRL6 functions would save a lot of trouble. Although, having to make workarounds has provided a nice learning experience.

About 100k worth now Mayor :D

DemiseScythe

2014-04-20 23:22:12

From: Clarity
Yeah a combination would be ideal, although idk if it works that way. I have run into many instances so far where SRL6 functions would save a lot of trouble. Although, having to make workarounds has provided a nice learning experience.

About 100k worth now Mayor :D


I would like to see a copy of that if you don't mind to see how you are writing the code itself. Feel free to remove the actual IDs. SRL6 is not compatible as updating SRL6 would overwrite the hooked plugins and running SRL6 without the updater is rather pointless. OGL has everything I need and if I need anything else, I just create my own function. That way I don't have to wait on someone else to release a fix.

I just wrote Chapter 4 of the tutorial. I will edit that out later with the fully finished power miner script. Fighting scripts really sound fun. If you would be so kind to tell me what is good to kill nowdays, I'll be more than happy to try them out since I am going to need a lot of Membership days to repair my +2400 lines OGL script. I am currently surviving on bonds so I got like a 8 days left of the 14 days the first bond gave me worth of membership. I don't know how to make money anymore in RS. Last good method I had was like 250k/hr.



Clarity

2014-04-21 00:14:10

The rorarii script I made is averaging like 3m gp/hr at 99 ranged (using maxed account).

You can make like 10m in an hour and 0m for the next hour, it has a weird way of never being balanced for me, haha.

Check this page (http://runescape.wikia.com/wiki/Money_making_guide) for good money making methods, QBD might be something interesting to try out, kills are usually 250k value each and take 2-4 minutes.

DemiseScythe

2014-04-21 06:08:34

From: Clarity
The rorarii script I made is averaging like 3m gp/hr at 99 ranged (using maxed account).

Check this page (http://runescape.wikia.com/wiki/Money_making_guide) for good money making methods, QBD might be something interesting to try out, kills are usually 250k value each and take 2-4 minutes.


Thank you, ranged is cool. I got 99 running my Slayer script in ranged mode. Looked at some of the money making methods and although they look interesting. I don't have the requirements not the level at the time plus they sound risky. TDS script I am willing to make more for the challenge of it. As for money making, well my old method is now profitable and I got a few slaves that can collectively make me 7.5M/hr while being completely undetectable from RS. Shame I sold my 6 Nat crafters, they'd be making quite a pretty penny. The main issue is the temperature. I shouldn't run that many on my laptop unless I want to melt the motherboard and cpu again. It gets pretty hot on just 12% load.




Anyone knows reasonable CPU for a build? I built 4770k computer recently and although nice, I don't have the $1.1k nor do I need that much power. Looking for a 2500k or 3770k build that comes out reasonable at around $700ish.

Anyone know of any more random stuff that pops up in inventories over time besides?


Clarity

2014-04-21 18:48:53

Re SRL compatibility, this scripting method is extremely viable and I would motion for the hooked plugins becoming included with the updater (maybe as like opengl32_h.dll or some different name that script authors can choose to use or not)…but that's just my opinion :p

so that in an openGL script you would just say smartPlugins = ['openGL32_h.dll']

or is it not that simple?

Personally, since the updater is bugged a lot, I have disabled it and always just redownload SRL6/plugins from github whenever I hear of an update being released.

DemiseScythe

2014-04-22 07:50:17

From: Clarity
Re SRL compatibility, this scripting method is extremely viable and I would motion for the hooked plugins becoming included with the updater (maybe as like opengl32_h.dll or some different name that script authors can choose to use or not)…but that's just my opinion :p

so that in an openGL script you would just say smartPlugins = ['openGL32_h.dll']

or is it not that simple?

Personally, since the updater is bugged a lot, I have disabled it and always just redownload SRL6/plugins from github whenever I hear of an update being released.


The devs are opposed to distributing the hooked plugin so that is the reason all GLHook development has been thrown into this sub forum. If you need a specific function, just port it and fix it for OGL. Here is an example:

function VGetAmount(area: TBox): integer;
begin
Result := StrToInt(ExtractFromStr(getTextAtEx(area.X1, area.Y1, area.X2, area.Y2, 0, 1, 1, 65535, 0, statChars), Numbers));
end;

Pretty much had to write it from scratch but it is an OGL working equivalent of the color version. Then I can search for a certain texture and store it to G, a glTextureArray. By passing G[0].Bounds to this function, I get the amount of the texture in the pile. Anyways, I got two tests this thursday so I'll be putting the tutorial into hold until the weekend.

The Mayor

2014-04-23 01:21:34

You can just directly copy and paste a whole bunch of functions too. Pixel shift stuff and msToTime etc.

E: Really rough script that picks flax and then goes and spins it, then banks it. 200 lines:


|| The Mayor's OGL Flax PickSpin ||
|| v.1.00 ||
|| ||
|| Run Time: 20m 33s ||
|| Loads Done: 5 ||
|| Flax Spun: 140 (408 PH) ||
|| Profit Made: 51800 (151137 PH) ||
||--------------------------------||

+ 6k crafting xp/h

Pretty botty though. Will be interesting to see ban rate.


E2: Seems to get real laggy after a while


|| The Mayor's OGL Flax PickSpin ||
|| v.1.00 ||
|| ||
|| Run Time: 01h 11m 47s ||
|| Loads Done: 13 ||
|| Flax Spun: 364 (304 PH) ||
|| Profit Made: 134680 (112567 PH)||
||--------------------------------||

DemiseScythe

2014-04-23 16:01:38

Completely finished chapter 4. Chapter 5 is pending until I am finish with my tests tomorrow. Fancy little script can get me 99 in a week or two. Personally might make myself a Gold Miner once I reach level 80.

The Mayor

2014-04-23 18:27:27

From: DemiseScythe
Completely finished chapter 4. Chapter 5 is pending until I am finish with my tests tomorrow. Fancy little script can get me 99 in a week or two. Personally might make myself a Gold Miner once I reach level 80.


I'm keen to see how you implement your walking stuff. I've been doing something like this:


if VClickItem(51675, 4212576, 15, 50, SM, MOUSE_LEFT) then {MM Lodestone Symbol}
if waitForModel(2614060304, SZ, 100, 10000) then {Blue Flag Model}
if VClickItem(45052, 3618624, 5, 10, SM, MOUSE_LEFT) then {MM Bank Symbol}
if waitForModel(3498681761, SZ, 100, 10000) then {Bank Booth Model}
waitPlayerMoving();

DemiseScythe

2014-04-23 18:52:02

From: The Mayor
I'm keen to see how you implement your walking stuff. I've been doing something like this:


if VClickItem(51675, 4212576, 15, 50, SM, MOUSE_LEFT) then {MM Lodestone Symbol}
if waitForModel(2614060304, SZ, 100, 10000) then {Blue Flag Model}
if VClickItem(45052, 3618624, 5, 10, SM, MOUSE_LEFT) then {MM Bank Symbol}
if waitForModel(3498681761, SZ, 100, 10000) then {Bank Booth Model}
waitPlayerMoving();


I don't plan to do something as complicated as what I did with my slayer script but here is one of the walks:

function VJ: Boolean;
var
U: glModelArray;
I: Integer;
begin
if VClickItem(VVVVV[0], VVVVV[1], 20, SI, Mouse_Right, VVVVVVV[0]) then
begin
Wait(2450 + Random(50));
VMakeCompass(0);
if VFindModel(VVVVVV[0], SZ) then
begin
I := 0;
repeat
Wait(100 + Random(50));
Inc(I);
until VClickModel(VVVVVV[0], SZ, Mouse_Right, VVVVVVV[1]) or (I > 10) or (not(GL_LoggedIn));
Wait(1450 + Random(50));
Mouse(SMCX+26, SMCY+120, 1, 1, Mouse_Left);
VFlag;
Wait(750 + Random(50));
VMakeCompass(275);
Mouse(SMCX+54, SMCY-130, 1, 1, Mouse_Left);
VFlag;
Wait(850 + Random(50));
if VFindModel(VVVVVV[1], SS) then
begin
I := 0;
repeat
U := glGetModels(VVVVVV[1], SS);
if (Length(U) > 0) then
Mouse(U[0].X, U[0].Y-23, 1, 1, Mouse_Right);
Inc(I);
until GL_WaitOption(VVVVVVV[2], 300) or (I > 10) or (not(GL_LoggedIn));
VFlag;
Wait(750 + Random(50));
if VFindModel(VVVVVV[2], SS) then
begin
I := 0;
repeat
Wait(100 + Random(50));
Inc(I);
until VClickModel(VVVVVV[2], SS, Mouse_Right, VVVVVVV[2]) or (I > 10) or (not(GL_LoggedIn));
Wait(750 + Random(50));
if VFindModel(VVVVVV[3], SZ) then
begin
I := 0;
repeat
Wait(100 + Random(50));
Inc(I);
until VClickModel(VVVVVV[3], SZ, Mouse_Right, VVVVVVV[1]) or (I > 10) or (not(GL_LoggedIn));
Wait(750 + Random(50));
Mouse(SMCX+31, SMCY-100, 1, 1, Mouse_Left);
VFlag;
Wait(750 + Random(50));
Mouse(SMCX+15, SMCY-90, 1, 1, Mouse_Left);
VFlag;
VFlag;
Wait(650 + Random(50));
VMakeCompass(355);
if VClickModel(VVVVVV[4], SS, Mouse_Right, VVVVVVV[3]) then
begin
VFlag;
Wait(950 + Random(50));
U := glGetModels(IntToBox(VVVVV[2], VVVVV[3], VVVVV[4], VVVVV[5]));
if (Length(U) > 0) then
begin
Mouse(U[0].X, U[0].Y, 1, 1, Mouse_Right);
if GL_WaitOption(VVVVVVV[3], 300) then
begin
VFlag;
Wait(950 + Random(50));
U := glGetModels(IntToBox(VVVVV[2], VVVVV[3], VVVVV[4], VVVVV[5]));
if (Length(U) > 0) then
begin
Mouse(U[0].X, U[0].Y, 1, 1, Mouse_Right);
if GL_WaitOption(VVVVVVV[3], 300) then
begin
VFlag;
Wait(950 + Random(50));
VMakeCompass(270);
Mouse(SMCX-20, SMCY-40, 1, 1, Mouse_Left);
VFlag;
Wait(750 + Random(50));
if VFindItem(VVVVV[6], VVVVV[7], SM) then
begin
I := 0;
repeat
if VClickItem(VVVVV[6], VVVVV[7], SM, Mouse_Left) then
VFlag;
Wait(650 + Random(50));
Inc(I);
until VFindModel(VVVVVV[5], SZ) or (I > 10) or (not(GL_LoggedIn));
if VFindModel(VVVVVV[5], SZ) then
begin
I := 0;
repeat
Wait(100 + Random(50));
Inc(I);
until VClickModel(VVVVVV[5], SZ, Mouse_Right, VVVVVVV[4]) or (I > 10) or (not(GL_LoggedIn));
VFlag;
Wait(4450 + Random(50));
Mouse(SMCX+70, SMCY-10, 1, 1, Mouse_Left);
VFlag;
Wait(850 + Random(50));
Result := VFindTarget;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;

If it fails, it just teleports and tries to get there again although my walks work 99% of the time.

DemiseScythe

2014-04-24 07:00:23

Well, it was good while it lasted. My laptop is more or less fried again due to overheating so I will not be able to code until after I am done with the semester and open it to have it cleaned and repasted. Enjoy the current tutorial.

Gu3st...

2014-04-24 08:01:56

From: DemiseScythe
Well, it was good while it lasted. My laptop is more or less fried again due to overheating so I will not be able to code until after I am done with the semester and open it to have it cleaned and repasted. Enjoy the current tutorial.
We could all pitch in like 10 dollars each and you'd get a new laptop in no time!

Frement

2014-04-24 08:43:45

From: Zyt3x
We could all pitch in like 10 dollars each and you'd get a new laptop in no time!


I'm in!

DemiseScythe

2014-04-24 13:03:11

From: Zyt3x
We could all pitch in like 10 dollars each and you'd get a new laptop in no time!




It sounds like a good idea and I appreciate the support. My laptop is from 2010 and it doesn't have integrated graphics which means the GPU must run all the time. It has always run hot and last time the extreme overheating started happening, it kept completely freezing anytime it got hot until eventually I couldn't even surf the internet. Sent it to Dell for out of warranty repair and they charged me $560ish which was their flat fee for CPU/motherboard damage. They claim they replaced the motherboard, CPU/heatsink and RAM because they got melted/burned/damaged which I doubt since the MSRP for a 840qm was like $500-600 at the time. They probably just added cheap paste and dusted it a little. It started overheating like a couple months later though it hadn't gone back to freezing until last night.

I don't want a laptop anymore since they overheat easily. I rather get a big box that allows for air flow in my midly warm room temperature. I got some money saved although it isn't much, about $340. This is what I am trying to save for to replace my laptop: http://pcpartpicker.com/p/3xGge That says $770 though they charge me taxes so it will be closer to $842. I can probably sell the 100M I got on my main to Justin and get $35 out of that so I'll still be $467 short. I doubt there will be 46 donators.

I got nothing to offer back other than my gratitude and code. I could write, release and support more scripts for free for all SRL members. Repair my Slayer script and give out free keys to anyone who requests them. Upheld function and script request threads short of a Dung script request. More advanced tutorials that go indept into walking and php based authentication methods. With some more work, I bet we could get a small OGL subforum going as long as those who decide to release scripts are willing to keep them reasonably updated. I code because it is fun and challenging. There is so much I haven't have a chance to script for such as TDS and others. My Slayer script took around a year to write and is 2400 lines which is long for OGL code given that a good power miner can be written with less than 20 lines. It will probably take 3-5 weeks to fix but I want to do it because it is just so useful and can help many members here.



Well if anyone wishes to donate they can just send me a pm requesting the PP email address. Currently 55.5% to goal.

The Mayor

2014-04-24 17:51:57

I had a HP DV6 laptop which overheated. It got so hot that it melted the solder around the gpu (basically disconnecting it from the mobo) which meant that my screen was always black. I had to take the mobo out and heat it up with a mini gas torch to reset it. Eventually it would break again from the heating/cooling from normal use. One day I tried to fix it on my gas stove which ended badly as I ended up melting the mobo beyond repair, haha :(

Clarity

2014-04-25 12:53:13

Haha I'd be down for making a $10 dollar donation, I've already made like 10x that with what you provided for us here.
Something I would recommend strongly considering, which would save everyone tons of time when grabbing model and texture IDs, would be some way of filtering out the known common textures (blank invent slots, borders of interfaces), so that only the important ones show up on the debugger (I know you said it was more complicated than that).

For instance, I've been trying to figure out a certain ID, and it's taken me like over an hour of inductive reasoning to try and filter it out from all of the noise. Still not getting the correct one. Maybe I'm just stupid. Maybe it's a breeze for everyone else :p

DemiseScythe

2014-04-26 05:44:17

From: Clarity
Haha I'd be down for making a $10 dollar donation, I've already made like 10x that with what you provided for us here.
Something I would recommend strongly considering, which would save everyone tons of time when grabbing model and texture IDs, would be some way of filtering out the known common textures (blank invent slots, borders of interfaces), so that only the important ones show up on the debugger (I know you said it was more complicated than that).

For instance, I've been trying to figure out a certain ID, and it's taken me like over an hour of inductive reasoning to try and filter it out from all of the noise. Still not getting the correct one. Maybe I'm just stupid. Maybe it's a breeze for everyone else :p


I managed to get this progress report before my computer started to lock up:



I cannot remove the screen IDs since that would require rewritting the plugin but I could stop them from being printed in my printing functions. I can still run Simba since by itself, it doesn't use much CPU or generate heat so I can write the function if you provide me an array of the useless/background textures. Give me a couple hours to write it.

function TIntegerArray.Find(G: Integer): Boolean;
var
I: Integer;
begin
for I := 0 to High(Self) do
if (Self[I] = G) then
begin
Result := True;
Exit;
end;
Result := False;
end;

procedure VPrintTextures(x1, y1, x2, y2: Integer);
var
I: Integer;
Q: TIntegerArray;
P: glTextureArray;
begin
Q := [88625]; // Array of textures to ignore;
P := glGetTextures(IntToBox(x1, y1, x2, y2));
for I := 0 to High(P) do
begin
if (not(Q.Find(P[I].ID))) then
Writeln(P[I]);
end;
end;

That is the new VPrintTextures function and it shouldn't print any texture whose ID is found in Q. All that is left is for you or someone else to compile the list of useless IDs and add them to Q. I need to turn this include into something proper useful and less specific. VPrintTextures should have TBox a overload among other fixes.

Gu3st...

2014-04-26 16:02:46

I sent you some money; post some pictures after the purchase or something! :)

Maybe we should create a thread or something here in the SRL Members section?
Donating money towards a good cause feels rewarding for me and I'm sure others would feel the same! Especially when it's for a good cause withing this community

The Mayor

2014-04-26 20:35:33

PM me your PayPal!

DemiseScythe

2014-04-26 21:10:52

From: Zyt3x
I sent you some money; post some pictures after the purchase or something! :)

Maybe we should create a thread or something here in the SRL Members section?
Donating money towards a good cause feels rewarding for me and I'm sure others would feel the same! Especially when it's for a good cause withing this community


Thank you very much, I don't know if that type of thread would be allowed. I am going to order some of the parts with the $350ish I got saved plus what you gave me. I'll try to sell the gp I got and put more money towards it. Going to sell 123M I got for $43 USD, bit less than 0.35/M and add it to the fund.

Got case and memory with some of my savings[$345-$235=$110 left]
$110[Savings Left]+$20[Zyt3x]+$20[The Mayor]=$150 is enough for the motherboard.
Found ~$100 cashback bonus on one of my mother's cards and since she is over 3k miles away at the time. Free HHD.

Edit:

Well, somehow managed to borrow enough for the CPU from a friend, now I just got to wait for all the parts to arrive so I can put it together and start scripting again. Thank you to the two that helped me out.

DemiseScythe

2014-04-29 16:30:59

What else do people want to learn about OGL before I move on from this tutorial to my other projects?

Ian

2014-04-29 16:45:07

From: DemiseScythe
What else do people want to learn about OGL before I move on from this tutorial to my other projects?


Is it possible to use OGL to find all the points of a model so you can make sure you're clicking an area of it that's clickable?

If that doesn't make any sense maybe I could rephrase it or add a diagram to show what I mean.

DemiseScythe

2014-04-29 17:27:55

From: BMWxi
Is it possible to use OGL to find all the points of a model so you can make sure you're clicking an area of it that's clickable?

If that doesn't make any sense maybe I could rephrase it or add a diagram to show what I mean.


It is possible and I've already discussed this with Brandon. The plugin is too heavy when operating this way. In other words, it would make it too slow and use way more resources to process all the points in a model. It is possible but not really pragmatic. Just add a height modifier to all your functions. I did that for Slayer and I rarely ever miss. When I do is because it takes my function time to sort and the ms it lags can allow the model to move from where it was.

Ian

2014-04-29 18:20:54

From: DemiseScythe
It is possible and I've already discussed this with Brandon. The plugin is too heavy when operating this way. In other words, it would make it too slow and use way more resources to process all the points in a model. It is possible but not really pragmatic. Just add a height modifier to all your functions. I did that for Slayer and I rarely ever miss. When I do is because it takes my function time to sort and the ms it lags can allow the model to move from where it was.

How many ms is it total (from start to mouse starting to move) for finding an object like this?

Olly

2014-04-29 18:34:57

^ Even a TPAOutline of the model would work no?

DemiseScythe

2014-04-29 19:10:14

From: BMWxi
How many ms is it total (from start to mouse starting to move) for finding an object like this?


Thing is the plugin doesnt just see one point for a model or model ID, it sees all the points for all the models. You should be getting this information from Brandon directly but when we talked, it was way slower than using just 1 point which btw is the center of all the points. He would have to rewrite the plugin to change it so its more of if he is willing to.

Ian

2014-04-29 19:30:11

From: DemiseScythe
Thing is the plugin doesnt just see one point for a model or model ID, it sees all the points for all the models. You should be getting this information from Brandon directly but when we talked, it was way slower than using just 1 point which btw is the center of all the points. He would have to rewrite the plugin to change it so its more of if he is willing to.

Ah, ok. I was just remembering how when I tried it out (last summer I think?) that it was like I was moving the mouse blind because I'd have no way of knowing where the object was except for the point given to me by the plugin. It would be nice to use this in combination with colour so I could find the object point with OGL and then use colour to find the parts of it that I can click. I've been out of the loop with OGL since then, do you know if it can be used alongside SRL6 yet?

Frement

2014-04-29 19:32:36

Grabbing the center vertex and clicking on it, should always result in a successful click.

Ian

2014-04-29 20:08:36

From: Frement
Grabbing the center vertex and clicking on it, should always result in a successful click.


Yeah but I decided I didn't want to be clicking the same place on the model every time in case Jagex thought that that was something a bot would do.

DemiseScythe

2014-04-29 20:09:12

From: Frement
Grabbing the center vertex and clicking on it, should always result in a successful click.


Apparently not because of RS. Models have invisible parts, so their center is at their feet for moving models and in the middle for stationary ones.

Officially done with the tutorial. The mining script can last around 16 hours, it would have lasted more but I had to shut it down. Once I setup my system and can script again, I will focus on fixing my merchanter which is unfortunately plagued with bugs as well as my slayer script. To avoid getting bored, I will put on a script request thread soon and do script requests if they manage to catch my interest.

DemiseScythe

2014-05-03 13:04:40

I am going to rewrite most of the include to make it human-like since there are a few things that bother me such as waitoption always clicking in the exact middle of the box. I'll release it once I am done.

DemiseScythe

2014-05-04 19:40:35

Please do not use this include to run actual scripts since there are serious issues with it such as:

Procedure MouseBox(Box: TBox; ClickType: Integer = Mouse_Move);
Begin
Mouse(MiddleBox(Box).X, MiddleBox(Box).Y, 3, 3, ClickType);
End;

I don't know what happened to this include while I was gone but functions like this will get your account flagged for revision. I will work fixing the include and checking everything in it to make sure there aren't anymore funky functions and then post it on here.

Edit:

Did optimizations and fixes on the include and it now has a fairly decent amount of randomness. Once I am done with antiban, I will release the new include.

DemiseScythe

2014-05-05 16:37:13

New OGL Include Released. Link in OP.

5/5/14 Release Notes:
-New Antiban-Add randomness to your scripts.
-Advanced Player Detection-Tells you if there is a player nearby or talking to you.
-Improved VPrintTextures-Now ignores many abstract textures and takes TBoxes.
-VRestart for 6 hour limit-Easy way to stay logged in. Added functionality to prevent unnecessary client spawn.
-Increased Randomness-Human Mouse as well as many other randomness improvements. Compatible with previous scripts.
-Bug fixes-Please do not choose World 22 as a favorite world as that will result in a bug since it is only partially visible on login. Might have fixed it.

Please look at Template file provided for file include changes.

Hoodz

2014-05-07 10:01:01

demise thank you!

going to use this to make my acc ready for legacy.

one note: if you have a pc with windows 64 bit you have 2 program files: program files and program files (x86), but if you only have 32 bit then smart wont launch since your smart file calls this:

Line 41:
 Self.__Target := SmartSpawnClient('C:\Program Files (x86)\Java\jre7\bin\javaw.exe', Replace(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], Width, Height, InitSequence, '', '-XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30', Implode(',', Plugins));
notice the (x86)

simply remove the (x86) and smart will launch

DemiseScythe

2014-05-07 12:58:20

From: hoodz
demise thank you!

going to use this to make my acc ready for legacy.

one note: if you have a pc with windows 64 bit you have 2 program files: program files and program files (x86), but if you only have 32 bit then smart wont launch since your smart file calls this:

Line 41:
 Self.__Target := SmartSpawnClient('C:\Program Files (x86)\Java\jre7\bin\javaw.exe', Replace(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], Width, Height, InitSequence, '', '-XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30', Implode(',', Plugins));
notice the (x86)

simply remove the (x86) and smart will launch


You welcome. Nice catch, I forgot about 32-bit systems since I haven't used one in quite a while. As for this tutorial, I don't know if there are people using it or not so I've just been working on my own personal work. I got walking going for one script, adding walking to the second one to get away from noobs bothering my pure. Now accounts won't try to log in if another is logging in to prevent issues as I think this is what messed up my other two pures.

rj

2014-05-07 13:11:04

From: DemiseScythe
You welcome. Nice catch, I forgot about 32-bit systems since I haven't used one in quite a while. As for this tutorial, I don't know if there are people using it or not so I've just been working on my own personal work. I got walking going for one script, adding walking to the second one to get away from noobs bothering my pure. Now accounts won't try to log in if another is logging in to prevent issues as I think this is what messed up my other two pures.


Some computers don't use the C drive so you could also get the harddrive letter:

function getHardDriveLetter():string;
var
names:string;
folders:tstringarray;
i:integer;
begin
names := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
for i := 1 to length(names) do
begin
folders := getDirectories(names[i] + ':\');
if folders.containsString('Simba') then
exit(names[i])
else
folders.clear();
end;
end;

DemiseScythe

2014-05-07 13:32:24

From: Robert
Some computers don't use the C drive so you could also get the harddrive letter:

function getHardDriveLetter():string;
var
names:string;
folders:tstringarray;
i:integer;
begin
names := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
for i := 1 to length(names) do
begin
folders := getDirectories(names[i] + ':\');
if folders.containsString('Simba') then
exit(names[i])
else
folders.clear();
end;
end;


There is no issue in regards to the path since the only file that include Simba's path is the settings file which I don't include since I keep my Simba on the D drive.

Hoodz

2014-05-07 13:44:59

From: DemiseScythe
You welcome. Nice catch, I forgot about 32-bit systems since I haven't used one in quite a while. As for this tutorial, I don't know if there are people using it or not so I've just been working on my own personal work. I got walking going for one script, adding walking to the second one to get away from noobs bothering my pure. Now accounts won't try to log in if another is logging in to prevent issues as I think this is what messed up my other two pures.


btw demi do you have skype?

DemiseScythe

2014-05-07 13:49:20

From: hoodz
btw demi do you have skype?


Not really, I always use IRC.

Hoodz

2014-05-07 13:54:51

From: DemiseScythe
Not really, I always use IRC.


can you get on IRC (a)

DemiseScythe

2014-05-07 14:01:14

From: hoodz
can you get on IRC (a)


#srl-thinktank on Rizon, look for Bambi

Also, for anyone suffering the OGL Minimap glitch, I found a fix.

If you have an active task that displays the yellow arrow on the minimap, it loads correctly. I am yet to see if removing the yellow arrow will leave the Minimap working but that seemed to fix it. It shouldn't really bother an GLH user as you don't even need the visible map to walk.

DemiseScythe

2014-05-09 08:50:17

Thank you Zytex and The Mayor for your help. I still had to lend a little over $400 from my friend but I managed to get a desktop to code on and run scripts. I should be able to pay back my friend if I run some money makers during the summer. 3 of 4 of my pures got banned in the process of fixing my include but with my main and the pure that remains, I should be alright eventually. I have greatly decreased the chances of getting banned in both of them and with just two accounts, I can actually take care of both and still output 1.4b/month.

Some pictures from my build: http://puu.sh/8FhKo http://puu.sh/8FhKv http://puu.sh/8FhKE http://puu.sh/8FhKK http://puu.sh/8FhXf.jpg

I've managed to finally get around to fixing my auth system for my Slayer script so now I can actually run it without crashing and burning with access violations: http://puu.sh/8FfMn.png =) I got two finals early next week but after I am done with them, I can get around to testing every single function and fixing what doesn't work. Eventually I'll be able to give away auths in a controlled manner.

In other news, I got plans to add onto this tutorial an OGL walking section as well as a Pyramid Plunder and a Advanced Barbarian Agility script for SRL members. Other than walking, I don't think there is anything else I haven't covered but if you got any suggestions feel free to express it and I might consider it.

DemiseScythe

2014-05-10 18:25:56

They can't keep it down forever =)



I handled the decrypting and so far I've only fixed up to the combat functions meaning that if I start it at the task it will work as long as I fix the IDs. I still need to fix some miscellaneous functions, walking functions and the master functions that control all the logic. Also, every single NPC ID changed so it will take me a while to compile the list of IDs again although everything else about an NPC is pretty much still the same except for the walks since the icons changed. Overall progress is line 1035/2410 plus the IDs and encryption. I'd say I am 40% done on fixing it but not bad for 24 hours worth of work since I am not just fixing it but improving on it.

I do have bonus Slayer experience and probably some combat bonus so the experience rates on the progress report will not be that high normally but slayer should be 50% of what is shown there since I am only gaining 2X the experience.

The Mayor

2014-05-13 05:31:42

Nice build you have there, and good to see your slayer script up and running!!

E: I wouldn't go botting too long on your main though. Jagex/botwatch really did get smart.

Hoodz

2014-05-13 07:12:06

made a flawless goat killer at nardah bank, ~ 700k an hour ;)

Foundry

2014-05-17 22:39:38

Thanks, just made a green dragon killer :) :D :D

HT BaaFly

2014-05-21 14:04:45

Nice plugin, really surprised this was hidden away this long. Anyway, does any one notice the smart client becoming laggy afrer running opengl scripts for a few hours?

Foundry

2014-05-21 14:11:53

From: HT BaaFly
Nice plugin, really surprised this was hidden away this long. Anyway, does any one notice the smart client becoming laggy afrer running opengl scripts for a few hours?


Yeah, it does that. I kill mine every 3 hours to keep my scripts running smooth.

HT BaaFly

2014-05-21 22:31:18

From: Foundry
Yeah, it does that. I kill mine every 3 hours to keep my scripts running smooth.


Phew, what a relief. Thought it was my shitty GPU all along.

HT BaaFly

2014-05-23 02:02:27

Just hit me guys, why is this only SRL-member material? Releasing this to the public would be greatly beneficial to all kinds of scripters. It would also make exponentially increase traffic to this site because simba would now be able to compete with java bots such as powerbot and tribot.

I am thinking of releasing my fully functional abyss nature crafter as soon as I am able to get past the 1700 runes per hour. Currently at 1500 :/…
Anyway, what are your thoughts on this?

Ian

2014-05-23 09:15:17

From: HT BaaFly
Just hit me guys, why is this only SRL-member material? Releasing this to the public would be greatly beneficial to all kinds of scripters. It would also make exponentially increase traffic to this site because simba would now be able to compete with java bots such as powerbot and tribot.

I am thinking of releasing my fully functional abyss nature crafter as soon as I am able to get past the 1700 runes per hour. Currently at 1500 :/…
Anyway, what are your thoughts on this?


Brandon released the OGL plugin & include publicly here: http://villavu.com/forum/showthread.php?t=104932

As for this tutorial, I'm not sure.

DemiseScythe

2014-05-23 17:53:37

From: HT BaaFly
Just hit me guys, why is this only SRL-member material? Releasing this to the public would be greatly beneficial to all kinds of scripters. It would also make exponentially increase traffic to this site because simba would now be able to compete with java bots such as powerbot and tribot.

I am thinking of releasing my fully functional abyss nature crafter as soon as I am able to get past the 1700 runes per hour. Currently at 1500 :/…
Anyway, what are your thoughts on this?


Mainly for the same reason the Hooked version of the OGL plugin is not released with the autoupdater. This site's devs don't want to publicly support hooks which might be considered illegal and/or result in legal action. Thus this content is not publicly shown. If they ever place the Hooked plugin on the updater, then this content shall be public as well.

Olly

2014-05-23 19:39:47

From: DemiseScythe
Mainly for the same reason the Hooked version of the OGL plugin is not released with the autoupdater. This site's devs don't want to publicly support hooks which might be considered illegal and/or result in legal action. Thus this content is not publicly shown. If they ever place the Hooked plugin on the updater, then this content shall be public as well.


What? No your lost… That's not the reason.. It is not in high demand + it's a bitch to add shit to the updater.

HT BaaFly

2014-05-25 07:11:04

It would probably be pointless as well. OpenGL is too glitchy to do anything on. I mean you can barely run for a few hours before having fps drop to 1 or 2. We should have an include something like this for directX

edit: Did anyone notice any glitches with functions that grab models, textures or chars? My script sometimes randomly stops working at those functions for no apparent reason. I've looked into one of thise, glGetChars, and I think it has to do with with the size being returned as 0

[SIMBA={*
Returns an array of all font/text characters rendered to the screen.

Note:
Fonts/Chars/Text may contain shadows. Ex: 'LLooggiinn Ppllaayyeerr'
instead of 'Login Player'.

Usage Info:
writeln(glGetChars);
*}
function glGetChars: glCharArray;
var
Size, I: Cardinal;
Ptr: Pointer;
begin
Result := [];
Ptr := GLXFonts(Size);
SetLength(Result, Size);
writeln('Size - 1: ', size - 1);
for I := 0 to Size - 1 do
begin
writeln('I: ', I);
Result := glChar(Ptr^);
Ptr.Inc(sizeof(glChar));
end;
writeln('exit');
exit;
end; ]

I have little knowledge of lape so I don't know what much of this means.
Would something as simple as if size < 0 then exit; solve this problem?

DemiseScythe

2014-05-25 08:48:16

From: HT BaaFly
It would probably be pointless as well. OpenGL is too glitchy to do anything on. I mean you can barely run for a few hours before having fps drop to 1 or 2. We should have an include something like this for directX

edit: Did anyone notice any glitches with functions that grab models, textures or chars? My script sometimes randomly stops working at those functions for no apparent reason. I've looked into one of thise, glGetChars, and I think it has to do with with the size being returned as 0

[SIMBA={*
Returns an array of all font/text characters rendered to the screen.

Note:
Fonts/Chars/Text may contain shadows. Ex: 'LLooggiinn Ppllaayyeerr'
instead of 'Login Player'.

Usage Info:
writeln(glGetChars);
*}
function glGetChars: glCharArray;
var
Size, I: Cardinal;
Ptr: Pointer;
begin
Result := [];
Ptr := GLXFonts(Size);
SetLength(Result, Size);
writeln('Size - 1: ', size - 1);
for I := 0 to Size - 1 do
begin
writeln('I: ', I);
Result := glChar(Ptr^);
Ptr.Inc(sizeof(glChar));
end;
writeln('exit');
exit;
end; ]

I have little knowledge of lape so I don't know what much of this means.
Would something as simple as if size < 0 then exit; solve this problem?


I have never run into the low fps issue personally but the plugin randomly stops working as described and there is nothing we can do about it. The issue is rare though and will only happen twice per day. You can get around the lag issue by simply killing smart every 3-4 hours. As for the plugins, you do realize all of your scripts share the same set unless you do the include shortcut fix. Technically all your scripts are trying to use the same set of plugins but they all cannot at the same time so there is a cpu-load like wait line.

I definitely want to try exiting like you are explaining since I do notice the script entering some sort of endless loop although there are none in my script.
for I := 0 to -1 do will keep increasing I which will never be equal to -1 and cause an endless loop. It should be size < 1 though so that it also includes 0.

I suggest next time you run into the 1 fps issue, you look at your RAM usages in Task Manager for Simba and SMART. There is a weird bug in RS/SMART/plugin where everytime you load a map, you increase 2-4 MB RAM, performance decreases the higher this number is. My max is around 1660 MB at which SMART just throws some C++ error and crashes altogether.

Edit:

Added bunch of Exits to my include, I will test and report back if I run into any issues. I made an infinite loop, apparently the Exit needs to be before the SetLength.

HT BaaFly

2014-05-25 09:25:23

From: DemiseScythe
I have never run into the low fps issue personally but the plugin randomly stops working as described and there is nothing we can do about it. The issue is rare though and will only happen twice per day. You can get around the lag issue by simply killing smart every 3-4 hours. As for the plugins, you do realize all of your scripts share the same set unless you do the include shortcut fix. Technically all your scripts are trying to use the same set of plugins but they all cannot at the same time so there is a cpu-load like wait line.

I definitely want to try exiting like you are explaining since I do notice the script entering some sort of endless loop although there are none in my script.
for I := 0 to -1 do will keep increasing I which will never be equal to -1 and cause an endless loop. It should be size < 1 though so that it also includes 0.

I suggest next time you run into the 1 fps issue, you look at your RAM usages in Task Manager for Simba and SMART. There is a weird bug in RS/SMART/plugin where everytime you load a map, you increase 2-4 MB RAM, performance decreases the higher this number is. My max is around 1660 MB at which SMART just throws some C++ error and crashes altogether.

Edit:

Added bunch of Exits to my include, I will test and report back if I run into any issues. I made an infinite loop, apparently the Exit needs to be before the SetLength.


I'm gonna look at that loop again. It's probably like you said, running an infinite loop from 0 to -1. But I think the size can be 0 because when you return arrays you always begin with 0. i.e. [0, 1, 2] and so on. So omitting 0 out would remove one of the possible results and including 0 is perfectly valid.

As for the fps, it's probably my shitty GPU which is 5+ years old. I'm thinking about creating a function that reads fps using displayfps command and restarts the client if it goes below a certain threshold. Good thing is, I have a function that restarts the client after going under a certain rate per hour so changing this to include fps change wouldn't be too hard to implement.



About the memory leaks, back in the days of powerbot there was a command line (.bat) scripted to limite client memory usage to 256 mb. Maybe we can implement this with smart. Just some of my thoughts…

DemiseScythe

2014-05-25 09:42:32

From: HT BaaFly
I'm gonna look at that loop again. It's probably like you said, running an infinite loop from 0 to -1. But I think the size can be 0 because when you return arrays you always begin with 0. i.e. [0, 1, 2] and so on. So omitting 0 out would remove one of the possible results and including 0 is perfectly valid.

As for the fps, it's probably my shitty GPU which is 5+ years old. I'm thinking about creating a function that reads fps using displayfps command and restarts the client if it goes below a certain threshold. Good thing is, I have a function that restarts the client after going under a certain rate per hour so changing this to include fps change wouldn't be too hard to implement.



About the memory leaks, back in the days of powerbot there was a command line (.bat) scripted to limite client memory usage to 256 mb. Maybe we can implement this with smart. Just some of my thoughts…


It is an RS bug since I can still legit the method and the ram will still increase at a rate of 11MB/min. I went around it with restarts and as you can see, I made my runecrafter last over 10 hours where it would crash around 2. I got 16 GB ram on this computer so it can use more if it needs, idk why it just won't use more than 10% of my RAM. First of all, Size can be 0 but it sets the length of the results to Size or 0 thus it would be the same as just exiting. If it is 1, then it goes and does: for I := 0 to (1-1) which just executes the [0] array index which is right since they do start at 0. I say < 1 because there is no point to continue processing when the result length is equal to 0.

Clarity

2014-07-21 10:47:14

From: The Mayor
@Clarity better get started on that dung script


Ok.

Turpinator

2014-07-21 14:58:35

From: Clarity

Ok.


pretty neat lookin'

The Mayor

2014-07-22 03:26:35

From: Clarity

Ok.


What do the green dots represent?

Clarity

2014-07-22 03:33:36

From: The Mayor
What do the green dots represent?

Player position in the dungeon. It's flawless tracking and takes camera position/angle into account, which is totally awesome. Sometimes when the character moves too fast, smart.clearArea doesn't clear correctly so there are some leftover green dots, but only visually of course.

Older pic before I added in smart.clearArea and other room representation, basically a recording of my character's movements the entire time.

Combine this ability with MMtoMS/MStoMM and we have a DG script. So excited to get this out asap.

The Mayor

2014-07-22 03:38:51

From: Clarity
Player position in the dungeon. It's flawless tracking and takes camera position/angle into account, which is totally awesome. Sometimes when the character moves too fast, smart.clearArea doesn't clear correctly so there are some leftover green dots, but only visually of course.

Older pic before I added in smart.clearArea and other room representation, basically a recording of my character's movements the entire time.

Combine this ability with MMtoMS/MStoMM and we have a DG script. So excited to get this out asap.


Very nice :)

DemiseScythe

2014-07-22 12:05:58

Pretty cool, will totally help you with the PHP side.

I will move to another project soon and will try to build a full PC game. MMORPG styled mecha game. Going to build it using Unity 3D and might take me a year or more to have a version that runs but it will definitely be an interesting project.

Clarity

2014-10-29 10:34:13

Fun with OGL :)


With good gear this is incredible income and crimson charms.

Ashaman88

2014-10-29 10:59:24

Is it sad that I don't know what a gladius is… ? :( I'm behind the times


But looks awesome!