GLHook Beta
Brandon
2012-08-09 15:59:33
GLHook Beta v0.9
Last Updated:
October 20th, 2012 - 22:45 EST.
Updates:
Serialization, Shared Memory, Events, Hooks all re-written from scratch!
Events (Client/Server Communication):
Why? Because 7 days ago, I was testing the older DLL's and the ping between Simba and the Official client was incredibly large!! I decided to remove all the sleeping/waiting calls and instead replace them with events. That means as soon as a command is sent, a reply is sent back. Basically like your own SERVER! Client sends a request, server replies!
Serialization:
The next thing is the Serialization. This was updated with a private class I wrote. Now I didn't want to have to use any of my private libraries but it was definitely necessary and I thought.. pft why not give SRL something nice. This library allows you to Serialize complex structures and DeSerialize them at the other end. More on this in after the Shared Memory explanation.
Shared Memory:
I also used a private class I wrote for the shared memory communication. This class allows us to create any amount of instances and communicate with events to send/store notifications and receive/store notifications as to when the Memory is updates with new data/info. That's where the events come in.
Not only that, but this class can be used with the serialization class so that you can serialize the data, send it to the shared memory and deserialize it at the other end with EASE!! This should make teaching/learning data communication in GLHook MUCH EASIER! Also makes Updating and adding new features a breeze.
Hooks:
Finally, some new hooks have been implemented to ensure 100% accuracy. This includes text, minimap icons, minimap dots, compass updates, etc..
Smart:
Smart v8.1 or v8.2 depending on if Ben wants to change the Version number, will include data feeding to Simba. What does this mean? Well, currently Simba is unable to read OpenGL colours from the client. This will feed Smart a buffer with NO lag, and Smart will pass it to Simba just like it currently does for safe-mode. I still have some testing to do with this as I need a proper computer to test it on (aka my mom's since I'm on Windows 8 lol).
Include/Makefile:
Building the project from a makefile is now an option as well. Though, the makefile needs updating because I just re-wrote and added quite a lot.
Ohh almost forgot. One last thing, the GLHook include is ready for testing and fixing/updating by the SRL-Community. I've done MOST of it and it needs work still but EVERYTHING that is currently needed is there. Only things missing is animation and walking which I will try my best to get around to eventually. Currently working on Shader hooks ( don't ask.. :l ).
Enjoy!
Other News:
The Sources Are Updated. Check The Date Of The Last Update Of This Post. I used portions of my private libraries instead of Boost.
Q & A:Q: What is GLHook?
A: Well it's OpenGL hooking that I've been developing for
the last 2.5 weeks a while now.
Q: How does it benefit you?
A: Well you like DTMs, you like Bitmaps, but sometimes, that's just not enough!
Introducing GLHook:
EDIT: Removed the explanation. Everyone should know by now what this project is about..
Test Script (Perhaps write a proper test script.. I only wrote the most basic one):
{$I GLHook/GLHook.Simba}
var
Colour: String;
begin
writeln('Prayer Level: ' + ToStr(GLH_GetMMLevels(GLE_MMLevel_Prayer, Colour)));
WriteLn('Magic Tab: ' + ToStr(GLH_GameTab(TAB_MAGIC)));
Writeln('Cloak Equiped: ' + ToStr(GLH_ItemEquipped(GLE_Equipment_Cloak)));
end.
Instructions:- Grab GLHook.zip. Extract it anywhere. Place GLHook.dll in Simba's Plugins folder.
- Place OpenGL32.dll in \\jagexcache\jagexlauncher\bin. <– That's the location of the official runescape client's bin folder.
- Place GLHook.dll in \\Simba\Plugins. <– That's the location of the Simba Plugins folder.
- Install the Lape Include.
- Copy the script above, place it in Simba's editor.
- In Simba, go to the scripts menu, choose Interpreter and Lape.
- Run the official RS-Client and run the script after it's finished loading.
The
Basic Include looks like:
https://github.com/Brandon-T/SRL-GLHookNotes:Some of the functions are incomplete as I didn't have time to finish it all and I'd like as many people as possible to get involved before they fall behind on potential.
Anyway, PLEASE if you don't know what you're doing, refrain from touching GLCommunications.Simba. You will regret it if you mess it up as it controls EVERYTHING and has all core functions for which ALL others are derived from.
Enjoy.. The development thread:
http://villavu.com/forum/showthread.php?t=86230
Impressive release, I've been playing around with OpenGL hooks for a while now (Java, for another bot) and I will definately give this a try :) Wondering if the ID's are the same or if you guys are using different algorithms to determine them.
Le Jingle
2012-08-09 16:10:51
EPIC! AMAZING WORK!
Testing NOW! :)
Thanks for all the hard work Brandon!!
Kyle Undefined
2012-08-09 16:12:23
Wow, this is fantastic work man! So glad to see this develop into something useful! So it only works with the RS Client as of now, correct?
This is so impressive, considering you knew nothing about opengl before this.
Brandon
2012-08-09 16:14:00
From: Kyle Undefined
Wow, this is fantastic work man! So glad to see this develop into something useful! So it only works with the RS Client as of now, correct?
Yeah ={
Uh I'd have to talk to benland if Smart wants it.
Jordan155
2012-08-09 16:32:05
Wow this is amazing work man.
I am actually looking into OpenGL at the moment as well playing around with stuff.
Massive boner. Sucks that I have a nvidia card, I can't get the pretty eyecandy.
Does anyone have an account stuck in a random? I might want to see how easy/hard to would be to do it with GlHook.
Sirenia
2012-08-09 16:42:15
Exception in Script: Plugin(GLHook32) has not been found
I do have that pesky dll in the Plugins folder but it still dont want to cooperate it seems
Brandon
2012-08-09 16:48:43
From: Sirenia
Exception in Script: Plugin(GLHook32) has not been found
I do have that pesky dll in the Plugins folder but it still dont want to cooperate it seems
Then you're most likely on a 64-bit Simba. These aren't 64-bit plugins. Either that or your Simba's looking at the wrong folder.
It also works without simba as well.
F1 - F7 = Change strides.
F8 = Display ALL
F11 = Toggle Displays.
Simba has all those functions via the plugin so it can be done both ways.
Le Jingle
2012-08-09 16:58:01
It's suppose to run at lower fps with the model id's shown, no?
Also, with the intel dll (using on a intel comp ofc) should it run slower, or is it dependent on the graphics card? (the graphics card on this intel comp sucks.. :s)
Nice release. :D
Been waiting for one of these OpenGL or DirectX plugins.
Now I guess the next step is getting it into SMART?
From: eska
Massive boner. Sucks that I have a nvidia card, I can't get the pretty eyecandy.
Does anyone have an account stuck in a random? I might want to see how easy/hard to would be to do it with GlHook.
Ive looked into randoms on another opengl bot, and its all ids man pretty sweet :)
From: Ollybest
Ive looked into randoms on another opengl bot, and its all ids man pretty sweet :)
I know, but I want to make some randoms quickly so that people go like 'omgwtfbqq it does randoms, lets all change to nazi opengl guise!!@@'
Brandon
2012-08-09 17:11:06
From: Le Jingle
It's suppose to run at lower fps with the model id's shown, no?
Also, with the intel dll (using on a intel comp ofc) should it run slower, or is it dependent on the graphics card? (the graphics card on this intel comp sucks.. :s)
It's the drawing that's doing that. On ATI cards, drawing will use almost no memory so it won't lag you like that. Without drawing, it shouldn't do that. I had to swap buffers 2x as much on Nvidia cards just to get it to draw so that's why it's lagging you. When it's finished, it won't have that double buffer swap as Simba will be the one grabbing all the info.
Le Jingle
2012-08-09 17:18:11
From: Brandon
It's the drawing that's doing that. On ATI cards, drawing will use almost no memory so it won't lag you like that. Without drawing, it shouldn't do that. I had to swap buffers 2x as much on Nvidia cards just to get it to draw so that's why it's lagging you. When it's finished, it won't have that double buffer swap as Simba will be the one grabbing all the info.
Ah okay, thanks for the quick answer. I'll experiment on some nvidia cards here in a second too, and edit those into this post. Again, super duper awesome stuffs, Brandon! ^.^
Edit: Nvida looks good, also like the id's on the main screen for other players/my own character. ^.^
LemonHaze
2012-08-09 17:36:56
amazing!
This brings botting to a new level!
Great job mate! You did it! I'm proud of you :)
Testing with nVidia.
Works great but lags like hell (Read above couple posts if you have same problem)
~Home
Currently trying to get some random event. I'll post all the ID I can find. We'll need em.
Might sound like a noob question but would this work on a private server? lol
Nebula
2012-08-09 18:42:21
From: Sean25
Might sound like a noob question but would this work on a private server? lol
no. Edit: well probably not, I'm just assuming no. You can try it though.
-
-
Smart8.0 supports OpenGL so why can't this work with smart right now? (I don't know anything about OpenGL)
From: Nebula
no. Edit: well probably not, I'm just assuming no. You can try it though.
-
-
Smart8.0 supports OpenGL so why can't this work with smart right now? (I don't know anything about OpenGL)
Thanks for the answer - I was just wondering because I have a 60% working script for a private server but its not 100% reliable. I'm going to start scripting for runescape soon since I have time again.
Hazzah
2012-08-09 18:54:13
So you never came up with a new algorithm to accounts for colors for new id's or is that still a work in progress?
From: Sirenia
Exception in Script: Plugin(GLHook32) has not been found
I do have that pesky dll in the Plugins folder but it still dont want to cooperate it seems
I'm also getting this. Been trying to make it work for a while.
Yes I have windows 7 64 bit. Reinstalled simba with all the default stuff just to see if it fix anything, and sadly it does not.
Le Jingle
2012-08-09 19:06:21
From: eska
I'm also getting this. Been trying to make it work for a while.
Yes I have windows 7 64 bit. Reinstalled simba with all the default stuff just to see if it fix anything, and sadly it does not.
Same, it worked the first time I opened it up and used the test script. However now I as well have trouble with this error.
Edit: it worked / loaded the lib after I hit f11 in the official client.. (perhaps that loaded / activated it?) It works now
Sirenia
2012-08-09 19:11:20
From: Brandon
Then you're most likely on a 64-bit Simba. These aren't 64-bit plugins. Either that or your Simba's looking at the wrong folder.
It also works without simba as well.
F1 - F7 = Change strides.
F8 = Display ALL
F11 = Toggle Displays.
Simba has all those functions via the plugin so it can be done both ways.
Now im on x86 and it still gets the same error :/ Can I get the link to a direct x32 simba ?
Brandon
2012-08-09 19:14:40
:S That's odd I've implemented the plugin the same way in Simba's documentation. There should be no reason why it isn't found.
Also Remember the RS Client has to be loaded first as the OpenGL32 dll is the one that creates the memory map and the GLHookk reads from it.
I'm glad its working for some of you. For the others I can't seem to replicate that problem. It loads fine 100% of the time here. I'm working on passing models as pointers to Simba then have Simba read those but it's difficult since Pointers and shared memory isn't so nice.
I'll figure something out eventually. =]
Thanks brandon, it works now. Problem was that I didn't loard the rs first.
I was trying to compile it using only simba.
Also:

Is that normal?
Edit1: For inventory items it works well though.
Edit2: For items droped on the ground, it works well too.
Sirenia
2012-08-09 19:18:17
Urgh it gives me error even if runescape is started and all that… wanna TV me? :/
Brandon
2012-08-09 19:19:53
From: eska
Thanks brandon, it works now. Problem was that I didn't loard the rs first.
I was trying to compile it using only simba.
Also:

Is that normal?
Yeah it's a bug in my vertex buffer code.. Using a static buffer, it stays the same 100% of the time. Use one of the functions to turn off Display all and it'll be fine. I already fixed that but I just didn't upload it yet. The plugin on the OP is older than the current one I have. I'm still porting some stuff to simba so a couple bugs in the OP's plugin is expected. Hopefully none will be in the official release.
Basically the DLL's on the first posts are just extreme alpha-beta. They're sorta proof of concept and at the same time allows everyone to see how things would work together with Simba.
It can also work with browsers atm too. Just not smart yet.
Man even though it's not too pretty for nvidia, I just love watching the labels follow moving npc like magic.
Le Jingle
2012-08-09 19:28:16
From: eska
Man even though it's not too pretty for nvidia, I just love watching the labels follow moving npc like magic.
This.
Side note, gathering id's now (ones that stay the same), would not be pointless to do would it? Or should I hold off until later, due to future changes?
Silentcore
2012-08-09 19:28:38
Nice release brandon..+1
From: Le Jingle
This.
Side note, gathering id's now (ones that stay the same), would not be pointless to do would it? Or should I hold off until later, due to future changes?
Some ID change, and some don't.
ID that are static:
- Inventory items.
- Items droped on the floor.
- Scenery (bushes, wall, lampost, funace, trees etc)
- Prayer buttons.
- Spells in the magic spellbook.
- Stuff on the minimap (For some reason, white dots, yellow dots, red flag, and symbols (pray altar, dungeon, bank etc) all have the same ID)
Id that are dynamic:
But yeah brandon might change stuff in the future so it depend on him. Getting ncp ID is 100% useless right now though.
Brandon
2012-08-09 19:44:48
From: eska
Some ID change, and some don't.
ID that are static.
- Inventory items.
- Items droped on the floor.
- Scenery (bushes, wall, lampost, funace etc)
- Prayer buttons.
- Spells in the magic spellbook.
Id that are dynamic:
But yeah brandon might change stuff in the future so it depend on him. Getting ncp ID is 100% useless right now though.
This.. I have to supply a second ID for models. Models will have 2-3 ID's to Identify them accurately.
It'll be something like:
if (Model.ID2 == 1024) … It really depends on the NPC. It's static with Algorithm #1 but in some randoms, algorithm #1 isn't good enough so #2 is used instead. That being said, you don't need to use 2 ID's. Just one.
Everything is subject to change. I posted it to show how it'll be so scripters get a feel of what's to come. It is in no way official so gathering ID's right now WILL be useless. Even inventory ones.
Jakkle
2012-08-09 20:05:45
Amazing work, Brandon, absolutely amazing.
I really admire you, all the work you've put into this, in such a small amount of time and come out with such a great piece of work.
Thanks :)
Rep +++++++ :thumbsup:
P.s I can't rep you on this thread atm, you were the last person I gave rep to :p
Bam Bam
2012-08-09 20:18:33
This is sexy, I'm excited. :)
-Bam Bam
Justin
2012-08-09 20:24:45
Wow. Amazing release here Brandon! Can't wait to get home and start playing around with it!
Brandon my user interfaces has ID's etc, but my MS has nothing on.
I am Running a ATI Radeon HD 4300/4500 Series.
Mat
Brandon
2012-08-09 20:42:40
From: Mat
Brandon my user interfaces has ID's etc, but my MS has nothing on.
I am Running a ATI Radeon HD 4300/4500 Series.
Mat
That's because the ModelFilter is set to 0. If you do not filter the models, it should show all. Filtering them to 0, 0, 0, 0 will wipe ALL model ID's from the main screen.
Excellent work with this Brandon! I look forward to having a minute to check things out a bit more. :)
Oh by the way, what is a stride? I checked for its definition but it has nothing to do with opengl. I'm guessing it's the length of a verticle or something?
Brandon
2012-08-09 21:23:07
From: eska
Oh by the way, what is a stride? I checked for its definition but it has nothing to do with opengl. I'm guessing it's the length of a verticle or something?
Stride is the length in bytes to get from one variable to another of the same type.
struct Foo
{
int A, B, C;
float A, B, C;
};
The stride for the above would be 6 * 4 bytes each datatype = 24.
Even though I don't understand everything in this thread, I feel as if i'm witnessing botting history in the making :D. This is some seriously exciting stuff!
Flight
2012-08-09 21:46:02
Cool cool, it's nice to have one that reads text. Good job bud. :)
Edit:
Brandon, do you have a list of commands somewhere for the plugin?
From: Flight
Cool cool, it's nice to have one that reads text. Good job bud. :)
Edit:
Brandon, do you have a list of commands somewhere for the plugin?
Yea ^^ :) Would be cool to know if there are any :)
Mat
(LOVE THE WORK)
Thanks for the amazing work :)
Finaly managed to get a random on my noob.
Id for sergeant Damien (I know it won't be usefull because of future changes, but here it is anyway)
1860340846 = Push up plate
1042468844 = Star jump plate
2877688137 = Sit up plate
1862962707 = Jog plate
Proof:

They are static. I tried logging out and back in but the ID remains the same.
Brandon
2012-08-09 22:23:28
From: Flight
Cool cool, it's nice to have one that reads text. Good job bud. :)
Edit:
Brandon, do you have a list of commands somewhere for the plugin?
Uhh the list of functions show up in Simba's console when the DLL is loaded. OR in the function box, type GLH and it'll show all OpenGL functions.
For Commands without Simba:
case VK_F1: Stride = 12; break;
case VK_F2: Stride = 16; break;
case VK_F3: Stride = 20; break;
case VK_F4: Stride = 24; break;
case VK_F5: Stride = 28; break;
case VK_F6: Stride = 36; break;
case VK_F7: Stride = 40; break;
case VK_F8: DrawAllStrides = !DrawAllStrides; break;
case VK_F9: InfoDisplayed++; break;
case VK_F10: LogCalls = !LogCalls; break;
case VK_F11: Overlay = !Overlay; break;
case VK_F12: UseModelBuffer = !UseModelBuffer; break;
Some of the commands are disabled by default and would require Simba to enable them to be used. Such as LogCalls, and InfoDisplayed. That's not all the commands but those are the ones on the first post. Filters aren't part of the commands. That's Simba side as it has way too many parameters, etc.
Very nice to see the random ID's static =] Try not to "UseModelBuffer" yet as it uses ID2's which can be dynamic at times and it enables vertices which returns a list of all possible vertices per model so stay away from that one for now.. Use the commands via Simba or the rest of commands via FKeys. For now these are the commands available on the OP. The actual DLL may have more/less as Simba should take care of most of them.
Flight
2012-08-09 23:15:20
One more question (for now), can you give a little detail explaining each stride? (12, 16, 20, 24, 28, 36, 40) That would be useful to see written in the OP.
From: eska
Finaly managed to get a random on my noob.
Id for sergeant Damien (I know it won't be usefull because of future changes, but here it is anyway)
1860340846 = Push up plate
1042468844 = Start jump plate
2877688137 = Sit up plate
1862962707 = Jog plate
Proof:
-Cut-
They are static. I tried logging out and back in but the ID remains the same.
Would It be useful to others for me to try to get some other randoms? Let me know and I'll do my best.
Brandon
2012-08-10 00:19:53
From: Flight
One more question (for now), can you give a little detail explaining each stride? (12, 16, 20, 24, 28, 36, 40) That would be useful to see written in the OP.
Well each model has different strides. On the user side of things, this doesn't really matter. On the developer/debugging side of things, the stride is used to display various models in wireframe. That way you know what type of model you're looking at.
IIRC 12 = ground items.
24 = NPC's
28 - 40 is only in high detail for some models.
The others just split between different models. Some walls are 16, some are 20. Changing strides will just change what is displayed on screen but it doesn't actually affect any data. Lets say you have stride 24 enabled, it'll still return data for all strides. Not just 24.
omgnomorenames
2012-08-10 00:43:07
Very Good Job, I have to try this.
From: BMWxi
Would It be useful to others for me to try to get some other randoms? Let me know and I'll do my best.
Right now, brandon said that he will most likely make some change that WILL change all ID, so it would be useless to find all those ID right now.
BUT
It would be usefull if you managed to get account(s) you don't usualy play in a random and keep it there so that we can use it in the future. That,s what I did. I took a screenshot of the ID just for fun but I didn't complete the random on purpose. It's an old account I never use (except for testing script/bot).
By the way brandon, do you have an idea of how detectable this is?
According to silentwolf the overlay is/could be detectable, but what if you disable it?
I have my farm acc's all in randoms atmo, but i don't want to keep them there long, week tops. Hope fully the ID's will get stable soon :)
Mat
From: Mat
I have my farm acc's all in randoms atmo, but i don't want to keep them there long, week tops. Hope fully the ID's will get stable soon :)
Mat
I got one in sergent damien and one in the Lost and Found (abyssal rift) so if you want to free those up go ahead, I'm going to keep mine in there for months (I never use em)
Also got a third account due for a random, we'll see what I get, hopefully something else than those 2.
i can easily get back in them, so once i hear ID's are solid I'll lets dev's use them :)
Mat
VastlySuperior
2012-08-10 12:20:16
Brandon, you are amazing! Thanks for all your hard work.
Question, I noticed the talisman's all have the same ID's and are different items. Will that be fixed in the next release or is that how its going to be?
Brandon
2012-08-10 13:20:53
From: Sean25
Question, I noticed the talisman's all have the same ID's and are different items. Will that be fixed in the next release or is that how its going to be?
It's a maybe. Atm, I have it returning the box around it + the ID.
So inother words, the dll on the first post will give:
All four corners of each talisman & the middle point of each one.
If anything, you just use the box with a colour in it to identify the item. But I'm trying to find a way to keep each unique. I've already tried checksums on the RGB values to get ID's but meh that isn't so good since RGB values change upon every client load.
ATM though I'm pretty busy but in my spare time I'm trying to figure out a way to share objects/structs across memory for models. That way you can just use a pointer in GLHook's address space as you'll get access violation trying to use anyhting from OpenGL32.dll's address space.
Basically atm I'm very very limited in what I can and cannot do. Pascal Script is the problem as it cannot use pointers. Lape can though so that's a light at the end of a tunnel if anything. Also sharing objects through memory is very very difficult for me since it's my first time trying it but meh I'll get it eventually just like I did with this project. Just need some time for it to sink in is all.
I'm keeping stuff as portable as I can hopefully. I removed all ASM and used pointers.
with 2D models you don't really need OGL a DTM is fine, its more the 3D Models you need it for.
Mat
Brandon
2012-08-10 14:08:45
From: Mat
with 2D models you don't really need OGL a DTM is fine, its more the 3D Models you need it for.
Mat
No because 3D Model ID's are static.. They don't change.. Well they won't. Neither will Item IDs but Items that have the same vertices, shape, alpha pixels will have the same ID which is what they were referring to. That's something I'm working on.
omgnomorenames
2012-08-10 16:23:34
Got it to work, but it doesn't show for bank or last line of inventory. Am I doing it wrong :redface:.
Brandon
2012-08-10 16:46:55
From: omgnomorenames
Got it to work, but it doesn't show for bank or last line of inventory. Am I doing it wrong :redface:.
Your filters have shorter parameters. You can turn off the filter.
Footy
2012-08-10 16:56:19
Wow, this looks incredible. Wouldnt runescape be able to check for the modified file inside the runescape folder though?
Shatterhand
2012-08-11 07:14:14
Very nice Brandon!! :)
My question is: is this legal?
Thanks for clearing that up with me. I cannot wait for the Alpha release of this
Brandon
2012-08-11 08:57:05
From: Footy
Wow, this looks incredible. Wouldnt runescape be able to check for the modified file inside the runescape folder though?
Yes it is legal as I'm not touching their code. I'm simply grabbing data off my graphics card before it hits the screen.
Are they able to detect it? Not with any methods that I know of. They have no choice but to load OpenGL32.dll. Whether they load it from System32 or their bin folder, makes no difference. I've made sure not to export the hooks and I haven't edited the .Data section of it either. For me to explain more about detectability for DLL's, you'd have to understand the PE structure. That being said, my DLL is a wrapper for the official/original opengl. It redirects all calls to the original to me first then passes it to the original after. If anything, I can implement the same thing as VAC hooks.
I can also inject it with:
#include <Windows.h>
#include <TlHelp32.h>
#include <iostream>
using namespace std;
HANDLE hThread;
void* pLibRemote;
DWORD hLibModule;
HMODULE hKernel32;
HANDLE hProcess;
PROCESSENTRY32 GetProcessInfo(char* ProcessName)
{
HANDLE hSnap = NULL;
PROCESSENTRY32 Proc32 = {0};
if((hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)) == INVALID_HANDLE_VALUE)
return Proc32;
Proc32.dwSize = sizeof(PROCESSENTRY32);
while(Process32Next(hSnap, &Proc32))
{
if(!strcmp(ProcessName, Proc32.szExeFile))
{
CloseHandle(hSnap);
return Proc32;
}
}
CloseHandle(hSnap);
return Proc32;
}
void Inject()
{
char szLibPath[MAX_PATH];
memset(szLibPath, 0, MAX_PATH);
hKernel32 = ::GetModuleHandle("Kernel32");
PROCESSENTRY32 RSDLL = GetProcessInfo("JagexLauncher.exe");
hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, RSDLL.th32ProcessID);
strcat(szLibPath, "C:/Users/Brandon/Desktop/GLHook.dll");
pLibRemote = ::VirtualAllocEx(hProcess, NULL, sizeof(szLibPath), MEM_COMMIT, PAGE_READWRITE);
::WriteProcessMemory(hProcess, pLibRemote, (void*)szLibPath, sizeof(szLibPath), NULL);
hThread = ::CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE) ::GetProcAddress(hKernel32, "LoadLibraryA"), pLibRemote, 0, NULL);
::WaitForSingleObject(hThread, INFINITE);
::GetExitCodeThread(hThread, &hLibModule);
::CloseHandle(hThread);
::VirtualFreeEx(hProcess, pLibRemote, sizeof(szLibPath), MEM_RELEASE);
}
void Terminate()
{
hThread = ::CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE) ::GetProcAddress(hKernel32, "FreeLibrary"), (void*)hLibModule, 0, NULL);
::WaitForSingleObject(hThread, INFINITE);
::CloseHandle(hThread);
}
int main()
{
Inject();
cin.get();
Terminate();
return 0;
}
So either way, they won't be able to tell. Even better if smart implements it natively, it'd be impossible for them to know. Now there is one feat to it. Drawing. When drawing, it uses a call list. Jagex can screeny their client and serialize the data and send it to themselves to check if you were drawing on the screen. That being said, who in the world would do that! So much work and can still be prevented by drawing on an overlay. It's safe enough that I test on my mules and my main.
^ Aka draw using SMART and we're bullet proof.
By the way, isn't lape supposed to be out anytime now? 2 weeks ago, I've read somewhere that it would probably be out in 2 weeks.
Lape has pointer support so that would fix some of the problems you've got with pascal script.
Shatterhand
2012-08-11 11:56:47
From: Brandon
Yes it is legal as I'm not touching their code. I'm simply grabbing data off my graphics card before it hits the screen.
Are they able to detect it? Not with any methods that I know of. They have no choice but to load OpenGL32.dll. Whether they load it from System32 or their bin folder, makes no difference. I've made sure not to export the hooks and I haven't edited the .Data section of it either. For me to explain more about detectability for DLL's, you'd have to understand the PE structure. That being said, my DLL is a wrapper for the official/original opengl. It redirects all calls to the original to me first then passes it to the original after. If anything, I can implement the same thing as VAC hooks.
So either way, they won't be able to tell. Even better if smart implements it natively, it'd be impossible for them to know. Now there is one feat to it. Drawing. When drawing, it uses a call list. Jagex can screeny their client and serialize the data and send it to themselves to check if you were drawing on the screen. That being said, who in the world would do that! So much work and can still be prevented by drawing on an overlay. It's safe enough that I test on my mules and my main.
Thanks for your answer. This thing sounds interesting, although I dont really understand much of it. So is there any way we can make scripts that easy (like SRL is) with OpenGL in the future?
From: Shatterhand
Thanks for your answer. This thing sounds interesting, although I dont really understand much of it. So is there any way we can make scripts that easy (like SRL is) with OpenGL in the future?
It would be even easier. The idea is to get injection-like ID on every object in runescape, so that we can easily find them, just like injection.
All random would be easily solvable (Except maybe the mime random, but that remain to be seen).
Detecting/Looting item on the ground will become ridiculously easy, finding object in place where colors are almost the same will also be super easy, obtaining the uptext, or text of anything will now have 100% accuracy.
I'm really looking foward to OpenGl for simba.
Footy
2012-08-11 12:15:21
Maybe you could tell which emote is which via pixel shift. Put a box around the mime, and a certain amount of pixel shift represents each emote. Can't wait for this, will make scripting so much easier!
From: Footy
Maybe you could tell which emote is which via pixel shift. Put a box around the mime, and a certain amount of pixel shift represents each emote. Can't wait for this, will make scripting so much easier!
That's exactly how SRL is doing it right now. There might be some way to do it with OpenGl though with near perfect accuracy.
From: eska
That's exactly how SRL is doing it right now. There might be some way to do it with OpenGl though with near perfect accuracy.
Oh man test tribot with animations, literately everything you do your player id changes. (so do other peoples).
Footy
2012-08-11 17:31:18
If they can do it, no reason we can't do it!
From: Ollybest
Oh man test tribot with animations, literately everything you do your player id changes. (so do other peoples).
You mean it mess it up when you do an animation? Or the ID change to the ID of the animation? If it's the latter, then that's great.
Edit: Tested it myself. It detects when there is an animation, but it doesn't detect what animation it is… the id stay the same for all animation…

Grihmm
2012-08-11 18:53:50
Really cool ggzz!
Brandon
2012-08-11 20:30:40
Mhmm. Updated the first post with v0.2. Contains a ton of fixes and new exports. Removed a lot of old exports as well. Inother words, instead of returning a single item or showing a single ID, it's simba's job to ask for what it wants.
For example, the script I posted will grab a pointer to a list of ALL ITEMS. You iterate that pointer for each item you want =] Also returns a count of all items found so that you'll know how much to iterate.
This is WAY FASTER and far better than asking for 100's of items in a for loop. I've updated the script instructions. Compass angles work as well. It also uses pointers but also has an overloaded method for guys that don't want to use pointers.
Inother words, GLHCompassAngle(Degrees, Radians); Where Degrees and Radians will hold your angles. OR you can do Ptr := GLHCompassAngle; and iterate the pointer for your angle by sizeof(Single).
Anyway the neat stuff: The script on the first post will find a list of all talismans - ID: 71145 (Bank, Shops, Inventory, etc..). And move the mouse to each talisman's top left corner. You can make it move to the dead center by doing X2 - X1, Y2 - Y1. I just chose to do X1, Y1 for simplicity. This is why I used pointers; because Simba gets a box around each item, a center point, etc. Very very accurate and does not make mistakes.
Testing.
Edit1: Seems like you removed ID's :s
Edit2: Brandon, how do I change the interpreter so that it will accept lape? I tried going in the setting and changing 0 to 1 or 2 without success.
Le Jingle
2012-08-11 20:38:43
From: eska
Testing.
Edit: Seems like you removed ID's :s
Ditto, will report back with results!
edit 1: love the lape, starting now!
edit 2: looks great! (because of my graphics card, I don't get all the cool id's on this computer :s)
however…. when I right clicked the banker, I got some pretty id's ^.^
Brandon
2012-08-11 20:40:37
From: eska
Testing.
Edit: Seems like you removed ID's :s
No no. I didn't have time to compile it for the two different graphics card types. The ID's are there it's just you can't see on screen with Nvidia cards. I'll fix the drawing in the next release. I just decide to work on the most important stuff first as drawing can always be done later.
Brandon
2012-08-11 20:45:34
From: eska
Testing.
Edit1: Seems like you removed ID's :s
Edit2: Brandon, how do I change the interpreter so that it will accept lape? I tried going in the setting and changing 0 to 1 or 2 without success.
The instructions at the bottom of the first post.
Script->Interpreter->Lape.
Didn't see the instruction changed -.-
Anyway I executed the code and nothing happen beside succesfully executed. Maybe it's because of nvidia card. Damn you nvidia.
Edit: I checked your code, and I see it should move the mouse right over mystic might judging from the ID? Nothing happens for me though.
Brandon
2012-08-11 20:51:05
From: eska
Didn't see the instruction changed -.-
Anyway I execute the code and nothing happen beside succesfully executed. Maybe it's because of nvidia card. Damn you nvidia.
What did you have in your inventory? If Angles work, Items should work as well.
I've just tried it :S The source code is on the github for anyone wanting to compile it.
From: Brandon
What did you have in your inventory? If Angles work, Items should work as well.
I've just tried it :S The source code is on the github for anyone wanting to compile it.
I got an air talisman and a ring of kinship.
nothing happens.
Edit: Just tested with an earth talisman and it worked. Seems like the first talisman in the inventory isn't found, only the second is. (I know this because I swaped the air and earth talisman, and now the air one is found)
Le Jingle
2012-08-11 20:57:43
Your old thread had a git link (this thread's op doesn't), but here's a direct git link for those whom need;
https://github.com/Brandon-T/GLHookEdit; I think you need multiple items in your inventory for the op script to work?
I had hatchets bronze - rune (grabbed the right id for them), and mouse move sure did just that to each of the 4 items.
(move to each of their top 0,0 coords too)
Brandon
2012-08-11 21:01:41
From: eska
I got an air talisman and a ring of kinship.
nothing happens.
Edit: Just tested with an earth talisman and it worked. Seems like the first talisman in the inventory isn't found, only the second is. (I know this because I swaped the air and earth talisman, and now the air one is found)
OOPS error in the script itself.. I was iterating the pointer first before the first item.
{$loadlib GLHook}
type Vector3D = record
X, Y, Z: Integer;
end;
type Vector3DArray = array of Vector3D;
type TModel = record
SX, SY: Integer;
Stride: Word;
ID: Cardinal;
TriangleCount: Integer;
Vertices: Vector3DArray;
end;
type TPanelItem = record
ID: Integer;
TextureID: Integer;
X, Y: Integer;
SX, SY: Array [0..3] Of Integer;
end;
type PModel = ^TModel;
type TModelArray = array of TModel;
type PPanelItem = ^TPanelItem;
type TPanelArray = array of TPanelItem;
var
Ptr: Pointer;
PP: PPanelItem;
I, Size: Integer;
begin
ClearDebug;
Ptr := GLHGetItemsByID(71145, Size);
//GLHEnableFilter(True, 1, 1, 71145, 0, 0, 0, 0, 500, 500, 765, 553);
For I := 0 To Size - 1 Do
begin
PP := Ptr;
MoveMouse(PP^.X, PP^.Y);
Ptr := Ptr + sizeof(TPanelItem);
Wait(500);
end;
end.
Well besides Id not showing off because nvidia is lame, I don't think theres many problems with this.
Finds item in the inventory and in the bank without issue (items must be visible to be found, a single pixel is enough)
Out with the old in with the New. Stickified!
Keep up the good work there Brandon!
Le Jingle
2012-08-12 00:15:53
I know, as stated in the thread, that the id's are subject to change over the course of development; however will the id's remain attached to each of their own '1 particular "id",' after the beta? Or could unforeseen updates potentially alter their id to something else? I know that rs would have to rewrite their junk in order to dent OpenGL (but I think this question differs because it's about grabbing id's with OGL?); I ask because I question if I should keep accounts with items on them, in order to save time finding their id's at a later point in time.
P.S. having fun still with the 0.2 beta :>
Cheers,
Lj!
Brandon
2012-08-12 01:08:47
From: Le Jingle
I know, as stated in the thread, that the id's are subject to change over the course of development; however will the id's remain attached to each of their own '1 particular "id",' after the beta? Or could unforeseen updates potentially alter their id to something else? I know that rs would have to rewrite their junk in order to dent OpenGL (but I think this question differs because it's about grabbing id's with OGL?); I ask because I question if I should keep accounts with items on them, in order to save time finding their id's at a later point in time.
P.S. having fun still with the 0.2 beta :>
Cheers,
Lj!
Basically, for now don't grab ID's. I'm working on better algorithms. Infact, I'll be writing the Models to shared memory some time tomorrow so that Simba reads them instead and I'll be looking at different algorithms to perform on the buffer for better ID's or at least shorter ID's so they're readable.
ID's are always going to be subject to change in a beta.
freezeyp
2012-08-12 10:05:34
Nice job, Brandon.
Can't wait to see the 0.3 beta coming out (It will be release right?), because my laptop was using the nvidia one :( .
@The Animation part even if they were, all different, the Animation ID's will be different for every, one so you'll have to make your script get there ID Null and then the animation ID of the movement.
Mat
slacky
2012-08-12 19:44:17
You could try to make it work with SMART, by placing OpenGL32 in "Java\jre7\bin\"-folder. That would have been realy nice!! :)
Brandon
2012-08-12 19:47:30
From: warpie
You could try to make it work with SMART, by placing OpenGL32 in "Java\jre7\bin\"-folder. That would have been realy nice!! :)
Can't do that. Smart reads from a native buffer of its own. It would actually have to be implemented into smart or have benland load this DLL instead.
slacky
2012-08-12 20:00:59
Hmm, well… I pretty darn sure that silentwolf's Iterception worked with SMART. And he seemed to have figured out how to make the text work with nVidia-cards, as it works with nVidia 8-series (8600GTS, 8800GT & also tested GT460), and so does TriBot.
Is the ID's (items, NPC, objects ++) the same as in trilez openGL-bot (TriBot)? As I cant find any ID's using my nvidia-card (even though I find it with all other GL-bots I've tried).. :S
The ID's was displayed for just a few secounds, then it went "away". And it should be possible to get the NPC's, or Items name (instead of making a DB for every NPC, object and Item), even though it might be a challange.
I'm not sure how you get the IDs, but if you use Vertex data, then would it be static? Or will the ID will be outdated with the next GFX change? (OFC, I could just try going from low detail to high, and check if the ID is the same, but I can't display the IDs…) :P
I'll give the source a look when I get some sparetime (and it seems big, so theres a lot to read up on), and by that time, you might have allready solved it:)
I wouldn't say they are the same, there using different method of getting the IDs.
Mat
Flight
2012-08-12 21:16:57
From: Mat
@The Animation part even if they were, all different, the Animation ID's will be different for every, one so you'll have to make your script get there ID Null and then the animation ID of the movement.
Mat
I've wondered about this but I've yet to do a simple test to see if my theory is correct. I
believe that it may work by first, every player (depending on their appearance & equipment) have a static model ID for standing, and then when animating a their model ID becomes (base ID + animation index ID).
IF this is correct then detecting if we're doing an exact animation would be quite simple if all we have to do is get our base model ID and add the ID of whichever animation we're doing and that will be our player's unique model ID for that animation.
If someone wants to test this just get two accounts, record your base standing model ID on both, record the new ID when doing an animation (also on both), and subtract (or add in some cases?) the base from the animating and see if the result matches.
From: warpie
Hmm, well… I pretty darn sure that silentwolf's Iterception worked with SMART.
I don't believe he did, I remember his post using a much bigger screen infact. Even Aftermath and Silabsoft both had to use the RS Launcher to load their OGL plugin for Simba.
Brandon
2012-08-12 21:18:01
From: warpie
Hmm, well… I pretty darn sure that silentwolf's Iterception worked with SMART. And he seemed to have figured out how to make the text work with nVidia-cards, as it works with nVidia 8-series (tested with 8600GTS, 8800GT & GT460), and so does TriBot.
Is the ID's (items, NPC, objects ++) the same as in trilez openGL-bot (TriBot)? As I cant find any ID's using my nvidia-card (even though I find it with all other GL-bots I've tried).. :S
The ID's was desplayed for just a few secounds, then it went "away". And it should be possible to get the NPC's, or Items name (instead of making a DB for every NPC, object and Item), even though it might be a challange.
I'm not sure how you get the IDs, but if you need to calculate it by the items look, it will be outdated, and I bet there's a way to make it static.
I'll give the source a look when I get some sparetime (and it seems big, so theres a lot to read up on), and by that time, you might have allready solved it:)
I have no clue what you're talking about. I've already stated why drawing doesn't work on Nvidia cards.
Trilez doesn't draw text. If he does, I guarantee he isn't using call lists or opengl. He's most likely drawing on an overlay within his client itself. I'd reverse his bot and see but I'm lazy.
My code is raw opengl, nothing else and because of that, it has problems with some cards.
OpenGL is architecture dependent for extensions which is why Windows does not export anything higher than 1.1 (Look up OpenGL ARB, NV, etc). If you want higher level exports, you have to get your own extension files, export each one manually on your own OR use a library called glew to do it for you. Now I did it manually since I know others will have problems compiling it if I used a library.
Finally, my ID's are static. Well for inventory items at least. I've monitored Model ID's and they're static. I haven't tested every single model but as far as I can tell, they're not changing even when running (These are vertex buffer hooks, not looks so shape doesn't matter). I'm not sure what you mean by look or by outdated because this isn't tribot :S
TriBot has nothing new other than what Aftermath, Silabsoft and Silent Wolf did (No text grabbing, no Vertex buffer hooks). I know this because the vertices on tribot is always located at a random point on the model (rand() % 100) which is what Silba, Silent and Aftermath did. Fortunately for us, I started from scratch without looking at their code and worked on buffer hooks first then everything else fell into place. After completion, I took a peek to see method was used for drawing on the screen. I opted to go with my own as theirs is the same as the NVidia export I used in 0.1.
Currently I'm using 0.3 which has full Lape support for models, items, compass, text recognition, etc.. but the drawing is still bad for Nvidia/Intel. I've tested it extensively but I'm not sure it's ready for release yet as I have to clean up and remove unused functions/variables, etc.
P.S. I have never looked into animation but I may after everything is all better.
Extensions:
http://www.opengl.org/registry/#arbextspecsThere's NV, ARB, AMD, EXT, APPLE, MESA, ATI, SGI. LOL that's a lot!
From: Flight
I've wondered about this but I've yet to do a simple test to see if my theory is correct. I believe that it may work by first, every player (depending on their appearance & equipment) have a static model ID for standing, and then when animating a their model ID becomes (base ID + animation index ID). IF this is correct then detecting if we're doing an exact animation would be quite simple if all we have to do is get our base model ID and add the ID of whichever animation we're doing and that will be our player's unique model ID for that animation.
If someone wants to test this just get two accounts, record your base standing model ID on both, record the new ID when doing an animation (also on both), and subtract (or add in some cases?) the base from the animating and see if the result matches.
If you are right then that would be the icing on the cake. Right now the animations are the only thing that worries me.
For positioning, we could use the same system SPS use, except we'd intercept the cached minimap. I believe this is what trilex is trying to do.
From: Brandon
I have no clue what you're talking about. I've already stated why drawing doesn't work on Nvidia cards.
Trilez doesn't draw text. If he does, I guarantee he isn't using call lists or opengl. He's most likely drawing on an overlay within his client itself. I'd reverse his bot and see but I'm lazy.
From what I remember on his Dev page, he does an overlay and it took him a fair amount of time to write it.
O and Tribot Positioning System is up and running. It uses the cached minimap and matches trees to find your position. So it is like a blend of SPS/ObjDtm.
@ Flight, I'll take a look :) and Some now for a sec.
Mat
E:
Nope:
Top is Legs No Animation
Middle with laugh Animation
Bottom Difference

Top is No Legs and No Animation
Middle with laugh Animation
Bottom Difference

Thats TRiBot, but if you think a Sword is a Model that protrudes out, as your in a animation the Sword goes, there by your ID changes in theory if all you had was a sword the ID would be the same as your ID w/o the sword during that animation.
Correct me if I'm wrong Brandon but I'm sure thats how oGL Interception works?
E2:
Test Two:

ID With Sword.

ID W/O Sword.

Animation with Sword.

Animation w/o sword
Now thats Freaky my ID is the same as my Stationary ID with the Sword during the Animation Freaky :O!
I got a question. Will you return the edge of an object when we looks for its ID?
I mean, say ID 5000 is a guard, will you return the boundary of the guard using some kind of TPA like this (where red is the TPA you return us):

… or a TPA of the whole object so we can find the edge ourself?
… or will you just return dead center?
… or a rectangle around it?
TRiLeZ
2012-08-13 07:36:00
Oh hai der. It's nice to see I have a little competition in the OpenGL botting scene now. :) What you've done so far is looking great.
From: Brandon
TriBot has nothing new other than what Aftermath, Silabsoft and Silent Wolf did (No text grabbing, no Vertex buffer hooks). I know this because the vertices on tribot is always located at a random point on the model (rand() % 100) which is what Silba, Silent and Aftermath did. Fortunately for us, I started from scratch without looking at their code and worked on buffer hooks first then everything else fell into place. After completion, I took a peek to see method was used for drawing on the screen. I opted to go with my own as theirs is the same as the NVidia export I used in 0.1.
http://img16.imageshack.us/img16/360/august92012.png -> Vertex buffer hooking / projection
http://tribot.org/doc/org/tribot/api/Text.html -> Text hooking
I have much more than what they have. ;)
What I do for drawing on the screen is I copy the graphics from OpenGL to Java, then I make an image and paint onto that.
Brandon
2012-08-13 09:24:17
From: TRiLeZ
Oh hai der. It's nice to see I have a little competition in the OpenGL botting scene now. :) What you've done so far is looking great.
http://img16.imageshack.us/img16/360/august92012.png -> Vertex buffer hooking / projection
http://tribot.org/doc/org/tribot/api/Text.html -> Text hooking
I have much more than what they have. ;)
What I do for drawing on the screen is I copy the graphics from OpenGL to Java, then I make an image and paint onto that.
Why is your cows not fully green :S But nice nice. Looks like you came a long way as well. At least from the last thread you posted. =]
gerauchert
2012-08-13 11:45:53
I can't find jagexlauncher/bin. I have jagexcache, but within it is only a "runescape" folder, and within that, a "LIVE" folder.
Any help here would be most appreciated
From: gerauchert
I can't find jagexlauncher/bin. I have jagexcache, but within it is only a "runescape" folder, and within that, a "LIVE" folder.
Any help here would be most appreciated
Try deleting it all and reloading runescape?
gerauchert
2012-08-13 11:57:44
From: Ollybest
Try deleting it all and reloading runescape?
Just tried that. The new folder that appears is the exact same….
slacky
2012-08-13 12:03:20
From: gerauchert
I can't find jagexlauncher/bin. I have jagexcache, but within it is only a "runescape" folder, and within that, a "LIVE" folder.
Any help here would be most appreciated
Install the runescape client. It seems like you're using the browser to play.
krasniy
2012-08-13 12:17:45
Almost feel like a little kid on Christmas morning…..this is one super update! Thanks Brandon and everyone else participating!
gerauchert
2012-08-13 13:05:16
From: warpie
Install the runescape client. It seems like you're using the browser to play.
:duh: Me dumb lol. Always thought rs client = browser.
Thanks for clearing that up for me!
Hmm… 0.1 worked just fine, 0.2 w/o simba worked good (although it lagged me), but when I ran the test script (in lape, following all the instructions) it blue screened me.
E: I have Intel CPU and 2 Radeon HD 5700 GPU's on crossfire.
Brandon
2012-08-13 14:03:19
From: JN13
Hmm… 0.1 worked just fine, 0.2 w/o simba worked good (although it lagged me), but when I ran the test script (in lape, following all the instructions) it blue screened me.
Do not call models. The serializer is only complete in 0.3. Same with drawing. I actually just finished it 5 minutes ago. 1 DLL for all cards now.
I'll upload it in a sec.
From: Brandon
Do not call models. The serializer is only complete in 0.3. Same with drawing. I actually just finished it 5 minutes ago. 1 DLL for all cards now.
I'll upload it in a sec.
Aah~ I love your project! I hope I can help you out in some way :)
Cant wait until this is released to see whats new. Keep up the good work, Ive been watching this thread for your progress everyday. :sasmokin:
From: Brandon
Do not call models. The serializer is only complete in 0.3. Same with drawing. I actually just finished it 5 minutes ago. 1 DLL for all cards now.
I'll upload it in a sec.
VastlySuperior
2012-08-14 12:17:48
Oi Brandon. This rocks! Stupid question, but will this work with any other game as well or just runescape?
Greatly appreciate what you are doing.
This project is its cool!
Brandon
2012-08-14 12:58:45
From: VastlySuperior
Oi Brandon. This rocks! Stupid question, but will this work with any other game as well or just runescape?
Greatly appreciate what you are doing.
The BASE dll will work for any game. Inother words, you can get any game to load the dll but the hooks will of course be different. Every game uses different techniques of rendering things.
Make sense?
Anyway, this is my last problem before I release 0.3 and POSSIBLY remove it from beta:
http://pastebin.com/kcPhD035I've done so much work on it last night.. More than 2-3k lines of changes. Still have to upload the latest changes in a sec. I've finished serialization.. FINALLY! Lol.
Current script in testing:
{$loadlib GLHook}
type TModel = record
SX, SY: Integer;
Stride: Cardinal;
ID: Cardinal;
TriangleCount: Integer;
end;
type TPanelItem = record
ID: Integer;
TextureID: Integer;
X, Y: Integer;
SX, SY: Array [0..3] Of Integer;
end;
type TFontInfo = record
ID: Cardinal;
R, G, B, A: Byte;
X, Y: Single;
Symbol: Char;
Shadow: Boolean;
VX, VY: Array [0..3] Of Integer;
end;
type PModel = ^TModel;
type PPanelItem = ^TPanelItem;
type PFontInfo = ^TFontInfo;
type TModelArray = array of TModel;
type TPanelArray = array of TPanelItem;
type TFontArray = array of TFontInfo;
Function GLHook_GetFonts: TFontArray;
var
Ptr: Pointer;
Size, I: Integer;
FontPtr: PFontInfo;
begin
Ptr := GLHGetFonts(Size); //Get a pointer to the Font buffer + the size.
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
FontPtr := Ptr;
Result[I] := FontPtr^;
Ptr := Ptr + sizeof(TFontInfo); //iterate the pointer.
end;
end;
Function GLHook_GetAllItems: TPanelArray;
var
Ptr: Pointer;
Size, I: Integer;
PanelPtr: PPanelItem;
begin
Ptr := GLHGetPanelItems(Size); //Get a pointer to the Panel buffer + the size.
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
PanelPtr := Ptr;
Result[I] := PanelPtr^;
Ptr := Ptr + sizeof(TPanelItem); //iterate the pointer.
end;
end;
Function GLHook_GetAllModels: TModelArray;
var
Ptr: Pointer;
Size, I: Integer;
ModelPtr: PModel;
begin
Ptr := GLHGetModels(Size); //Get a pointer to the model buffer + the size.
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
ModelPtr := Ptr;
Result[I] := ModelPtr^;
Ptr := Ptr + sizeof(TModel); //iterate the pointer.
end;
end;
var
Ptr: Pointer;
Size, I: Integer;
FontPtr: PFontInfo;
begin
ClearDebug;
Ptr := GLHGetFonts(Size);
FontPtr := Ptr;
writeln(FontPtr^.Symbol); //WTF! Not working.. Todo: Fix.
end.
P.S. I cannot upload it right now. Maybe in the next 5 hrs. I got stuff to do. But yeah, everything is looking pretty good.
Brandon
2012-08-14 13:02:29
Excuse the double post.. Phone won't let me edit!! If anyone can merge this with that previous post then please do.
Uhh The font problem is that it's not aligning right. Well inother words, it's not displaying what it should on the simba side. But in both GLHook and OpenGL32, it is displaying it properly 100%!
Simba is getting the correct size of the data, it's just not reading the pointer right. I've tried everything I know of so far but I can only work on it in the next 5 hrs. I even went so far as to make simba its own struct -_- and a function to give it the data 1 by 1.
All the other functions, simba reads them correctly. Just not the stupid font.
Brandon what type of camera angle stuff can you get? If anything if you decide to hook it?
Brandon
2012-08-14 13:07:05
From: Ollybest
Brandon what type of camera angle stuff can you get? If anything if you decide to hook it?
Anything you want, why? I can supply all matrices, quaternions, any info you need. I have it hooked already it's just not exported because currently I know of no way to use the data YET. It's the math part that will actually kill anyone trying to help. You'd need an extremely strong math background + very strong knowledge of how opengl works + C++ knowledge to know how to modify the matrices.
I've uploaded the latest matrix class I wrote already but it isn't enough and needs modifications.
From: Brandon
Anything you want, why? I can supply all matrices, quaternions, any info you need. I have it hooked already it's just not exported because currently I know of no way to use the data YET. It's the math part that will actually kill anyone trying to help. You'd need an extremely strong math background + very strong knowledge of how opengl works + C++ knowledge to know how to modify the matrices.
I've uploaded the latest matrix class I wrote already but it isn't enough and needs modifications.
In terms off like we can have perfect mmtoms? and the stuff console walking needs to work?
Brandon
2012-08-14 13:15:53
From: Ollybest
In terms off like we can have perfect mmtoms? and the stuff console walking needs to work?
No need for MMToMS. And it's already perfect because All Minimap dots have ID's. You get those ID's, do MMToMS on them..
OR You can just do GLHook_GetAllModels;
For each model, check if it's on screen. Click it.
I do not have the stuff console walk needs because I cannot get the camera angle. I cannot figure out how jagex is calculating it. Remember I have to be able to reverse it to get the info and atm, it's a bit beyond me but I'm hoping that I'd figure something out soon. If anything, we can live with the essentials for now and figure out walking later as that's absolutely the hardest thing I came across so far (Getting camera angles).
From: Brandon
No need for MMToMS. And it's already perfect because All Minimap dots have ID's. You get those ID's, do MMToMS on them..
OR You can just do GLHook_GetAllModels;
For each model, check if it's on screen. Click it.
I do not have the stuff console walk needs because I cannot get the camera angle. I cannot figure out how jagex is calculating it. Remember I have to be able to reverse it to get the info and atm, it's a bit beyond me but I'm hoping that I'd figure something out soon. If anything, we can live with the essentials for now and figure out walking later as that's absolutely the hardest thing I came across so far (Getting camera angles).
Oh for sure, The main benefit of ogl isn't walking :P You think its possible for sps to walk at any angle because you can get the perfect compass angle now?
From: Ollybest
Oh for sure, The main benefit of ogl isn't walking :P You think its possible for sps to walk at any angle because you can get the perfect compass angle now?
I don't think that we need SPS for OpenGL walking..
~Home
Le Jingle
2012-08-14 13:29:14
From: Brandon
No need for MMToMS. And it's already perfect because All Minimap dots have ID's. You get those ID's, do MMToMS on them..
OR You can just do GLHook_GetAllModels;
For each model, check if it's on screen. Click it.
I do not have the stuff console walk needs because I cannot get the camera angle. I cannot figure out how jagex is calculating it. Remember I have to be able to reverse it to get the info and atm, it's a bit beyond me but I'm hoping that I'd figure something out soon. If anything, we can live with the essentials for now and figure out walking later as that's absolutely the hardest thing I came across so far (Getting camera angles).
Just trying to help, (I'm sure Brandon's aware of this quote), but for more on the camera angel specifics [From his
old thread, OpenGL ], there's this too: (Just trying to save him more explaining than needed :p )
From: Brandon
Camera rotation works like this:
Projection Matrix defines the view/clipping area. That's basically how much you can see on the screen at one time. The distance you can see, etc.
ModelView Matrix is two matrices combined. You use this + Projection matrices to convert from 2D to 3D and back. I've provided all the matrices needed to get the camera position but it simply isn't possible to reverse/split a matrix.
Using the two matrices, by rotating, translating, inversing and transposing, it's possible to get the camera location and use that to get the look-at. Aka eye coordinates.
Example: The model view is the view matrix + Model matrix combined. You cannot split them. If I could then I'd have camera position.
Instead, I have to some how use the modelview matrix + projectionview matrix and hooks to get the camera position. I've already provided the source for all the hooks needed but still it puzzles me how anyone could possibly get the camera position. Now there is a program calld GLIntercept which has a plugin called FreeCam. This plugin is opensource and it is able to get the camera position by some insane mathematics. I've tried and given up on even bothering to understand it at this point in time. It's beyond matrices. It's called Quaternions.
Anyway all the info needed to get camera position is what that post was showing. I didn't expect anyone to know what it was or just reverse it magically because that really really isn't possible (for me at least) atm. Lets just say the amount of math required atm isn't worth it for anyone to start learning from scratch. I admire game programmers now. The amount of work is ridiculous.
I'm going to go bother benland for an algorithm or do some of research or something.
Not sure if this Document helps with anything.
http://www.songho.ca/opengl/gl_vbo.html~Home
From: Home
I don't think that we need SPS for OpenGL walking..
~Home
Nah I was just raising the question, it would be nothing to do with actually opengl walking, just if we can get the perfect compass angle and rotate the bitmap in sps surely it would work?
euphemism
2012-08-14 14:24:11
From: Ollybest
Nah I was just raising the question, it would be nothing to do with actually opengl walking, just if we can get the perfect compass angle and rotate the bitmap in sps surely it would work?
The compass angle isn't really the issue. The issue is that rotating a bitmap reduces its quality and introduces a lot of distortion which hinders SPS' ability to match the minimap with a rotated image.
From: euphemism
The compass angle isn't really the issue. The issue is that rotating a bitmap reduces its quality and introduces a lot of distortion which hinders SPS' ability to match the minimap with a rotated image.
We can intercept the unrotated map using Opengl according to Trilez.
From
http://tribot.org/forums/showthread.php?tid=388 :
Like Leetsxc, I am also developing a positioning system for TRiBot. I was already using the name 'TPS' before Leetsxc came up with his idea, so don't think I'm trying to steal the name or anything. Tongue Sorry for any confusion between the two.
But anyways, TRiBot is able to intercept an unrotated, large minimap image without any dots, symbols, etc. being drawn on it.
I've put these pieces together to create a large map.
What TPS does is it compares the current cached minimap image with the large map to give you your base coordinates.
The current way of comparing the two images is by using tree positions (which is pretty reliable for areas with trees). I'll expand on the comparing later.
I also tried comparing chunks of the minimap to the large map, but I wasn't able to get it to work… because I was trying to use an up-side-down minimap image (just realized today)… stupid me. Anyways, I'll try to come back to this method since it's more reliable than searching for objects such as trees (for instance, if you were to be in a baren land such as the desert).
So, with that base position… add your character's relative position to it and you'll have your coordinates. Smile
I'll post my progress in this thread. Hopefully I have some smooth sailing. Big Grin
So in other word, it is SPS, but much more accurate because there is no need to rotate the image, there is no symbol on it, and no white/yellow dots of moving players/npcs (that also mess up the IsWalking() function).
He also made a video:
http://youtu.be/F5Q1_dwYGGI
From: euphemism
The compass angle isn't really the issue. The issue is that rotating a bitmap reduces its quality and introduces a lot of distortion which hinders SPS' ability to match the minimap with a rotated image.
Oh? My bad then man.
TRiBots Walking Works Very Well par you have to walk everywhere to get the maps took me 6 Hours to make most of the left side of RS Members for TRiBot.
Mat
From: Mat
TRiBots Walking Works Very Well par you have to walk everywhere to get the maps took me 6 Hours to make most of the left side of RS Members for TRiBot.
Mat
If we do something similar, it shouldn't take took long to get all of runescape, with the amount of user willing to contribute here on villavu.
We could probably do the whole surface runescape and all popular dungeons in a day if if we could organise ourself proprely.
ReadySteadyGo
2012-08-14 17:44:48
From: Brandon
I do not have the stuff console walk needs because I cannot get the camera angle. I cannot figure out how jagex is calculating it. Remember I have to be able to reverse it to get the info and atm, it's a bit beyond me but I'm hoping that I'd figure something out soon. If anything, we can live with the essentials for now and figure out walking later as that's absolutely the hardest thing I came across so far (Getting camera angles).
Are you sure they aren't just using the standard "look at" camera model, I doubt they would need anything more sophisticated? i.e. Eye, Target, Up vectors.
It's likely that they use a function like (
http://cmldev.net/?p=157 ) to create a look at matrix then just multiple it by the Projection and ModelView matrices.
But then again, I'm just guessing, I haven't looked at their matrix stack.
E: Even so, there is no way that you'll be able to get a global position from this. It will be sent to the GPU in patches, likely using quadtrees.
Your best bet is to have a CRC look up table of all the minimap patches, grab the minimap patch, calculate your local position, then determine a global position using the look up table.
Not sure if this helps at all. But this is how you can calculate Reflection tiles With Color and console (Note Text Coords needs to be updated but you will understand how the Math works with this)
function C_GetPosEx :TIntegerArray;
var
Box :TBox;
TPA :TPointArray;
CPos :String;
I :Integer;
TSA :TStringArray;
begin
If not C_UpdatePos then Exit;
FindColors(TPA, clWhite, 65, 296, 516, 307);
Box := GetTPABounds(TPA);
CPos := GetTextAtExWrap(Box.X1 - 2, Box.Y1 - 2, Box.X2 + 2, Box.Y2 + 2, 0, 5, 4, clWhite, 0, SmallChars);
CPos := Between('s: ', 'H', CPos);
TSA := Explode('''', CPos);
If Length(TSA) < 4 then Exit;
for I := 0 to Length(TSA) - 1 do
TSA[I] := Trim(TSA[I]);
SetLength(Result, 5);
for I := 1 to 4 do
Result[I] := StrToInt(TSA[I]);
DeleteValueInIntArray(Result, 0);
end;
function C_ConvertToGlobalPos(Position :TIntegerArray) :TPoint;
begin
If Length(Position) = 4 then
begin
Result.X := Round(Position[0] * 64) + Position[2];
Result.Y := Round(Position[1] * 64) + Position[3];
end;
end;
function C_GetPos :TPoint;
begin
Result := C_ConvertToGlobalPos(C_GetPosEx);
CurrPos := Result;
end;
~Home
Brandon
2012-08-14 18:44:30
From: ReadySteadyGo
Are you sure they aren't just using the standard "look at" camera model, I doubt they would need anything more sophisticated? i.e. Eye, Target, Up vectors.
It's likely that they use a function like ( http://cmldev.net/?p=157 ) to create a look at matrix then just multiple it by the Projection and ModelView matrices.
But then again, I'm just guessing, I haven't looked at their matrix stack.
E: Even so, there is no way that you'll be able to get a global position from this. It will be sent to the GPU in patches, likely using quadtrees.
Your best bet is to have a CRC look up table of all the minimap patches, grab the minimap patch, calculate your local position, then determine a global position using the look up table.
Correct. Looks like you understand what I meant. I indeed cannot "Extract" anything from it. But I'm working on a method atm. Collecting data from the client. I noticed they do indeed set the projection matrix, do a multiplication, then select the modelview and do a different multiplication. Looking at this data, I can probably get the camera from it. Hopefully. Since I know some of the transformations done. Not sure if I can grab all but currently I'm grabbing a lot of it and it could possibly be useful.
Brandon are the ids currently generated going to stay the same? or do you plan on changing them?
I find myself camping on this thread waiting like its Christmas.
Le Jingle
2012-08-15 15:30:48
From: Ollybest
Brandon are the ids currently generated going to stay the same? or do you plan on changing them?
He never uploaded the next version he was working on (I think because there were still a couple kinks - afaik) to this thread, so I wouldn't worry about id's just yet.
Brandon
2012-08-15 15:58:12
The IDs in the current dll on he thread are different from the new ones.
That being said, I don't plan on changing anything. If I do, I'll add it as ID2.
I haven't been able to get to a computer since yesterday. Thread says August 15th I'd be busy.. I didn't expect to be this busy.. That being said, I have a possible solution to reflection walking but it may involve ASM so if you don't understand assembly, development on it isn't for you. Anyway when I get home from my job seminar, I'll load up olly and Ida and get to work on walking.
For now just hold on tight lol. Sorry for the long waits and delays though I can't actually help it else I'd have pushed it already if I had more time.
~From my phone~
From: JN13
I find myself camping on this thread waiting like its Christmas.
Same. I check it atleast 5-6 times a day to see even a slight update lol // also reading the new comments.
From: Brandon
The IDs in the current dll on he thread are different from the new ones.
That being said, I don't plan on changing anything. If I do, I'll add it as ID2.
I haven't been able to get to a computer since yesterday. Thread says August 15th I'd be busy.. I didn't expect to be this busy.. That being said, I have a possible solution to reflection walking but it may involve ASM so if you don't understand assembly, development on it isn't for you. Anyway when I get home from my job seminar, I'll load up olly and Ida and get to work on walking.
For now just hold on tight lol. Sorry for the long waits and delays though I can't actually help it else I'd have pushed it already if I had more time.
~From my phone~
Take all the time you need, post once in a while some code or upload it into github, I'm trying to learn from your code all the time.
~Home
Brandon
2012-08-15 21:35:05
From: Home
Take all the time you need, post once in a while some code or upload it into github, I'm trying to learn from your code all the time.
~Home
https://github.com/Brandon-TUpdated. A lot of the serialization was updated to allow Simba to read all data correctly and formatted. Also to allow sharing data between memory modules (Ogl32 + GLHook). A lot of other stuff I didn't mention but the git shows all changes.
All compilers supported I hope. Well the main ones at least. Sorry for not leaving comments in the code but if any questions just ask and I'll reply whenever I can. Should be pretty straight forward though.
P.S. Serialization is the concept of turning data into bytes for transfering or using however. I use this to write to the shared memory, then deserialize to read.
Basically transform to bytes, write to shared memory.. Read from shared memory and reconstruct data on the other side. I'm pretty sure smart does this but quite a bit different.
I haven't gotten around to figuring out why Simba doesn't read the font struct properly as it is constructed the same as all the others but I believe it is because of alignment OR because it's just not reading a "char" datatype correctly. Possibly the size of the data types may be different though I doubt it -_-
Oh and feel free to edit my first post anyone. Whatever makes it easier for reading or understanding. I also updated the test script. Just to show how to use pointers and how to derive functions from the data given. It's pretty straight forward.
Le Jingle
2012-08-15 21:56:09
Simply, Epic.

Same machine that didn't show up all id's before too.
Also, time to get me some id databases.
>:] Impressive Brandon, thank you.
Nice job. Looks all pretty now.
I assume you already know this, player and NPC ID's are still dynamic.
So it's not a good idea to gather ID for those things.
Brandon
2012-08-15 22:18:39
From: eska
Nice job. Looks all pretty now.
I assume you already know this, player and NPC ID's are still dynamic.
So it's not a good idea to gather ID for those things.
Really? They shouldn't be :S Unless there is an overflow on your comp. I'll check it again. It really isn't supposed to change.
From: Brandon
Really? They shouldn't be :S Unless there is an overflow on your comp. I'll check it again. It really isn't supposed to change.
You are making me scared :S I'm going to re-download it and see how it goes.
Edit: Yes it is still dynamic I'm afraid. Unless the display Id's are meant to be? I'm just running the jagex launcher right now, not using simba and I'm checking ID.
Everytime I login I get a new player ID, and NPC also get a new one.

I tried checking my ID, equiping an item and removing it, and then see if it change my ID changes and it doesn't..
Brandon
2012-08-15 22:31:13
From: eska
You are making me scared :S I'm going to re-download it and see how it goes.
Edit: Yes it is still dynamic I'm afraid. Unless the display Id's are meant to be? I'm just running the jagex launcher right now, not using simba and I'm checking ID.
Everytime I login I get a new player ID, and NPC also get a new one.
Ahh yeah that's called an overflow. It shouldn't do that but I guess on your comp, Integers are of a different size. Nothing to be scared of really.
It works like this:
Integers by default are usually 4 bytes. Unsigned ints are 4 bytes as well. They can hold a certain range of values. When you go beyond that range, you get an overflow. On my comp, integers are 4 bytes, unsigned are 4 and long's are 8. On most comps, longs are defined as 4 bytes.
I assume that on your comp, int's may be 2 bytes which is very very old. Though I doubt it, I'll check to see if it's a fault in my code. If anything, I'll either change it to a DWORD or int64. On the laptop I write code on, it's all static and doesn't change.
I'll look into it. Nothing to be worried about really. It shouldn't happen since it's a uint32_t but meh.. lol. Happening to anyone else?
Using Windows 7 64 bit with java 6 update 30. Simba 1.00.
intel 2600k
asus sabertooth p67
32gig of ram
64gb ssd
1tb harddrive
geforce 570 gtx
My computer is a about 10 months old.
Edit: Going to experiment in a VM.
Edit: Same thing happen in my VM which is 32bit win 7:
Le Jingle
2012-08-15 22:57:30
From: eska
Using Windows 7 64 bit with java 6 update 30. Simba 1.00.
intel 2600k
asus sabertooth p67
32gig of ram
64gb ssd
1tb harddrive
geforce 570 gtx
My computer is a about 10 months old.
Edit: Going to experiment in a VM.
dang your setup is kinda what I'm going to build off of..
OT: Yea, I'm getting dynamic npc ids too:

on this computer: Windows, intel processor, crap intel graphics
Brandon
2012-08-15 23:01:48
From: Le Jingle
dang your setup is kinda what I'm going to build off of..
OT: Yea, I'm getting dynamic npc ids too:

on this computer: Windows, intel processor, crap intel graphics
Happening on other comps? I cannot replicate it on my ATI :S
The varrock guard shows up as: ID: 4109771728 100% of the time. I'll test it on another card in the morning. Seriously shouldn't be happening though.

If it happens on my Intel card then it's an endian problem and I'll have to compile it on one of those machines or use IFDEF's. It's not something that I cannot fix. It's fixable but it's just annoying :c
Well then the good news is that it is only related to nvidia/intel card.
The bad news is that I'm sad :(
I see you uploaded a picture.. are the graphics important? I just put it on OpenGl and minimum.
Borrowing my brothers computer right now, I'll see if it's really nvidia related.
Le Jingle
2012-08-15 23:13:18
I'll test on a nvidia computer here and edit in the results, too.
Brandon
2012-08-15 23:17:34
From: eska
Well then the good news is that it is only related to nvidia/intel card.
The bad news is that I'm sad :(
I see you uploaded a picture.. are the graphics important? I just put it on OpenGl and minimum.
Borrowing my brothers computer right now, I'll see if it's really nvidia related.
Basically, inother words, it works on both computers. The byte orders and just flipped so for you, it'll display something different than for me. That's a big problem which can easily be fixed. I'll try to avoid casting though it's nearly impossibly since I'm dealing with pointers. But I'll just reverse them myself then. That'll fix it. Could possibly explain the drawing crap as well from before. I'm 100% sure it's endianness since what prints on ATI's as Cyan, prints on intel/nvidia as teal. Flip the order and it prints properly.
I'll fix it in the next release. I'll try to get it out tomorrow or something.
Got bad news brandon, it also messes up on ATI cards. (Just tested on my brother's computer)
The guard sometime had the ID 4109771728 (which is good), but it also changed to something717 and other IDs too from time to time.
The ID also sometime change without reloading anything. I spoted a guard just walking and then all of a sudden his ID changed. Also, when they die, at the last moment of their death dying animation, the ID briefly returns to 4109771728 and then vanish.
Sorry I can't provide a in-depth test.. my bro started complaining after 5 minutes..
Brandon
2012-08-15 23:22:54
From: eska
Got bad news brandon, it also messes up on ATI cards. (Just tested on my brother's computer)
The guard sometime had the ID 4109771728 (which is good), but it also changed to something717 and other IDs too from time to time.
The ID also sometime change without reloading anything. I spoted a guard just walking and then all of a sudden his ID changed. Also, when they die, at the last moment of their death dying animation, the ID briefly returns to 4109771728 and then vanish.
Sorry I can't provide a in-depth test.. my bro started complaining after 5 minutes..
Does this happen to your player ID or just NPC's? Also endian stuff is architecture related not graphics. Like I said its easy to fix ill do it in the morning or when I get home
From: Brandon
Does this happen to your player ID or just NPC's?
Didn't check my player ID, I was focused on the guard. Can't check now since my bro took the computer back.
I remember though when I first logged in I saw 2 guard with the good ID. Then some time later the ID had changed.
Don't take every bit of info I give you for granted though. I was being pushed by my brother to leave the computer so I did a quick and dirty test.
I'm currently trying to find items on the ground and move my mouse right over it (I've already succeded in finding it in my inventory and bank). The following code moves the mouse to all ID match, but the problem is that it doesn't move it to the item, it brings it to some random location.
I know it finds the ID I'm giving it because I drop a certain amount of the item I'm searching. Say I'm searching ashes, I drop 10 ashes, test it, and the mouse moves 10 time. Then I do 3.. moves 3 times… then I pick all up, no movement.
Thats the code I'm using:
Ptr:= GLHGetModelsByID(1894056545, Size); // I also tried GLHGetItemsByID out of desperation with no success.
SetLength(models, Size);
For I := 0 To Size - 1 Do
begin
ModelPtr := Ptr;
models[I] := ModelPtr^;
Ptr := Ptr + sizeof(TModel); //iterate the pointer.
MoveMouse(models[I].SX,models[I].SY);
Wait(RandomRange(1500, 2000));
end;
So my question is, does SX and SY represent 'screen x' and screen y' or do I need to calcule their position somehow, or maybe is it a bug?
Jakkle
2012-08-16 04:26:54
Hey Brandon. I've just downloaded the zip file from Github and I'm having trouble building it. I have tried Visual Studio 2010 and code-blocks, both come up with errors. I am not sure how to build it in Mingw, I haven't looked tho tbh. I was just wondering if there is something else I need ? To be able to build it.
These are the errors I get in code-blocks.

I'm still a noob with C++ as I've only learnt the basics so far :p.
Brandon
2012-08-16 07:12:19
From: Jakkle
Hey Brandon. I've just downloaded the zip file from Github and I'm having trouble building it. I have tried Visual Studio 2010 and code-blocks, both come up with errors. I am not sure how to build it in Mingw, I haven't looked tho tbh. I was just wondering if there is something else I need ? To be able to build it.
These are the errors I get in code-blocks.
I'm still a noob with C++ as I've only learnt the basics so far :p.
Link to:
opengl32
glu32
gdi32
user32
As for the mouse moving to a random location, SX, SY is NOT the screen coordinates. It's buffer coordinates. Use the viewport to translate it to the screen. Or just add 224 to it for fixed mode. Couple more hrs I'll be home and fix the endian stuff.
CynicRus
2012-08-16 08:00:32
What a software bunch of you use for debugging JagexLauncher? I'l try ollydbg+hide plugin, IDA 5.5 but it only leads to errors.
Brandon
2012-08-16 08:07:33
From: CynicRus
What a software bunch of you use for debugging JagexLauncher? I'l try ollydbg+hide plugin, IDA 5.5 but it only leads to errors.
You have to NOP out Kernel32's IsDebuggerPresent. I'm not sure if Hide works for you but it didn't work for me.
Try: Tuts4You's Phantom plugin.
EDIT: Don't forget to use runescape as the arguments.
Le Jingle
2012-08-16 08:07:51
From: CynicRus
What a software bunch of you use for debugging JagexLauncher? I'l try ollydbg+hide plugin, IDA 5.5 but it only leads to errors.
I think try Frement's
plugin?
http://tuts4you.com/download.php?view.1276^might be it (googled)
Jakkle
2012-08-16 10:23:53
From: Brandon
Link to:
opengl32
glu32
gdi32
user32
Well I have done what you said and I still get an error. I looked up how to sort it out and I already got an OGL project to compile and run.
Here is a pic of what I get plus showing I have linked the libraries.

When you have the time it would be nice if you could help me sort this out over msn or what ever you would prefer to use to communicate. I would greatly appreciate it :)
ReadySteadyGo
2012-08-16 16:09:05
From: Jakkle
Well I have done what you said and I still get an error. I looked up how to sort it out and I already got an OGL project to compile and run.
Here is a pic of what I get plus showing I have linked the libraries.
When you have the time it would be nice if you could help me sort this out over msn or what ever you would prefer to use to communicate. I would greatly appreciate it :)
Post the full debug then someone here may be able to help… Can not read a thing at that resolution!
We are both called Jack :)
Brandon
2012-08-16 16:24:58
From: ReadySteadyGo
Post the full debug then someone here may be able to help… Can not read a thing at that resolution!
We are both called Jack :)
Oops.. Well yeah I can read that lol I have pretty good eyes =] Uhh if ARB functions aren't defined, that's because Windows compilers do NOT ship with glext.
Solution is to download it from Kronos and place it in the includes folder.
http://www.opengl.org/registry/api/glext.h
Jakkle
2012-08-16 16:40:51
From: ReadySteadyGo
Post the full debug then someone here may be able to help… Can not read a thing at that resolution!
We are both called Jack :)
Haha well you must of been able to, to know my names the same as yours :p
From: Brandon
Oops.. Well yeah I can read that lol I have pretty good eyes =] Uhh if ARB functions aren't defined, that's because Windows compilers do NOT ship with glext.
Solution is to download it from Kronos and place it in the includes folder.
http://www.opengl.org/registry/api/glext.h
Ok thanks Brandon, I will give it a go :)
Edit: Tried what you said plus I added 2 other header files that were very similar and had no luck.
Not sure if this was right but I did change GLsizeiptrARB size to GLsizei size and it didn't error on that any more but it still has 1 error.
Which is this,
Hope you can see this one :p lol

C:\Users\Jack\Desktop\Brandon-T-GLHook-f060cc2\Mingw - G++ - CodeBlocks\OpenGL32\Models.hpp|50|error: 'GLchar' does not name a type|
||=== Build finished: 1 errors, 0 warnings ===|
Oh by the way I've finaly managed to get an account in every single random possible, including the 3 certers (niles, giles and miles) as well as the first time you die (you are put in a random-like room with death talking to you)
That will be usefull for ID's.
As for finding items on the main screen (beside items in bank), I pretty much gave up. Seems impossible with the current functions.
Found some error which seems related to the problem you were talking about in page 6.

Edit1: LPCWSTR means "Long Pointer to Constant Wide String"
Edit2: Just fixed error in commands. Had to add a 'L' before the string because it can't convert it otherwise. Can't fix the other one…
Edit3: Found a workaround for the other error. I had to replace the variable with actual text with L in front.
Edit4: Now I got 12 unresolved external error..
Edit5: Now down to 2 unresolved external about gluproject or something… I wonder what awaits me once I fixed those.
Edit6: BUILD SUCCEDED WOLOLOLOLOLOOOOOOOOOOOOOOOOOOO
Edit7: Made my own OpenGl32.Dll using release mode but it when I load up runescape it doesn't seem to work at all. D:
Edit8: Just noticed that my OpenGL32.Dll is only 28 ko in size while Brandon's Dll is 700+. I did something wrong obviously.
Edit: 60 minutes since I built OpenGL32.Dll and I still can't figure out how to make it like Brandon's Dll even though it's the same code. Then it must mean it's in the settings.
Anyone know why im getting this compile error?
[Error] C:\Simba\Scripts\GlHook 3.0(27:15): Identifier expected at line 26
Compiling failed.
[Error] C:\Simba\Scripts\GlHook 3.0(27:15): Identifier expected at line 26
Compiling failed.
[Error] C:\Simba\Scripts\GlHook 3.0(27:15): Identifier expected at line 26
Compiling failed.
From: Sean25
Anyone know why im getting this compile error?
[Error] C:\Simba\Scripts\GlHook 3.0(27:15): Identifier expected at line 26
Compiling failed.
[Error] C:\Simba\Scripts\GlHook 3.0(27:15): Identifier expected at line 26
Compiling failed.
[Error] C:\Simba\Scripts\GlHook 3.0(27:15): Identifier expected at line 26
Compiling failed.
Are you using the Lape interpreter? Maybe you are actualy missing an identifier. If you are a beginner and don't know much about scripting I suggest you avoid this for the time being. We still got bugs and not everyone is used to Lape.
Brandon, do you have a clue why my Dll is only 28ko in size, when yours is 700+ko? I'm sure it's in the settings or the build options but I just can't figure out what it is. Using visual studio 2010. I really want to experimant with this and make new function but I need to be able to make the thing work in the first place -_-
From: eska
Are you using the Lape interpreter? Maybe you are actualy missing an identifier. If you are a beginner and don't know much about scripting I suggest you avoid this for the time being. We still got bugs and not everyone is used to Lape.
Brandon, do you have a clue why my Dll is only 28ko in size, when yours is 700+ko? I'm sure it's in the settings or the build options but I just can't figure out what it is. Using visual studio 2010. I really want to experimant with this and make new function but I need to be able to make the thing work in the first place -_-
Yes, that did fix my problem.
I'm currently very new to scripting and wanted to learn the new while its in the making.
EDIT: Got the script to run but I dont see none of the ID's coming up.. What am I doing wrong lol?
From: Sean25
Yes, that did fix my problem.
I'm currently very new to scripting and wanted to learn the new while its in the making.
EDIT: Got the script to run but I dont see none of the ID's coming up.. What am I doing wrong lol?
Have you copied the GlHook file in the simba folder?
Have you copied the OpenGL32 file in jagexlauncher/lib folder?
If you have done that, press F11 while logged on the runescape client using opengl graphic mode
From: eska
Have you copied the GlHook file in the simba folder?
Have you copied the OpenGL32 file in jagexlauncher/lib folder?
If you have done that, press F11 while logged on the runescape client using opengl graphic mode
Works great, I did everything but the F11 :)
EDIT1: In this picture below why doesnt the esslings or esshounds have ID's?
EDIT2: Or the floating rocks?

Uploaded with
ImageShack.usEDIT3: Thanks eska - I know I'm a noob but its cool to see it personally and checking items out ext.
They have different strides. (Press F1, F2, F3, ….. F8)
Brandon
2012-08-18 01:17:15
From: eska
……
LOL! -_- If you've never compiled C++ before, look up a quick tutorial. You shouldn't have had to change a thing. Infact, all you had to do was change the settings from Unicode to MultiByte.
Also I compiled with g++ not Visual Studio. Visual studio doesn't statically link the CRT so that's why your DLL is smaller. It means it'll only run on computers that have the same build settings as yours. Whereas compiling statically will allow it to run on any computer since all the files needed are included into the dll itself.
Anyway I figured out the problem with the stupid random ID's. It is 100% an intel/nvidia problem. They render extremely stupid which is why it lags more on those graphics cards. Instead of keeping a previous buffer and just changing the data it holds, they delete the entire thing, and render from scratch again OR they delete a portion and fill the rest with specific data. It's ridiculous so it's going to take me a while to get it working on nvidia/intel cards since I have other stuff to do. Most likely if I get a day or two off, I can fix it.. I even tried a CRC32 checksum and an endian test.. Endian test works just fine so it's not endianess. CRC32 checksum however gives completely different ID's every single time but only on nvidia cards. I tested it on 5 ati/radeon cards and 4 nvidia/intel cards.
P.S.. It's not only my DLL that's doing that. I had my friends build an opengl wrapper from scratch and it gave the same thing. Also tried Silab's and Aftermath's and it doesn't even show ID's at all! Only on ATI/radeon.. lol.
Anyway in my free time, I've been letting gDebugger and GLIntercept collect data to fix it.
Le Jingle
2012-08-18 01:35:40
@post Brandon's post above;
So ATI/radeon cards currently maintain static id's? And then intel/nvidia are random for the moment? Also, when the time does come around (because you are busy, and well busy means busy ;P [so full understanding there, can relate]) then data from gDebugger and GLIntercept will help you provide static id's for intel/nvidia? Sorry if this is repetitive, just seeing if I understood correctly |:?
I've managed to get my hand on a PC with an ATI card/chipset (Had a old pc, hooked it up and to my surprise it was still working just fine).
Here are some observation:
Your FPS get hit very hard. In my case, I had 20 FPS normaly, and 5 when using the Dll. Keep in mind I am testing this on a 7 years old pc.
The CPU usage increase a little bit (5-8%).
ID's for droped items are static.
ID's for inventory/bank items are static.
ID's for NPC are mostly dynamic, with some exceptions.
For example, Varrock guard have a few IDs. When a guard spawn, it will have one of the following IDs:
- 4109771728
- 4061411718
- 3684875452
- 3055771717 ** Only saw this one once. As it was dying, the ID changed to 4061411718.
In random event, it appears that the rotating object (that change colors to mess up color bot) do not have ID on them. They actualy have ID on them, only the ID doesn't appear next to the item, it is at the bottom of the screen in the chat!
Also, items can be found where the camera is aiming even if they are not visible (behind a wall for example)
slacky
2012-08-18 17:35:22
Hmm… It then seams like both GLHook, and TriBot share id's.
Varrock Guard (using TriBot):
3055771717L, 3684875452L, 4109771728L, 4061471718L
I'm starting to work on the random that we all hate because simba can't do it (with colors): Grave digger.
The ID's I'm using:
item ID
Leo 3889407584
Mausoleum (deposit box) 2722045510
coffins (in grave) 4144908143
grave (with no coffin) 1991316682
coffin (in inventory) 88485
Gravestone (flower) 1354881590
Gravestone (middle) 1149812268
Gravestone (side ones) 548408487
(small x to close) 48960
OBJECT INSIDE THE COFFINS:
POTS:
Pot 3937992794
Bowl 2057512415
Plant pot 3498840711
FARMING:
potato seed 3102717972
seed diber 273812747
secateur 2276098488
COOKING:
kebab 1138536929
chef hat 1838388837
cake 2957281085
MINING:
pickaxe 3694556631
apron 1325635456
ore 2587240836
WOODCUTTING:
hatchet 2919083330
logs 3063088826
knife 2435285455
OBJECT 'IN' THE GRAVE STONE:
watercan 3835333879
hatchet 921241370
pot 1637279479
chef hat 3905244131
pickaxe 1855624303
Brandon
2012-08-19 00:36:42
From: warpie
Hmm… It then seams like both GLHook, and TriBot share id's.
Varrock Guard (using TriBot):
3055771717L, 3684875452L, 4109771728L, 4061471718L
Yeah.. The algorithm is:
if(!pData) { return 0x0; }
DWORD sum;
DWORD tmp;
sum = *pData;
for(int i = 1; i < (size/4); i++)
{
tmp = pData[i];
tmp = (DWORD)(sum >> 29) + tmp;
tmp = (DWORD)(sum >> 17) + tmp;
sum = (DWORD)(sum << 3) ^ tmp;
}
return sum;
My new algorithm is a CRC checksum:
DWORD Crc32::Calculate(void *pData, size_t length)
{
return Crc32::Calculate(pData, length, 0);
}
DWORD Crc32::Calculate(void *pData, size_t length, DWORD initialRemainder)
{
static const DWORD lookupTable[256] =
{
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
};
DWORD crc = ~initialRemainder;
BYTE *p = (BYTE*)pData;
for( size_t i=0; i < length; i++) {
crc = lookupTable[(crc ^ *p++) & 0xFF] ^ (crc >> 8);
}
return ~crc;
}
It's far better. Still Intel gives random crap. On my ATI cards, nothing is dynamic. Everything is static. I'm not sure why though but I'm working on figuring out why my card is static. Yes CPU takes a hit due to the fonts. BUT that can be disabled. Reason being is that it's looping it twice!
Once for Simba to read and once for drawing on screen. It does this for everything (Models, Items, etc)
Now in the dll I currently have, I removed all that crap. Draws only on command so CPU and fps is exactly the same as usual.
EDIT:
Also stop PMing me about TriBot.. Check their exports:

Look at the first three.. Jagex can bash/dent them in a second by just reading the import table -__- Let them work on what they're working on and I'll work on what I am. I don't need someone breathing down my back telling me what they're doing.
Also someone might want to tell him that the original opengl32 exports 361 NATIVE functions.. His exports 366 which includes 3 of his own internals (363 without them). Anyway point is.. don't PM me about that stuff it takes more time to read it and reply.. Time I really need and could use to work on one of our own hooks.
Useful PM's are welcomed though. Just not the ones telling me what another is doing.. especially when it's closed source.
New algorithm = new IDs?
Great to hear that you've made some optimisation.
Wow. I'm now debating on staying with Simba more than TRiBot from what Brandon says.
But its all guess work though as no one really knows what Jagex are looking for but I agree that if they start looking they'll be able to see instantly.
Mat
(Once Brandon has this on smart working :) I'll be back here scripting :) )
I Also feel Brandon should get something for all his hard work, like he should accept PP Donations as he deservers them <3.
I would Donate to him :)
From: Mat
Wow. I'm now debating on staying with Simba more than TRiBot from what Brandon says.
But its all guess work though as no one really knows what Jagex are looking for but I agree that if they start looking they'll be able to see instantly.
Mat
(Once Brandon has this on smart working :) I'll be back here scripting :) )
I Also feel Brandon should get something for all his hard work, like he should accept PP Donations as he deservers them <3.
I would Donate to him :)
^ but people will be like omg asking for donations.
<Removed inappropriate language form post - BraK>
True, but he does deserver something for all his work.
Mat
Sirenia
2012-08-19 15:34:53
I think we should order him some footmassage and something nice to drink as a thanks for hes efforts :)
Brandon
2012-08-19 16:18:16
From: Mat
Wow. I'm now debating on staying with Simba more than TRiBot from what Brandon says.
But its all guess work though as no one really knows what Jagex are looking for but I agree that if they start looking they'll be able to see instantly.
Mat
(Once Brandon has this on smart working :) I'll be back here scripting :) )
I Also feel Brandon should get something for all his hard work, like he should accept PP Donations as he deservers them <3.
I would Donate to him :)
There's nothing to be scared of I'm just saying someone should tell him in case jagex decides to read the import table of his dll.. After all they're the ones loading it so it isn't hard to do.. But just in case.. I doubt they even check right now but meh nothing bad about being precautious
:), They'd only start doing that if OGL bots became Main Stream ?
Which looks fairly soon.
Mat
GLHGetPosition(X, Y, var WorldX, WorldY, WorldZ: Single)
How do I use it this function, and what can I use it for?
I'm asking this because I'm making a Leo random solver. Right now it finds and pickup all coffins, and check what is inside each of those and saves the answer in an array. Even though I can easily open a gravestone and find what coffin I should put in its grave, the problem is to place the coffin in the grave related to the gravestone. It is the 'hardest' part of this random. Of course, it *could* be done with only screen position (x, y) but it wouldn't be 100% accurate.
I want injection-like accuracy.
Now to achieve this, I believe I'd need the real position of the object on the screen in 3d (x, y, z) so that I can compare it with other object without having to worry about the position of the camera. Using that data, I could find nearest object to another object with 100% accuracy.
Also, what can I use GLHGetViewPort for?
GLHGetViewPort(var X, Y, Width, Height: Integer)
Brandon
2012-08-22 00:36:13
From: eska
Simba Code:
[LEFT]GLHGetPosition(X, Y, var WorldX, WorldY, WorldZ: Single)
[/LEFT]
How do I use it this function, and what can I use it for?
I'm asking this because I'm making a Leo random solver. Right now it finds and pickup all coffins, and check what is inside each of those and saves the answer in an array. Even though I can easily open a gravestone and find what coffin I should put in its grave, the problem is to place the coffin in the grave related to the gravestone. It is the 'hardest' part of this random. Of course, it *could* be done with only screen position (x, y) but it wouldn't be 100% accurate.
I want injection-like accuracy.
Now to achieve this, I believe I'd need the real position of the object on the screen in 3d (x, y, z) so that I can compare it with other object without having to worry about the position of the camera. Using that data, I could find nearest object to another object with 100% accuracy.
Also, what can I use GLHGetViewPort for?
Simba Code:
[LEFT]GLHGetViewPort(var X, Y, Width, Height: Integer)
[/LEFT]
GetPosition will give the 3D coordinates in the world corresponding to the 2d coordinates you pass it.
Example, if you gave it X and Y on a cartesian plane, it'll unproject it and give you X, Y, Z in Euclidean space.
I took 3D points and projected it to get the 2D points inorder to click it. Well that function will do the reverse.
Viewport can be used to determine whether or not a person is using fixed vs. resizeable or to determine what portion of the screen is being rendered. It's also used to project points and to determine if a point is on screen or off screen. This can be used to tell if a model is on the screen and clickable or if it rendered in the background but we can't see it.
Anyway I'm going to sleep lol. I can work on this all thursday as that's my only day off.
x := 266;
y := 124;
if GLHGetPosition(x, y, worldx, worldy, worldz) then
begin
writeln(tostr(x));
writeln(tostr(y));
writeln(tostr(worldx));
writeln(tostr(worldy));
writeln(tostr(worldz));
end;
Result:
259
222
259
223
0
It's always the same result no matter what you give it in parameters: worldX = x, worldY = y +1, worldZ= 0;
Brandon
2012-08-22 11:43:01
From: eska
Simba Code:
It's always the same result no matter what you give it in parameters: worldX = x, worldY = y +1, worldZ= 0;
If Z is 0 then stuff is just rendering with 0 depth is all. Meaning it's just rendering on the XY plane. Some stuff will actually render before it hits the screen then the buffer swaps. Then Z will not be 0.
I'll post an example tomorrow. Maybe my code is a bit messed. I haven't tested that function but I will in a sec. Not everything is supposed to be 0.
From: Brandon
If Z is 0 then stuff is just rendering with 0 depth is all. Meaning it's just rendering on the XY plane. Some stuff will actually render before it hits the screen then the buffer swaps. Then Z will not be 0.
I'll post an example tomorrow. Maybe my code is a bit messed. I haven't tested that function but I will in a sec.
Ok I've been testing this with coordinate of the mainscreen and also inventory screen. Always the same result. Didn't matter what floor of a building I was, or if the height of the terrain was different of another point, both gave me 0.*Anyway thanks for the reply. I know you're a bussy guy.
Brandon
2012-08-22 11:58:10
From: eska
Ok I've been testing this with coordinate of the mainscreen and also inventory screen. Always the same result. Didn't matter what floor of a building I was, or if the height of the terrain was different of another point, both gave me 0.*Anyway thanks for the reply. I know you're a bussy guy.
Also if you're not getting static ID's, for now just use the triangle count as it's also unique and static on every card so that means something with my algorithm is off.
EDIT: Uhh just realized the current DLL on the OP doesn't have triangle count for displaying. I'll upload it soon.
Hope things are going well with the project :)
Brandon
2012-08-23 17:40:41
From: JN13
Hope things are going well with the project :)
Just uploaded a new DLL.
F9 will display TriangleCount, Coordinates, and ID's. Just keep pressing it to switch between displays.
Uhh quite a bit of updates in this one. Tested it on all machines that I currently have with me. It's all static. Hopefullly it is for all of you guys too.
Updated the notes and stuff.. I'll post it on git and what not. The changes are on the first post.
Let me know if it lags or anything. If it does then I'll stop the font hooks until it goes into Smart (If it does).
EDIT2: Also I have ID2's in the background. It's there but not called in the DLL yet. Thinking of whether to just use the CRC32 for ID1's or implement it as ID2's.
EDIT3: It's not the fonts lagging me on my intel comp.. It's the stupid PanelItemChecksum function that takes a copy of all texture pixels and iterates them to generate ID's. I'll fix it when I'm free ={
Le Jingle
2012-08-23 17:41:48
Friends! ;)
I'll try to test the new upload out soon, might take a couple days to work with it;
Nice work too, amazing programming to the max ^^
Brandon
2012-08-23 22:18:30
Updated to 0.5. Largest speed increase ever. Also quite a bit of changes. Completely re-wrote the algorithm for ID's in the inventory/mm/etc.. And instead of using a bitmap and copying pixels 24/7, I decided to use it (No copying needed). I found that this function is the one that generates all textures and stores pointers to their memory. I hook these and generate ID's rather than reading pixels over and over and over!
In-other words, instead of grabbing the bitmap, width, height, generate ID.. grab bitmap, width, height, generate ID.. grab bitmap, width, height, generate ID, etc.. It grabs the pointer that Jagex supplies to their functions and generates ID's directly from that all in one swoop. Also helps future updates if jagex decides to change their client stuff (it won't affect the IDs).
It's way shorter code too! No ring around the rosie stuff.
I can confirm that ID's are 100% static on Nvidia cards. Nice job.
Flight
2012-08-24 01:25:21
Looking great, I'll have to try this soon. Wonderful job, Brandon. :)
Brandon
2012-08-25 10:52:42
Updated script (DLL comes with it but I gotta go back to work so I'll upload it whenever)..
Changes: Removed the VX, VY arrays from Fonts. Why? Because to users it's completely useless. For developers it's probably the single most important thing for text reading. It was used to grab each character of every font from jagex's bitmap thing. Simba side doesn't really need it unless you plan on still using Simba's OCR which is obsolete with this update as it already provides everything needed.
How it works. Well I'll leave that for later. Why Manual Pointer Iterations? Well it's difficult to explain but lets just say that Pascal pads structures by 2 byte boundaries and it wasn't aligning C++ structs to Pascal so manually was the best choice. Even packed structs didn't work on both C++ and Pascal side. How come I didn't do it for the other structures/records? Well the problem was that it only does this for the Fonts record and I don't know why. Either way it works now and I'm happy to say Font Recognition is now part of the Simba side. Remember that OpenGL renders bottom up and not top down so the top of the font is actually the bottom of it. I would flip it but meh it doesn't matter at all.
Enjoy (I'll be uploading the source + the DLL on the next release).
The code will look like this for scripts:
{$loadlib GLHook}
type pByte = ^Byte;
type pInt = ^Integer;
type pBool = ^Boolean;
type pFloat = ^Single;
type TModel = record
SX, SY: Integer;
Stride: Cardinal;
ID: Cardinal;
TriangleCount: Integer;
end;
type TPanelItem = record
ID: Integer;
TextureID: Integer;
X, Y: Integer;
SX, SY: Array [0..3] Of Integer;
end;
type TFontInfo = record
ID: Cardinal;
R, G, B, A: Byte;
Colour: Integer;
X, Y: Single;
Symbol: Char;
Shadow: Boolean;
end;
type PModel = ^TModel;
type PPanelItem = ^TPanelItem;
type PFontInfo = ^TFontInfo;
type TModelArray = array of TModel;
type TPanelArray = array of TPanelItem;
type TFontArray = array of TFontInfo;
Function GLHook_GetAllItems: TPanelArray;
var
Ptr: Pointer;
Size, I: Integer;
PanelPtr: PPanelItem;
begin
Ptr := GLHGetPanelItems(Size); //Get a pointer to the Panel buffer + the size.
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
PanelPtr := Ptr;
Result[I] := PanelPtr^;
Ptr := Ptr + sizeof(TPanelItem); //iterate the pointer.
end;
end;
Function GLHook_GetAllModels: TModelArray;
var
Ptr: Pointer;
Size, I: Integer;
ModelPtr: PModel;
begin
Ptr := GLHGetModels(Size); //Get a pointer to the model buffer + the size.
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
ModelPtr := Ptr;
Result[I] := ModelPtr^;
Ptr := Ptr + sizeof(TModel); //iterate the pointer.
end;
end;
Function GLHook_GetAllFonts: TFontArray;
var
Ptr: Pointer;
Size, I: Integer;
begin
Ptr := GLHGetFonts(Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do //Pointer Iteration is manual! DO NOT TOUCH IT!
begin
Result[I].ID := pInt(Ptr)^;
Ptr := Ptr + sizeof(Integer);
Result[I].R := pByte(Ptr)^;
Result[I].G := pByte(Ptr + sizeof(Byte))^;
Result[I].B := pByte(Ptr + (2 * sizeof(Byte)))^;
Result[I].A := pByte(Ptr + (3 * sizeof(Byte)))^;
Ptr := Ptr + (sizeof(Byte) * 4);
Result[I].Colour := RGBToColor(Result[I].R, Result[I].G, Result[I].B); //Just added it for testing and stuff. Might as well leave it.
Result[I].X := pFloat(Ptr)^;
Result[I].Y := pFloat(Ptr + sizeof(Single))^;
Ptr := Ptr + (sizeof(Single) * 2);
Result[I].Symbol := pChar(Ptr)^;
Result[I].Shadow := pBool(Ptr + sizeof(Char))^;
Ptr := Ptr + (sizeof(Char) + sizeof(Boolean)) + 2;
//Notes: Removed All Arrays. Total of 16 lines.
end;
end;
var
I: Integer;
Fonts: TFontArray;
begin
ClearDebug;
Fonts := GLHook_GetAllFonts;
For I := 0 To High(Fonts) Do
If (Not Fonts[I].Shadow) Then
begin
WriteLn(Fonts[I].Symbol);
MoveMouse(Round(Fonts[I].X), Round(Fonts[I].Y));
end;
end.
Results (From the login screen):
L
o
g
i
n
U
s
e
r
n
a
m
e
:
P
a
s
s
w
o
r
d
:
L
o
g
I
n
R
e
c
o
v
e
r
Y
o
u
r
P
a
s
s
w
o
r
d
O
r
l
o
g
i
n
w
i
t
h
:
(
O
p
e
n
s
a
p
o
p
u
p
w
i
n
d
o
w
)
C
r
e
a
t
e
A
c
c
o
u
n
t
N
o
w
Successfully executed.
Yeah I know.. I need to figure out a way to recognize new lines. It'd probably be a couple lines of code or so. Jagex doesn't use the space character.. Instead they just move a certain amount of pixels and starts rendering the next word.
Either way I've provided GetFontsArea which will give all characters within a box.. This will suffice until I figure out when a new word is rendering.
Woah. Great job! It looks good from my comp. So when do you plan on moving the project into SMART?
E: Just updated the GLhook without realizing its .5 again ^-^ <- thats what I get for being so tired…
From: JN13
Woah. Great job! It looks good from my comp. So when do you plan on moving the project into SMART?
E: Just updated the GLhook without realizing its .5 again ^-^ <- thats what I get for being so tired…
I believe that's not all in Brandon's control since BenLand still needs to add/change certain things to SMART.
Brandon
2012-08-26 11:19:21
From: Ollybest
I believe that's not all in Brandon's control since BenLand still needs to add/change certain things to SMART.
It's actually not in my control at all. Only thing in my control is what I post. Anything to do with Smart isn't me. Well I can help but that's probably the most I can do as Smart stuff is really up to Ben.
Anyway I got this far.. I got work now so can't finish atm but meh.. Was just messing around to see what I can and can't do to figure out what I should hook or fix. So far it's the stupid text reading. When I figure out the newline/new word thing this'll work even better. Anyway.. This is just a play thing I was doing. It's nothing official or serious. The include isn't up to me at all. So I hope no one thinks that I'm leaving anyone out and doing it on my own cuz that will not be the case; and isn't.
{$I GLHook/GLHook.Simba}
const
FixedWidth = 765;
FixedHeight = 553;
Function GLH_LobbyScreen: Boolean;
Begin
Result := InRange(GLH_GetLobbyTab, L_PlayerInfo, L_Options);
End;
Function GLH_RSReady: Boolean;
var
Area: TBox;
Begin
Result := (GLH_LoggedIn) Or (GLH_LobbyScreen);
If (Not Result) Then
Result := (Length(GLHook_GetItemsByID(9180)) > 0)
GLHGetViewPort(Area.X1, Area.Y1, Area.X2, Area.Y2);
If ((Area.X2 - Area.X1 > FixedWidth) or (Area.Y2 - Area.Y1 > FixedHeight)) Then
Begin
WriteLn('You are using the "Resizeable" screen option in RS.');
WriteLn('Please set it to "Fixed" to have SRL function properly.');
TerminateScript;
End;
End;
Function GLH_ValidEmail: Boolean;
var
SkipButton: TPanelArray;
Begin
While (Length(GLHook_GetItemByID(535342)) > 0) Do
Begin
SkipButton := GLHook_GetItemByID(24265);
If (Length(SkipButton) > 0) Then
MouseBox(SkipButton.SX[0], SkipButton.SY[0], SkipButton.SX[2], SkipButton.SY[2], MOUSE_LEFT);
WaitFunc(@GLH_LobbyScreen, 75, 3000);
End;
Result := GLH_LobbyScreen;
End;
Function GLH_ExitToLobby: Boolean;
var
Count: Integer;
LobbyButton: TPanelArray;
Begin
Result := GLH_LobbyScreen;
If Result Then Exit;
If (SRL_Procs[srl_OnExitToLobby] <> nil) Then
SRL_Procs[srl_OnExitToLobby]();
If (Not GLH_GameTab(TAB_LOGOUT)) Then Exit;
Wait(200 + Random(100));
While (GLH_LoggedIn and (Count < 10)) Do
Begin
Inc(Count);
LobbyButton := GLHook_GetItemsByID(171870);
If (Length(LobbyButton) > 1) Then
If (GLHook_GetTextArea(LobbyButton[0].SX[0], LobbyButton[0].SY[0], LobbyButton[0].SX[2], LobbyButton[0].SY[2]) = 'Lobby') Then
Begin
MouseBox(LobbyButton[0].SX[0], LobbyButton[0].SY[0], LobbyButton[0].SX[2], LobbyButton[0].SY[2], MOUSE_LEFT);
For I := 0 To 10 Do
Begin
Wait(1000);
If (Not GLH_LobbyScreen) Then
If GLH_ValidEmail Then
Begin
Result := True;
Exit;
End;
End;
End;
End;
End;
Function GLH_LeaveLobby: Boolean;
var
T: LongInt;
ExitButton: TPanelArray;
Begin
T := GetSystemTime;
While ((Not (Result)) And ((GetSystemTime - T) < 30000)) Do
Begin
ExitButton := GLHook_GetItemsByID(9369);
If (Length(ExitButton > 0)) Then
MouseBox(ExitButton[0].SX[0], ExitButton[0].SY[0], ExitButton[0].SX[2], ExitButton[0].SY[2], Mouse_Left);
Wait(RandomRange(1000, 2000));
Result := (Not (LobbyScreen));
End;
End;
Function GLH_LogOut: Boolean;
var
Count: Integer;
LogInButton: TPanelArray;
Begin
GLH_ExitedSquealOfFortune := False;
Result := Not GLH_LoggedIn;
If Result Then Exit;
If (SRL_Procs[srl_OnLogOut] <> nil) Then
SRL_Procs[srl_OnLogOut]();
If (Not GLH_GameTab(TAB_LOGOUT)) Then
Begin
GLH_CloseWindow;
If (Not GLH_GameTab(TAB_LOGOUT)) Then
Exit;
End;
While (GLH_LoggedIn and (Count < 10)) Do
Begin
Inc(Count);
LogInButton := GLHook_GetItemsByID(171870);
If (Length(LogInButton) > 1) Then
If (GLHook_GetTextArea(LogInButton[1].SX[0], LogInButton[1].SY[0], LogInButton[1].SX[2], LogInButton[1].SY[2]) = 'Login') Then
Begin
MouseBox(LogInButton[1].SX[0], LogInButton[1].SY[0], LogInButton[1].SX[2], LogInButton[1].SY[2], MOUSE_LEFT);
For I := 0 To 10 Do
Begin
Wait(1000);
If (Not GLH_LoggedIn) Then
Begin
Result := True;
Exit;
End;
End;
End;
End;
Function GLH_LoginToLobby: Boolean;
var
InfoBox: TPanelArray;
InfoLocation: TBox;
Begin
ActivateClient;
Wait(100);
TypeByte(VK_ESCAPE);
Wait(500);
Result := ((GLH_LobbyScreen) Or (GLH_LoggedIn));
If Result Then Exit;
If (Not (Players[CurrentPlayer].Active)) Then
Begin
WriteLn('Player is not Active...');
If (AllPlayersInActive) Then
Begin
WriteLn('All players not active!');
Exit;
End;
NextPlayer(False);
Exit;
End;
T := GetSystemTime;
Repeat
If GLH_RSReady Then
Break;
If ((GetSystemTime - T) > 180000) Then
Begin
WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
TerminateScript;
End;
Wait(RandomRange(1000, 2000));
Until (False);
WriteLn('Welcome to Runescape.');
Members := Players[CurrentPlayer].Member;
If (Length(Players[CurrentPlayer].WorldInfo) > 0) Then
Members := Players[CurrentPlayer].WorldInfo[0];
ProcStart:
If (GLH_LoggedIn) Then Exit;
For W := 0 To 1 Do
Begin
InfoBox := GLHook_GetItemsByID(61200);
If (W = 0) Then
InfoLocation := IntToBox(InfoBox[0].SX[0], InfoBox[0].SY[0], InfoBox[1].SX[2], InfoBox[1].SY[2])
Else
InfoLocation := IntToBox(InfoBox[2].SX[0], InfoBox[2].SY[0], InfoBox[3].SX[2], InfoBox[3].SY[2]);
T := (GetSystemTime + (60000 * 2));
If GLH_FindTextArea(InfoLocation) Then
Begin
Mouse(InfoBox.X2 - 2, InfoBox.Y2 - 5, 5, 5, MOUSE_LEFT);
Repeat
TypeByte(VK_BACK);
Until(Not GLH_FindTextArea(InfoLocation));
End;
Wait(100 + Random(200));
If W = 0 Then
Begin
WriteLn(Capitalize(Players[CurrentPlayer].Name));
TypeSend(Players[CurrentPlayer].Name);
End Else
TypeSend(Players[CurrentPlayer].Pass);
Wait(100 + Random(50));
End;
End;
I like that your going to let other help build the include, means it'll get done very fast :) as where others aren't :P
Gratz Man:)
Mat
Flight
2012-08-26 21:49:23
How might we go about reading text within a certain area, Brandon? Also including the format/colour of the text.
mormonman
2012-08-26 22:58:17
When you build the include first make a development map for people to follow. It needs to be built from the ground up, not just random functions that people find useful.
Good to know you've made a lot of progress with this, I'm really exited and will test in anyway if you need :)
In other news, shocking typo mate:
From: Brandon
Last Updated:
August 23th, 2012 - 22:00 EST
It's not 23
th, it's 23
rd :p
Brandon any clue why I get this? Exception in Script: Plugin(GLHook32) has not been found
Trust me its in the right folder lol. it drove me crazy :X
Brandon
2012-08-29 10:10:19
From: abu_jwka
Good to know you've made a lot of progress with this, I'm really exited and will test in anyway if you need :)
In other news, shocking typo mate:
It's not 23th, it's 23rd :p
LOL Google Chrome's auto correct. Not moi.
From: Ollybest
Brandon any clue why I get this? Exception in Script: Plugin(GLHook32) has not been found
Trust me its in the right folder lol. it drove me crazy :X
RS has to be loaded first then you can do whatever in Simba.
Brandon
2012-08-30 21:29:25
I updated the DLL's now. I'll upload the source when I'm finished work or have some free time other than just browsing around the forum. Basically when I get on my own laptop.
Anyway I also updated the test script. I'm going to work on splitting the fonts into words. Atm, the DLL gives a list of characters rendered to the screen but in order.
Every time there is a new line, it adds a blank font with symbol 0x10. Then fills the array with the next set of chars rendered.
Inother words, the test script can print stuff like:
Script:
var
I: Integer;
Foo: TStringArray;
begin
ClearDebug;
writeln(FontsToText(GLHook_GetAllFonts, False, 10, 0));
end;
Result:
[Banana]
[L o g in,
Usernam e:,
Password:,
L o g I n,
Recover Your Password,
Or log in with:,
(Opensapopupwindow),
Create Account Now,
]
Successfully executed.
Successfully saved: C:\Simba\Scripts\GLHook.simba
[/Banana]
Yeah I know some of the spacing is messed but that's because I rushed the splitting and used left of each char distance rather than absolute distance between each char. All splitting is done on the Simba side.
If anyone understood what I meant, you can probably complete it and post it otherwise wait until September comes and I'll write something up.
Can also just leave it normal without splitting and simply use a Regex to identify words with a for-loop. Also note that GetFontsByArea can be passed to the FontsToText instead of AllFonts.
EDIT: Updated the splitting function. Buddy at work covered for me =]
Function FontsToText(var FontArray: TFontArray; Shadow: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TStringArray;
var
I, J, L: Integer;
Str: String;
Begin
L := High(FontArray);
If Shadow Then J := 1 Else J := 2;
SetLength(Result, 1);
For I := 0 To L Do
If (FontArray[I].Shadow = Shadow) Then
Begin
If (((FontArray[I].Translate[0] - (FontArray[I - 2].Translate[0] + FontArray[I - 2].VX[3] - FontArray[I - 2].VX[0])) >= MinHSpacing) And (I >= 2)) Then
Str := Str + ' ';
If ((((FontArray[I].Translate[1] - FontArray[I - J].Translate[1]) >= MinVSpacing) And (I >= 2) And MinVSpacing > 0) Or (Ord(FontArray[I].Symbol) = 10)) Then
Str := Str + Chr(13);
Str := Str + FontArray[I].Symbol;
End;
ExplodeWrap(Chr(13), Str, Result);
End;
Prints:
[Banana]
[Login,
Username:,
Password:,
L o g I n,
Recover Your Password,
Or log in with:,
(Opens a popup window),
Create Account Now,
]
Successfully executed.
[/Banana]
slacky
2012-08-31 14:48:44
From: Brandon
It's actually not in my control at all. Only thing in my control is what I post. Anything to do with Smart isn't me. Well I can help but that's probably the most I can do as Smart stuff is really up to Ben.
Smart is released at github, under the lisence: GPL v3. So you, or anyone else are free to modify it, and release it, but jut let people know that it's built on BenLand100's SMART. So it's honesty up to you, or anyone else for that sake.
But of cource, I understand if you don't want to, or have the time to do so! :)
From: warpie
Smart is released at github, under the lisence: GPL v3. So you, or anyone else are free to modify it, and release it, but jut let people know that it's built on BenLand100's SMART. So it's honesty up to you, or anyone else for that sake.
But of cource, I understand if you don't want to, or have the time to do so! :)
I think Brandon might just know that :P I think if he was going to do it he would get it officially done with benland.
Brandon
2012-08-31 15:29:02
From: warpie
Smart is released at github, under the lisence: GPL v3. So you, or anyone else are free to modify it, and release it, but jut let people know that it's built on BenLand100's SMART. So it's honesty up to you, or anyone else for that sake.
But of cource, I understand if you don't want to, or have the time to do so! :)
Thats not the case here though.. I can only read & understand java not write it.
My plugin is C++ and Smart has to be able to run in OpenGL mode.. If it can do that then I have no problem helping or writing code to integrate the plugin.
Also I have yet to document anything.. I'm not exactly a fan of commenting in code unless absolutely necessary. In this case I have no choice.
I'm leaning toward September 4/5th for everything (basic include and dll).
For smart though I'd prefer if Ben had input
Flight
2012-08-31 23:39:54
From: Brandon
EDIT: Updated the splitting function. Buddy at work covered for me =]
Function FontsToText(var FontArray: TFontArray; Shadow: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TStringArray;
var
I, J, L: Integer;
Str: String;
Begin
L := High(FontArray);
If Shadow Then J := 1 Else J := 2;
SetLength(Result, 1);
For I := 0 To L Do
If (FontArray[I].Shadow = Shadow) Then
Begin
If (((FontArray[I].Translate[0] - (FontArray[I - 2].Translate[0] + FontArray[I - 2].VX[3] - FontArray[I - 2].VX[0])) >= MinHSpacing) And (I >= 2)) Then
Str := Str + ' ';
If ((((FontArray[I].Translate[1] - FontArray[I - J].Translate[1]) >= MinVSpacing) And (I >= 2) And MinVSpacing > 0) Or (Ord(FontArray[I].Symbol) = 10)) Then
Str := Str + Chr(13);
Str := Str + FontArray[I].Symbol;
End;
ExplodeWrap(Chr(13), Str, Result);
End;
Prints:
[Banana]
[Login,
Username:,
Password:,
L o g I n,
Recover Your Password,
Or log in with:,
(Opens a popup window),
Create Account Now,
]
Successfully executed.
[/Banana]
Beautiful. I had a rough way of getting the Uptext and then, like you said, use(d) Regex to search for matches. It worked pretty good but I got stuck on the word (not character) spacing; I only had a solid line of text. It's nice that you updated it now. Great job Brandon. :)
Brandon
2012-09-01 09:16:00
From: Flight
Beautiful. I had a rough way of getting the Uptext and then, like you said, use(d) Regex to search for matches. It worked pretty good but I got stuck on the word (not character) spacing; I only had a solid line of text. It's nice that you updated it now. Great job Brandon. :)
Yeah ;) I have a lot more text functions and stuff. Still not finished but it's ALMOST complete now. Tjese are just some random functions I picked out of the ones I wrote. The others are too long to post all.
Function GLH_PinScreen: Boolean;
Begin
Result := (Length(GLHook_GetItemsByID(848640)) > 0);
End;
Function GLH_BankScreen: Boolean;
Begin
Result := GLHook_FindTextAreaEx(IntToBox(195, 76, 324, 96), ['Bank', 'Bank of Runescape'], False, 5, 0);
End;
Function GLH_GetCurrentTab: Integer;
Var
P: TPoint;
ItemArray: TPanelArray;
Begin
Result := -1;
If (Not GLH_LoggedIn) Then
Exit;
ItemArray := GLHook_GetItemsByID(48705);
If (Length(ItemArray) < 1) Then Exit;
For Result := 0 To (Tab_LogOut - Tab_Combat) - 1 Do
Begin
P.X := 535 + Result mod 8 * 30;
P.Y := (169 + Result div 8 * 298) + 18;
If PointInBox(P, IntToBox(ItemArray[1].SX[0], ItemArray[1].SY[0], ItemArray[1].SX[2], ItemArray[1].SY[2])) Then
Break;
End;
Result := Result + Tab_Combat;
If GLH_BankScreen Then
Result := Tab_Inv;
End;
Etc.. I'm writing all the harder functions first and all the text ones.
I'm using this and adding to it as I go along:
{$IFDEF GLHook}
{$loadlib GLHook}
{$ENDIF}
type pByte = ^Byte;
type pInt = ^Integer;
type pBool = ^Boolean;
type pFloat = ^Single;
type TModel = record
SX, SY: Integer;
Stride: Cardinal;
ID: Cardinal;
TriangleCount: Integer;
end;
type TPanelItem = record
ID: Integer;
TextureID: Integer;
X, Y: Integer;
SX, SY: Array [0..3] Of Integer;
end;
type TFontInfo = record
ID: Cardinal;
R, G, B, A: Byte;
Colour: Integer;
X, Y: Single;
Symbol: Char;
Shadow: Boolean;
Translate: Array [0..2] Of Single;
VX, VY, TX, TY: Array [0..3] Of Integer;
end;
type PModel = ^TModel;
type PPanelItem = ^TPanelItem;
type PFontInfo = ^TFontInfo;
type TModelArray = array of TModel;
type TPanelArray = array of TPanelItem;
type TFontArray = array of TFontInfo;
Function GLHook_GetAllItems: TPanelArray;
var
Ptr: Pointer;
Size, I: Integer;
PanelPtr: PPanelItem;
begin
Ptr := GLHGetPanelItems(Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
PanelPtr := Ptr;
Result[I] := PanelPtr^;
Ptr := Ptr + sizeof(TPanelItem);
end;
end;
Function GLHook_GetItemsByID(ID: Integer): TPanelArray;
var
Ptr: Pointer;
Size, I: Integer;
PanelPtr: PPanelItem;
begin
Ptr := GLHGetItemsByID(ID, Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
PanelPtr := Ptr;
Result[I] := PanelPtr^;
Ptr := Ptr + sizeof(TPanelItem);
end;
end;
Function GLHook_GetItemsByArea(Area: TBox): TPanelArray;
var
Ptr: Pointer;
Size, I: Integer;
PanelPtr: PPanelItem;
begin
Ptr := GLHGetItemsByArea(Area.X1, Area.Y1, Area.X2, Area.Y2, Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
PanelPtr := Ptr;
Result[I] := PanelPtr^;
Ptr := Ptr + sizeof(TPanelItem);
end;
end;
Function GLHook_GetAllModels: TModelArray;
var
Ptr: Pointer;
Size, I: Integer;
ModelPtr: PModel;
begin
Ptr := GLHGetModels(Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
ModelPtr := Ptr;
Result[I] := ModelPtr^;
Ptr := Ptr + sizeof(TModel);
end;
end;
Function GLHook_GetModelsByID(ID: Cardinal): TModelArray;
var
Ptr: Pointer;
Size, I: Integer;
ModelPtr: PModel;
begin
Ptr := GLHGetModelsByID(ID, Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
ModelPtr := Ptr;
Result[I] := ModelPtr^;
Ptr := Ptr + sizeof(TModel);
end;
end;
Function GLHook_GetModelsByTriangleCount(Count: Cardinal): TModelArray;
var
Ptr: Pointer;
Size, I: Integer;
ModelPtr: PModel;
begin
Ptr := GLHGetModelsByTCount(Count, Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
ModelPtr := Ptr;
Result[I] := ModelPtr^;
Ptr := Ptr + sizeof(TModel);
end;
end;
Function GLHook_GetModelsByArea(Area: TBox): TModelArray;
var
Ptr: Pointer;
Size, I: Integer;
ModelPtr: PModel;
begin
Ptr := GLHGetModelsByArea(Area.X1, Area.Y1, Area.X2, Area.Y2, Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
ModelPtr := Ptr;
Result[I] := ModelPtr^;
Ptr := Ptr + sizeof(TModel);
end;
end;
Function GLHook_GetAllFonts: TFontArray;
var
Ptr: Pointer;
Size, I: Integer;
begin
Ptr := GLHGetFonts(Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
Result[I].ID := pInt(Ptr)^;
Ptr := Ptr + sizeof(Integer);
Result[I].R := pByte(Ptr)^;
Result[I].G := pByte(Ptr + sizeof(Byte))^;
Result[I].B := pByte(Ptr + (2 * sizeof(Byte)))^;
Result[I].A := pByte(Ptr + (3 * sizeof(Byte)))^;
Ptr := Ptr + (sizeof(Byte) * 4);
Result[I].Colour := RGBToColor(Result[I].R, Result[I].G, Result[I].B);
Result[I].X := pFloat(Ptr)^;
Result[I].Y := pFloat(Ptr + sizeof(Single))^;
Ptr := Ptr + (sizeof(Single) * 2);
Result[I].Symbol := pChar(Ptr)^;
Result[I].Shadow := pBool(Ptr + sizeof(Boolean))^;
Ptr := Ptr + (sizeof(Char) + sizeof(Boolean)) + 2; //Padded by 2.
Result[I].Translate[0] := pFloat(Ptr)^;
Result[I].Translate[1] := pFloat(Ptr + sizeof(Single))^;
Result[I].Translate[2] := pFloat(Ptr + (2 * sizeof(Single)))^;
Ptr := Ptr + (sizeof(Single) * 3);
Result[I].VX[0] := pInt(Ptr)^;
Result[I].VX[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].VX[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].VX[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
Result[I].VY[0] := pInt(Ptr)^;
Result[I].VY[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].VY[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].VY[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
Result[I].TX[0] := pInt(Ptr)^;
Result[I].TX[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].TX[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].TX[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
Result[I].TY[0] := pInt(Ptr)^;
Result[I].TY[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].TY[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].TY[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
end;
end;
Function GLHook_GetFontsByArea(Area: TBox): TFontArray;
var
Ptr: Pointer;
Size, I: Integer;
begin
Ptr := GLHGetFontsArea(Area.X1, Area.Y1, Area.X2, Area.Y2, Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
Result[I].ID := pInt(Ptr)^;
Ptr := Ptr + sizeof(Integer);
Result[I].R := pByte(Ptr)^;
Result[I].G := pByte(Ptr + sizeof(Byte))^;
Result[I].B := pByte(Ptr + (2 * sizeof(Byte)))^;
Result[I].A := pByte(Ptr + (3 * sizeof(Byte)))^;
Ptr := Ptr + (sizeof(Byte) * 4);
Result[I].Colour := RGBToColor(Result[I].R, Result[I].G, Result[I].B);
Result[I].X := pFloat(Ptr)^;
Result[I].Y := pFloat(Ptr + sizeof(Single))^;
Ptr := Ptr + (sizeof(Single) * 2);
Result[I].Symbol := pChar(Ptr)^;
Result[I].Shadow := pBool(Ptr + sizeof(Boolean))^;
Ptr := Ptr + (sizeof(Char) + sizeof(Boolean)) + 2; //Padded by 2.
Result[I].Translate[0] := pFloat(Ptr)^;
Result[I].Translate[1] := pFloat(Ptr + sizeof(Single))^;
Result[I].Translate[2] := pFloat(Ptr + (2 * sizeof(Single)))^;
Ptr := Ptr + (sizeof(Single) * 3);
Result[I].VX[0] := pInt(Ptr)^;
Result[I].VX[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].VX[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].VX[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
Result[I].VY[0] := pInt(Ptr)^;
Result[I].VY[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].VY[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].VY[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
Result[I].TX[0] := pInt(Ptr)^;
Result[I].TX[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].TX[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].TX[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
Result[I].TY[0] := pInt(Ptr)^;
Result[I].TY[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].TY[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].TY[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
end;
end;
Function GLHook_FontsToText(var FontArray: TFontArray; Shadow: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TStringArray;
var
I, J, L: Integer;
Str: String;
Begin
L := High(FontArray);
If Shadow Then J := 1 Else J := 2;
SetLength(Result, 1);
For I := 0 To L Do
If (FontArray[I].Shadow = Shadow) Then
Begin
If (((FontArray[I].Translate[0] - (FontArray[I - J].Translate[0] + FontArray[I - J].VX[3] - FontArray[I - J].VX[0])) >= MinHSpacing) And (I >= 2)) Then
Str := Str + ' ';
If ((((FontArray[I].Translate[1] - FontArray[I - J].Translate[1]) >= MinVSpacing) And (I >= 2) And MinVSpacing > 0) Or (Ord(FontArray[I].Symbol) = 10)) Then
Str := Str + Chr(13);
If (Ord(FontArray[I].Symbol) <> 10) Then
Str := Str + FontArray[I].Symbol;
End;
ExplodeWrap(Chr(13), Str, Result);
For I := 0 To High(Result) Do
Result[I] := Trim(Result[I]);
End;
Function PosStrArr(ToFind: String; SearchArray: TStringArray; Var Where: Integer): Boolean;
var
I, H: Integer;
Begin
H := High(SearchArray);
For I := 0 To H Do
If (Pos(LowerCase(ToFind), LowerCase(SearchArray[I])) > 0) Then
Begin
Where := I;
Result := True;
Break;
End;
End;
Function GLHook_CountTextInArea(Area: TBox; Text: String; Shadow: Boolean; MinHSpacing, MinVSpacing: Integer): Integer;
Var
I, J: Integer;
AreaFonts: TStringArray;
Begin
AreaFonts := GLHook_FontsToText(GLHook_GetFontsByArea(Area), Shadow, MinHSpacing, MinVSpacing);
For I := 0 To High(AreaFonts) Do
For J := 0 To High(AreaFonts[I]) Do
If (LowerCase(AreaFonts[I][J]) = LowerCase(Text)) Then
Inc(Result);
End;
Function GLHook_FindTextAreaEx(Area: TBox; Text: TStringArray; Shadow: Boolean; MinHSpacing, MinVSpacing: Integer): Boolean;
var
I, J: Integer;
AreaFonts: TStringArray;
Begin
AreaFonts := GLHook_FontsToText(GLHook_GetFontsByArea(Area), Shadow, MinHSpacing, MinVSpacing);
For I := 0 To High(Text) Do
If InStrArrEx(Text[I], AreaFonts, J) or PosStrArr(Text[I], AreaFonts, J) Then
Begin
Result := True;
Break;
End;
End;
Function GLHook_FindTextArea(Area: TBox; Text: String; Shadow: Boolean; MinVSpacing: Integer): Boolean;
var
I: Integer;
Begin
For I := 0 To 11 Do
If GLHook_FindTextAreaEx(Area, [Text], Shadow, I, MinVSpacing) Then
Begin
Result := True;
Break;
End;
End;
Anyone got a copy of the lape include? I seem to find myself copying over or writing some of the basic SRL functions like MouseBox and stuff to lape :S
mormonman
2012-09-01 15:59:43
You should throw those integer values into constants.
This project has grown so much since I last checked up on it. Great job so far
n3ss3s
2012-09-01 18:58:28
Looking forward to seeing the text hooking added to git, sort of curious about that
Noob King
2012-09-02 04:10:11
So this only works for 32bit, correct?
Le Jingle
2012-09-02 04:15:09
From: Noob King
So this only works for 32bit, correct?
Yes, the library created by Brandon, OpenGL32.dll, is defined as 32 bit afaik.
grats
2012-09-02 04:16:35
runescape runs as 32bit only
Noob King
2012-09-02 04:40:12
From: Le Jingle
Yes, the library created by Brandon, OpenGL32.dll, is defined as 32 bit afaik.
Dammit. I guess my brain isn't too good at paying attention to obvious things at 3am.
Noob King
2012-09-02 20:09:40
I don't know if this is the same for other items, but I noticed that all the water skins (0,1,2,3,4) all have the same id.
mormonman
2012-09-02 20:58:19
From: Noob King
I don't know if this is the same for other items, but I noticed that all the water skins (0,1,2,3,4) all have the same id.
That's because they have the same model.
n3ss3s
2012-09-03 00:19:15
Anyone who's getting an error loading the plugin - don't forget to set your RS to OGL ..
Noob King
2012-09-03 01:35:45
From: mormonman
That's because they have the same model.
Hmm is there going to be a way to distinguish them then?
mormonman
2012-09-03 02:50:38
From: Noob King
Hmm is there going to be a way to distinguish them then?
Uptext.
From: mormonman
Uptext.
And for ores, they have the same id aswell, you can use the RGB values :P
Gu3st...
2012-09-03 03:57:19
Imo I think it's a good thing we can't "magically" distinguish the different models from eachother; it would have been very unhumanlike to do so
From: J J
And for ores, they have the same id aswell, you can use the RGB values :P
I don't think this ogl uses rgb values even if it did water skins don't change colour.
Flight
2012-09-03 05:30:40
From: Zyt3x
Imo I think it's a good thing we can't "magically" distinguish the different models from eachother; it would have been very unhumanlike to do so
For sure, but without being able to read color in OGL mode it's taking a step backwards. Would a normal player check every ore in his inventory
by UpText to see which one is, let's say, iron? ;) Using OGL models to distinguish inventory items is no more detectable (unhumanlike) than DTMs & black lists.
From: Mat
I don't think this ogl uses rgb values even if it did water skins don't change colour.
Indeed it does, color codes, textures, bitmaps, ect… all all drawn (and can be hooked) in OGL. If this were not possible, than how do objects/items/NPCs/players differ in color? What tells a trout to be white and a salmon to be pink? The models we're looking at now can be compared to a picture of a sunset drawn in outline only. That base picture, the outline, is the model, and if I've read this correctly there's
other parts of OpenGL that tell what colors & textures to fill in each piece of that sunset. I've skimmed through everything that OGL can/does do; much of which is RGB colors for each pixel, textures, as well as bitmaps.
Brandon
2012-09-03 10:09:18
From: Flight
For sure, but without being able to read color in OGL mode it's taking a step backwards. Would a normal player check every ore in his inventory by UpText to see which one is, let's say, iron? ;) Using OGL models to distinguish inventory items is no more detectable (unhumanlike) than DTMs & black lists.
Indeed it does, color codes, textures, bitmaps, ect… all all drawn (and can be hooked) in OGL. If this were not possible, than how do objects/items/NPCs/players differ in color? What tells a trout to be white and a salmon to be pink? The models we're looking at now can be compared to a picture of a sunset drawn in outline only. That base picture, the outline, is the model, and if I've read this correctly there's other parts of OpenGL that tell what colors & textures to fill in each piece of that sunset. I've skimmed through everything that OGL can/does do; much of which is RGB colors for each pixel, textures, as well as bitmaps.
This. Yes it is possible to actually generate unique ID's regardless of shape BUT the colours change every time. If it didn't, I'd use the RGB values. We can still use it and check if the colour is similar.
I'm actually looking into the lists and shaders right now.
Example of jagex's random stuff is:
DP4 worldPos.x, ivMatrix[0], viewPos;
DP4 worldPos.y, ivMatrix[1], viewPos;
DP4 worldPos.z, ivMatrix[2], viewPos;
DP4 worldPos.w, ivMatrix[3], viewPos;
ADD noise.x, worldPos.x, worldPos.z;SUB noise.y, worldPos.z, worldPos.x;MUL noise, noise, 0.0001220703125;
FRC noise, noise;
MUL noise, noise, 64;
ARL noiseAddr.x, noise.x;
MOV noise.x, fNoise[noiseAddr.x].x;
ARL noiseAddr.x, noise.y;
MOV noise.y, fNoise[noiseAddr.x].y;
MUL noise, noise, turbulence.x;
That noise is what's added to the position of every item and to the colour. But again, it's ASM. All the commands can be interpreted here:
http://msdn.microsoft.com/en-us/library/windows/desktop/hh446994%28v=vs.85%29.aspxHooking it is a different story though. But we'll see what happens eventually.
Gu3st...
2012-09-03 10:45:20
From: Flight
For sure, but without being able to read color in OGL mode it's taking a step backwards. Would a normal player check every ore in his inventory by UpText to see which one is, let's say, iron? ;) Using OGL models to distinguish inventory items is no more detectable (unhumanlike) than DTMs & black lists.
What? It is possible to read color in OGL..
euphemism
2012-09-03 10:48:21
From: Zyt3x
What? It is possible to read color in OGL..
I believe Flight is referencing SMART. BenLand100 was able to get the different rending modes to run in SMART, but Safemode is the only one from which you can actually get color data. Currently, anyway.
Gu3st...
2012-09-03 10:57:48
From: euphemism
I believe Flight is referencing SMART. BenLand100 was able to get the different rending modes to run in SMART, but Safemode is the only one from which you can actually get color data. Currently, anyway.
Oh, SMART… :o
yeah, that'll become a problem later…
ReadySteadyGo
2012-09-03 13:28:01
From: euphemism
I believe Flight is referencing SMART. BenLand100 was able to get the different rending modes to run in SMART, but Safemode is the only one from which you can actually get color data. Currently, anyway.
I believe that you actually have to hook in order to read the frame buffer. All that is needed is a call to glReadPixels (
http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml), then flip the resulting image.
mormonman
2012-09-03 16:57:18
From: ReadySteadyGo
I believe that you actually have to hook in order to read the frame buffer. All that is needed is a call to glReadPixels (http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml), then flip the resulting image.
Would we be able to do that by making SMART the keymouse target, while GLHook makes the imagetarget some pointer from itself?
Brandon
2012-09-03 17:44:27
From: mormonman
Would we be able to do that by making SMART the keymouse target, while GLHook makes the imagetarget some pointer from itself?
I do not believe so. I'm not sure how to integrate it with Java but anyway here is just my 2 cents which isn't very much:
Smart might have to add its own implementation of OpenGL and/or simply do..
A. wglMakeCurrent
B. wglCopyContext
C. Load the ogl plugin and use its buffer.
Etc.. Those are just some small examples. If I were to provide the buffer for smart, that means the official client would have to be running so that I can give smart that buffer. That'd be non-sensical. It's always going to be better if Smart did indeed implement OGL and I'm pretty sure Ben is already working/playing around with that.
One idea though is that instead of having the official client load RS, Smart can load it instead and I'd provide a pointer to the buffer. It's difficult to say though since I have almost no java writing skills. Tri-bot can do it so I believe Smart can do it too. It's all just a matter of the implementation.
I've already guaranteed Ben that it can be minimized while OGL is running (with that minimized screenshot bitmap "example"). Dunno where I posted that. He said it was something he could work with so that's always good.
@Nesses I'll post the source in a couple hours. Re-writing some core functions. Also not sure how much longer I'd be able to support MSVC but I'll go as long as I can until I can't anymore lol.
KeepBotting
2012-09-03 17:55:03
From: Le Jingle
It's suppose to run at lower fps with the model id's shown, no?
Also, with the intel dll (using on a intel comp ofc) should it run slower, or is it dependent on the graphics card? (the graphics card on this intel comp sucks.. :s)
Lol @ Welcome to Funescape.
ontopic: dafuq is this, and how can it be used with Simba? Will findobj etc still work, or will there be a different api?
mormonman
2012-09-03 18:03:22
From: Brandon
I do not believe so. I'm not sure how to integrate it with Java but anyway here is just my 2 cents which isn't very much:
Smart might have to add its own implementation of OpenGL and/or simply do..
A. wglMakeCurrent
B. wglCopyContext
C. Load the ogl plugin and use its buffer.
Etc.. Those are just some small examples. If I were to provide the buffer for smart, that means the official client would have to be running so that I can give smart that buffer. That'd be non-sensical. It's always going to be better if Smart did indeed implement OGL and I'm pretty sure Ben is already working/playing around with that.
One idea though is that instead of having the official client load RS, Smart can load it instead and I'd provide a pointer to the buffer. It's difficult to say though since I have almost no java writing skills. Tri-bot can do it so I believe Smart can do it too. It's all just a matter of the implementation.
I've already guaranteed Ben that it can be minimized while OGL is running (with that minimized screenshot bitmap "example"). Dunno where I posted that. He said it was something he could work with so that's always good.
@Nesses I'll post the source in a couple hours. Re-writing some core functions. Also not sure how much longer I'd be able to support MSVC but I'll go as long as I can until I can't anymore lol.
<mormonman> Wizzup: http://villavu.com/forum/showpost.php?p=1094825&postcount=236
<Wizzup> glreadpixels is hard to do thread safe and somewhat slow
<Wizzup> but it should work
<mormonman> is there not a better gl function?
<Wizzup> keymouse and image are indeed completely separate
<Wizzup> no
<mormonman> but hey can we link gl with a smart applet the same way we can link simba?
<mormonman> like, if i had two smart applets with gl open
<mormonman> but i only wanted info from the one that is linked with simba
<BenLand100> mormonman yes
<BenLand100> doable
<mormonman> by brandon or you/
<mormonman> ?
<BenLand100> afaik brandon's ogl stuff should work with SMART
<BenLand100> but both his and mine do some client pairing
Doable, but is it the best way to do it?
Brandon
2012-09-03 18:05:12
From: KeepBotting
Lol @ Welcome to Funescape.
ontopic: dafuq is this, and how can it be used with Simba? Will findobj etc still work, or will there be a different api?
This is GLHook and it doesn't use FindObj as that's an entirely different type of scripting. That's colour scripting alone. This is both Hooking + Colour. Whatever cannot be done in OpenGL would be done in Colour until I get a brain lol.
Basically it works like this:
var
Foo: TPanelArray;
begin
Foo := GLHook_FindItemsByID(.....);
Mouse(Foo[0].X, Foo[0].Y, 0, 0, Mouse_Move);
If GLHook_FindText("Deposit", 4, 4, .....) Then
ClickMouse2(Mouse_Left);
end;
Etc.. That's just how it would work.
@Mormonman, seems simple enough. The pairing stuff can be easily overcome. I made sure of that by adding Serialize.hpp and Serialize.cpp respectfully. Copy those into smart and just change the file that it pairs with to Ben's PID files. A couple Ifdef's would make sure it worked on Linux. Either that or I provide the pointer. I don't mind writing that.. Couple lines and some copy pasting. When it's finished we can all work on that Smart stuff or talk to Ben on how it can be done. Several options are available.
Brandon is there anything in OGL that could tell if a monster is in combat?
Brandon
2012-09-03 18:53:40
From: Ollybest
Brandon is there anything in OGL that could tell if a monster is in combat?
The HP Bar on that monster yes. The health of it, etc. I haven't looked into animations or anything. AFAIK, the models actually do not change during an animation but something has to be changing. Maybe there is like a couple extra commands I can look for or something.
ATM I'm working on figuring out completely unique ID's for Items. I can look into animations later.
From: Brandon
The HP Bar on that monster yes. The health of it, etc. I haven't looked into animations or anything. AFAIK, the models actually do not change during an animation but something has to be changing. Maybe there is like a couple extra commands I can look for or something.
ATM I'm working on figuring out completely unique ID's for Items. I can look into animations later.
So how much lifepoints left a monster has? pretty neat dude keep it up.
Brandon
2012-09-03 22:25:48
From: Ollybest
So how much lifepoints left a monster has? pretty neat dude keep it up.
Mhmm.
Updated. Nesses you can read the source now if you want. MSVC and Codeblocks/Mingw/G++ all supported.
Items can be identified with 95-99% accuracy atm. I cannot make it 100% because I have to skip the first 12 scanlines inorder to ignore digits.
Enjoy the long read and the code behind it all. Enjoy the test script and basic include which should give enough understanding on how things could be done. Resizeable mode is supported as well. It will give proper positions and ID's and everything in either mode.
Also can someone remove the v0.1 from the thread title please?
Le Jingle
2012-09-03 23:04:26
Do you think Ben, if/when he integrates your work into smart, that he'd account for the debug visual you have? (i.e. a menu/drop down list that replicates your f1-11 keys?) I know it's a way out of the way question, but I'm not expecting any real or definite answer either :) Just curious!
Also very nice work! I think I'll take a stab at writing some includes just to get the feel of OGL, hope it turns out!
Brandon
2012-09-03 23:07:40
From: Le Jingle
Do you think Ben, if/when he integrates your work into smart, that he'd account for the debug visual you have? (i.e. a menu/drop down list that replicates your f1-11 keys?) I know it's a way out of the way question, but I'm not expecting any real or definite answer either :) Just curious!
Well the Simba functions can do that. SetDisplay would show ID's and stuff. I guess it wouldn't be hard to just export a simple function that'll change the displays as well. It'd be even better if Simba did the drawing itself as you can draw boxes and what not around items found. I could do the drawing in C++ but meh it's not worth all the GDI/Windows specific stuff.
The very first DLL did the drawings using a library I wrote called Purely-Cplusplus(originally Simba++). I removed it because the library is too large. Around 20k lines of code + the code for the dll and I didn't want anyone using it maliciously as it had sockets and all sorts of stuff in that library. Safety first before anything else.
But yeah simba can do the drawings on smart. Infact, it'll look far better than the ones now.
Noob King
2012-09-03 23:26:33
I can't seem to get it to work now after you updated it today. Both DLL's are in the right spots as well.
Exception in Script: Error loading plugin C:\Simba\Plugins\GLHook32.dll
Brandon
2012-09-03 23:40:00
From: Noob King
I can't seem to get it to work now after you updated it today. Both DLL's are in the right spots as well.
Exception in Script: Error loading plugin C:\Simba\Plugins\GLHook32.dll
Hmm I cannot seem to replicate that. If it's happening to someone else then I'lll recompile it and see if that helps.
slacky
2012-09-04 13:11:32
From: Noob King
I can't seem to get it to work now after you updated it today. Both DLL's are in the right spots as well.
Exception in Script: Error loading plugin C:\Simba\Plugins\GLHook32.dll
- Make sure you are in OpenGL-mode (the rs-client). Btw. don't forget to actually run the rs-client befor starting the script… :P
Le Jingle
2012-09-04 17:02:53
I'm trying out the latest binary at the moment now. Seems to be working great!
Also if anyone notices, take the version out of this threads title? (as asked by Brandon a few posts back)
Cheers,
Lj
EDIT: GREAT work with this! I just noticed the compass degree/radians text, absolutely helpful! Now I just need to figure out an effective way to download a 2nd simba so I can run lape/pascal script based includes simultaneously.
Gu3st...
2012-09-04 17:18:03
From: Le Jingle
EDIT: GREAT work with this! I just noticed the compass degree/radians text, absolutely helpful! Now I just need to figure out an effective way to download a 2nd simba so I can run lape/pascal script based includes simultaneously.
Just run the simba.exe once more..? :p
Le Jingle
2012-09-04 18:07:38
From: Zyt3x
Just run the simba.exe once more..? :p
Whaa? Well wait, I just looked over the includes from the lape zipball and they are the same as the current ones.. did I miss a lape pertinent srl includes somewhere? I ask because just copying over the plugins / srllape.simba didn't seem to work when I used
interpreter:lape, define lape, i srl/srl.simba, loadlib GLHook in a script. But I'm probably missing something very simple and I apologize for it in advanced.
Also, regarding the items, I seem to get the same ID's per identical models used. I.E. All talismans don't filter to unique ID's based on the methods you used for detecting the differences in models. It might just be me though, doing something I forgot to look over :s I also understand/took note that it's a high percent rate (95-99%), not 100%.
Ex. of items from latest upload:

I do think though, that the text seems to fit well over the stuffs, and hearing that it'd look even better on smart is just too good of news, if/when that's done.
Cheers,
Lj
:)
Brandon
2012-09-04 18:35:19
From: Le Jingle
Whaa? Well wait, I just looked over the includes from the lape zipball and they are the same as the current ones.. did I miss a lape pertinent srl includes somewhere? I ask because just copying over the plugins / srllape.simba didn't seem to work when I used interpreter:lape, define lape, i srl/srl.simba, loadlib GLHook in a script. But I'm probably missing something very simple and I apologize for it in advanced.
Also, regarding the items, I seem to get the same ID's per identical models used. I.E. All talismans don't filter to unique ID's based on the methods you used for detecting the differences in models. It might just be me though, doing something I forgot to look over :s I also understand/took note that it's a high percent rate (95-99%), not 100%.
Ex. of items from latest upload:

I do think though, that the text seems to fit well over the stuffs, and hearing that it'd look even better on smart is just too good of news, if/when that's done.
Cheers,
Lj
:)
F9 is the magic button. It will display the meanid's which is used in combination with the base ID..
See the test script for an example.
Noob King
2012-09-04 18:44:07
Edit: Working now :redface:
Sirenia
2012-09-05 01:13:15
Now it compiles and loads correctly :) No flashy ID's showing up however, im doing something wrong for sure :/ Whats the item thats already in the mainloop? Could see if I could try to click it :)
Le Jingle
2012-09-05 01:32:16
Press f11 to show ID's
Place the .dll's appropiately, load rs in OpenGL, (mine never shows for the login screen, but will for the lobby / in game), then hit f11 to make everything visible that OpenGL uses. At least that's what I've been doing. There's also different f-keys that do complicated stuffs that Brandon went over earlier in this thread/the previous thread.
Edit: I also like how f9 has three filters!! :) I find them all very useful!!
Sirenia
2012-09-05 02:21:15
From: Le Jingle
Press f11 to show ID's
Place the .dll's appropiately, load rs in OpenGL, (mine never shows for the login screen, but will for the lobby / in game), then hit f11 to make everything visible that OpenGL uses. At least that's what I've been doing. There's also different f-keys that do complicated stuffs that Brandon went over earlier in this thread/the previous thread.
Edit: I also like how f9 has three filters!! :) I find them all very useful!!
Will try to use F11, tried F9 as the first post stated but it didnt work :/ Im on a Intel card atm
m3gaman3g3nd
2012-09-08 17:56:00
open gl seems kinda good i might try to learn it, and btw how do i know you guys arent all bots?
i deicoverd .wsf and the scripting agent java and vb - this is irrelevant but i thought id like to share that π stuff ππ♣7+♥#cππ♣ππ♣77777
print
2012-09-08 18:04:00
this project looks great it will make take scripting to a new lvl ?
Flight
2012-09-08 20:59:45
From: print123
this project looks great it will make take scripting to a new lvl ?
Let's hope so. :) First thing's first, we should be working on an included & random-solvers.
euphemism
2012-09-08 21:35:09
From: Flight
Let's hope so. :) First thing's first, we should be working on an included & random-solvers.
Yes, but Brandon hasn't laid out a framework for others to help with the include.
Brandon
2012-09-08 21:41:14
From: euphemism
Yes, but Brandon hasn't laid out a framework for others to help with the include.
Well I laid out some of it. I wasn't able to upload all but it's there. It's just a matter of writing functions that use what's already there.
Writing an OpenGL tutorial is a different story though (Probably needed inorder to understand the layout and how to use the functions). I'll work on that tonight I guess. See how far I get. I'll start now.
Lape isn't pushed, Smart doesn't load OGL yet. There isn't too much I can do atm other than write the basic include and OGL tut.
I started the tut but I'm not sure what I should be teaching (what people need to know/want to know). So far I have this for content:
Contents:1. Compiler Setup.
2. Basics of C++.
3. Layout of the OpenGL Plugin.
4. OpenGL Basics.
5. Function Information/Descriptions.
6. Putting It Together.
7. Hooking & Implementing Interceptions.
slacky
2012-09-09 19:59:01
I can't seem to find out what's wrong… But here it goes:
...*
var
Items: TModelArray;
I,x,y: Integer;
begin
ClearDebug;
Items := GLHook_GetModelsByID(4152837985);
For I := 0 To High(Items) Do
Begin
x := Items[I].SX;
y := Items[I].SY;
//MoveMouse(x,y);
ClickMouse(x, y, true);
Wait(2500);
End;
end.
That will not work - error given is:
Exception in Script: Expected variable of type "Int32", got "False..True(4294967295)" at line 328, column 15
But by removing
ClickMouse(); and adding
MoveMouse(); it works… Any ideas?
Brandon
2012-09-09 20:14:39
From: warpie
I can't seem to find out what's wrong… But here it goes:
That will not work - error given is:
Exception in Script: Expected variable of type "Int32", got "False..True(4294967295)" at line 328, column 15
But by removing ClickMouse(); and adding MoveMouse(); it works… Any ideas?
I think ClickMouse using an Integer for clicking so it's ClickMouse(X, Y, MOUSE_LEFT);
EDIT:Meh quick Update.. I've been learning Java starting today.. I learn pretty quick by trial and error and hands on but lets just say there is lots of hope for smart if I can wrap my head around JNI.. So far I can get Wyn's loader to load it using:
#include <Windows.h>
#include <TlHelp32.h>
#include <iostream>
using namespace std;
HANDLE hThread;
void* pLibRemote;
DWORD hLibModule;
HMODULE hKernel32;
HANDLE hProcess;
PROCESSENTRY32 GetProcessInfo(char* ProcessName)
{
HANDLE hSnap = NULL;
PROCESSENTRY32 Proc32 = {0};
if((hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)) == INVALID_HANDLE_VALUE)
return Proc32;
Proc32.dwSize = sizeof(PROCESSENTRY32);
while(Process32Next(hSnap, &Proc32))
{
if(!strcmp(ProcessName, Proc32.szExeFile))
{
CloseHandle(hSnap);
return Proc32;
}
}
CloseHandle(hSnap);
return Proc32;
}
void Inject()
{
char szLibPath[MAX_PATH];
memset(szLibPath, 0, MAX_PATH);
hKernel32 = ::GetModuleHandle("Kernel32");
PROCESSENTRY32 RSDLL = GetProcessInfo("Java.exe");
hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, RSDLL.th32ProcessID);
strcat(szLibPath, "C:/Users/Brandon/Desktop/OpenGL32.dll");
pLibRemote = ::VirtualAllocEx(hProcess, NULL, sizeof(szLibPath), MEM_COMMIT, PAGE_READWRITE);
::WriteProcessMemory(hProcess, pLibRemote, (void*)szLibPath, sizeof(szLibPath), NULL);
hThread = ::CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE) ::GetProcAddress(hKernel32, "LoadLibraryA"), pLibRemote, 0, NULL);
::WaitForSingleObject(hThread, INFINITE);
::GetExitCodeThread(hThread, &hLibModule);
::CloseHandle(hThread);
::VirtualFreeEx(hProcess, pLibRemote, sizeof(szLibPath), MEM_RELEASE);
}
void Terminate()
{
hThread = ::CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE) ::GetProcAddress(hKernel32, "FreeLibrary"), (void*)hLibModule, 0, NULL);
::WaitForSingleObject(hThread, INFINITE);
::CloseHandle(hThread);
}
int main()
{
Inject();
cin.get();
Terminate();
return 0;
}
OR by placing it in the Java home directory or forcefully loading via: System.load(new File("OpenGL" + System.getProperty("sun.arch.data.model") + ".dll").getAbsolutePath()); Which I found on MoparIsTheBest.
Looks like:

Anyway time to go to sleep now. 4 hrs till school -__-. I'll investigate more on how Wyn's loader can load it but not Smart and probably fix it or let Ben know if I find something more. Currently writing my own loader as well to see how things work and to get a natural feel for this sorta stuff. Smart loads completely different from Wyn's loader but meh I'm sure we can all work something out. It shouldn't be too hard to make it load OGL.
EDIT 2: After talking with Ben, he refused to believe that Smart cannot run in OGL.. He was right. It does run in OGL mode and perfectly too. Just doesn't run in OGL mode on my Developer Computer. Thus I kept having to borrow a computer to test the dll on..
This is the result (Still I'm angry that I cannot get Smart in OGL mode on my dev comp. Both Win7/Win8.. Preferably the Win8 one):

My task is now to make Smart load it naturally rather than injecting it into Smart/Java.exe. Simply placing it in the %Home%/bin and Simba's plugin folder will NOT work.
EDIT 3: Having a hard time writing it into smart :S
All I need is Smart to load my DLL. That's simply all that is needed. The rest I can do myself. Ben suggests that I get Smart to load the DLL but I know I'm doing it wrong! I just know it. The way I'm doing it just doesn't seem right. Yeah Smart loads it but RS doesn't use it.. I seem to be able to get all the hard methods (injection) done but I cannot get stupidly easy loading done :S
http://diffchecker.com/17H79D87EDIT 4: Got smart to load the OGL plugin (Thanx to Ben for the tips, and Java Docs + Google for teaching me). Now it's time to fix the PID system. PID system is where I emulate Smart's Shared memory but within GLHook. That way more than one client can use GLHook rather than having them all use the same shared memory slot.
Still I'd love to get this to work on Windows 8 as that's currently going to be the only system I have access to throughout the week.
YoHoJo
2012-09-12 10:58:46
OGL, on SMART, WOW.
Brandon, you are a damn amazing man!
Great work Brandon :D
Looks like I/we can finish some unsolvable randoms (right now) in the near future :P
Ashaman88
2012-09-12 11:08:00
Oh snap didn't see those edits. You the man brandon!
ReadySteadyGo
2012-09-12 11:21:31
Well done Brandon!!
Jakkle
2012-09-12 12:17:50
Sweet, now we can make an official include ? What will you call it ? haha :D
Oh wow, Brandon continues to impress…
[XoL]
2012-09-12 18:30:47
Wow Brandon nice job, very impressive!
Solar
2012-09-13 08:19:49
Haven't checked this thread in a while, but everytime I do there is so much more that's been added. It looks amazing.
Far out! Not like this hasn't been said a hundred times before in this thread. But, amazing work, you're one talented guy!
Brandon
2012-09-13 11:40:13
:D Thanx!
Anyway I'll probably push an update today. It'll contain the Smart stuff and the pairing. I'll ask Ben to approve the Smart changes as it's probably only around 5 lines added (1 function). I got GLHook to load with Smart's PID/Pairing ID so now you can run multiple instances.
Also Simba can draw the ID's and what not on Smart so I disabled the KeyPresses (F1-F11) and replaced them with Simba functions. If you want to draw continuously, use a loop OR enable internal drawing through GLHSetDebug(…). If you wish to still use the Keypresses, just compile it without the Smart and Simba defines.
The changes sorta look like:
std::string SharedMemoryName = "Local\\GLHookMap";
GL_EXTERN std::string __stdcall GetProcessID()
{
std::stringstream OS;
OS << "_" << _getpid();
return OS.str();
}
GL_EXTERN bool __stdcall CreateSharedMemory()
{
#ifdef GLHOOK_SMART //In the simba plugin, it's ifdef GLHOOK_SIMBA.
SharedMemoryName += GetProcessID;
#endif
//...........
}
I used an ifdef so that I don't have to supply multiple DLL files. Also this will work with official client as well as the browser so yeah. The above function is also only called once! Thus there is 0 speed compromise from using an sstream.
Also you should only call GLHSetup at the start of your script. Well you can call it as many times as you want but it's useless as it'll unmap the sharedmemory and remap it to whatever PID you set. No point constantly doing that.
Probably time for me to start finishing the basic include then I'll work on the Linux side of things. I'll update OP when I'm finished with that stuff.
P.S. Working with Cynic Rus on the Developer side of things. He'll be writing code to save in-game textures/images by their ID that way for ID's that overlap, you can enable saving and see which one is which =] I have code that does this already but mind does it stupidly and lags. He'll be writing much better code.
He'll be helping me develop on the C++ side of things. I'll write OGL code, he can help on pure C++ code.
Brandon, Brandon..
Your a god :D You've gone from nothing to this with in two weeks? Just stunning mate, I can't wait for the next update, means I can have a play, gives me a reason to get this Maths, and chemistry done :D
Mat
Le Jingle
2012-09-13 12:48:44
Nice work Brandon, and nice to see CynicRus there helping too. One day I'll be as smart as you two ^.^
I was going to make a new post here, however if anyone see's this I suppose they might not mind answering :>
- Out of curiosity, there's not too many changes from what you've already made on the windows os side of things, as compared to the linux side of things? I mean, you probably have most everything figured out, however it's just a matter of compatibility and translating things? I only ask because I'm trying to venture into the linux OS realm, and I'll probably start off by downloading Ubuntu to a blank disk (Got to start somewhere!)
Cheers,
Lj
Jakkle
2012-09-13 12:54:11
From: Brandon
:D Thanx!
Anyway I'll probably push an update today. It'll contain the Smart stuff and the pairing. I'll ask Ben to approve the Smart changes as it's probably only around 5 lines added (1 function). I got GLHook to load with Smart's PID/Pairing ID so now you can run multiple instances.
Also Simba can draw the ID's and what not on Smart so I disabled the KeyPresses (F1-F11) and replaced them with Simba functions. If you want to draw continuously, use a loop OR enable internal drawing through GLHSetDebug(…). If you wish to still use the Keypresses, just compile it without the Smart and Simba defines.
The changes sorta look like:
std::string SharedMemoryName = "Local\\GLHookMap";
GL_EXTERN std::string __stdcall GetProcessID()
{
std::stringstream OS;
OS << "_" << _getpid();
return OS.str();
}
GL_EXTERN bool __stdcall CreateSharedMemory()
{
#ifdef GLHOOK_SMART //In the simba plugin, it's ifdef GLHOOK_SIMBA.
SharedMemoryName += GetProcessID;
#endif
//...........
}
I used an ifdef so that I don't have to supply multiple DLL files. Also this will work with official client as well as the browser so yeah. The above function is also only called once! Thus there is 0 speed compromise from using an sstream.
Also you should only call GLHSetup at the start of your script. Well you can call it as many times as you want but it's useless as it'll unmap the sharedmemory and remap it to whatever PID you set. No point constantly doing that.
Probably time for me to start finishing the basic include then I'll work on the Linux side of things. I'll update OP when I'm finished with that stuff.
P.S. Working with Cynic Rus on the Developer side of things. He'll be writing code to save in-game textures/images by their ID that way for ID's that overlap, you can enable saving and see which one is which =] I have code that does this already but mind does it stupidly and lags. He'll be writing much better code.
He'll be helping me develop on the C++ side of things. I'll write OGL code, he can help on pure C++ code.
This is all great news. You have done amazingly well in my eyes, Brandon.
I bet it's nice to have someone helping out :) Thanks alot for what your doing Cynic :thumbsup:
I will be willing to help out as much as pos, as soon as I get my head round things :p
I didn't read everything as of yet but I was trying to sort out the computer I got for scripting/programming. It kept giving me problems lol (it's kinda old :p) and after I had sorted most things out SMART 8.0 decided it didn't want to work :fiery:, I gave up lol and had to chill out. Anyway I got all weekend to sort things out :D
Nice nice, working with Cynic Rus :), Also have you looked into animations yet?
Brandon
2012-09-17 19:54:22
From: Ollybest
Nice nice, working with Cynic Rus :), Also have you looked into animations yet?
Not yet. I'm planning to though. It's in the TODO list. CynicRus just pulled through =] He wrote PNG saving code and Bitmap Saving Code. Even though I already had bitmap saving code, I'm happy to work with him as his BMP/PNG code is amazing.
I've implemented his code just now and tested it. Also using his code, I've implemented it as an inherited class of my BitmapClass and used it with a partial Library I wrote which allows us to save only UNIQUE items.
Thus you never save the same images twice. In other words, for those hard to find ID's (Overlapping crap), you can just do the following and find which item you want:
GLHSaveImages(Save: Boolean; Tolerance, Format: Integer);
//Where it can be used like:
GLHSaveImages(True, 5, GLH_PNG); //Save as PNG with tolerance 5 for ID's. Previously CR_PNG. =]
GLHSaveImage(True, 5, GLH_BMP); //Save as BMP with tolerance 5 for ID's.
//These functions use Pythagorean Theorem in the core to figure out Tolerance ranges. I would use CTS stuff but meh.. This is more than good enough for sure!
//Also I decided both PNG and BMP is good because we can use BMP's for other stuff such as DTM's, etc.. These would obviously be as failsafes..
//Though the need for a failsafe is extremely rare since the DLL does everything!, I feel it should be there so we don't lose the colour roots of scripting and just in case.
and it'll look like:

Where the ID's are in this format: ItemID_MeanID. ItemID's can be Similar but MeanID's are unique (unless it's a Very Very Very similar item or the same item).
They can be then used like:
GLHGetItemByMeanID(ItemID, MeanID, Tolerance);
That finds items flawlessly and does not make mistakes as far as testing has been going.
Also I updated the github to reflect the Makefile changes. Yes.. You can compile with a makefile now. Exactly like Smart so that you don't "Need" codeblocks or anything. All a matter of preference.
Anyway, Thanks CynicRus and BenLand for indirectly teaching me Java (a bit). =] Now to get back to my homework and await CR's reply on my proposed changes to his code.
From: Brandon
Not yet. I'm planning to though. It's in the TODO list. CynicRus just pulled through =] He wrote PNG saving code and Bitmap Saving Code. Even though I already had bitmap saving code, I'm happy to work with him as his BMP/PNG code is amazing.
I've implemented his code just now and tested it. Also using his code, I've implemented it as an inherited class of my BitmapClass and used it with a partial Library I wrote which allows us to save only UNIQUE items.
Thus you never save the same images twice. In other words, for those hard to find ID's (Overlapping crap), you can just do the following and find which item you want:
GLHSaveImages(Save: Boolean; Tolerance, Format: Integer);
//Where it can be used like:
GLHSaveImages(True, 5, GLH_PNG); //Save as PNG with tolerance 5 for ID's. Previously CR_PNG. =]
GLHSaveImage(True, 5, GLH_BMP); //Save as BMP with tolerance 5 for ID's.
//These functions use Pythagorean Theorem in the core to figure out Tolerance ranges. I would use CTS stuff but meh.. This is more than good enough for sure!
//Also I decided both PNG and BMP is good because we can use BMP's for other stuff such as DTM's, etc.. These would obviously be as failsafes..
//Though the need for a failsafe is extremely rare since the DLL does everything!, I feel it should be there so we don't lose the colour roots of scripting and just in case.
and it'll look like:

Where the ID's are in this format: ItemID_MeanID. ItemID's can be Similar but MeanID's are unique (unless it's a Very Very Very similar item or the same item).
They can be then used like:
GLHGetItemByMeanID(ItemID, MeanID, Tolerance);
That finds items flawlessly and does not make mistakes as far as testing has been going.
Also I updated the github to reflect the Makefile changes. Yes.. You can compile with a makefile now. Exactly like Smart so that you don't "Need" codeblocks or anything. All a matter of preference.
Anyway, Thanks CynicRus and BenLand for indirectly teaching me Java (a bit). =] Now to get back to my homework and await CR's reply on my proposed changes to his code.
Wow, This has came a long way in such little time. Keep up the great work!
:sasmokin:
Jakkle
2012-09-17 20:34:12
Great job guys, coming along nicely.
Have you tested the images with items that have numbers over the top of them ?
You know when, say, you have, 53082 air runes. The numbers will be over the item your trying to find and if the pic does not have the numbers, will it not find the item ?
Brandon
2012-09-17 21:10:00
From: Jakkle
Great job guys, coming along nicely.
Have you tested the images with items that have numbers over the top of them ?
You know when, say, you have, 53082 air runes. The numbers will be over the item your trying to find and if the pic does not have the numbers, will it not find the item ?
Regardless of the numbers, the item will be found. You can have 2.147b of the same item, it will still be found in the same way as just 1 of the same item.
Inother words, 2.147b grapes is the same BaseID and MeanID as 1 grape.
Jakkle
2012-09-17 22:19:26
From: Brandon
Regardless of the numbers, the item will be found. You can have 2.147b of the same item, it will still be found in the same way as just 1 of the same item.
Inother words, 2.147b grapes is the same BaseID and MeanID as 1 grape.
Sweet, that's all good. :)
Sooo… like you said you really do only need one pic for each 2d image. That makes it so much easier to make a stable data base to reference from and only ever have to add things in theory, right ? But I was thinking about graphical updates. if they change things then the data base of the images would have to be changed ? But that shouldn't take to long to sort out and could even be done by an auto updater I was thinking of.
Smart and ogl :O
Please keep the work up!
One last thing Brandon can you tell anything in means of like which way something is facing or something? think of a door… a closed door must have something different (somewhere) than an open one?
mormonman
2012-09-18 14:12:10
From: Ollybest
One last thing Brandon can you tell anything in means of like which way something is facing or something? think of a door… a closed door must have something different (somewhere) than an open one?
A hacky way would be to check the distance from a different object.
tristen8878
2012-09-18 14:27:15
I've done everything it says to do but nothing happens do I drag the client icon to the rs client then start script? I am running on open gl on gtx 470 if anyone can tell me what I am doing wrong would help a lot
Jakkle
2012-09-18 14:36:41
You could get which way the doors faces are looking, comparing it to the compass.
DoorClosed(X = 0 or 360, Y = 180) X would be facing north and Y would be facing south. DoorOpen(X = 270 or 90, Y = 90 or 270) The doors faces X and Y would be either East or west once opened, depending on which way the door opens. If you get where I'm coming from :p
Edit:
From: tristen8878
I've done everything it says to do but nothing happens do I drag the client icon to the rs client then start script? I am running on open gl on gtx 470 if anyone can tell me what I am doing wrong would help a lot
Yes drag Simba's cross hair to the Runescape client so Simba knows what to focus on. Double check you have followed everything correctly, that Brandon has instructed to do.
tristen8878
2012-09-18 14:58:00
From: Jakkle
You could get which way the doors faces are looking, comparing it to the compass.
DoorClosed(X = 0 or 360, Y = 180) X would be facing north and Y would be facing south. DoorOpen(X = 270 or 90, Y = 90 or 270) The doors faces X and Y would be either East or west once opened, depending on which way the door opens. If you get where I'm coming from :p
Edit:
Yes drag Simba's cross hair to the Runescape client so Simba knows what to focus on. Double check you have followed everything correctly, that Brandon has instructed to do.
I've done everything and I looked over the instruction again and doubled check everything I think It might be something to do with my gpu it's nvidia so I herd some people where having problems with them
Brandon
2012-09-18 15:11:37
From: tristen8878
I've done everything and I looked over the instruction again and doubled check everything I think It might be something to do with my gpu it's nvidia so I herd some people where having problems with them
Nvidia problems were fixed long ago. I'll upload a dll later.. Going to install gnome first though and test stuff on linux.
In school ATM though and also I think your missing something :S
Switch to OpenGL mode?
Brandon where can I find the newest updates? And how is the progress going on getting it on smart :d
Brandon
2012-09-24 16:37:18
From: Ollybest
Brandon where can I find the newest updates? And how is the progress going on getting it on smart :d
I already got it to work in Smart and the latest is on the github. It supports linux Partially. I cannot get RS to load on my Ubuntu system.. probably due to drivers and the fact that this laptop is extremely old..
Thus I cannot fully port it to linux. Only thing left for linux really is to just swap wgl functions with glx functions and see which ones are being called. That's it.
Uhh as for Smart.. I cannot get Smart to load it on Windows 8! My main system as of right now since I broke my other laptop lol..
But yeah Smart can already load it and can use it as well.
From: Brandon
I already got it to work in Smart and the latest is on the github. It supports linux Partially. I cannot get RS to load on my Ubuntu system.. probably due to drivers and the fact that this laptop is extremely old..
Thus I cannot fully port it to linux. Only thing left for linux really is to just swap wgl functions with glx functions and see which ones are being called. That's it.
Uhh as for Smart.. I cannot get Smart to load it on Windows 8! My main system as of right now since I broke my other laptop lol..
But yeah Smart can already load it and can use it as well.
Oh wow nice progress, I may start grabbing some ids etc you don't plan to change them anymore?
Edit: You still need to look into animations :P that may screw the ids up so I think il hold.
Brandon
2012-09-24 17:02:11
From: Ollybest
Oh wow nice progress, I may start grabbing some ids etc you don't plan to change them anymore?
Edit: You still need to look into animations :P that may screw the ids up so I think il hold.
Nope. It's safe to grab them. I've changed them more than enough and they are far more accurate. I don't see them getting anymore accurate than they currently are.
Animations will be difficult for sure but meh.. Jagex is removing randoms or something.. I'll still look into it.. Just have other things to do is all.
Been a bit less motivated lately to work on RS lol.
Eh on second thoughts I may hold, If you did get something to do with animations in the future for like an animating npc it would have some sort of id change, but then again I don't even know if its possible nor do you I think :P
Brandon
2012-09-24 17:15:14
From: Ollybest
Eh on second thoughts I may hold, If you did get something to do with animations in the future for like an animating npc it would have some sort of id change, but then again I don't even know if its possible nor do you I think :P
No.. that won't affect anything. I won't be dumb and mess with the current methods. Currently, I haven't actually touched any of the classes and methods. Instead, I inherit from them and adapt onto them (UNLESS a change is actually needed).
Bitmap/Png saving would be an example. I didn't want to touch the bitmapclass so.. Inherit from it, create a friend class called CynicImages (CynicRus), and form PNG's from the Pixels of the bitmaps or from a direct pointer.
This is the approach I've been taking. Built from the bottom up. In other words, instead of touching the ID's unless I find a more accurate way, I will just add a member variable called AnimationID (if I get animation working).
Also instead of removing the platform specific code and having the Linux code run for both systems, it was easier to just do an #ifdef _platform #else..
So yes model and item ID's will stay how they current are. If I add animation, I'll simply add a variable that says AnimationID.
Fair enough, great speaking to you as usual :D
CynicRus
2012-09-25 01:34:20
Brandon, I'm still waiting for task-) I can write such a injection mechanism for Linux, or something else.
xtrapsp
2012-09-25 06:28:54
Brandon do you need any help? I can offer server space to share stuff and whatnot. To be honest I'l help with anything I can, advances like this really do help SRL
Brandon
2012-09-25 08:12:35
From: CynicRus
Brandon, I'm still waiting for task-) I can write such a injection mechanism for Linux, or something else.
If you want you can write the injection.cpp file for linux yeah. But it'd be no use (at this moment) since I cannot get gDebugger to load RS.
Basically, all that is needed for a release atm is an include and the glx hooks (for linux). That's about it. All the other stuff can come as updates and what not.
Basically, do an Ifdef in this file:
https://github.com/Brandon-T/GLHook/blob/master/OGL%20Editing/GLHookInfo/Injector.cppand put the linux stuff if you like. But like I said, it'd be useless without the glx hooks and I cannot write them because I cannot get gDebugger to load RS on linux. Well at least on this laptop I can't. I haven't tried other computers.
Stuff like animation, position, direction, etc.. all that stuff would be hooks. If you want you can look into it but I guess you'd need OGL background to know how to do it.
CynicRus
2012-09-25 08:49:45
For linux OGL debugging you may use
http://sourceforge.net/projects/bugle/ this.
Brandon
2012-09-25 09:56:27
From: CynicRus
For linux OGL debugging you may use http://sourceforge.net/projects/bugle/ this.
gDebugger is much much better than any that I've ever used.. I have no problem with the debuggers.. It's linux I have a problem with. It won't load RS in OpenGL mode for me so yeah. Just did what I could and left the rest.
Anyway, we'll have to wait and see how things change when this botnuke hits. Doubt it'd affect this project though.
slacky
2012-09-25 10:42:21
From: Brandon
gDebugger is much much better than any that I've ever used.. I have no problem with the debuggers.. It's linux I have a problem with. It won't load RS in OpenGL mode for me so yeah. Just did what I could and left the rest.
Sounds like you're having some driver-issues.
If you're using the "built in driver", that comes with your Linux-distro: Try downloading original driver for your grafic card. If you are using am, look for an update.
If you already got an up to date version of the original driver from ATI(?), and it's still not working with OGL you could try out the OpenSource drivers. I don't realy like am my self, but they can the trick.
Not all distros is compatible with the Original-, and OpenSource-drivers, make sure you're noe using a old distro, and that you are using a somewhat popular distro. I've had most success with both ATI-, and nvidia-drivers on RPM-based systems (Mageia and Fedora in my case). While offen had som trubble with the drivers on Debian-based systems; Mint should be fine, and thereby also Ubuntu (pretty much identical, except the gui and all the shit that is "built into Ubuntu", making it more unstable). Even tough Backtrack, and ultimate edition is built on Ubuntu, you should not expect drivers to work there.
Brandon
2012-09-25 12:30:38
From: warpie
Sounds like you're having some driver-issues.
If you're using the "built in driver", that comes with your Linux-distro: Try downloading original driver for your grafic card. If you are using am, look for an update.
If you already got an up to date version of the original driver from ATI(?), and it's still not working with OGL you could try out the OpenSource drivers. I don't realy like am my self, but they can the trick.
Not all distros is compatible with the Original-, and OpenSource-drivers, make sure you're noe using a old distro, and that you are using a somewhat popular distro. I've had most success with both ATI-, and nvidia-drivers on RPM-based systems (Mageia and Fedora in my case). While offen had som trubble with the drivers on Debian-based systems; Mint should be fine, and thereby also Ubuntu (pretty much identical, except the gui and all the shit that is "built into Ubuntu", making it more unstable). Even tough Backtrack, and ultimate edition is built on Ubuntu, you should not expect drivers to work there.
Meh I've gotten OpenGL working now.. loading RS into a debugger in OGL mode on Linux is quite difficult. Dgby was trying with me on IRC two days ago. He's busy though but it required him to edit some perl script.
See Linux doesn't have an official RSClient and loading Firefox into gDebugger didn't work for me as it said something stupid about "Not a proper executable" or something like that. Meh I'll work on linux stuff later I guess. The majority of "users" are windows users I would assume so Linux can wait I guess.
Noob King
2012-09-25 19:34:32
Edit: Didn't see it at the bottom of the first page :whistling:
n3ss3s
2012-10-01 17:10:17
Any news?
Brandon
2012-10-01 17:25:35
From: n3ss3s
Any news?
Well the latest news is that I have a way of getting Smart to give Simba OpenGL colour information. Currently, there is no way to do this but I just give Smart a pointer to a GLBuffer and it works. Current GLHook only uses ID's and stuff but some were asking about reading colours for DTM's and stuff in OpenGL mode and it was said that it doesn't work. This should fix it all and allow Smart to get stuff even while minimized.. See the two discussion threads:
http://villavu.com/forum/showthread.php?t=67417&page=3http://villavu.com/forum/showthread.php?t=86223&highlight=Rendering+ModesThat's about it so far.
If you wanna take a look at the code (Just a test application):
#include "jni.h"
#include "Images.hpp"
#ifdef BUILD_DLL
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT __declspec(dllimport)
#endif
#ifdef __cplusplus
#define CPPEXTERN extern "C"
#define CPPEXPORT extern "C" DLL_EXPORT
#endif
void GetBits(unsigned char* &Data, int &Size, int BitsPerPixel)
{
Bitmap Foo("C:/Users/Brandon/Desktop/Untitled.bmp");
std::unique_ptr<unsigned char> Pixels(new unsigned char[Foo.Size()]);
unsigned char* BuffPos = Pixels.get();
for (int I = 0; I < Foo.Height(); ++I)
{
for (int J = 0; J < Foo.Width(); ++J)
{
*(BuffPos++) = (Foo.PixelsPointer() + ((Foo.Height() - 1 - I) * Foo.Width() + J))->RGBA.R;
*(BuffPos++) = (Foo.PixelsPointer() + ((Foo.Height() - 1 - I) * Foo.Width() + J))->RGBA.G;
*(BuffPos++) = (Foo.PixelsPointer() + ((Foo.Height() - 1 - I) * Foo.Width() + J))->RGBA.B;
if (BitsPerPixel > 24)
*(BuffPos++) = (Foo.PixelsPointer() + ((Foo.Height() - 1 - I) * Foo.Width() + J))->RGBA.A;
}
if(BitsPerPixel == 24) BuffPos += Foo.Width() % 4;
}
Size = Foo.Size();
memcpy(Data, Pixels.get(), Size);
}
extern "C" JNIEXPORT void JNICALL Java_library_SharedLibrary_GetGLBuffer(JNIEnv *Env, jclass Cls, jobject Buffer)
{
unsigned char* CBuff = (unsigned char*)Env->GetDirectBufferAddress(Buffer);
int Size = 0;
GetBits(CBuff, Size, 24);
//Bitmap TestSave(CBuff, 344, 336, 24);
//TestSave.Save("C:/users/brandon/desktop/Test.bmp");
}
package library;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.nio.ByteBuffer;
class SharedLibrary {
static{System.loadLibrary("TestDLL");}
static native void GetGLBuffer(ByteBuffer Buffer);
public SharedLibrary() {
int BitsPerPixel = 32, Width = 344, Height = 336;
int ByteSize = ((Width * BitsPerPixel + 31) / 32) * 4 * Height;
ByteBuffer Buffer = ByteBuffer.allocateDirect(ByteSize);
GetGLBuffer(Buffer);
Frame F = new Frame(Width + 15, Height + 39, "Brandon", ImageFromByteBuffer(Buffer, Width, Height, BitsPerPixel));
}
private static BufferedImage ImageFromBytes(byte[] Bytes, int Width, int Height) {
BufferedImage Image = new BufferedImage(Width, Height, BufferedImage.TYPE_INT_RGB);
WritableRaster raster = (WritableRaster) Image.getData();
raster.setPixels(0, 0, Width, Height, ByteBufferToIntBuffer(Bytes));
Image.setData(raster);
return Image;
}
private static BufferedImage ImageFromByteBuffer(ByteBuffer ByteBuffer, int Width, int Height, int BitsPerPixel) {
int ByteSize = ((Width * BitsPerPixel + 31) / 32) * 4 * Height;
byte Bytes[] = new byte[ByteSize];
ByteBuffer.get(Bytes);
return ImageFromBytes(Bytes, Width, Height);
}
private static int[] ByteBufferToIntBuffer(byte[] Data) {
int IntBuffer[] = new int[Data.length];
for (int I = 0; I < Data.length; I++) {
IntBuffer[I] = (int)Data[I] & 0xFF;
}
return IntBuffer;
}
}
That's the proof of concept. Instead of the GetBits though, I just do GLReadPixels on the SmartByteBuffer directly and format it on the Java side so Simba can use. That's about all I got done.. Had to learn a bit of JNI/Java ={
Been working on looking into other things as well. Such things would be animation and Vertex hooking on all Systems. Before it only worked on ATI cards but I worked on it during the weekend and got it on all cards.. As you can see, no one replied to me:
http://www.gamedeception.net/threads/25335-Model-Hooking-OpenGLFixed it up though. Animation is quite quite difficult to find as it's a lot of code I have to go through and compare and go through and compare over and over to make sure its correct.
Other than that, I haven't done much I guess ={
P.S. The proof of concept has a couple flaws at first.. Such as in Java, it was RGB and C++ it read as BGR.. I had to flip the bytes. Hopefully when implemented I won't have this problem else I'll just have to flip it as well. Also there is no Speed loss since it gives Smart the buffer before it even renders to the screen =] No data loss either. I tested it by rendering to two windows side by side. Also note that work on this project is a bit slow since I have to test everything on my mom's computer since I'm on Windows 8 and Smart doesn't load OGL on win8. Only win7.
From: Brandon
http://villavu.com/forum/showthread.php?t=67417&page=3
What's that thread about?
Seems you forgot us <SSRL folk can't read up there.
;)
Just about loading .dlls with SMART?
So animation is defiantly possible? just may take some time / alot of coding?
Brandon
2012-10-01 20:02:25
From: Ollybest
So animation is defiantly possible? just may take some time / alot of coding?
Un-sure still. Still "Looking" into it.
Firstly great work Brandon.
Finally had chance to play with this the other day and i love it already although creating a script at this time takes slightly longer due to having to Edit some of srl functions to work with it but overall it's working quite fast and accurate will post the script i made last night later today when i can.
Brandon
2012-10-05 08:40:40
Well I haven't updated the Thread in a while but here is the updated Code attached to this Post.
What it contains? It is subject to a drastic change as I figured out a new style of model/texture hooking. This won't change the current ID's of anything. What it does is grab ID's of those hard to get thing. Example would be things like Tree Leaves to identify which tree is which.
Embedded interfaces such as the Compass currently doesn't have an ID as well as things on the minimap which all have the same ID can be identified.
This DLL won't show them but the code is there. Also learning GLSL so I can hook the shaders. I'm learning it from:
http://www.eng.utah.edu/~cs5610/lectures/GLSL-ATI-Intro.pdfIf anyone wants to know.
This zip file also contains a partial include. It has a list of around 250-300 ID's of things you'd find in RS. It was only for testing but I decided to include it as that's the format I'd go with unless anyone objects.
Looks like this:
//Known Constants.
const
GLC_FixedWidth = 765;
GLC_FixedHeight = 553;
{*
GLI = ImageID.
GLIM = ImageMeanID.
GLIMT = ImageMeanIDTolerance.
GLM = ModelID.
GLMT = ModelTriangleCount.
*}
//Client ID's.
const
GLI_LoginScreenID = 1393566;
GLI_LoginButton = 72450;
GLI_LoginFaceBook = 571560;
GLI_ValidEmailBox = 22731;
GLI_ValidEmailExit = 18969;
GLI_ValidEmailCape = 536723;
GLI_FreeMemberTrial = 6643195;
GLI_WorldStar_Selected = 14280;
GLIM_WorldStar_F2P = 4144442;
GLIM_WorldStar_P2P = 4471837;
GLI_WorldList_Loot = 6375;
GLI_WorldList_NoLoot = 7395;
GLIM_WorldList_Loot = 1578000;
GLIM_WorldList_NoLoot = 1904910;
GLI_LobbyTab = 56100;
GLI_Lobby_ExitButton = 9369;
GLI_Lobby_PlayButton = 159375;
GLIM_Lobby_ExitButton = 2169371;
GLIM_Lobby_WorldList = 3623998;
GLIM_Lobby_PlayerInfo = 3688266;
GLIM_Lobby_FriendsList = 3885871;
GLIM_Lobby_FriendChat = 4612915;
GLIM_Lobby_ClanChat = 6573875;
GLIM_Lobby_Options = 3683885;
GLIM_Lobby_PlayButton = 8613438;
GLI_WorldList_Refresh = 82365;
GLIM_WorldList_Refresh = 4085853;
GLI_SquealGoblin = 312863;
GLI_Squeal_ExitButton = 11270;
GLIM_Squeal_ExitButton = 2362638;
GLI_GameChat_Options = 139230;
GLIM_GameChat_Selected = 5457460;
GLIM_GameChat_Normal = 3683116;
GLI_ReportPlayer_Button = 279225;
GLIM_ReportPlayer_Button = 6168606;
GLI_Interface_SmlButton = 12240;
GLI_Interface_MedButton = 16320;
GLI_BasicExit_SmlButton = 3419942;
GLIM_BasicExit_MedButton = 4143405;
GLIM_Scroll_SmBasicArrow = 3880491;
GLI_GameTab_Selected = 48705;
GLI_GameTab_Combat = 31110;
GLI_GameTab_Notice = 49470;
GLI_GameTab_Stats = 48705;
GLI_GameTab_Inventory = 45135;
GLI_GameTab_Equipment = 35445;
GLI_GameTab_Prayer = 21420;
GLI_GameTab_Magic = 34935;
GLI_GameTab_Extras = 24990;
GLI_GameTab_FriendsList = 42585;
GLI_GameTab_FriendsChat = 42330;
GLI_GameTab_ClanChat = 42330;
GLI_GameTab_Options = 30345;
GLI_GameTab_Emotes = 43860;
GLI_GameTab_Music = 44115;
GLI_GameTab_Notes = 27540;
GLI_GameTab_LogOut = 46665;
GLI_GameTab_LogOut_Btn = 201960;
GLIM_GameTab_Selected = 2629392;
GLIM_GameTab_Combat = 4534812;
GLIM_GameTab_Notice = 7300172;
GLIM_GameTab_Stats = 4736586;
GLIM_GameTab_Inventory = 3218958;
GLIM_GameTab_Equipment = 4803401;
GLIM_GameTab_Prayer = 2831669;
GLIM_GameTab_Magic = 4010786;
GLIM_GameTab_Extras = 4008503;
GLIM_GameTab_FriendsList = 4410149;
GLIM_GameTab_FriendsChat = 3753770;
GLIM_GameTab_ClanChat = 6769420;
GLIM_GameTab_Options = 2104598;
GLIM_GameTab_Emotes = 4867129;
GLIM_GameTab_Music = 5853246;
GLIM_GameTab_Notes = 3616805;
GLIM_GameTab_LogOutHover = 5981710;
GLIM_GameTab_LogOut_Btn = 7740442;
GLI_GameTab_CombatStyle = 551423;
GLI_GameTab_CombatPunch = 54578;
GLI_GameTab_CombatKick = 60992;
GLI_GameTab_CombatBlock = 77536;
GLIM_Combat_StyleNormal = 1712420;
GLIM_Combat_StyleCurrent = 4334353;
GLIM_Combat_StyleNHover = 2831931;
GLIM_Combat_StyleCHover = 6830363;
GLI_AutoRetaliate = 1267286;
GLIM_AutoRetaliate_Off = 2303784;
GLIM_AutoRetaliate_On = 4466453;
GLIM_AutoRetal_OffHover = 3291709;
GLIM_AutoRetal_OnHover = 6699550;
GLI_NoticeBoard_NoTask = 484500;
GLI_Notice_OpenButton = 43020;
GLI_Notice_Exit = 18969;
GLI_Skill_Attack = 19987;
GLI_Skill_Constitution = 39978;
GLI_Skill_Mining = 19123;
GLI_Skill_Strength = 42199;
GLI_Skill_Agility = 35940;
GLI_Skill_Smithing = 34831;
GLI_Skill_Defense = 44198;
GLI_Skill_Herblore = 56516;
GLI_Skill_Fishing = 57796;
GLI_Skill_Range = 25698;
GLI_Skill_Theiving = 27478;
GLI_Skill_Cooking = 51495;
GLI_Skill_Prayer = 30182;
GLI_Skill_Crafting = 37599;
GLI_Skill_FireMaking = 48964;
GLI_Skill_Magic = 54428;
GLI_Skill_Fletching = 22836;
GLI_Skill_WoodCutting = 47644;
GLI_Skill_RuneCrafting = 36826;
GLI_Skill_Slayer = 57788;
GLI_Skill_Farming = 37657;
GLI_Skill_Construction = 57334;
GLI_Skill_Hunting = 33773;
GLI_Skill_Summoning = 40105;
GLI_Skill_Dungeoneering = 62639;
GLI_Equipment_Aura = 56040;
GLI_Equipment_Helmet = 48816;
GLI_Equipment_Cape = 25585;
GLI_Equipment_Neck = 19539;
GLI_Equipment_Arrows = 32177;
GLI_Equipment_Torso = 28305;
GLI_Equipment_Shield = 20464;
GLI_Equipment_Legs = 35152;
GLI_Equipment_Gloves = 41890;
GLI_Equipment_Feet = 38957;
GLI_Equipment_Ring = 18368;
GLI_Equipment_ShowEquip = 106335;
GLI_Equipment_ItemsKept = 123675;
GLI_Equipment_ToolBelt = 111743;
GLI_Equipment_Customize = 136604;
GLI_MMPanel_Normal = 86955;
GLI_MMPanel_ToggleXP = 166260;
GLI_MMPanel_XPBarShowing = 48705;
GLI_MMPanel_MoneyPouch = 30345;
GLI_MMPanel_MoneyBacking = 159120;
GLI_MMPanel_MoneyPouchOn = 227970;
GLI_MMPanel_WorldMap = 164730;
GLI_MMPanel_RunEnergy = 16830;
GLI_MMPanel_Heath = 2040;
GLI_MMPanel_Prayer = 12750;
GLIM_MMPanel_ToggleXP = 7559212;
GLIM_MMPanel_XPHover = 6047525;
GLIM_MMPanel_WorldHover = 6849921;
GLIM_MMPanel_RunOn = 7626790;
GLIM_MMPanel_RunOff = 5322271;
GLIM_MMPanel_Heath = 2098945;
GLIM_MMPanel_PrayerOn = 7505518;
GLIM_MMPanel_PrayerOff = 3220555;
GLIM_MMPanel_MoneyHover = 3953254;
GLI_MMIcon_MyPlayerDot = 4256970;
GLI_MMIcon_PlayerNPCDot = 1887493;
GLIM_MMIcon_MyPlayerDot = 2432791;
GLI_MMSymbol_Small = 6375;
GLI_MMSymbol_Medium = 27030;
GLI_MMSymbol_Flag = 1275;
GLIM_MMSymbol_Flag = 987918;
GLIM_MMSymbol_Bank = 2827799;
GLIM_MMSymbol_GExchange = 2828584;
GLIM_MMSymbol_Rareree = 3157806;
GLIM_MMSymbol_Loyalty = 3289651;
GLIM_MMSymbol_LodeStone = 2238005;
GLIM_MMSymbol_Tannery = 3750201;
GLIM_MMSymbol_Dungeon = 4340024;
GLI_Compass_Icon = 507195;
GLIM_Compass_Icon = 6051142;
GLI_Bank_BtnBackgrnd = 114495;
GLI_Bank_Note = 22950;
GLI_Bank_Deposit_Money = 43350;
GLI_Bank_Deposit_Items = 39780;
GLI_Bank_Deposit_Follower = 37740;
GLI_Bank_Deposit_Equipment = 26010;
GLI_Bank_SwitchMode = 13515;
GLI_Bank_SearchMode = 9435;
GLI_Bank_ShowEquipment = 106335;
GLIM_Bank_BtnBackgrndOn = 3682342;
GLIM_Bank_BtnBackgrndOff = 5523773;
GLIM_Bank_Note_Normal = 7302232;
GLIM_Bank_Note_Selected = 4670516;
GLIM_Bank_Deposit_Money = 4542497;
GLIM_Bank_Deposit_Items = 2766353;
GLIM_Bank_Deposit_Follower = 3362361;
GLIM_Bank_Deposit_Equipment = 1190674;
GLIM_Bank_SwitchMode = 1381651;
GLIM_Bank_SearchMode = 1446930;
GLIM_Bank_ShowEquipment = 3682349;
GLI_Texture = 3786240;
GLI_Texture_ChatBox = 17204850;
GLIM_Texture_Water = 8361138;
GLIM_Texture_Lava = 16361547;
GLIM_Texture_StoneWall = 7829099;
GLIM_Texture_ChatBox = 13285783;
//NPC IDs:
GLM_NPC_PurpleBankFemale = 3273447472;
GLM_NPC_PurpleBankMale = 1775775211;
GLM_NPC_VarrockGuardOne = 1569043836;
GLM_NPC_VarrockGuardTwo = 1441885601;
GLM_NPC_GrandExchangeFemale = 2253528948;
GLM_NPC_GrandExchangeMale = 2553342430;
GLM_NPC_BobBarter = 40148168;
GLM_NPC_FaridMorrisane = 1873423136;
GLM_NPC_ReloboBlinyo = 830120687;
GLM_NPC_Hofuthand = 742643267;
GLM_NPC_GrandExchangeTutor = 901994727;
GLM_NPC_BrugsenBursen = 3829711705;
GLMT_NPC_PurpleBankFemale = 1270;
GLMT_NPC_PurpleBankMale = 1121;
GLMT_NPC_VarrockGuardOne = 1267;
GLMT_NPC_VarrockGuardTwo = 1323;
GLMT_NPC_GrandExchangeFemale = 1209;
GLMT_NPC_GrandExchangeMale = 1585;
GLMT_NPC_BobBarter = 1176;
GLMT_NPC_FaridMorrisane = 908;
GLMT_NPC_ReloboBlinyo = 1392;
GLMT_NPC_Hofuthand = 1124;
GLMT_NPC_GrandExchangeTutor = 1089;
GLMT_NPC_BrugsenBursen = 1833;
//Object IDs:
GLM_Obj_BankBooth = 4216896244;
GLM_Obj_Door = 3072665158;
GLM_Obj_VBank_UpStairCase = 1053311928;
GLM_Obj_VBank_DownStairCase = 2290863208;
GLM_Obj_Anvil = 1628035397;
GLM_Obj_LogFire = 2057907316;
GLMT_Obj_BankBooth = 150;
GLMT_Obj_Door = 290;
GLMT_Obj_VBankUpStairCase = 610;
GLMT_Obj_VBankDownStairCase = 388;
GLMT_Obj_Anvil = 84;
GLM_Obj_LogFire = 388;
Read the file to see the format. I tried to keep them short but descriptive at the same time. No two should have the same name unless they have a different prefix extension.
The idea behind it is to forget the rest of files such as Bank, Amount, etc.. Write the ID's file then write the others after which will use the ID's file. That way whenever there is a change, all you do is update the ID's file? Make sense?
Stuff like Tree Leaves and specs of dust will have to wait until I implement it (Along with the JNI stuff for smart). Same with embedded interfaces. Example is again the Compass and the Notice Board Buttons.
Anyway I got school and I prob won't be able to do anything until the weekend. You guys can start adding ID's or make a Git for an include. If not I'll do that.
F12 To Save Images and see what Items are What.
EDIT: Gosh I feel stupid. Forgot we had the Git. I'll update that after class.
In the future would it be possible to get the bounds of a model? Also I will do some id gathering if I can figure out how to run the latest version :P well that's if it even works :X first time I tried it it wouldn't start haha.
Brandon
2012-10-06 10:26:14
From: Ollybest
In the future would it be possible to get the bounds of a model? Also I will do some id gathering if I can figure out how to run the latest version :P well that's if it even works :X first time I tried it it wouldn't start haha.
You can get the bounds of a model right now. It's just I disabled it since it isn't needed atm. Basically all you need atm is to click the center of a model.
If we do indeed need bounds, I'll re-enable it (Make it write the vertices to SharedMem). I didn't compile the version above. I only posted the source. I'll update the thread today as soon as I get some stuff sorted.
Alright man, i was just thinking for fighting get the bounds, search for hpbar/damage shields inside the npc. Then again you can just get the mid point and make a box around it. Mind posting here when you update the thread? no rush I just want to know when its updated :P
Thanks again.
Noob King
2012-10-10 03:51:39
Made any more progress lately Brandon?
Bobzilla69
2012-10-10 04:07:20
I am really impressed with all this work you have done, keep it up
Swatarianess
2012-10-10 07:11:06
I came running back because I heard the word OGL :O
~Bro433
Brandon
2012-10-10 08:04:33
From: Noob King
Made any more progress lately Brandon?
http://villavu.com/forum/showpost.php?p=1109694&postcount=55That's the link. I'm not sure if you guys can see it but that's what I've been working on lately. It's a method of giving Smart a pointer through JNI and smart feeds it to Simba.


I have to fix the flipping and use Smart's buffer instead of my own. That's all. I wrote the code for it just didn't test it or try it or anything. It's just sitting there.
Wizzup?
2012-10-11 05:35:45
Awesome work. Keep it up.
tristen8878
2012-10-12 11:07:44
Do you think we will see a lot more bots using opengl or directx and do you think it's possible that jagex can detect these kinds of methods because your not actually breaking realworld laws if your using opengl and there's no injecting into the client that I know of.
From: tristen8878
Do you think we will see a lot more bots using opengl or directx and do you think it's possible that jagex can detect these kinds of methods because your not actually breaking realworld laws if your using opengl and there's no injecting into the client that I know of.
Meh Jagex aren't exactly doing anything to stop injection bots so I don't think so.
Noob King
2012-10-13 01:59:05
From: Brandon
http://villavu.com/forum/showpost.php?p=1109694&postcount=55
That's the link. I'm not sure if you guys can see it but that's what I've been working on lately. It's a method of giving Smart a pointer through JNI and smart feeds it to Simba.


I have to fix the flipping and use Smart's buffer instead of my own. That's all. I wrote the code for it just didn't test it or try it or anything. It's just sitting there.
Not cool enough for that section I guess.
Daniel
2012-10-13 05:51:23
From: Noob King
Not cool enough for that section I guess.
He pretty much took a screenshot of the post anyway :p
Brandon
2012-10-13 18:06:13
From: tristen8878
Do you think we will see a lot more bots using opengl or directx and do you think it's possible that jagex can detect these kinds of methods because your not actually breaking realworld laws if your using opengl and there's no injecting into the client that I know of.
Definitely will have more bots I'm waiting to see when RSBot decides to copy all of this since it's open source.
No Atm, I cannot find anything in the client that looks for OpenGL. I'm constantly checking the client every 2-3 days to make sure everything is intact.
Also my noob account that I use to test and write everything on hasn't been banned or warned. Not to mention that I'm only grabbing data right before it hits the graphics card, Exporting only what OpenGL exports, keeping GLHook in Simba's folder (Not Java/JavaHome folders). All security precautions taken.
Anyway I haven't been able to upload the new plugin yet because I still have to test it on my Mom's computer with Smart/Simba. Thus it will again.. Be delayed and I'm very sorry for this.
Anyway, a peak at the new basic include:
https://github.com/Brandon-T/SRL-GLHookI'd like to note that the Text Functions Update was probably the most difficult and most significant! There are now no issues with Spacing, etc..
ChooseOptions and stuff works too! As well as Uptext is 100% accurate. I've provided a list of SOME of the useful ID's around RS that I've been using to develop the include.
Now everyone can see how the include starts and the rules and syntax, you can now contribute. Mind you I don't know git very well so pushing stuff to the git will just confuse me! It's best you fork it and push to your own or make an official one for SRL OR Teach me Git properly as the tutorials confuse me and I don't have time to read them all anymore. I'd rather spend that time on the work rather than git.
Now I'd also like to say if you do indeed test these functions, you should note that NOT all of them work. Some are dependent on others that aren't there yet. Thus I left notes beside them such as Edit.. OR I left them with a blank begin and end for now. Also note that the NavBar does NOT affect these functions thus I may have to edit some of the constant values which is why I placed them all in GLHookIDs.Simba. Since Simba has the offset affect all functions, this makes sense as it makes editing easier.
Now don't PM me for the new DLL. I'll post it when it's ready. MOST of the current functions work with the old DLL's (Except Minimap stuff and embedded interfaces).
Time to go do my homework ;)
Looks great dude, once you get round to updating the dll il work on id collecting + some functions :), one thing i think you might want to split the ids up to separate files… it could get very hard to find a id once it grows, have something like glhookids_NPC and glhookids_Grounditem etc
Brandon
2012-10-13 18:35:24
From: Ollybest
Looks great dude, once you get round to updating the dll il work on id collecting + some functions :), one thing i think you might want to split the ids up to separate files… it could get very hard to find a id once it grows, have something like glhookids_NPC and glhookids_Grounditem etc
Or you can do:
Ctrl + F: NPC IDs
And it'll jump to that section. It'd prob be cool if Simba had code folding user defined sections. Iunno I was kinda just using that file for the Include not really scripts. But we'll see how it goes. Might just use it for all ID's. Well that'll be up to everyone.
From: Brandon
Or you can do:
Ctrl + F: NPC IDs
And it'll jump to that section. It'd prob be cool if Simba had code folding user defined sections. Iunno I was kinda just using that file for the Include not really scripts. But we'll see how it goes. Might just use it for all ID's. Well that'll be up to everyone.
Fair enough, could even do something like this
procedure NPCs;
begin
end;
Const
NPC1 = 1337;
procedure Minimap;
begin
end;
Const
MMDotRED = 1337;
Procedure GroundItems;
begin
end;
Const
Item1 = 1337;
just splits them up you know
revon
2012-10-14 14:59:45
Looks very nice. Too bad I don't know anything about OpenGL to help; I don't use anything except Linux so cross-platform implementation is important to me. Good luck and great work.
wantonman
2012-10-15 00:39:40
i hope im in the right sectin but ill ask here well the question is do i need 2 have smart for opengl 2 work or is there a way 2 have the numberes written on the debug canvas instead…reason y i ask is sumtimes smart halts my system n the debug canvas would be less cpu intensive…
I believe the original version of this only worked with the downloadable RS client. So you can feel free to give that a whirl?
Brandon
2012-10-20 22:48:34
Updated finally. Quite a large one. Feel free to play around with the source as long as you know what you're doing.
Play around with the include as much as you want. You can see that gametab and most of the functions work. All the stuff to create them are already there.
I got lazy on the text functions and ignored colours. Example: GetBlackChatMessage, I said screw this… and just put in a normal Grab-All text function. I eventually wrote a function to grab and filter EVERYTHING by custom parameters. This includes getting text by colour, spacing, height, width, area, 2D, 3D, etc.. Yeah the algorithm took quite some time to get it 100% correct.
Because of this, choose options works as well as uptext, etc. Everything is 100% accurate as far as I have tested. Like I said, play around with it. If I have time, I will just write the coloured text functions.
See:
https://github.com/Brandon-T/SRL-GLHook/blob/master/GLCommunication.SimbaFontsToText1D and 2D for more info as well as their corresponding return value structures.
Woohoo :P il mess around with this today, How's this and smart working together going? (i mean reading the colours)
Brandon
2012-10-21 09:26:58
From: Ollybest
Woohoo :P il mess around with this today, How's this and smart working together going? (i mean reading the colours)
It works.
Lol the rs client crashes every time i try to switch to ogl mode :s
Brandon
2012-10-21 10:06:36
From: Ollybest
Lol the rs client crashes every time i try to switch to ogl mode :s
Did you compile it yourself?
From: Brandon
Did you compile it yourself?
Uh no, are we supposed to?
Brandon
2012-10-21 11:53:59
From: Ollybest
Uh no, are we supposed to?
No you shouldn't have to. I don't seem to have that problem with crashing :S
I'll try it on another comp soon and see.
From: Brandon
No you shouldn't have to. I don't seem to have that problem with crashing :S
I'll try it on another comp soon and see.
Yeah I can load OGL fine without your opengl32 but with it as soon as i click switch modes to OGL it crashes :P
Noob King
2012-10-21 17:30:33
I can't seem to get opengl to load in smart.
Enslaved
2012-10-21 18:00:46
dont think smart was designed for opengl
From: Enslaved
dont think smart was designed for opengl
"Smart v8.1 or v8.2 depending on if Ben wants to change the Version number, will include data feeding to Simba. What does this mean? Well, currently Simba is unable to read OpenGL colours from the client. This will feed Smart a buffer with NO lag, and Smart will pass it to Simba just like it currently does for safe-mode. I still have some testing to do with this as I need a proper computer to test it on (aka my mom's since I'm on Windows 8 lol)."
Noob King
2012-10-21 18:12:26
From: Ollybest
"Smart v8.1 or v8.2 depending on if Ben wants to change the Version number, will include data feeding to Simba. What does this mean? Well, currently Simba is unable to read OpenGL colours from the client. This will feed Smart a buffer with NO lag, and Smart will pass it to Simba just like it currently does for safe-mode. I still have some testing to do with this as I need a proper computer to test it on (aka my mom's since I'm on Windows 8 lol)."
I thought the smart in Brandon's Github already has support for opengl. Any how I can't get lape to run without using smart, and I am getting annoyed trying to find a fix. :fiery:
Brandon
2012-10-21 19:15:39
From: Noob King
I thought the smart in Brandon's Github already has support for opengl. Any how I can't get lape to run without using smart, and I am getting annoyed trying to find a fix. :fiery:
I don't even have Smart in my Github :S
Also for those running the OpenGL with Smart, you shouldn't be doing that yet. I didn't compile it for Smart. If you want to run it with Smart, you'll have to compile it with the #DEFINE GLHook_Smart and #DEFINE GLHook_Simba then do:
GLHSetup(SmartCurrentClient);
Otherwise, stick it to the official client for now. I'm working on the Smart thing atm. I'm not too great at Java.
I've also tested the DLL on multiple computers, I have no problem getting RS to load it. Also what error message does it say? Does it leave a herr.txt file in the same folder?
Noob King
2012-10-21 19:29:03
From: Brandon
I don't even have Smart in my Github :S
Also for those running the OpenGL with Smart, you shouldn't be doing that yet. I didn't compile it for Smart. If you want to run it with Smart, you'll have to compile it with the #DEFINE GLHook_Smart and #DEFINE GLHook_Simba then do:
GLHSetup(SmartCurrentClient);
Otherwise, stick it to the official client for now. I'm working on the Smart thing atm. I'm not too great at Java.
I've also tested the DLL on multiple computers, I have no problem getting RS to load it. Also what error message does it say? Does it leave a herr.txt file in the same folder?
https://github.com/Brandon-T/SMART << You do have smart on your Github. "forked from BenLand100/SMART"
Anyways it loads fine for me in the official client. Simba on the other hand, seems to not want to let me use lape without using smart. When trying to run your test script on the first page with the lape interpreter:
Exception in Script: Unknown declaration "SetupSmart" at line 190, column 7 in file "C:\Simba\Includes\SRL\SRL.Simba"
Which is:
SetupSmart(Smart_ForceNew);
I get that when running:
program new;
{$I GLHook/GLHook.Simba}
var
Colour: String;
begin
writeln('Prayer Level: ' + ToStr(GLH_GetMMLevels(GLE_MMLevel_Prayer, Colour)));
WriteLn('Magic Tab: ' + ToStr(GLH_GameTab(TAB_MAGIC)));
Writeln('Cloak Equiped: ' + ToStr(GLH_ItemEquipped(GLE_Equipment_Cloak)));
end.
Brandon
2012-10-21 19:48:40
I have no clue why that is happening.
Try:
https://github.com/SRL/SRL-5That should have the Lape include with it. Also make sure you have the latest Simba.
Oh wow.. happening to me now on Simba 0.99. I think you need 1.0 to run Lape.
Noob King
2012-10-21 20:02:01
From: Brandon
I have no clue why that is happening.
Try: https://github.com/SRL/SRL-5
That should have the Lape include with it. Also make sure you have the latest Simba.
Oh wow.. happening to me now on Simba 0.99. I think you need 1.0 to run Lape.
Is there anywhere I can get 1.0 from?
Brandon
2012-10-21 20:07:08
From: Noob King
Is there a special place to get 1.0? Downloading the latest version for me is still 991.
http://nala.villavu.com/downloads/master/e19ab664ad757168d434bcb4fc8f30f005a9ec54/
Daniel
2012-10-21 20:09:11
From: Noob King
Is there anywhere I can get 1.0 from?
Build 1000 (what Brandon is referring to as 1.0) is a beta build and can be downloaded from
here. :)
Le Jingle
2012-10-24 00:58:12
compiles,
successfully executes.
^ From the test script on 1st post.
Simba Build 1.00 (I assume), from "
2012-Oct-13 23:00:34." Newest SRL dl'd, hook in the /plugins/, ogl in the /bin/, rs client in ogl loaded up and logged in to first. (on screen f-keys show visual-Ids and all that good stuffs)
I duno why it successfully executes the test script and then says srl wasn't free'd + doesn't writeln the test script. :confused:
Brandon
2012-10-24 01:04:04
From: Le Jingle
compiles,
successfully executes.
^ From the test script on 1st post.
Simba Build 1.00 (I assume), from "2012-Oct-13 23:00:34." Newest SRL dl'd, hook in the /plugins/, ogl in the /bin/, rs client in ogl loaded up and logged in to first. (on screen f-keys show visual-Ids and all that good stuffs)
I duno why it successfully executes the test script and then says srl wasn't free'd + doesn't writeln the test script. :confused:
https://github.com/SRL/SRL-5/commit/55f3bb00e9b544df8b6a8fe1dbba93de9eb18940#commitcomment-2032154^I commented on it but I don't think they're going to fix that any time soon. Anyway just letting you know that it isn't what I wrote but rather the Lape include itself.
The temp solution to that is to remove the lines I commented on in that github link.
Le Jingle
2012-10-24 01:18:07
From: Brandon
https://github.com/SRL/SRL-5/commit/55f3bb00e9b544df8b6a8fe1dbba93de9eb18940#commitcomment-2032154
^I commented on it but I don't think they're going to fix that any time soon. Anyway just letting you know that it isn't what I wrote but rather the Lape include itself.
The temp solution to that is to remove the lines I commented on in that github link.
Delete all my includes? :bart:
Just messing around :p I see now, thanks, I'll try doing those changes now. :)
Edit: Pulls in -1 Prayer, but get's to the magic tab perfectly. (cloak is returned directly after we enter the magic game tab, I suppose I'll take a look at the GLHook includes tomorrow)
Cheers,
Lj
P.S. - this awesome super duper work Mr. Brandon! :)
Brandon
2012-10-24 01:36:42
From: Le Jingle
Delete all my includes? :bart:
Just messing around :p I see now, thanks, I'll try doing those changes now. :)
Edit: Pulls in -1 Prayer, but get's to the magic tab perfectly. (cloak is returned directly after we enter the magic game tab, I suppose I'll take a look at the GLHook includes tomorrow)
Cheers,
Lj
P.S. - this awesome super duper work Mr. Brandon! :)
Oh yeah lol. I need to update the skill coords. It can read the text fine though. Just the coords are off a bit since the NavBar does NOT affect this.
Brandon
2012-10-24 02:17:08
Ohh one more thing.. I solved the buffer problem. Simba can now great OpenGL DTM's, Bitmaps, etc.. So colour is no longer useless in OGL mode (Implemented in the Smart on the github.. I'll await Benland's reply and see if he likes it).
I'd prefer if someone gave a better solution to image flipping. Aka flipping an array of bytes since Bitmaps are usually stored upside down.
Atm.. my solution to flipping is (and it works as show in the picture below):
void JNIData::FlipBytes(void*& Result)
{
unsigned long Chunk = width * Bpp > 24 ? 4 : 3;
unsigned char* Destination = static_cast<unsigned char*>(Result);
unsigned char* Source = &BufferPixels[0] + Chunk * (height - 1);
for (int I = 0; I < height; ++I)
{
std::memcpy(Destination, Source, Chunk);
Destination += Chunk;
Source -= Chunk;
}
}
I dislike it though.. :l but meh it's an ok solution I guess. Too tired to come up with a better one. Feel free to post some.
Sorry if I'm being a complete noob… I'm trying to test this out and when I try to run the test script I get this message: Exception in Script: Unknown declaration "SetupSmart" at line 190, column 7 in file "C:\Simba\Includes\SRL\SRL.Simba"
What do?
Le Jingle
2012-11-20 01:09:38
From: dweg
Sorry if I'm being a complete noob… I'm trying to test this out and when I try to run the test script I get this message: Exception in Script: Unknown declaration "SetupSmart" at line 190, column 7 in file "C:\Simba\Includes\SRL\SRL.Simba"
What do?
Make sure to read the main post / smart setup guides.
ot: How bout them Yankee's?
KingKong
2012-11-20 02:44:41
@bitmap flipping, just do height-y value and use that new value to get px col
n3ss3s
2012-11-25 02:17:48
I've replaced Jagex's OpenGL32 etc, but this script I used to use to get a person's name from the trade window doesn't work anymore (and the debug writeln in GetTradeName returns ''). F11 debug works though, and it shows cyan on top of the texts too, but the length of GLHook_GetAllFonts is 0.
{$loadlib GLHook}
type pByte = ^Byte;
type pInt = ^Integer;
type pBool = ^Boolean;
type pFloat = ^Single;
type TFontInfo = record
ID: Cardinal;
R, G, B, A: Byte;
Colour: Integer;
X, Y: Single;
Symbol: Char;
Shadow: Boolean;
Translate: Array [0..2] Of Single;
VX, VY, TX, TY: Array [0..3] Of Integer;
end;
type PFontInfo = ^TFontInfo;
type TFontArray = array of TFontInfo;
Function GLHook_GetAllFonts: TFontArray;
var
Ptr: Pointer;
Size, I: Integer;
begin
Ptr := GLHGetFonts(Size);
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
Result[I].ID := pInt(Ptr)^;
Ptr := Ptr + sizeof(Integer);
Result[I].R := pByte(Ptr)^;
Result[I].G := pByte(Ptr + sizeof(Byte))^;
Result[I].B := pByte(Ptr + (2 * sizeof(Byte)))^;
Result[I].A := pByte(Ptr + (3 * sizeof(Byte)))^;
Ptr := Ptr + (sizeof(Byte) * 4);
Result[I].Colour := RGBToColor(Result[I].R, Result[I].G, Result[I].B);
Result[I].X := pFloat(Ptr)^;
Result[I].Y := pFloat(Ptr + sizeof(Single))^;
Ptr := Ptr + (sizeof(Single) * 2);
Result[I].Symbol := pChar(Ptr)^;
Result[I].Shadow := pBool(Ptr + sizeof(Boolean))^;
Ptr := Ptr + (sizeof(Char) + sizeof(Boolean)) + 2; //Padded by 2.
Result[I].Translate[0] := pFloat(Ptr)^;
Result[I].Translate[1] := pFloat(Ptr + sizeof(Single))^;
Result[I].Translate[2] := pFloat(Ptr + (2 * sizeof(Single)))^;
Ptr := Ptr + (sizeof(Single) * 3);
Result[I].VX[0] := pInt(Ptr)^;
Result[I].VX[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].VX[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].VX[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
Result[I].VY[0] := pInt(Ptr)^;
Result[I].VY[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].VY[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].VY[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
Result[I].TX[0] := pInt(Ptr)^;
Result[I].TX[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].TX[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].TX[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
Result[I].TY[0] := pInt(Ptr)^;
Result[I].TY[1] := pInt(Ptr + sizeof(Integer))^;
Result[I].TY[2] := pInt(Ptr + (2 * sizeof(Integer)))^;
Result[I].TY[3] := pInt(Ptr + (3 * sizeof(Integer)))^;
Ptr := Ptr + (sizeof(Integer) * 4);
end;
end;
Function GLHook_FontsToText(var FontArray: TFontArray; Shadow: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TStringArray;
var
I, J, L: Integer;
Str: String;
Begin
L := High(FontArray);
If Shadow Then J := 1 Else J := 2;
SetLength(Result, 1);
For I := 0 To L Do
If (FontArray[I].Shadow = Shadow) Then
Begin
Try
If (((FontArray[I].Translate[0] - (FontArray[I - J].Translate[0] + FontArray[I - J].VX[3] - FontArray[I - J].VX[0])) >= MinHSpacing) And (I >= 2)) Then
Str := Str + ' ';
If ((((FontArray[I].Translate[1] - FontArray[I - J].Translate[1]) >= MinVSpacing) And (I >= 2) And MinVSpacing > 0) Or (Ord(FontArray[I].Symbol) = 10)) Then
Str := Str + Chr(13);
If (Ord(FontArray[I].Symbol) <> 10) Then
Str := Str + FontArray[I].Symbol;
Except
//
End;
End;
ExplodeWrap(Chr(13), Str, Result);
For I := 0 To High(Result) Do
Result[I] := Trim(Result[I]);
End;
Function GetTradeName: String;
var
T: TStringArray;
I: Integer;
S: String;
Begin
T := GLHook_FontsToText(GLHook_GetAllFonts, true, 4, 2);
For I := 0 To High(T) do
Begin
Writeln(T[i]); // Blank
If (Replace(T[i], 'Trading With: ', '', [rfReplaceAll]) <> T[i]) Then
Begin
Writeln(T[i]);
Result := Replace(T[i], 'Trading With: ', '', [rfReplaceAll]);
Exit;
End;
End;
End;
Function GayTrim(S: String): String;
var
I: Integer;
A, N: String;
begin
A := 'abcdefghijklmnopqrstuvwxyz ';
N := '012345689';
For I := 1 To Length(S) Do
Begin
if (PosEx(Lowercase(S[i]), A, 1) > 0) or (PosEx(S[i], N, 1) > 0) then
Begin
Result := Result + S[i];
End;
End;
end;
var
S: String;
Begin
ClearDebug;
Writeln(GetTradeName);
{Repeat
If (IsMouseButtonDown(1)) Then
Begin
S := GetTradeName;
Writeln(GayTrim(s));
Wait(1000);
End;
Until(False); }
End.
Brandon
2012-11-25 03:10:21
From: n3ss3s
I've replaced Jagex's OpenGL32 etc, but this script I used to use to get a person's name from the trade window doesn't work anymore (and the debug writeln in GetTradeName returns ''). F11 debug works though, and it shows cyan on top of the texts too, but the length of GLHook_GetAllFonts is 0.
This is all that is needed (provided you have this include
https://github.com/Brandon-T/SRL-GLHook):
{$DEFINE GLHook}
{$I SRL/SRL.Simba}
{$I GLHook/GLHook.Simba}
var
Texts: TStringArray;
begin
SetupSRL;
Texts := GLHook_FontsToText(GLHook_GetFontsByArea(IntToBox(163, 61, 339, 84)), true, 4, 20);
writeln(Texts);
end.
The above prints (The text circled in blue below perfectly):

Are you using Smart? If you are, then you need to call the Setup function and pass it the PID of the RS client.
Try this DLL (Not compiled for smart):
[ATTACH]17880[/ATTACH]
n3ss3s
2012-11-26 17:40:37
Hmm, now it works again magically (the code I posted)… :/
Noob King
2012-11-26 17:48:55
Brandon do you know if we still have to use simba 1000?
Flight
2012-11-26 21:17:10
I'm looking forward to seeing this officially working with SMART. It's actually a bit of a pain to run it through the official RS-Loader. Are you just waiting on Ben at this point, Brandon?
Brandon
2012-11-26 21:23:32
From: Flight
I'm looking forward to seeing this officially working with SMART. It's actually a bit of a pain to run it through the official RS-Loader. Are you just waiting on Ben at this point, Brandon?
https://github.com/BenLand100/SMART/pull/13Not only Ben but I guess others as well.. No one really uses the plugin and the srl-lape include isn't exactly the best atm or official as a matter of fact.
Noob King
2012-12-03 10:55:53
From: Brandon
https://github.com/BenLand100/SMART/pull/13
Not only Ben but I guess others as well.. No one really uses the plugin and the srl-lape include isn't exactly the best atm or official as a matter of fact.
is lape a necessity?
Le Jingle
2012-12-03 11:04:29
From: Noob King
is lape a necessity?
I believe his exports are lape format, no? Meaning with his given files, yes lape is necessary to use OGL, afaik
footballjds
2012-12-03 11:45:14
From: Brandon
https://github.com/BenLand100/SMART/pull/13
Not only Ben but I guess others as well.. No one really uses the plugin and the srl-lape include isn't exactly the best atm or official as a matter of fact.
Could you describe what needs to be done before we can use this with SMART? If we used this with smart would we still be able to use our current color-picking techniques along side of it or would we be un-able to to do that in Open GL mode? I forget if safemode is required for SMART, etc. I'd like to get the ball rolling on this as it seems like a perfect and undetectable solution without reflection :)
My waterfiends script would improve DRASTICALLY with using this for object finding ;)
Thanks for the hard work Brandon! Drop me a PM if you could use a tester or want help with something.
Noob King
2012-12-03 12:27:12
From: Le Jingle
I believe his exports are lape format, no? Meaning with his given files, yes lape is necessary to use OGL, afaik
Yes, But does it need to be in lape is my question.
From: footballjds
Could you describe what needs to be done before we can use this with SMART? If we used this with smart would we still be able to use our current color-picking techniques along side of it or would we be un-able to to do that in Open GL mode? I forget if safemode is required for SMART, etc. I'd like to get the ball rolling on this as it seems like a perfect and undetectable solution without reflection :)
My waterfiends script would improve DRASTICALLY with using this for object finding ;)
Thanks for the hard work Brandon! Drop me a PM if you could use a tester or want help with something.
"Simba can now great OpenGL DTM's, Bitmaps, etc.. So colour is no longer useless in OGL mode (Implemented in the Smart on the github.. I'll await Benland's reply and see if he likes it)."
so yes is your answer.
n3ss3s
2012-12-03 15:46:48
From: Brandon
https://github.com/BenLand100/SMART/pull/13
Not only Ben but I guess others as well.. No one really uses the plugin and the srl-lape include isn't exactly the best atm or official as a matter of fact.
Anyway, this is for the communication between the DLL and Smart. It reads the pixels every buffer swap and gives them to smart with the option of flipping the image which I enabled by default.
Inb4 people start scripting in a handstand to avoid needing to flip the image -> save a ms
Brandon
2012-12-03 16:52:27
From: n3ss3s
Inb4 people start scripting in a handstand to avoid needing to flip the image -> save a ms
LOL! It'd be pretty hard to script with an upside down buffer lol. Made it optional just in case though.
@Other guy asking, yes it must have Lape. Without it, you cannot use pointers. Without pointers it'd be slow and it wouldn't work since I exported everything as a pointer to a memory location.
@Guy asking about Smart, it can already be used. Ben hasn't pushed the pull yet but if you compile it yourself, it will work. OR you can wait until he pushes it.
footballjds
2012-12-03 17:02:14
From: Brandon
@Guy asking about Smart, it can already be used. Ben hasn't pushed the pull yet but if you compile it yourself, it will work. OR you can wait until he pushes it.
I'm that guy :redface:
I'll await ben's push as it'll have to be available to everyone or else they wouldn't use my script.
Noob King
2012-12-04 02:35:57
From: Brandon
@Other guy asking, yes it must have Lape. Without it, you cannot use pointers. Without pointers it'd be slow and it wouldn't work since I exported everything as a pointer to a memory location.
Alright. :redface:
ReadySteadyGo
2012-12-04 05:03:23
From: footballjds
I'm that guy :redface:
I'll await ben's push as it'll have to be available to everyone or else they wouldn't use my script.
You could just provide the dll in the meantime. Might even help get the ball rolling.
ssshhhaaa
2012-12-04 05:57:07
Can this be used as a walking method?
Le Jingle
2012-12-04 06:03:43
Yes, as I've understood from Brandon, math is used to calculate relative character position on the loaded map area. This would be accurate to every individual tile.
ssshhhaaa
2012-12-05 07:49:20
From: Le Jingle
Yes, as I've understood from Brandon, math is used to calculate relative character position on the loaded map area. This would be accurate to every individual tile.
Are there any tutorials on this, or would anyone be willing to make one or help me understand how to do this :)?
Le Jingle
2012-12-05 15:04:56
From: ssshhhaaa
Are there any tutorials on this, or would anyone be willing to make one or help me understand how to do this :)?
I don't think there are any tutorials on this, as the calculations for walking would be in the lib files; therefore you couldn't make a script other than using exported methods from the lib files to understand this.
Cheers,
Lj
*pretty sure about the above, although it's probably phrased horribly
Brandon
2012-12-05 15:20:57
From: ssshhhaaa
Are there any tutorials on this, or would anyone be willing to make one or help me understand how to do this :)?
It works like this.. Within the DLL of course.. Not on the Simba side. The functions would have to be exported for Simba though. Anyway, the idea behind it is:
Runescape loads a map like:

into memory. The map is given an ID and that ID is unique every time. The map though, never changes at all. We always know where the map is located in memory and the ID and the size as it is the only and always a 512x512 item with a couple bytes padded (if in bmp form).
Anyway, next the minimap shadow is loaded:

It is always in the minimap location, always the same size and it is identified just as easily as the map itself and every item as well. Both are textures and both are very very easy to find.
Using the two of them, RS uses the GLCombine and AlphaBlend to merge the two items such that it looks like (without the icons):

It then adds the icons after the map is finished being clipped.
How it works? Well a portion of the Map has to be clipped to the smaller map using glMultiTexCoords2f (The 2-parameter float version as noted by the 2f).
It uses GLScissors to make sure that other areas are not affected and then it passes the coordinates to clip. This a square is clipped out and blended with the squared minimap image above.
Knowing the coordinates that are clipped, you can do:
((X2 - X1) / 2) + The distance from the top corner to the clip top corner. Do the same for the Y values to find the player's position within the entire map.
It's like how SPS works except that you don't need any matching algorithms for position finding. All you need to know is which map is loaded and bam (may require a matching algo to find what map your standing in or you can specify the area you wanna walk within).
Basically, instead of clipping the big map, what it does is it puts the little minimap shadow thing inside the big map (centered around the player) and cut off the rest. Simple mathematics finds the player.
BUT.. I've been lazy lately and bored of programming so I never gave it a chance or completed it :l
Can probably also hook Lists and see if the Camera pos is passed to it (doubt this happens though).
ssshhhaaa
2012-12-06 07:57:43
From: Brandon
It works like this.. Within the DLL of course.. Not on the Simba side. The functions would have to be exported for Simba though. Anyway, the idea behind it is:
Runescape loads a map like:

into memory. The map is given an ID and that ID is unique every time. The map though, never changes at all. We always know where the map is located in memory and the ID and the size as it is the only and always a 512x512 item with a couple bytes padded (if in bmp form).
Anyway, next the minimap shadow is loaded:

It is always in the minimap location, always the same size and it is identified just as easily as the map itself and every item as well. Both are textures and both are very very easy to find.
Using the two of them, RS uses the GLCombine and AlphaBlend to merge the two items such that it looks like (without the icons):

It then adds the icons after the map is finished being clipped.
How it works? Well a portion of the Map has to be clipped to the smaller map using glMultiTexCoords2f (The 2-parameter float version as noted by the 2f).
It uses GLScissors to make sure that other areas are not affected and then it passes the coordinates to clip. This a square is clipped out and blended with the squared minimap image above.
Knowing the coordinates that are clipped, you can do:
((X2 - X1) / 2) + The distance from the top corner to the clip top corner. Do the same for the Y values to find the player's position within the entire map.
It's like how SPS works except that you don't need any matching algorithms for position finding. All you need to know is which map is loaded and bam (may require a matching algo to find what map your standing in or you can specify the area you wanna walk within).
Basically, instead of clipping the big map, what it does is it puts the little minimap shadow thing inside the big map (centered around the player) and cut off the rest. Simple mathematics finds the player.
BUT.. I've been lazy lately and bored of programming so I never gave it a chance or completed it :l
Can probably also hook Lists and see if the Camera pos is passed to it (doubt this happens though).
Seems awesome!
Sad that it won't be developed though :(
Brandon
2012-12-09 17:37:48
From: ssshhhaaa
Seems awesome!
Sad that it won't be developed though :(
Lol. It does get boring after a while.. I might continue that part of the project. The project is OpenSource. Anyone who wants to contribute can.
Anyone, a while back, an issue came up. Someone mentioned to me that: "This doesn't work with browsers because you cannot get colour info from the browser version since it has no buffer".
Well, I worked some magic today on my totally shit laptop and well.. I'm happy to say that it will work now. Both browser and Smart versions will be able to give Simba client data so you can make DTM's and screenshots and what not..
It also supports multiple clients (though useless). Reason it's useless for multiple client support for browsers is because you only have ONE mouse!
How it works? You give it the process ID of the browser client and it'll Connect to that Sharedmemory ID. It will create a Buffer and give Simba the pointer to read from.
If I remove multiple browser support, you won't need to give it a Process ID. It does however require one of three things no matter what (for browsers):
1. Inject the dll into the browser.
OR
2. Place the dll in the browser's main folder.
OR
3. Place the dll in the java/bin folder.
I would also like to mention that this produces absolutely no lag/delay. This also allows SPS to work in OpenGL mode.
The code on the C++ side, however, does get a bit complicated.. I wrote multiple classes to simplify it a ton and make it easy and update-able for the future. Here's the simplest & smallest Snippet:
#ifdef GLHOOK_SMART
glPixelStorei(GL_PACK_ALIGNMENT, 4);
glReadPixels(0, 0, JNIBuffer.Width(), JNIBuffer.Height(), GL_BGRA, GL_UNSIGNED_BYTE, JNIBuffer.Pointer());
#elif GLHOOK_SIMBA
glPixelStorei(GL_PACK_ALIGNMENT, 4);
void* Data = SimbaImageData->GetDataPointer();
std::vector<char> Buffer(JNIBuffer.Width() * JNIBuffer.Height() * 4);
glReadPixels(0, 0, JNIBuffer.Width(), JNIBuffer.Height(), GL_BGRA, GL_UNSIGNED_BYTE, Buffer.data());
FlipImageBytes(Buffer.data(), Data, JNIBuffer.Width(), JNIBuffer.Height());
#endif
Code used in the screenshot below:
{$I GLHook/GLHook.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
var
BMP: Integer;
begin
SetupSRL;
GLHSetup('3016');
SetTargetArray(Integer(GLHGetImagePointer()), 765, 553);
BMP := BitmapFromClient(0, 0, 764, 552);
DebugBitmap(BMP);
FreeBitmap(BMP);
end.
The screenshot below used to be possible only when using Smart. Now Simba can read with and without Smart. I'll add it to the git in a sec.
Le Jingle
2012-12-09 18:18:34
Oh, so the screen shot shows that you could previously only use the GLhook drawing on the RS client, but now you can also save the debug/bitmap from the RS client too - instead of only Smart?
also, how might one find the shared memory id, would task manager -> services -> PID contain that info?
Also, really like the work you've done! :) Thanks!
Brandon
2012-12-09 18:26:53
From: Le Jingle
Oh, so the screen shot shows that you could previously only use the GLhook drawing on the RS client, but now you can also save the debug/bitmap from the RS client too - instead of only Smart?
also, how might one find the shared memory id, would task manager -> services -> PID contain that info?
Also, really like the work you've done! :) Thanks!
You can save Debug from Any client now. Whether it's Wyn's client, Official RSClient, Browser Client, Smart, Swiftkit, etc.. As long as it loads the DLL, you can get data from it and bot with it via Simba.
Task Manager is how I get the PID to give Simba.
OR through CMD, you just type TaskList and it'll show a list of all process ID's for the respective applications.
Does ben not want to commit so smart works with it?
Flight
2012-12-09 19:46:41
From: Ollybest
Does ben not want to commit so smart works with it?
He's not been around for some time now.
@Brandon:
How about if you compiled your patched version of SMART and added a direct download link for the Simba plugin? Obviously you'll want to point out that it's a user-made version of SMART but atleast give people the option download it already compiled and ready to go, no?
Daniel
2012-12-09 21:12:45
From: Flight
He's not been around for some time now.
Oh he's around. He's just stupidly lazy. ;)
euphemism
2012-12-09 21:23:34
From: Daniel
Oh he's around. He's just stupidly lazy. ;)
I will vouch to the truthfulness of this statement.
Brandon out of the blue question how does this opengl handle stacked items? Do the ID's stay the same, say blood runes?
Mat
Brandon
2012-12-10 11:52:43
From: Mat
Brandon out of the blue question how does this opengl handle stacked items? Do the ID's stay the same, say blood runes?
Mat
Yes it doesn't change for stacked Items.. After all, they're still the same Item.
BenLand100
2012-12-11 17:30:10
Euphemism, unfortunately our upsidedown 'friend' is beyond help, but you should know better.
So I got around to looking at the modifications made to SMART and… well, I don't particularly like them. I'll take a stab at it in a week or so, after finals, and see what I can come up with. In an ideal world it would function like a plugin system:
1) Names of plugins passed to SMART to load in its process (this is already written)
2) SMART loads plugin and passes its client reference via JNI to the plugin
3) Change SMARTs render modes from what they are to: "Software" and "Native"
4) The plugin will simply render directly to the native buffer SMART already has (i.e. in "Native" mode, SMART does nothing)
Brandon's code basically does this, except the plugin relies on SMART to create another internal buffer then copy that buffer onto the shared buffer (the one going to Simba). That last copy is superfluous and is making the computer move roughly 40Mb/s (for 30fps) more than it should have to (which is an appreciable amount considering the processor has to mediate it). Basically, could be avoided by having the plugin write directly to the shared buffer which is what I intended it to do.
I saw that edit Daniel :p
Brandon
2012-12-12 10:56:49
From: BenLand100
Euphemism, unfortunately our upsidedown 'friend' is beyond help, but you should know better.
So I got around to looking at the modifications made to SMART and… well, I don't particularly like them. I'll take a stab at it in a week or so, after finals, and see what I can come up with. In an ideal world it would function like a plugin system:
1) Names of plugins passed to SMART to load in its process (this is already written)
2) SMART loads plugin and passes its client reference via JNI to the plugin
3) Change SMARTs render modes from what they are to: "Software" and "Native"
4) The plugin will simply render directly to the native buffer SMART already has (i.e. in "Native" mode, SMART does nothing)
Brandon's code basically does this, except the plugin relies on SMART to create another internal buffer then copy that buffer onto the shared buffer (the one going to Simba). That last copy is superfluous and is making the computer move roughly 40Mb/s (for 30fps) more than it should have to (which is an appreciable amount considering the processor has to mediate it). Basically, could be avoided by having the plugin write directly to the shared buffer which is what I intended it to do.
;( I thought I removed that?
public void GetBuffer(ByteBuffer Buffer) {
Buffer.rewind();
GetGLBuffer(Buffer.asIntBuffer());
}
public void GetBuffer(IntBuffer Buffer) {
Buffer.rewind();
GetGLBuffer(Buffer);
}
I just pass nativeBuff to that :S
Main.GLLibrary.GetBuffer(nativeBuff);
If you mean the un-used buffer within the constructor, yeah that can definitely be removed (Not even sure why I have that there). Either way, I'd prefer waiting to see what you come up with.
mastaraymond
2012-12-12 11:49:37
This is awesome! Why isn't anybody using this?
From: mastaraymond
This is awesome! Why isn't anybody using this?
SMART and SRL6 really..
mormonman
2012-12-12 14:41:30
From: mastaraymond
This is awesome! Why isn't anybody using this?
It uses lape which is really unstable and not easy to get srl setup with it.
mastaraymond
2012-12-13 10:26:40
From: mormonman
It uses lape which is really unstable and not easy to get srl setup with it.
What a shame. How does it specifically need lape?
From: mastaraymond
What a shame. How does it specifically need lape?
It uses pointers…. whatever they are haha.
SRL6 is actually making some notable progress if anyone would care to check the git repo. I've not followed this thread all too closely, but hopefully we'll be able to put some of this to use before too much longer.
mastaraymond
2012-12-13 12:04:36
From: Ollybest
It uses pointers…. whatever they are haha.
Pointers can be hacked into PascalScript… If that is the only problem currently?
From: mastaraymond
Pointers can be hacked into PascalScript… If that is the only problem currently?
You'd have to ask Brandon if there's more :p
Brandon
2012-12-13 13:19:47
Uhh there is only ONE way that I personally can think of to get around the pointers..
That would be passing every variable within the records to a function within the dll that will iterate the pointer and store the value in that variable. For the client Image that Simba will read from, I have no problem exporting it as integer instead of pointer. For the records/structs, I see a problem doing that as you can't cast Integers to Records/Structs in PS. The function to do work on the C++ side is all I can think of :S
Other than that, I see no way of hacking the pointers into pascal script? It'd also require a bit more work I guess.
I had functions and a version of the DLL that did this already but I lost it :c Lost 2 years of code yesterday LOL..
So what's the idea behind hacking pointers into PS?
Something like this is what I was thinking:
EDIT: I couldn't get it to export Templates.. so I had to explicitly export each function for each datatype.. The below is tested and works in Pascal script. Basically a lot more work! But removes the need for Lape.. Basically makes Lape optional.
//Export:
(char*)"GLHIteratePointerByte", (char*)"Procedure GLHIteratePointerByte(var Pointer: Integer; var Value: Byte);",
(char*)"GLHIteratePointerInt", (char*)"Procedure GLHIteratePointerInt(var Pointer: Integer; var Value: Integer);",
(char*)"GLHIteratePointerFloat", (char*)"Procedure GLHIteratePointerFloat(var Pointer: Integer; var Value: Single);",
(char*)"GLHIteratePointerBool", (char*)"Procedure GLHIteratePointerBool(var Pointer: Integer; var Value: Boolean);",
(char*)"GLHIteratePointerUInt", (char*)"Procedure GLHIteratePointerUInt(var Pointer: Integer; var Value: Cardinal);",
//Implementations:
template <typename T>
T ReadPointer(char*& Pointer)
{
T Result = *(reinterpret_cast<T*>(Pointer));
Pointer += sizeof(T);
return Result;
};
template <typename T>
void WritePointer(char*& Pointer, const T& Value)
{
*(reinterpret_cast<T*>(Pointer)) = Value;
Pointer += sizeof(T);
};
GL_EXPORT void GLHIteratePointerByte(int* &Pointer, byte &Value)
{
Value = ReadPointer<byte>(reinterpret_cast<char* &>(Pointer));
}
GL_EXPORT void GLHIteratePointerInt(int* &Pointer, int &Value)
{
Value = ReadPointer<int>(reinterpret_cast<char* &>(Pointer));
}
GL_EXPORT void GLHIteratePointerFloat(int* &Pointer, float &Value)
{
Value = ReadPointer<float>(reinterpret_cast<char* &>(Pointer));
}
GL_EXPORT void GLHIteratePointerBool(int* &Pointer, bool &Value)
{
Value = ReadPointer<bool>(reinterpret_cast<char* &>(Pointer));
}
GL_EXPORT void GLHIteratePointerUInt(int* &Pointer, uint32_t &Value)
{
Value = ReadPointer<uint32_t>(reinterpret_cast<char* &>(Pointer));
}
If templates cannot be exported like that, then I'd export an overload for every type I think?
{$IFDEF GLHook}
{$loadlib GLHook}
{$ENDIF}
type TModel = record
ID: Cardinal;
SX, SY: Integer;
Stride: Cardinal;
TriangleCount: Integer;
end;
type TPanelItem = record
X, Y: Integer;
BaseID: Integer;
MeanID: Integer;
TextureID: Integer;
SX, SY: Array [0..3] Of Integer;
end;
type TTextInfo = record
Area: TBox;
Text: String;
Colour: Integer;
end;
type TTextColour = Record
Text: String;
Areas: Array Of TBox;
Colours: Array Of Integer;
End;
type TFontInfo = record
ID: Cardinal;
R, G, B, A: Byte;
Colour: Integer;
X, Y: Single;
Symbol: Char;
Shadow: Boolean;
Translate: Array [0..2] Of Single;
VX, VY, TX, TY: Array [0..3] Of Integer;
end;
type TModelArray = array of TModel;
type TPanelArray = array of TPanelItem;
type TFontArray = array of TFontInfo;
type TTextInfoArray = Array Of TTextInfo;
type TTextColourArray = Array Of TTextColour;
type T2DTextInfoArray = Array Of TTextInfoArray;
Function GLHook_IterateItems(Ptr, Size: Integer): TPanelArray;
var
I, J: Integer;
Begin
SetLength(Result, Size);
For I := 0 To Size - 1 Do
begin
GLHIteratePointerInt(Ptr, Result[I].X);
GLHIteratePointerInt(Ptr, Result[I].Y);
GLHIteratePointerInt(Ptr, Result[I].BaseID);
GLHIteratePointerInt(Ptr, Result[I].MeanID);
GLHIteratePointerInt(Ptr, Result[I].TextureID);
For J := 0 To 3 Do
GLHIteratePointerInt(Ptr, Result[I].SX[J]);
For J := 0 To 3 Do
GLHIteratePointerInt(Ptr, Result[I].SY[J]);
end;
End;
Function GLHook_IterateModels(Ptr, Size: Integer): TModelArray;
var
I: Integer;
Begin
For I := 0 To Size - 1 Do
begin
GLHIteratePointerUInt(Ptr, Result[I].ID);
GLHIteratePointerInt(Ptr, Result[I].SX);
GLHIteratePointerInt(Ptr, Result[I].SY);
GLHIteratePointerUInt(Ptr, Result[I].Stride);
GLHIteratePointerInt(Ptr, Result[I].TriangleCount);
end;
End;
Function GLHook_IterateFonts(Ptr, Size: Integer): TFontArray;
var
I, J: Integer;
Symbol, Trash: Byte;
Begin
For I := 0 To Size - 1 Do
begin
GLHIteratePointerUInt(Ptr, Result[I].ID);
GLHIteratePointerByte(Ptr, Result[I].R);
GLHIteratePointerByte(Ptr, Result[I].G);
GLHIteratePointerByte(Ptr, Result[I].B);
GLHIteratePointerByte(Ptr, Result[I].A);
Result[I].Colour := RGBToColor(Result[I].R, Result[I].G, Result[I].B);
GLHIteratePointerFloat(Ptr, Result[I].X);
GLHIteratePointerFloat(Ptr, Result[I].Y);
GLHIteratePointerByte(Ptr, Symbol);
Result[I].Symbol := Chr(Symbol);
GLHIteratePointerBool(Ptr, Result[I].Shadow);
GLHIteratePointerByte(Ptr, Trash); //Two bytes of padding required. Char + Boolean = 2 bytes. Total needed = 4. Thus, pad by 2.
GLHIteratePointerByte(Ptr, Trash);
For J := 0 To 2 Do
GLHIteratePointerFloat(Ptr, Result[I].Translate[J]);
For J := 0 To 3 Do
GLHIteratePointerInt(Ptr, Result[I].VX[J]);
For J := 0 To 3 Do
GLHIteratePointerInt(Ptr, Result[I].VY[J]);
For J := 0 To 3 Do
GLHIteratePointerInt(Ptr, Result[I].TX[J]);
For J := 0 To 3 Do
GLHIteratePointerInt(Ptr, Result[I].TY[J]);
end;
End;
Function GLHook_GetAllItems: TPanelArray;
var
Ptr, Size: Integer;
begin
Ptr := GLHGetPanelItems(Size);
SetLength(Result, Size);
Result := GLHook_IterateItems(Ptr, Size);
end;
Function GLHook_GetItemsByID(ID: Integer): TPanelArray;
var
Ptr, Size: Integer;
begin
Ptr := GLHGetItemsByID(ID, Size);
SetLength(Result, Size);
Result := GLHook_IterateItems(Ptr, Size);
end;
Function GLHook_GetItemsByArea(Area: TBox): TPanelArray;
var
Ptr, Size: Integer;
begin
Ptr := GLHGetItemsByArea(Area.X1, Area.Y1, Area.X2, Area.Y2, Size);
SetLength(Result, Size);
Result := GLHook_IterateItems(Ptr, Size);
end;
Function GLHook_GetItemsByMeanID(BaseID, MeanID, Tolerance: Integer): TPanelArray;
var
I, L: Integer;
ListOfItems: TPanelArray;
begin
ListOfItems := GLHook_GetItemsByID(BaseID);
L := High(ListOfItems);
For I := 0 To L Do
If SimilarColors(ListOfItems[I].MeanID, MeanID, Tolerance) Then
begin
SetLength(Result, Length(Result) + 1);
Result[Length(Result) - 1] := ListOfItems[I];
end;
end;
Function GLHook_GetAllModels: TModelArray;
var
Ptr, Size: Integer;
begin
Ptr := GLHGetModels(Size);
SetLength(Result, Size);
Result := GLHook_IterateModels(Ptr, Size);
end;
Function GLHook_GetModelsByID(ID: Cardinal): TModelArray;
var
Ptr, Size: Integer;
begin
Ptr := GLHGetModelsByID(ID, Size);
SetLength(Result, Size);
Result := GLHook_IterateModels(Ptr, Size);
end;
Function GLHook_GetModelsByTriangleCount(Count: Cardinal): TModelArray;
var
Ptr, Size: Integer;
begin
Ptr := GLHGetModelsByTCount(Count, Size);
SetLength(Result, Size);
Result := GLHook_IterateModels(Ptr, Size);
end;
Function GLHook_GetModelsByArea(Area: TBox): TModelArray;
var
Ptr, Size: Integer;
begin
Ptr := GLHGetModelsByArea(Area.X1, Area.Y1, Area.X2, Area.Y2, Size);
SetLength(Result, Size);
Result := GLHook_IterateModels(Ptr, Size);
end;
Function GLHook_GetAllFonts: TFontArray;
var
Ptr, Size: Integer;
begin
Ptr := GLHGetFonts(Size);
SetLength(Result, Size);
Result := GLHook_IterateFonts(Ptr, Size);
end;
Function GLHook_GetFontsByArea(Area: TBox): TFontArray;
var
Ptr, Size: Integer;
begin
Ptr := GLHGetFontsArea(Area.X1, Area.Y1, Area.X2, Area.Y2, Size);
SetLength(Result, Size);
Result := GLHook_IterateFonts(Ptr, Size);
end;
Function GLH_iAbs(I: Integer): Integer;
Begin
Result := I;
If (Result < 0) Then
Result := Result * -1;
End;
Function GLHook_FontsToText1D(var FontArray: TFontArray; Shadow, RecordColours: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TTextColourArray;
var
I, J, K, L, N: Integer;
IX, IY: Integer;
X, Y: Integer;
X2, Y2: Integer;
Text: String;
Store: Boolean;
SameLine, NewLine: Boolean;
Begin
L := High(FontArray);
If (L < 1) Then
Exit;
Store := True;
If (Shadow) Then
Begin
K := 0;
I := 1;
J := 2;
End Else
Begin
K := 0;
I := 0;
J := 1;
End;
SetLength(Result, 1);
For I := I To L Do
Begin
X := Round(FontArray[I].X + FontArray[I].VX[2]);
Y := Round(FontArray[I].Y);
If ((L > 1) And (I <= L)) Then
Begin
X2 := Round(FontArray[I + J].X);
Y2 := Round(FontArray[I + J].Y);
End Else
Begin
X2 := Round(FontArray[I].X);
Y2 := Round(FontArray[I].Y);
End;
Text := Text + FontArray[I].Symbol;
If (X2 - X) >= MinHSpacing Then
Text := Text + ' ';
If Store Then
Begin
IX := Round(FontArray[I].X);
IY := Y - FontArray[I].VY[2];
Store := False;
End;
NewLine := ((GLH_iAbs(Y2 - Y)) >= MinVSpacing);
If (RecordColours And (FontArray[I].Colour <> FontArray[I + J].Colour) And (Not NewLine)) Then
Begin
SetLength(Result[N].Areas, Length(Result[N].Areas) + 1);
SetLength(Result[N].Colours, Length(Result[N].Colours) + 1);
Result[N].Text := Text;
Result[N].Areas[K].X1 := IX;
Result[N].Areas[K].Y1 := IY;
Result[N].Areas[K].X2 := X;
Result[N].Areas[K].Y2 := Y;
Result[N].Colours[K] := FontArray[I].Colour;
Inc(K);
SameLine := True;
End;
If (NewLine) Then
Begin
SetLength(Result[N].Areas, Length(Result[N].Areas) + 1);
SetLength(Result[N].Colours, Length(Result[N].Colours) + 1);
If (Not SameLine) Then K := 0;
Result[N].Text := Text;
Result[N].Areas[K].X1 := Round(FontArray[I].X);
Result[N].Areas[K].Y1 := Y - FontArray[I].VY[2];
Result[N].Areas[K].X2 := X;
Result[N].Areas[K].Y2 := Y;
Result[N].Colours[K] := FontArray[I].Colour;
SetLength(Result, Length(Result) + 1);
Text := '';
K := 0; Inc(N);
Store := True;
SameLine := False;
End;
If Shadow Then Inc(I);
End;
End;
Function GLHook_FontsToText2D(var FontArray: TFontArray; Shadow, RecordColours: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): T2DTextInfoArray;
var
I, J, K, L, N: Integer;
IX, IY: Integer;
X, Y: Integer;
X2, Y2: Integer;
Text: String;
Store: Boolean;
TextInfo: TTextInfoArray;
SameLine, NewLine: Boolean;
Begin
L := High(FontArray);
If (L < 1) Then
Exit;
Store := True;
If (Shadow) Then
Begin
K := 0;
I := 1;
J := 2;
End Else
Begin
K := 0;
I := 0;
J := 1;
End;
For I := I To L Do
Begin
X := Round(FontArray[I].X + FontArray[I].VX[2]);
Y := Round(FontArray[I].Y);
If ((L > 1) And (I <= L)) Then
Begin
X2 := Round(FontArray[I + J].X);
Y2 := Round(FontArray[I + J].Y);
End Else
Begin
X2 := Round(FontArray[I].X);
Y2 := Round(FontArray[I].Y);
End;
Text := Text + FontArray[I].Symbol;
If (X2 - X) >= MinHSpacing Then
Text := Text + ' ';
If Store Then
Begin
IX := Round(FontArray[I].X);
IY := Y - FontArray[I].VY[2];
Store := False;
End;
NewLine := ((GLH_iAbs(Y2 - Y)) >= MinVSpacing);
If (RecordColours And (FontArray[I].Colour <> FontArray[I + J].Colour) And (Not NewLine)) Then //If Different Colours On Line..
Begin //Append The Current Text To The Array..
SetLength(TextInfo, Length(TextInfo) + 1);
TextInfo[K].Text := Text;
TextInfo[K].Area.X1 := IX;
TextInfo[K].Area.Y1 := IY;
TextInfo[K].Area.X2 := X;
TextInfo[K].Area.Y2 := Y;
TextInfo[K].Colour := FontArray[I].Colour;
Inc(K);
Text := ''; //Clear Everything && Start Grabbing The Next Set of Text With A Different Colour.
SameLine := True;
End;
If (NewLine) Then //If There's a New-Line, Append To The Current Text, Push It To The Result, Reset Everything.
Begin
SetLength(TextInfo, Length(TextInfo) + 1);
If (Not SameLine) Then K := 0;
TextInfo[K].Text := Text;
TextInfo[K].Area.X1 := Round(FontArray[I].X);
TextInfo[K].Area.Y1 := Y - FontArray[I].VY[2];
TextInfo[K].Area.X2 := X;
TextInfo[K].Area.Y2 := Y;
TextInfo[K].Colour := FontArray[I].Colour;
SetLength(Result, Length(Result) + 1);
Result[N] := TextInfo; //Each Array Is One Line Of Text With A List Of All Colours.
Text := '';
K := 0; Inc(N);
Store := True;
SameLine := False;
SetLength(TextInfo, 0);
End;
If Shadow Then Inc(I);
End;
End;
Function GLHook_FontsToTextEx(var FontArray: TFontArray; Shadow: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TTextInfoArray;
var
I, J, K, L: Integer;
IX, IY: Integer;
X, Y: Integer;
X2, Y2: Integer;
Text: String;
Store: Boolean;
Begin
L := High(FontArray);
If (L < 1) Then
Exit;
Store := True;
If (Shadow) Then
Begin
K := 0;
I := 1; //Actual Font's Index.. 0 = Font's Shadow Index.
J := 2; //Stride To The Next Font.
End Else
Begin
K := 0;
I := 0;
J := 1;
End;
For I := I To L Do
Begin
X := Round(FontArray[I].X + FontArray[I].VX[2]); //Font Position + Width.
Y := Round(FontArray[I].Y); //Bottom of the Font.
If ((L > 1) And (I <= L)) Then
Begin
X2 := Round(FontArray[I + J].X); //The Next Character's X.
Y2 := Round(FontArray[I + J].Y); //The Next Character's. Y.
End Else
Begin
X2 := Round(FontArray[I].X);
Y2 := Round(FontArray[I].Y);
End;
Text := Text + FontArray[I].Symbol;
If (X2 - X) >= MinHSpacing Then
Text := Text + ' ';
If Store Then
Begin
IX := Round(FontArray[I].X);
IY := Y - FontArray[I].VY[2];
Store := False;
End;
If (GLH_iAbs(Y2 - Y)) >= MinVSpacing Then
Begin
SetLength(Result, Length(Result) + 1);
Result[K].Text := Text;
Result[K].Area.X1 := IX;
Result[K].Area.Y1 := IY;
Result[K].Area.X2 := X;
Result[K].Area.Y2 := Y;
Result[K].Colour := FontArray[I].Colour;
Inc(K);
Text := '';
Store := True;
End;
If Shadow Then Inc(I);
End;
End;
Function GLHook_FontsToTextColours(var FontArray: TFontArray; Shadow, RecordColours: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TTextInfoArray;
var
I, J, K, L: Integer;
IX, IY: Integer;
X, Y: Integer;
X2, Y2: Integer;
Text: String;
Store: Boolean;
OldColour: Integer;
ColourChanged: Boolean;
Begin
L := High(FontArray);
If (L < 1) Then
Exit;
Store := True;
If (Shadow) Then
Begin
K := 0;
I := 1;
J := 2;
End Else
Begin
K := 0;
I := 0;
J := 1;
End;
For I := I To L Do
Begin
X := Round(FontArray[I].X + FontArray[I].VX[2]);
Y := Round(FontArray[I].Y);
If ((L > 1) And (I <= L)) Then
Begin
X2 := Round(FontArray[I + J].X);
Y2 := Round(FontArray[I + J].Y);
End Else
Begin
X2 := Round(FontArray[I].X);
Y2 := Round(FontArray[I].Y);
End;
Text := Text + FontArray[I].Symbol;
If (X2 - X) >= MinHSpacing Then
Text := Text + ' ';
If Store Then
Begin
OldColour := FontArray[I].Colour;
IX := Round(FontArray[I].X);
IY := Y - FontArray[I].VY[2];
Store := False;
End;
If (RecordColours And (FontArray[I + J].Colour <> OldColour)) Then ColourChanged := True;
If (((GLH_iAbs(Y2 - Y)) >= MinVSpacing) Or ColourChanged) Then
Begin
SetLength(Result, Length(Result) + 1);
Result[K].Text := Text;
Result[K].Area.X1 := IX;
Result[K].Area.Y1 := IY;
Result[K].Area.X2 := X;
Result[K].Area.Y2 := Y;
Result[K].Colour := FontArray[I].Colour;
Inc(K);
Text := '';
Store := True;
ColourChanged := False;
End;
If Shadow Then Inc(I);
End;
End;
Function GLHook_FontsToText(var FontArray: TFontArray; Shadow: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TStringArray;
var
I, J, L: Integer;
X, Y: Integer;
X2, Y2: Integer;
Text: String;
Begin
L := High(FontArray);
If (L < 1) Then
Exit;
SetLength(Result, 1);
If (Shadow) Then
Begin
I := 1;
J := 2;
End Else
Begin
I := 0;
J := 1;
End;
For I := I To L Do
Begin
X := Round(FontArray[I].X + FontArray[I].VX[2]);
Y := Round(FontArray[I].Y);
If ((L > 1) And ((I + J) < L)) Then
Begin
X2 := Round(FontArray[I + J].X);
Y2 := Round(FontArray[I + J].Y);
End Else
Begin
X2 := Round(FontArray[I].X);
Y2 := Round(FontArray[I].Y);
End;
Text := Text + FontArray[I].Symbol;
If (X2 - X) >= MinHSpacing Then
Text := Text + ' ';
If (GLH_iAbs(Y2 - Y) >= MinVSpacing) Then
Text := Text + '\n\r';
If Shadow Then I := I + 1;
End;
ExplodeWrap('\n\r', Text, Result);
For I := 0 To High(Result) Do
Result[I] := Trim(Result[I]);
End;
Function PosStrArr(ToFind: String; SearchArray: TStringArray; Var Where: Integer): Boolean;
var
I, H: Integer;
Begin
H := High(SearchArray);
For I := 0 To H Do
If (Pos(LowerCase(ToFind), LowerCase(SearchArray[I])) > 0) Then
Begin
Where := I;
Result := True;
Break;
End;
End;
Function GLHook_CountTextInArea(Area: TBox; Text: String; Shadow: Boolean; MinHSpacing, MinVSpacing: Integer): Integer;
Var
I, J: Integer;
F: TFontArray;
AreaFonts: TStringArray;
Begin
F := GLHook_GetFontsByArea(Area);
AreaFonts := GLHook_FontsToText(F, Shadow, MinHSpacing, MinVSpacing);
For I := 0 To High(AreaFonts) Do
For J := 0 To Length(AreaFonts[I]) Do
If (LowerCase(AreaFonts[I][J]) = LowerCase(Text)) Then
Inc(Result);
End;
Function GLHook_FindTextAreaEx(Area: TBox; Text: TStringArray; Shadow: Boolean; MinHSpacing, MinVSpacing: Integer): Boolean;
var
I, J: Integer;
F: TFontArray;
AreaFonts: TStringArray;
Begin
F := GLHook_GetFontsByArea(Area);
AreaFonts := GLHook_FontsToText(F, Shadow, MinHSpacing, MinVSpacing);
For I := 0 To High(Text) Do
If {InStrArrEx(Text[I], AreaFonts, J) or }PosStrArr(Text[I], AreaFonts, J) Then
Begin
Result := True;
Break;
End;
End;
Function GLHook_FindTextArea(Area: TBox; Text: String; Shadow: Boolean; MinVSpacing: Integer): Boolean;
var
I: Integer;
Begin
For I := 0 To 11 Do
If GLHook_FindTextAreaEx(Area, [Text], Shadow, I, MinVSpacing) Then
Begin
Result := True;
Break;
End;
End;
Also rewrote a large amount of the text recognition for Pascal script and Lape compatibility as well as better accuracy and speed. Speed is always most important to me :) Anyway, the below is 100% flawless.
{* Still a work in progress. This file will make text-recognition 100% flawless as it was before.
It will not error out or throw any errors or go out of range, It's compatible with PASCAL-SCRIPT and LAPE.
It is 10x faster than the current include's font recognition. This removes shadows automatically which speeds up everything.
Shadow Removal makes font finding a singe. Very easy, accurate, customizeable, optional, etc..
This file will also have functions to get the colours of fonts with 100% accuracy and the best possible speed.
This file should need the least amount of updates in the future if any at all!
This File May NOT be Copied, Modified OR Translated for any purposes other than updating the SRL-GLHook Library.
By: Brandon-T.
*}
{$I GLHook/GLHook.Simba}
Function RemoveFontShadows(Fonts: TFontArray): TFontArray; //Reminder: Do on C++ side for maximum speed! Still extremely fast in PS though.
var
I, J, L: Integer;
Begin
L := Length(Fonts);
If (L < 1) Then Exit;
If ((L < 2) or (L mod 2 <> 0)) Then
Begin
Result := Fonts;
Exit;
End;
SetLength(Result, L / 2);
For I := 0 To L - 2 Do
Begin
If (Fonts[I].X - Fonts[I + 1].X = 1) Then
Result[J] := Fonts[I + 1];
Inc(I); Inc(J);
End;
End;
Function FontsToColourTextEx(var Fonts: TFontArray; Shadow: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TTextInfoArray; //Useless? Not sure why I made this but I needed it for something :S
var
I, J, L: Integer;
X, Y: Integer;
IX, IY: Integer;
Text: String;
StoreColour: Boolean;
Begin
If (Shadow) Then
Fonts := RemoveFontShadows(Fonts);
L := High(Fonts);
If (L < 1) Then Exit;
StoreColour := True;
For I := 0 To L Do
Begin
If (L > 1) And (I + 1 <= L) Then
Begin
X := Round(Fonts[I + 1].X - (Fonts[I].X + Fonts[I].VX[2]));
Y := Round(Fonts[I + 1].Y - Fonts[I].Y);
End Else
Begin
X := Round(-Fonts[I].X);
Y := Round(Fonts[I].Y);
End;
Text := Text + Fonts[I].Symbol;
If (X >= MinHSpacing) Then
Text := Text + ' ';
If (StoreColour) Then
Begin
IX := Round(Fonts[I].X);
IY := Round(Y - Fonts[I].VY[2]);
StoreColour := False;
End;
If (iAbs(Y) >= MinVSpacing) Then
Begin
SetLength(Result, Length(Result) + 1);
Result[J].Text := Text;
Result[J].Area.X1 := IX;
Result[J].Area.Y1 := IY;
Result[J].Area.X2 := X;
Result[J].Area.Y2 := Y;
Result[J].Colour := Fonts[I].Colour;
Inc(J);
Text := '';
StoreColour := True;
End;
End;
End;
Function FontsToColourText(var Fonts: TFontArray; Shadow: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TTextInfoArray;
var
I, J, L: Integer;
X, Y: Integer;
X2, Y2: Integer;
IX, IY: Integer;
Colour: Integer;
Text: String;
StoreColour: Boolean;
Begin
If (Shadow) Then
Fonts := RemoveFontShadows(Fonts);
L := High(Fonts);
If (L < 1) Then Exit;
StoreColour := True;
For I := 0 To L Do
Begin
If (Not InRange(Ord(Fonts[I].Symbol), 32, 127)) Then
Begin
Text := Text + ' ';
Continue;
End;
If (L > 1) And (I + 1 <= L) Then
Begin
X := Round(Fonts[I + 1].X - (Fonts[I].X + Fonts[I].VX[2]));
Y := Round(Fonts[I + 1].Y - Fonts[I].Y);
End Else
Begin
X := Round(-Fonts[I].X);
Y := Round(Fonts[I].Y);
End;
Text := Text + Fonts[I].Symbol;
If (X >= MinHSpacing) Then
Text := Text + ' ';
If (StoreColour) Then
Begin
Colour := Fonts[I].Colour;
IX := Round(Fonts[I].X);
IY := Round(Y - Fonts[I].VY[2]);
StoreColour := False;
End;
If ((iAbs(Y) >= MinVSpacing) Or ((I + 1 <= L) And (Fonts[I + 1].Colour <> Colour))) Then
Begin
SetLength(Result, Length(Result) + 1);
Result[J].Text := Text;
Result[J].Area.X1 := IX;
Result[J].Area.Y1 := IY;
Result[J].Area.X2 := X;
Result[J].Area.Y2 := Y;
Result[J].Colour := Fonts[I].Colour;
Inc(J);
Text := '';
StoreColour := True;
End;
End;
End;
Function FontsToText(var Fonts: TFontArray; Shadow: Boolean; MinHSpacing: Integer; MinVSpacing: Integer): TStringArray;
var
I, L: Integer;
X, Y: Integer;
Text: String;
Begin
If (Shadow) Then
Fonts := RemoveFontShadows(Fonts);
L := High(Fonts);
If (L < 1) Then Exit;
For I := 0 To L Do
Begin
If (Not InRange(Ord(Fonts[I].Symbol), 32, 126)) Then
Begin
Text := Text + ' ';
Continue;
End;
If (L > 1) And (I + 1 <= L) Then
Begin
X := Round(Fonts[I + 1].X - (Fonts[I].X + Fonts[I].VX[2]));
Y := Round(Fonts[I + 1].Y - Fonts[I].Y);
End Else
Begin
X := Round(-Fonts[I].X);
Y := Round(Fonts[I].Y);
End;
Text := Text + Fonts[I].Symbol;
If (X >= MinHSpacing) Then
Text := Text + ' ';
If (iAbs(Y) >= MinVSpacing) Then
Text := Text + '\n\r';
End;
ExplodeWrap('\n\r', Text, Result);
For I := 0 To High(Result) Do
Result[I] := Trim(Result[I]);
End;
var
I: Integer;
Fonts: TFontArray;
F: TTextInfoArray;
begin
SetupSRL;
if (Not GLHSetup('2268')) then
begin
Writeln('Failed To Setup GLHook');
TerminateScript;
end;
ClearDebug;
Fonts := GLHook_GetFontsByArea(IntToBox(7, 395, 512, 507));
writeln(FontsToText(Fonts, False, 3, 14));
end.
GLHook now works with pascal. I have to re-write some of the core so that "floats" and "chars" go from C++ to PascalScript properly. I'll do that later. It works for Lape but PS is being stupid. Example is the 2 bytes of padding I had to add manually as show above.
EDIT: Nevermind about the re-writing core.. Phew. Saved me a lot of work lol. Uhh what's happening is Pascal displays them differently from Lape (They're the same numbers though.. such a relief).
Example:
Lape:
[ 275, 206, 0]
[ 274, 205, 0]
[ 282, 206, 0]
[ 281, 205, 0]
[ 289, 206, 0]
[ 288, 205, 0]
[ 295, 206, 0]
[ 294, 205, 0]
[ 301, 206, 0]
[ 300, 205, 0]
[ 310, 206, 0]
[ 309, 205, 0]
[ 317, 206, 0]
[ 316, 205, 0]
[ 323, 206, 0]
[ 322, 205, 0]
[ 330, 206, 0]
[ 329, 205, 0]
Pascal Script:
[ 2.750000000E+02, 2.060000000E+02, 0.000000000E+00]
[ 2.740000000E+02, 2.050000000E+02, 0.000000000E+00]
[ 2.820000000E+02, 2.060000000E+02, 0.000000000E+00]
[ 2.810000000E+02, 2.050000000E+02, 0.000000000E+00]
[ 2.890000000E+02, 2.060000000E+02, 0.000000000E+00]
[ 2.880000000E+02, 2.050000000E+02, 0.000000000E+00]
[ 2.950000000E+02, 2.060000000E+02, 0.000000000E+00]
[ 2.940000000E+02, 2.050000000E+02, 0.000000000E+00]
[ 3.010000000E+02, 2.060000000E+02, 0.000000000E+00]
[ 3.000000000E+02, 2.050000000E+02, 0.000000000E+00]
[ 3.100000000E+02, 2.060000000E+02, 0.000000000E+00]
[ 3.090000000E+02, 2.050000000E+02, 0.000000000E+00]
[ 3.170000000E+02, 2.060000000E+02, 0.000000000E+00]
[ 3.160000000E+02, 2.050000000E+02, 0.000000000E+00]
[ 3.230000000E+02, 2.060000000E+02, 0.000000000E+00]
[ 3.220000000E+02, 2.050000000E+02, 0.000000000E+00]
[ 3.300000000E+02, 2.060000000E+02, 0.000000000E+00]
[ 3.290000000E+02, 2.050000000E+02, 0.000000000E+00]
When my new laptop arrives, I'll continue or write the first OpenGL script to get the ball rolling. Might have to implement that walking idea OR just make it work with SPS. I'll see I guess..
EDIT: I also had to adjust the fonts manually for hanging letters.. This adjusts the drawing on the screen and detection as OpenGL renders hanging letters lower than others..
bool GLHook_IsHangingLetter(GLchar Character)
{
return (Character == 'f' || Character == 'g' || Character == 'j' || Character == 'p' || Character == 'q' || Character == 'y' || Character == '[' || Character == ']');
}
CurrentFontData.ID = it->ID;
CurrentFontData.X = CurrentFontData.Translate[0] + it->Quad.VX[1];
CurrentFontData.Y = CurrentFontData.Translate[1] + it->Quad.VY[1] - (GLHook_IsHangingLetter(it->Symbol - 32) ? 4 : 1);
Link:
https://github.com/Brandon-T/SRL-GLHook
Nice progress, always interesting to read through some code :) What happened to your OpenGL Developer rank? Anyways, looking forward to future updates.

?
Nice work brandon, is there any speed difference with pascal than lape? Also for walking I think you can just work with SPS for now, you could load the 500x500 into sps and im sure sps is accurate enough to work out your location, especially how the 500x500 map is the minimap.
Brandon
2012-12-14 16:15:57
From: Ollybest
?
Nice work brandon, is there any speed difference with pascal than lape? Also for walking I think you can just work with SPS for now, you could load the 500x500 into sps and im sure sps is accurate enough to work out your location, especially how the 500x500 map is the minimap.
Well yeah Lape is a bit faster to code in as it has direct memory access but I made sure that PS would be almost as fast; if not equally fast. I personally believe they're equally fast, just PS is a bit annoying for some features I liked about lape.
I'm not sure if Pascal Script is slower than Lape as I don't see a difference with my eyes but I'm sure there's probably a benchmark difference of such a slight amount; negligible.
What I did was export functions that will give PS direct memory access. It could be dangerous if used improperly just like Lape as there are no restrictions and I don't do out of bounds checking for pointer Iterations.
That'll slow everything down. So anyone actually working directly with the pointer (no one should have to) will have to make sure they're using it right and not stupidly, whether it be in Pascal Or Lape.
This may not be faster, but it sure is cooler in Lape because you can do:
InRange(Ord(Which), Ord(GLE_Eqiupment_Aura), Ord(GLE_Equipment_Ring))
But in PS you do (because the above doesn't work):
var
A, R: GLE_Equipment;
begin
A := GLE_Equipment_Aura;
R := GLE_Equipment_Ring;
InRange(Ord(Which), Ord(A), Ord(R));
end;
Also in Lape you can just do:
writeln(GLHook_FontsToText(GLHook_GetFontsByArea(.....), ........));
But in PS you must make an intermediate variable like:
var
Fonts: TFontArray;
begin
Fonts := GLHook_GetFontsByArea(......);
writeln(GLHook_FontsToText(Fonts, .....));
end;
Other than those slight differences, the speed and ease of use is essentially the same. I do prefer Lape but it's pretty unstabled and I guess it wouldn't hurt at all to have PS as an alternative while Lape gets ready and on track.
To the average GLHook user, they will not notice the speed difference. I noticed it only because I've been working with it for so long already. It's less than a couple milliseconds difference. The font grabbing was the biggest difference which I fixed with the new file (though incomplete).
TLDR;No difference really. Difference is intermediate variable usage. Both use raw memory pointers. Pascal Script is faster compiling though. Atm, Lape takes long to compile but works wonderfully! PS is fast to compile and works wonderfully.
Lape is faster to code in but runs at the same speed as PS as far as I can tell.
Almost three weeks without any posts, how is this coming along Brandon? Did you have some time in the Christmas holiday to work on this? :P Would really like to see this being officially implemented.
xdarkshadowx
2013-01-05 16:29:36
Is this what we call reflection/injection? Cause it looks a helluvalot like the RSbuddy dev mode.
Brandon
2013-01-05 16:33:40
From: J J
Almost three weeks without any posts, how is this coming along Brandon? Did you have some time in the Christmas holiday to work on this? :P Would really like to see this being officially implemented.
Uhh during Christmas, I got a new laptop and worked on my C++x11 Library and theming Smart as well as an Avast Antivirus crack.. I did some OGL 20 days ago according to the Git.. I think I did some recently, just never pushed it.
The last thing I was working on was walking with another SRL-Member called Kasi and some text stuff as well as figuring out when objects are behind a wall.. Which I think I finished (using Depth Buffering value).
Walking.. Well, I have a method.. Was just lazy to write it and debugging is a bit more annoying than before but nothing I can't figure out or do. It's more related to SPS for OpenGL but I think it's far more accurate. I have found no patterns or ways of finding actual player coordinates without ripping the client apart (I didn't check Lists yet).. So I'll stick to the Map thing I got. Also SPS still works :)
The text stuff I was working on was to figure out if text overlap or if text is in a specific interface or behind something.. IE: When the bank is open, stop reading player text from behind the bank interface.. Think I finished it too.
I can't remember lol. The new Codeblocks is out so I'm sorta itching to try new stuffs.. I might work on OGL since I got nothing else to do really..
The include is already fully useable. Yeah, I might have to update stuffs here and there but it's already fully supported for EOC, Fighting, Mining, etc.. This includes the actionbar, equipment, text reading, colour finding, bitmaps, dtm's, smart, player information, fighting, item finding, etc.. Nothing is really holding it back from being used. But I'm waiting on Ben's implementation of the plugin system. That being said, it can all still be used without that as Smart already supports it and updates to smart will not break it. It works in both PascalScript and Lape, so there is no incompatibility issues. I'm not so sure many people are interested in OpenGL stuffs. I think this project is most likely going to end up as a safeguard as I basically through it out there as an Option when the Navbar stuff came out (
http://villavu.com/forum/showthread.php?t=86223)..
@DarkShadow.. No. This is what we call "Interception". There is a post explaining a lot of the grounding code:
http://villavu.com/forum/showthread.php?t=86230And a tutorial on how most of the ground work was coded (I probably changed like 50% of the code since then.. Logic is the same though):
http://villavu.com/forum/showthread.php?t=89645
Le Jingle
2013-01-05 19:53:37
Ah nice work Brandon, I missed that update for pascal script x_x so I think I'll definitely give that a go now :)
Also, something you may or may not have the answer to, is the work on GL-Hook/srl-Gl-hook from the github going in a future simba version? (maybe srl 6 + simba 1.0)
Any who,
cheers,
Lj
xdarkshadowx
2013-01-07 21:34:42
Will individual players have a "hook code"? (sorry I don't know what you call the item ID numbers).
ie. could I use this to make a bot that trades stuff to another account, or even a bot that runs around reporting other botters?
From: xdarkshadowx
Will individual players have a "hook code"? (sorry I don't know what you call the item ID numbers).
ie. could I use this to make a bot that trades stuff to another account, or even a bot that runs around reporting other botters?
No, ID's will have to be acquired directly through RS afaik.
From: Kasi
No, ID's will have to be acquired directly through RS afaik.
I think he was asking if each individual player on RS will have their own ID.
Brandon
2013-01-08 06:06:32
From: xdarkshadowx
Will individual players have a "hook code"? (sorry I don't know what you call the item ID numbers).
ie. could I use this to make a bot that trades stuff to another account, or even a bot that runs around reporting other botters?
You ever used Powerbot or RSBuddy or SRL-Reflection?
Essentially the same thing. The ID's are the Item-ID's and Models. You want to click an item or model, then you invoke GLHook_FindItem and click where the coordinates are. So no, I don't actually give you anything. It's just like regular scripting except it makes life easier.
@Jingle, that's not my decision and I really have no say there. Up to the devs and the big guys.
wantonman
2013-01-08 22:31:39
soo theres a new folder for runescape, its called runescape live or something like that and the bin files are inside it… thats where you put the oglplugin32 right?
also do you need your runescape gfx setting to be on open gl mode?
besides that i tried using oglbot with pascal script and could not get it working… hve not tried lape yet. i hope i can get ogl up an operational, it looks fun.
xdarkshadowx
2013-01-08 23:02:15
From: Brandon
You ever used Powerbot or RSBuddy or SRL-Reflection?
Essentially the same thing. The ID's are the Item-ID's and Models. You want to click an item or model, then you invoke GLHook_FindItem and click where the coordinates are. So no, I don't actually give you anything. It's just like regular scripting except it makes life easier.
@Jingle, that's not my decision and I really have no say there. Up to the devs and the big guys.
Yes I used to code for RSBuddy, thanks :)
wantonman
2013-01-08 23:45:07
totally out of topic but for a non-runescape script; other than runescape theres like neopets… not accelerated gx support… for like 3d mmos atleast .even maple story yet id get 2 bored starting from scratch
alar82
2013-01-10 09:05:34
Cant get it workin, Lape is not compiling for me.
{$I GLHook/trunk/Lape/GLHook.Simba}
var
Colour:String;
begin
writeln('Prayer Level: ' + ToStr(GLH_GetMMLevels(GLE_MMLevel_Health, Green)));
WriteLn('Magic Tab: ' + ToStr(GLH_GameTab(TAB_MAGIC)));
Writeln('Cloak Equiped: ' + ToStr(GLH_ItemEquipped(GLE_Equipment_Cloak)));
end.
Gives error:
Exception in Script: Operator expected at line 462, column 9 in file "C:\Simba\Includes\SRL\SRL\core\gametab.simba"
Interpreter is switched to lape, glhook is updated.
Could someone help me, I dont know what I am doing here:D
Dynamite
2013-01-10 09:24:32
From: alar82
Cant get it workin, Lape is not compiling for me.
{$I GLHook/trunk/Lape/GLHook.Simba}
var
Colour:String;
begin
writeln('Prayer Level: ' + ToStr(GLH_GetMMLevels(GLE_MMLevel_Health, Green)));
WriteLn('Magic Tab: ' + ToStr(GLH_GameTab(TAB_MAGIC)));
Writeln('Cloak Equiped: ' + ToStr(GLH_ItemEquipped(GLE_Equipment_Cloak)));
end.
Gives error:
Exception in Script: Operator expected at line 462, column 9 in file "C:\Simba\Includes\SRL\SRL\core\gametab.simba"
Interpreter is switched to lape, glhook is updated.
Could someone help me, I dont know what I am doing here:D
You need to include SRL
-Boom
Noob King
2013-01-13 06:01:54
From: wantonman
soo theres a new folder for runescape, its called runescape live or something like that and the bin files are inside it… thats where you put the oglplugin32 right?
also do you need your runescape gfx setting to be on open gl mode?
besides that i tried using oglbot with pascal script and could not get it working… hve not tried lape yet. i hope i can get ogl up an operational, it looks fun.
Yes. It would be rather redundant to try and intercept opengl calls if you weren't using opengl. Kinda like trying to score a touchdown while playing basketball.
Dervish
2013-01-14 16:54:37
This may already have been answered but do you think you could isolate a certain model and just not render the rest ?
Brandon
2013-01-14 17:56:00
Yes it's easy. If a specific model ID is NOT being rendered, it can be done through a technique called bottle-necking. Just don't pass it to the pointer function is all. Basically, if a model is rendering and it's not the model you want, just don't pass the parameters to the original function (through the function pointers). Why though?
Dervish
2013-01-23 12:56:29
From: Brandon
Yes it's easy. If a specific model ID is NOT being rendered, it can be done through a technique called bottle-necking. Just don't pass it to the pointer function is all. Basically, if a model is rendering and it's not the model you want, just don't pass the parameters to the original function (through the function pointers). Why though?
Wouldn't that enable us to only have that one model rendered on the screen ? Thus going through the hassle of object finding and such ? Could be very useful for randoms aswell.
From: Dervish
Wouldn't that enable us to only have that one model rendered on the screen ? Thus going through the hassle of object finding and such ? Could be very useful for randoms aswell.
There are no randoms anymore :P
n3ss3s
2013-01-24 16:12:40
From: Dervish
Wouldn't that enable us to only have that one model rendered on the screen ? Thus going through the hassle of object finding and such ? Could be very useful for randoms aswell.
If you're able to only render that model, you most likely have enough information about it to not have to do traditional object finding…
weequ
2013-01-25 08:33:03
Would it be possible with OpenGL hooking to render an object in a different place so that you could for example do actions on objects outside of your main screen? Of course this would be very detectable but not necessarily detected.
n3ss3s
2013-01-25 11:27:24
From: weequ
Would it be possible with OpenGL hooking to render an object in a different place so that you could for example do actions on objects outside of your main screen? Of course this would be very detectable but not necessarily detected.
I think rendering it in a different place wouldn't change the actual object's position, and if you clicked on it and it was rendered e.g in the middle of a road, your character would walk
weequ
2013-01-26 07:46:11
From: n3ss3s
I think rendering it in a different place wouldn't change the actual object's position, and if you clicked on it and it was rendered e.g in the middle of a road, your character would walk
Okay but wouldn't that mean that part of the 3D to 2D coordinate transformation stuff is done on the client without using OpenGL?
n3ss3s
2013-01-27 14:44:45
From: weequ
Okay but wouldn't that mean that part of the 3D to 2D coordinate transformation stuff is done on the client without using OpenGL?
Well now I'm actually not sure, but I'd expect it to be a "one way street", i.e anything done outside of the client won't affect gameplay
weequ
2013-01-27 22:55:18
From: n3ss3s
Well now I'm actually not sure, but I'd expect it to be a "one way street", i.e anything done outside of the client won't affect gameplay
So you mean OpenGL contains like procedures only instead of functions? I don't know but I would imagine it contains some stuff for collision detection etc.
From: weequ
Would it be possible with OpenGL hooking to render an object in a different place so that you could for example do actions on objects outside of your main screen? Of course this would be very detectable but not necessarily detected.
No, Hooking simply intercepts data whilst being undetected, it doesn't touch the kernel which brandon was saying in one of his threads. Also rs is server sided. whatever changes you make (only can be graphical) wont have any effect on what the actual position ie the global position of something, say for example you wanted to move a tree, you do so using your extreme ogl rs related editing code, this would only effect the local position of the tree and not that on the server.
From: weequ
Okay but wouldn't that mean that part of the 3D to 2D coordinate transformation stuff is done on the client without using OpenGL?
nothing is done on the client, OGL handles it; the data is passed onto ogl, depending on the format of the objects they have vertices, normals, texture coords, animations and all that other crap. OGL works with this data and matrices. There are 3 matrices as far as i know, View matrix, Model Matrix, Projection matrix. the view matrix is basically your camera, using rs as an example, the camera moves behind your char. every time you move; your camera moves, therefore every time you move; your View matrix changes. Every model has a model matrix, it represents several things, X, Y, Z positions, and rotations along the X, Y, Z axis, every time a model moves; e.g maybe a npc, it will render a walking animation maybe and the coordinates will change depending on where they have walked to and what plane OGL is rendering to. the projection matrix is probably the most static matrix, it simply just represents how you see the rendered image (you line of view) how wide you can see e.g can we see an angle of more than 160 Degrees (random number) infront of us.
From: weequ
So you mean OpenGL contains like procedures only instead of functions? I don't know but I would imagine it contains some stuff for collision detection etc.
OpenGL also contains functions, we have no need for stuff like collision detection in a rs botting situation really.
Gu3st...
2013-01-28 19:35:04
I think weequ is well aware that the server wont change based on what you tell the client to do… :p
What he is asking is to render something that is not visible in the mainscreen region onto something that is visible, i.e on-top of the inventory so that it can be clicked without being "visible" to the naked eye.
Another question: How much is visible to OpenGL? Does OpenGL only render what is seen, or can we pull information about the whole chunk? i.e count all trees in a chunk and all walls and all height differences and so on?
mormonman
2013-01-28 19:41:23
From: Zyt3x
I think weequ is well aware that the server wont change based on what you tell the client to do… :p
What he is asking is to render something that is not visible in the mainscreen region onto something that is visible, i.e on-top of the inventory so that it can be clicked without being "visible" to the naked eye.
Another question: How much is visible to OpenGL? Does OpenGL only render what is seen, or can we pull information about the whole chunk? i.e count all trees in a chunk and all walls and all height differences and so on?
Im pretty sure its the 104x104 loaded map region for the ground. Not so sure about the distance for objects.
Gu3st...
2013-01-29 04:26:50
Yes, but doesn't OpenGL limit the region of rendering?
From: Zyt3x
I think weequ is well aware that the server wont change based on what you tell the client to do… :p
What he is asking is to render something that is not visible in the mainscreen region onto something that is visible, i.e on-top of the inventory so that it can be clicked without being "visible" to the naked eye.
Another question: How much is visible to OpenGL? Does OpenGL only render what is seen, or can we pull information about the whole chunk? i.e count all trees in a chunk and all walls and all height differences and so on?
Ah i guess i just didnt understand what he was trying to ask. my guess it is would be a set region, afaik when brandon was debugging the rs client, stepping through it, 500x500 maps were being rendered, these were being rendered in pretty perfect condition (no deformities, rotation applied etc). since this is the only information we have it would be valid to say it would be 500x500 or under. you'd have to ask brandon about it as im pretty unsure on exact numbers. anyhow OGL would handle all clipping etc, so it wont project something that isnt in the viewplane. as far as hooking, it should be possible, we should be able to see it using ogl hooking without it being on the screen.
From: mormonman
Im pretty sure its the 104x104 loaded map region for the ground. Not so sure about the distance for objects.
i think 104x104 is the actual size it pulls off the 500x500 map, so this again could be valid.
Method
2013-01-29 10:34:15
From: Kasi
Ah i guess i just didnt understand what he was trying to ask. my guess it is would be a set region, afaik when brandon was debugging the rs client, stepping through it, 500x500 maps were being rendered, these were being rendered in pretty perfect condition (no deformities, rotation applied etc). since this is the only information we have it would be valid to say it would be 500x500 or under. you'd have to ask brandon about it as im pretty unsure on exact numbers. anyhow OGL would handle all clipping etc, so it wont project something that isnt in the viewplane. as far as hooking, it should be possible, we should be able to see it using ogl hooking without it being on the screen.
i think 104x104 is the actual size it pulls off the 500x500 map, so this again could be valid.
I think you guys are talking about different units. The minimap image is 512x512
pixels, but mormonman is right that 104x104
tiles are generally used to create the region the player is in.
From: Method
I think you guys are talking about different units. The minimap image is 512x512 pixels, but mormonman is right that 104x104 tiles are generally used to create the region the player is in.
ah yer sorry :P was 512x512
Gu3st...
2013-01-29 16:56:36
From: Kasi
Ah i guess i just didnt understand what he was trying to ask. my guess it is would be a set region, afaik when brandon was debugging the rs client, stepping through it, 500x500 maps were being rendered, these were being rendered in pretty perfect condition (no deformities, rotation applied etc). since this is the only information we have it would be valid to say it would be 500x500 or under. you'd have to ask brandon about it as im pretty unsure on exact numbers. anyhow OGL would handle all clipping etc, so it wont project something that isnt in the viewplane. as far as hooking, it should be possible, we should be able to see it using ogl hooking without it being on the screen.
What you are talking about is merely the minimap bitmap that opengl rotates (and scales, anti-bot system). The 512x512 pixel bitmap has little to do with the actual objects and OpenGL's functionality to only render what is "has to be rendered" i.e what is actually visible in the mainscreen box.
What I'm asking is if any of those objects outside of that, let's call it "render-box", is accessible to OpenGL hooking/interception.
Objects <> A minimap bitmap
Brandon
2013-01-29 19:18:10
:l Kasi just msg'd me on msn/skype.. Uhh here goes:
OGL has "Many" buffers.. Rougly 8 main ones that I looked at. Didn't use all of them though.
1. VertexBuffer holds all vertices for objects within a specified area.. How large the buffer is, is specified when the client loads.
2. FrameBuffers.. I don't mess with these in the client. I can't see anything useful in them.
3. Pixel Buffers.. Same as FrameBuffer..
4. ColourBuffer.. This COULD be used to detect the colour of every vertex and line of a model in game.. Annoying to do that so I didn't bother. Can care less about colour when I can identify them by ID.
5. IndexBuffer holds an array of indices for use with the VertexBuffer. This isn't really a buffer but rather a pointer to an array of indices.
When the client loads/renders to an area of the screen, it must first pour everything it wants to render into a buffer or generate the required texture.. Once a texture is generated, it will NEVER generate it again until the client restarts or you open the World Map (not sure why world map makes it re-gen).
What you do is create a vector<map<int, uint32>> to hold a list of all texture ID's/Pointers. Every texture that gets generated gets captured..
Generated textures can be used as many times as necessary. Every time it uses a texture, it has to bind it. Look for the bind call and the specified ID parameter. Match the ID with one in the vector to figure out what texture is rendering. Check the vertices to figure out where it renders.
The vector holds a map.. The map is defined as Map<BindParameterID, CheckSum>.. The checksums are calculated onces the textures are generated and paired with the GenID. Everytime a callee binds a texture, it must specify the GenID.. So capturing this call, matching the GenID to the map counterpart will give us the checksum.. The reason this was done was for speed! Rather than re-calculating a checksum every single time for the same item every single time, just do it once and store it.. Why? Because the GenID and the checksum will never change.
This takes out the need for any CPU-Usage capping.. Allows max/very good fps.
2. Maps:
Maps render in 512x512 pixels. The ground you stand on is stored in a vertex buffer and actually has an ID.. Since the ground is fairly large and rendered in chunks, there is no point storing the "Ground's" ID. Carpet ID's, textures rendered on the ground, however is captured and stored.
A 512x512 map is "Multi-Textured" to the minimap area. Figuring out what portions are cropped and squeezed into the minimap texture is done somewhere on the Java side.. I cannot find a pattern.. Either that or I'm blind/pattern blind.
Every time you move, A new map portion of 512x512 is grabbed from a buffer and cropped to the minimap. Determining what portion of a map is grabbed is extremely easy..
Note that the edge of every map has a 4 pixel blur.. Which I noticed that Tribot forgot to crop out in TPS walking.. If cropped, walking can be near (if not) 100% accurate.
Every time you move a single tile, the map will shift in your direction and load that extra tile too. The map will still obviously be 512x512.
Player position (white dot) is rendered on top of the minimap. All minimap icons are then rendered on top of the minimap and a shader/blur is applied to the final product for anti-botting.. Of course, the maps are always grabbed before Icons are even rendered.. Perfect for an OGL version of SPS with more accuracy. Mind you I've looked into a ton of ways of getting player position.. I don't remember how far I got with it though :l Basically I forgot how much OGL/work I put into it. Had something going though.. Maybe Kasi will remember as I worked on it with him before. 100% accuracy will either require 100% perfect calculation or Reflection/Injection. I would do but meh.. Keep it clean. Sure we/someone/iunno will work it out.
3. Models out of bounds.
Models within a very large area ARE stored in the VBO.. Accessing them would require knowing the size of portion of the buffer you want to force render.. Aka triangle count/vertex count. If you know, you can forcefully render objects that are in the distance (outside the clipping region).
What OGL does is: Given a size/vertex count, it reads the VBO using that and a pointer to the beginning of the portion to be rendered. If the model to be rendered is outside the clipping region/viewport/Far sight, it "Clips" the model and does NOT render it.. This doesn't mean that the model isn't in the buffer.. It's just not rendered is all..
I attempted to force render once but it gives "Duplicate" ID's.. messed things up. In other words, without knowing the exact triangle count or size in bytes, forcefully rendering is bad as it can place ID's on invisible objects that's not there! I've seen this happen on Tribot but I don't know why it happens to them..
See here for my explanation on the buffer over read:
https://tribot.org/forums/showthread.php?tid=480&pid=4202I used the wrong terms.. It's reading beyond the length of the buffer, not overflowing.
Couple other bugs I learned from them as well..
So again, yes models off the screen are accessible if you can guarantee the size/triangle count.. other wise it is dangerous to just iterate a given pointer..
How much is visible to OpenGL? Does OpenGL only render what is seen, or can we pull information about the whole chunk? i.e count all trees in a chunk and all walls and all height differences and so on?
All of it.. Well up to a limit that is.. It's not going to put all of runescape into the buffer.. It'll put quite a big portion.. However see above for why it's dangerous to do guess work and pull information for something we know little info about.
Uhh dunno if I missed anything in the explanation.. Hopefully answered all questions. Back to work now :l
Hey @Brandon great work you've really moved forward with this rep++ just had time again to play with this abit more but
while using my test script I noticed a memo I left my self inside saying to ask brandon if its possible to alter the position of the players camera for example zooming out I'm pretty sure its possible and would help with finding objects a lot.
I think runebot was the first to use something like this tho they never used opengl but I think I'm right in guessing this should work in opengl as I know it controls the players camera position right?
From: CRU1Z1N
Hey @Brandon great work you've really moved forward with this rep++ just had time again to play with this abit more but
while using my test script I noticed a memo I left my self inside saying to ask brandon if its possible to alter the position of the players camera for example zooming out I'm pretty sure its possible and would help with finding objects a lot.
I think runebot was the first to use something like this tho they never used opengl but I think I'm right in guessing this should work in opengl as I know it controls the players camera position right?
Finding objects out of your screen wouldn't be a little hacky?
Might get a ban?
From: NKN
Finding objects out of your screen wouldn't be a little hacky?
Might get a ban?
im pretty unsure about how detectable this would be but i've been testing this out myself now so we will see i also found jagex uses a shroud to hide objects out of view tho i can still get a much wider view area before stuff starts becoming invisible.
Here's a picture to show you [ATTACH=CONFIG]19098[/ATTACH] what i mean.
will have a play with this again and see what ideas i can come with for it.
From: CRU1Z1N
im pretty unsure about how detectable this would be but i've been testing this out myself now so we will see i also found jagex uses a shroud to hide objects out of view tho i can still get a much wider view area before stuff starts becoming invisible.
Here's a picture to show you [ATTACH=CONFIG]19098[/ATTACH] what i mean.
will have a play with this again and see what ideas i can come with for it.
Actually, that's how far you can walk, before you get that "Loading" message from switching sections, IIRC?
Daniel
2013-02-11 07:21:38
Detecting objects outside of the camera would very likely not result in a ban.
From: NKN
Actually, that's how far you can walk, before you get that "Loading" message from switching sections, IIRC?
Nope just tried that as i walk towards the shroud more map is revealed i can continue to walk passed the previously visible area a good amount before triggering a new loading area to be loaded so im pretty sure its a kind of shroud jagex has added may'b to prevent such mods to there client.
remember those green dragon bots that used to pick up bones way out of there view area may'b they used something like this is very possible i guess.
Gu3st...
2013-02-11 09:53:38
OpenGL only renders that area because the screen can't view anything more than that, so there is no point in rendering the other parts.
If we can force OpenGL to render the whole chunk, or only render the objects we want, then this would be possible, but it has to be loaded in the memory first anyways, and then we'd have to read RS's memory and so on
Brotein
2013-02-27 20:59:01
I can't get the base script to work. I have everything working, the Function Keys allow me to see the IDs in the client, but if I try to run the script I am left with an error. I am running simba 992(the 1.0 would crash with any script), SRL5, and the current includes are the pascal script ones on PS interpreter.
program new;
{$I GLHook/GLHook.Simba}
var
Colour: String;
begin
writeln('Prayer Level: ' + ToStr(GLH_GetMMLevels(GLE_MMLevel_Prayer, Colour)));
WriteLn('Magic Tab: ' + ToStr(GLH_GameTab(TAB_MAGIC)));
Writeln('Cloak Equiped: ' + ToStr(GLH_ItemEquipped(GLE_Equipment_Cloak)));
end.
I get this error
[Error] D:\Simba\Includes\GLHook/GLCommunication.Simba(70:5): Unknown identifier 'GLHIteratePointerInt' at line 69
Compiling failed.
CynicRus
2013-02-28 06:20:51
From: Brotein
I can't get the base script to work. I have everything working, the Function Keys allow me to see the IDs in the client, but if I try to run the script I am left with an error. I am running simba 992(the 1.0 would crash with any script), SRL5, and the current includes are the pascal script ones on PS interpreter.
program new;
{$I GLHook/GLHook.Simba}
var
Colour: String;
begin
writeln('Prayer Level: ' + ToStr(GLH_GetMMLevels(GLE_MMLevel_Prayer, Colour)));
WriteLn('Magic Tab: ' + ToStr(GLH_GameTab(TAB_MAGIC)));
Writeln('Cloak Equiped: ' + ToStr(GLH_ItemEquipped(GLE_Equipment_Cloak)));
end.
I get this error
[Error] D:\Simba\Includes\GLHook/GLCommunication.Simba(70:5): Unknown identifier 'GLHIteratePointerInt' at line 69
Compiling failed.
Use Lape interpreter for this.
IS this still being worked on?
Zorgatone
2013-03-25 17:52:37
From: RJJ95
IS this still being worked on?
Yeah, is this still working?
From: Zorgatone
Yeah, is this still working?
We shall see:
@Brandon
Brandon
2013-03-25 21:04:25
Yeah it still works :) I tested it two days ago.. I did some updates and stuff to it that I didn't push to git.. Didn't push them because they make no difference.. It was just simple updates to my library that also uses GLHook (well the serialization and imaging stuff anyway) and updates that use "UNICODE" instead of ANSI..
Makes no difference though..
Meh.. but yeah this project still works as always.. I don't think it'd ever break really.. Should work for WebGL if the API's stay the same. If not then I'd make a new hook for that too or possibly a DirectX hook just for fun :l It's just there is little support for this project atm so I haven't really worked on it since months ago..
Zorgatone
2013-03-25 21:07:25
From: Brandon
Yeah it still works :) I tested it two days ago.. I did some updates and stuff to it that I didn't push to git.. Didn't push them because they make no difference.. It was just simple updates to my library that also uses GLHook (well the serialization and imaging stuff anyway) and updates that use "UNICODE" instead of ANSI..
Makes no difference though.. My thing project is a chat client that uses GLHook's libraries:
[ATTACH=CONFIG]20195[/ATTACH]
Meh.. but yeah this project still works as always.. I don't think it'd ever break really.. Should work for WebGL if the API's stay the same. If not then I'd make a new hook for that too. It's just there is little support for it..
what's that image that you've attached? :S
Zorgatone
2013-03-25 23:07:26
Wait.. This is for EoC right? It won't work for 07scape? I'm looking for something to improve oldschool rs accuracy in my scripts..
Does it work for 07? If not is a 07 version planned?
Brandon
2013-04-02 16:49:22
From: Zorgatone
Wait.. This is for EoC right? It won't work for 07scape? I'm looking for something to improve oldschool rs accuracy in my scripts..
Does it work for 07? If not is a 07 version planned?
Sorry for the late-reply/bump..
Yes this plugin works for EOC and not 07.
I planned on an 07 version but 07 doesn't load OpenGL or at least I don't see it loading OpenGL or DirectX at all. I tried all debuggers available and even injected into it myself. It's a no go. If it did, I'd probably have written a plugin already.. In fact, I wrote the plugin already and tried loading it then realized that it doesn't even have HD or OpenGL for 07 so I wasted my time and deleted it :l
My OpenGL/DirectX knowledge is getting pretty rusty fast.. If a WebGL Rs does come out or if the HTML5 version does load it, I'd probably hook it if I'm up for it. I wrote a hook generator for OpenGL hooking already that creates a DLL for you and hooks all calls. Just requires the user to do something with those calls and that's it.
For now.. I have no plans for anything really.. Just reverse engineering random stuff and writing libraries to ease these tasks.
tealc
2013-04-02 18:57:31
tried on two different computers one 64bit the other is 32bit. Got the same errors on both of them any idea what im doing wrong
Exception in Script: Plugin(GLHook32) has not been found //pascal script
Exception in Script: Operator expected at line 453, column 93 in file "C:\Simba\Includes\SRL\SRL\core\gametab.simba" //lape
From: tealc
tried on two different computers one 64bit the other is 32bit. Got the same errors on both of them any idea what im doing wrong
Exception in Script: Plugin(GLHook32) has not been found //pascal script
Exception in Script: Operator expected at line 453, column 93 in file "C:\Simba\Includes\SRL\SRL\core\gametab.simba" //lape
is your interpreter set to lape or pascal script?
tealc
2013-04-02 21:32:56
From: RJJ95
is your interpreter set to lape or pascal script?
i tried both
Exception in Script: Plugin(GLHook32) has not been found //error I get in pascal script
Exception in Script: Operator expected at line 453, column 93 in file "C:\Simba\Includes\SRL\SRL\core\gametab.simba" //error I get in lape
edit:For lape I changed inside glhook.simba from {$include_once SRL/SRL.Simba} -> {$include_once SRL/SRLlape.Simba}
now I get
Exception in Script: Duplicate declaration "GLE_Spell_None" at line 26, column 24 in file "C:\Simba\Includes\GLHook\GLHookIDs.Simba"
if i remove one of the GLE_Spell_None's
i get
Exception in Script: Unknown declaration "GLHook_RemoveFontShadows" at line 328, column 14 in file "C:\Simba\Includes\GLHook\GLCommunication.Simba"
edit2:found the source to the dll's I should be able to figure this out.
Brandon
2013-04-03 00:35:53
From: tealc
i tried both
Exception in Script: Plugin(GLHook32) has not been found //error I get in pascal script
edit2:found the source to the dll's I should be able to figure this out.
I'm only able to reproduce your errors when using Lape. The Lape SRL include is pretty outdated or bad right now. A bunch of missing semi-colons, "Expression is not a valid range", etc.. For these reasons, I made GLHook compatible with both Pascalscript and Lape a while back and well.. I guess it paid off doing the extra work. If the Lape dev's update Lape, GLHook for Lape will work.
The only difference between the Lape one and Pascalscript one is directed at developers because Pascalscript is more lines to code. That's all there is to it. Why? Because most of the core functions are packed into a DLL which is binary and that's always going to be the same speed depending on your system. AND Lape has pointers which requires less work for iterations compared to wrapper functions that I exported for iterating the pointers.
Well for me thats what I get when I load using Lape. So instead I just used the Pascal GLHook32.dll and it works just fine:
tealc
2013-04-03 02:14:42
I figured out the Exception in Script: Plugin(GLHook32) has not been found
now I have [Error] C:\Simba\Includes\GLHook/GLCommunication.Simba(70:5): Unknown identifier 'GLHIteratePointerInt' at line 69
Compiling failed.
Here the text from my dos window.
Setting LastConfig/MainForm/RecentFiles/File10 to
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Setting Extensions/ExtensionCount to 11
Script name will be: ogltest
Current Simba version: 992
Latest Simba Version: 992
Interpreter onChange
[b]ERROR in HandleScriptStartData: Could not convert variant of type (Null) into ty
pe (String)[/b]
Adding Plugin Path: C:\Simba\Plugins\
Adding Plugin Path: C:\Simba\Plugins\
Loading plugin GLHook at C:\Simba\Plugins\
Inter-Process Communication Successful.
Plugin Version:2
Function GLHSetup(ProcessID: String): Boolean
Loading: Function GLHSetup(ProcessID: String): Boolean
Function GLHGetViewPort(var X, Y, Width, Height: Integer): Boolean;
Loading: Function GLHGetViewPort(var X, Y, Width, Height: Integer): Boolean;
Function GLHGetPosition(X, Y: Integer; var WorldX, WorldY, WorldZ: Single): Bool
ean
Loading: Function GLHGetPosition(X, Y: Integer; var WorldX, WorldY, WorldZ: Sing
le): Boolean
Procedure GLHSetClientResizeable(Resizeable: Boolean);
Loading: Procedure GLHSetClientResizeable(Resizeable: Boolean);
Function GLHGetPanelItems(var VectorSize: Integer): Pointer;
Loading: Function GLHGetPanelItems(var VectorSize: Integer): Pointer;
Function GLHGetItemsByID(BaseID: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetItemsByID(BaseID: Integer; var VectorSize: Integer): Poi
nter;
Function GLHGetItemsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Po
inter;
Loading: Function GLHGetItemsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Int
eger): Pointer;
Function GLHGetFonts(var VectorSize: Integer): Pointer;
Loading: Function GLHGetFonts(var VectorSize: Integer): Pointer;
Function GLHGetFontsArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Poin
ter;
Loading: Function GLHGetFontsArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integ
er): Pointer;
Function GLHGetModels(var VectorSize: Integer): Pointer;
Loading: Function GLHGetModels(var VectorSize: Integer): Pointer;
Function GLHGetModelsByID(ID: Cardinal; var VectorSize: Integer): Pointer;
Loading: Function GLHGetModelsByID(ID: Cardinal; var VectorSize: Integer): Point
er;
Function GLHGetModelsByTCount(TriangleCount: Integer; var VectorSize: Integer):
Pointer;
Loading: Function GLHGetModelsByTCount(TriangleCount: Integer; var VectorSize: I
nteger): Pointer;
Function GLHGetModelsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): P
ointer;
Loading: Function GLHGetModelsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: In
teger): Pointer;
Procedure GLHSetDebug(Overlay, DrawAll: Boolean; InfoDisplayed: Integer);
Loading: Procedure GLHSetDebug(Overlay, DrawAll: Boolean; InfoDisplayed: Integer
);
Procedure GLHSaveImages(Enabled: Boolean; Tolerance: Integer);
Loading: Procedure GLHSaveImages(Enabled: Boolean; Tolerance: Integer);
Procedure GLHSetStride(Stride: Integer);
Loading: Procedure GLHSetStride(Stride: Integer);
Procedure GLHCompassAngle(var DegreeAngle, RadianAngle: Single);
Loading: Procedure GLHCompassAngle(var DegreeAngle, RadianAngle: Single);
Procedure GLHEnableFilter(EnableFilter: Boolean; FilterType, ItemType: Integer;
ID: LongWord; R, G, B, A, X1, Y1, X2, Y2: Integer);
Loading: Procedure GLHEnableFilter(EnableFilter: Boolean; FilterType, ItemType:
Integer; ID: LongWord; R, G, B, A, X1, Y1, X2, Y2: Integer);[b]
The DLL "GLHook" doesn't set a memory manager.
Script name will be: GLCommunication
formWriteln: [Error] C:\Simba\Includes\GLHook/GLCommunication.Simba(70:5): Unkno
wn identifier 'GLHIteratePointerInt' at line 69
formWriteln: Compiling failed.[/b]
Zorgatone
2013-04-03 08:40:58
From: Brandon
Sorry for the late-reply/bump..
Yes this plugin works for EOC and not 07.
I planned on an 07 version but 07 doesn't load OpenGL or at least I don't see it loading OpenGL or DirectX at all. I tried all debuggers available and even injected into it myself. It's a no go. If it did, I'd probably have written a plugin already.. In fact, I wrote the plugin already and tried loading it then realized that it doesn't even have HD or OpenGL for 07 so I wasted my time and deleted it :l
My OpenGL/DirectX knowledge is getting pretty rusty fast.. If a WebGL Rs does come out or if the HTML5 version does load it, I'd probably hook it if I'm up for it. I wrote a hook generator for OpenGL hooking already that creates a DLL for you and hooks all calls. Just requires the user to do something with those calls and that's it.
For now.. I have no plans for anything really.. Just reverse engineering random stuff and writing libraries to ease these tasks.
I'm pretty sure that rs07 uses gl because I believe that TRiLeZ's TRiBot uses GlHook..
Brandon
2013-04-03 18:13:44
From: tealc
I figured out the Exception in Script: Plugin(GLHook32) has not been found
now I have [Error] C:\Simba\Includes\GLHook/GLCommunication.Simba(70:5): Unknown identifier 'GLHIteratePointerInt' at line 69
Compiling failed.
Here the text from my dos window.
This is the Lape version. I can tell because of the exports. Notice the return type "Pointer" that is Lape. Pascalscript version of the DLL exports Integers as well as the iteration functions which you do not have in the lape compiled version.
Also since you got the Lape one working as it prints "Shared Memory Mapping Successful", why not just load the Lape include? You already have it working :l Unless of course you want to use the Current SRL with it then Pascalscript version would need to be loaded.
From: Zorgatone
I'm pretty sure that rs07 uses gl because I believe that TRiLeZ's TRiBot uses GlHook..
I'm 100% sure it does NOT use OpenGL. It does not use GLHook either. The only functions it took from GLHook is the item finding algorithm/checksum where it ignores the digits of the item to ensure that all items of the same type have a unique ID that does not change. Probably a couple other ideas or influences. Iunno.
Other than that, Trilez pretty much wrote that from scratch and I'd definitely gives props to that seeing as Tribot has a lot of features and two different clients..
Here's a break down of Tribot's Api007.
The obfuscation of Tribot isn't that great tbh.. You can clearly tell that togl.dll is compiled using MSVC and not fully stripped of all symbols. It's stripped for size and optimized for size. Run it in a OllyDBG or IDA-Pro and you'll see that 007 doesn't even load it.
I wrote my own decompiler for programs that monitor the reference count of a specified DLL as well as all functions called and those within the IAT. I decompile every version of Tribot. Iunno what's the big deal with it being closed source. Everyone can see the source with this obfuscation.. :l
Meh:I'd say PB's obfuscation is harder.
As for Tribot.jar, it is obfuscated using Allatori algorithm (should prob use ZKM :l Tougher for me to read anyway..). Which is probably the worst and easiest to de-ob. Contra's github used to have a tool to de-ob these called JMD which doesn't work anymore since Trilez heavily increased the obfuscation or updated it. Iunno why but meh.. still easy to break and/or read.
No matter, when decompiled, the camera class uses Inject or Reflection to get the pitch yaw and roll of the camera.
The gametab class uses injection/reflection to get gametabs: "Interfaces.getChildren(548)".
Iunno what interface 548 is. Lots of guess work/manual reading since my de-ob needs work :l Or I can prob find a good one after some hours on google. This particular class as well as Projection crashed my program :(
The GroundItems class uses injection/reflection to get a linked-list of all items and iterates it. During iteration, it calls getplanes which is a reflection/injection function that Simba also used to have once upon a time.
Interfaces class is injection/reflection for enumerations of all interfaces. It contains a static master interface function that does this.
Finally, almost everything uses the project class and interface classes.
Nothing in the Api007 uses Colour or OpenGL hooking. The EOC uses Simba functions heavily.. DTM's and stuff. There's some hooks in there using some Native sender/receiver :S I'd imagine that's for JNI or some function that listens for information or does some sort of synchronization.
For the EOC, it uses only some hooks. If I had to guess, I'd say he switched to Microsoft Detours library or used SetWindowsHookEx and exported all his hooks seeing as there is an attach and detach hook :l
Anyone with a brain on Jagex's team would add a IAT/VAD reader to JacLib.dll and kaboom.
Safe:That all being said, its safe I'm sure. I forgot how he keeps these hooks hidden. He mentioned that it is safe last time somewhere on this thread though the structure of togl now looks almost completely different :S. I know no one that got banned from using Tribot so in no way am I putting it down.
Just educating.
I actually used Tribot on my main and didn't get banned.. I think it was the last time he posted on this thread that I had to try it out to see what it was about. I'd use it again. As with all bots, there is a risk a user takes and I'd take that risk for Tribot but Iunno I'm willing to take it on my main seeing that I can read it.. I'm not sure if the game creators can or if it is somehow sandboxed.
tealc
2013-04-04 04:10:12
I didn't notice the pointers in the last post, but I get the same error when it loads the pascal script version. The tribot stuff is interesting. With the lape include I get a endless amount of compile errors. I've tried simba .99 and 1.00, srl 5 and 6, I even tried compiling the dll. Even when I use the lape interpeter on the pascal include it still won't reconize any pointer wrapper functions. This might be probably
ERROR in HandleScriptStartData: Could not convert variant of type (Null) into type (String).
Setting LastConfig/MainForm/RecentFiles/File10 to
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Init procedure successfully called
Setting Extensions/ExtensionCount to 11
ERROR in HandleScriptStartData: Could not convert variant of type (Null) into type (String)
Adding Plugin Path: C:\Simba\Plugins\
Adding Plugin Path: C:\Simba\Plugins\
Current Simba version: 992
Latest Simba Version: 992
Script name will be: ogltest
Loading plugin GLHook at C:\Simba\Plugins\
Inter-Process Communication Successful.
Plugin Version:2
Function GLHSetup(ProcessID: String): Boolean
Loading: Function GLHSetup(ProcessID: String): Boolean
Function GLHGetViewPort(var X, Y, Width, Height: Integer): Boolean;
Loading: Function GLHGetViewPort(var X, Y, Width, Height: Integer): Boolean;
Function GLHGetPosition(X, Y: Integer; var WorldX, WorldY, WorldZ: Single): Boolean
Loading: Function GLHGetPosition(X, Y: Integer; var WorldX, WorldY, WorldZ: Single): Boolean
Procedure GLHSetClientResizeable(Resizeable: Boolean);
Loading: Procedure GLHSetClientResizeable(Resizeable: Boolean);
Function GLHGetPanelItems(var VectorSize: Integer): Pointer;
Loading: Function GLHGetPanelItems(var VectorSize: Integer): Pointer;
Function GLHGetItemsByID(BaseID: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetItemsByID(BaseID: Integer; var VectorSize: Integer): Pointer;
Function GLHGetItemsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetItemsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Function GLHGetFonts(var VectorSize: Integer): Pointer;
Loading: Function GLHGetFonts(var VectorSize: Integer): Pointer;
Function GLHGetFontsArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetFontsArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Function GLHGetModels(var VectorSize: Integer): Pointer;
Loading: Function GLHGetModels(var VectorSize: Integer): Pointer;
Function GLHGetModelsByID(ID: Cardinal; var VectorSize: Integer): Pointer;
Loading: Function GLHGetModelsByID(ID: Cardinal; var VectorSize: Integer): Pointer;
Function GLHGetModelsByTCount(TriangleCount: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetModelsByTCount(TriangleCount: Integer; var VectorSize: Integer): Pointer;
Function GLHGetModelsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetModelsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Procedure GLHSetDebug(Overlay, DrawAll: Boolean; InfoDisplayed: Integer);
Loading: Procedure GLHSetDebug(Overlay, DrawAll: Boolean; InfoDisplayed: Integer);
Procedure GLHSaveImages(Enabled: Boolean; Tolerance: Integer);
Loading: Procedure GLHSaveImages(Enabled: Boolean; Tolerance: Integer);
Procedure GLHSetStride(Stride: Integer);
Loading: Procedure GLHSetStride(Stride: Integer);
Procedure GLHCompassAngle(var DegreeAngle, RadianAngle: Single);
Loading: Procedure GLHCompassAngle(var DegreeAngle, RadianAngle: Single);
Procedure GLHEnableFilter(EnableFilter: Boolean; FilterType, ItemType: Integer; ID: LongWord; R, G, B, A, X1, Y1, X2, Y2: Integer)
;
Loading: Procedure GLHEnableFilter(EnableFilter: Boolean; FilterType, ItemType: Integer; ID: LongWord; R, G, B, A, X1, Y1, X2, Y2:
Integer);
ERROR in HandleScriptStartData: Could not convert variant of type (Null) into type (String)
Plugin GLHook already loaded: 0
The DLL "GLHook" doesn't set a memory manager.
Script name will be: GLCommunication
formWriteln: [Error] C:\Simba\Includes\GLHook/GLCommunication.Simba(76:5): Unknown identifier 'GLHIteratePointerInt' at line 75
formWriteln: Compiling failed.
[/
Brandon
2013-04-04 15:18:26
From: tealc
I didn't notice the pointers in the last post, but I get the same error when it loads the pascal script version.
Function GLHGetPanelItems(var VectorSize: Integer): Pointer;
Loading: Function GLHGetPanelItems(var VectorSize: Integer): Pointer;
Function GLHGetItemsByID(BaseID: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetItemsByID(BaseID: Integer; var VectorSize: Integer): Pointer;
Function GLHGetItemsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetItemsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Function GLHGetFonts(var VectorSize: Integer): Pointer;
Loading: Function GLHGetFonts(var VectorSize: Integer): Pointer;
Function GLHGetFontsArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetFontsArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Function GLHGetModels(var VectorSize: Integer): Pointer;
Loading: Function GLHGetModels(var VectorSize: Integer): Pointer;
Function GLHGetModelsByID(ID: Cardinal; var VectorSize: Integer): Pointer;
Loading: Function GLHGetModelsByID(ID: Cardinal; var VectorSize: Integer): Pointer;
Function GLHGetModelsByTCount(TriangleCount: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetModelsByTCount(TriangleCount: Integer; var VectorSize: Integer): Pointer;
Function GLHGetModelsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
Loading: Function GLHGetModelsByArea(X1, Y1, X2, Y2: Integer; var VectorSize: Integer): Pointer;
You're still using the Lape one.. Here is my plugins folder: [ATTACH]20510[/ATTACH]
Just take what you need from it or else add PASCALSCRIPT to your compiler
#defines so that you can compile it yourself.. My layout looks like:
Zorgatone
2013-04-06 14:25:15
From: Brandon
This is the Lape version. I can tell because of the exports. Notice the return type "Pointer" that is Lape. Pascalscript version of the DLL exports Integers as well as the iteration functions which you do not have in the lape compiled version.
Also since you got the Lape one working as it prints "Shared Memory Mapping Successful", why not just load the Lape include? You already have it working :l Unless of course you want to use the Current SRL with it then Pascalscript version would need to be loaded.
I'm 100% sure it does NOT use OpenGL. It does not use GLHook either. The only functions it took from GLHook is the item finding algorithm/checksum where it ignores the digits of the item to ensure that all items of the same type have a unique ID that does not change. Probably a couple other ideas or influences. Iunno.
Other than that, Trilez pretty much wrote that from scratch and I'd definitely gives props to that seeing as Tribot has a lot of features and two different clients..
Here's a break down of Tribot's Api007.
The obfuscation of Tribot isn't that great tbh.. You can clearly tell that togl.dll is compiled using MSVC and not fully stripped of all symbols. It's stripped for size and optimized for size. Run it in a OllyDBG or IDA-Pro and you'll see that 007 doesn't even load it.
I wrote my own decompiler for programs that monitor the reference count of a specified DLL as well as all functions called and those within the IAT. I decompile every version of Tribot. Iunno what's the big deal with it being closed source. Everyone can see the source with this obfuscation.. :l
Meh:
I'd say PB's obfuscation is harder.
As for Tribot.jar, it is obfuscated using Allatori algorithm (should prob use ZKM :l Tougher for me to read anyway..). Which is probably the worst and easiest to de-ob. Contra's github used to have a tool to de-ob these called JMD which doesn't work anymore since Trilez heavily increased the obfuscation or updated it. Iunno why but meh.. still easy to break and/or read.
No matter, when decompiled, the camera class uses Inject or Reflection to get the pitch yaw and roll of the camera.
The gametab class uses injection/reflection to get gametabs: "Interfaces.getChildren(548)".
Iunno what interface 548 is. Lots of guess work/manual reading since my de-ob needs work :l Or I can prob find a good one after some hours on google. This particular class as well as Projection crashed my program :(
The GroundItems class uses injection/reflection to get a linked-list of all items and iterates it. During iteration, it calls getplanes which is a reflection/injection function that Simba also used to have once upon a time.
Interfaces class is injection/reflection for enumerations of all interfaces. It contains a static master interface function that does this.
Finally, almost everything uses the project class and interface classes.
Nothing in the Api007 uses Colour or OpenGL hooking. The EOC uses Simba functions heavily.. DTM's and stuff. There's some hooks in there using some Native sender/receiver :S I'd imagine that's for JNI or some function that listens for information or does some sort of synchronization.
For the EOC, it uses only some hooks. If I had to guess, I'd say he switched to Microsoft Detours library or used SetWindowsHookEx and exported all his hooks seeing as there is an attach and detach hook :l
Anyone with a brain on Jagex's team would add a IAT/VAD reader to JacLib.dll and kaboom.
Safe:
That all being said, its safe I'm sure. I forgot how he keeps these hooks hidden. He mentioned that it is safe last time somewhere on this thread though the structure of togl now looks almost completely different :S. I know no one that got banned from using Tribot so in no way am I putting it down.
Just educating.
I actually used Tribot on my main and didn't get banned.. I think it was the last time he posted on this thread that I had to try it out to see what it was about. I'd use it again. As with all bots, there is a risk a user takes and I'd take that risk for Tribot but Iunno I'm willing to take it on my main seeing that I can read it.. I'm not sure if the game creators can or if it is somehow sandboxed.
Do you have Skype? I'm definitely interested in talking some more about this..
MY Skype ID is: Zorgatone
Zorgatone
2013-04-06 14:28:19
From: Brandon
This is the Lape version. I can tell because of the exports. Notice the return type "Pointer" that is Lape. Pascalscript version of the DLL exports Integers as well as the iteration functions which you do not have in the lape compiled version.
Also since you got the Lape one working as it prints "Shared Memory Mapping Successful", why not just load the Lape include? You already have it working :l Unless of course you want to use the Current SRL with it then Pascalscript version would need to be loaded.
I'm 100% sure it does NOT use OpenGL. It does not use GLHook either. The only functions it took from GLHook is the item finding algorithm/checksum where it ignores the digits of the item to ensure that all items of the same type have a unique ID that does not change. Probably a couple other ideas or influences. Iunno.
Other than that, Trilez pretty much wrote that from scratch and I'd definitely gives props to that seeing as Tribot has a lot of features and two different clients..
Here's a break down of Tribot's Api007.
The obfuscation of Tribot isn't that great tbh.. You can clearly tell that togl.dll is compiled using MSVC and not fully stripped of all symbols. It's stripped for size and optimized for size. Run it in a OllyDBG or IDA-Pro and you'll see that 007 doesn't even load it.
I wrote my own decompiler for programs that monitor the reference count of a specified DLL as well as all functions called and those within the IAT. I decompile every version of Tribot. Iunno what's the big deal with it being closed source. Everyone can see the source with this obfuscation.. :l
Meh:
I'd say PB's obfuscation is harder.
As for Tribot.jar, it is obfuscated using Allatori algorithm (should prob use ZKM :l Tougher for me to read anyway..). Which is probably the worst and easiest to de-ob. Contra's github used to have a tool to de-ob these called JMD which doesn't work anymore since Trilez heavily increased the obfuscation or updated it. Iunno why but meh.. still easy to break and/or read.
No matter, when decompiled, the camera class uses Inject or Reflection to get the pitch yaw and roll of the camera.
The gametab class uses injection/reflection to get gametabs: "Interfaces.getChildren(548)".
Iunno what interface 548 is. Lots of guess work/manual reading since my de-ob needs work :l Or I can prob find a good one after some hours on google. This particular class as well as Projection crashed my program :(
The GroundItems class uses injection/reflection to get a linked-list of all items and iterates it. During iteration, it calls getplanes which is a reflection/injection function that Simba also used to have once upon a time.
Interfaces class is injection/reflection for enumerations of all interfaces. It contains a static master interface function that does this.
Finally, almost everything uses the project class and interface classes.
Nothing in the Api007 uses Colour or OpenGL hooking. The EOC uses Simba functions heavily.. DTM's and stuff. There's some hooks in there using some Native sender/receiver :S I'd imagine that's for JNI or some function that listens for information or does some sort of synchronization.
For the EOC, it uses only some hooks. If I had to guess, I'd say he switched to Microsoft Detours library or used SetWindowsHookEx and exported all his hooks seeing as there is an attach and detach hook :l
Anyone with a brain on Jagex's team would add a IAT/VAD reader to JacLib.dll and kaboom.
Safe:
That all being said, its safe I'm sure. I forgot how he keeps these hooks hidden. He mentioned that it is safe last time somewhere on this thread though the structure of togl now looks almost completely different :S. I know no one that got banned from using Tribot so in no way am I putting it down.
Just educating.
I actually used Tribot on my main and didn't get banned.. I think it was the last time he posted on this thread that I had to try it out to see what it was about. I'd use it again. As with all bots, there is a risk a user takes and I'd take that risk for Tribot but Iunno I'm willing to take it on my main seeing that I can read it.. I'm not sure if the game creators can or if it is somehow sandboxed.
What about vInsert then? I know it's even easier to decompile since I've got the full deobf code
Zorgatone
2013-04-06 22:52:40
From: J J
Can also check the source on Github.. https://github.com/vInsertOfficial/vInsert
Actually I didn't even know that was opensource
@Brandon
Hey, this may be a long shot but because your SMART edit's etc make it very easy for a noob to use this, is it possible that you can add "hook?" the "outline" of the model? Why this would be nice? could click anywhere on the model, and more importantly you can use it to detect animation somewhat, you can easy compare the models outline to lets say a static model outline if that makes any sense.
Thanks :)
e: Is it also easily possible to grab the map loaded?
Brandon
2013-06-03 13:08:33
From: Ollybest
@Brandon
Hey, this may be a long shot but because your SMART edit's etc make it very easy for a noob to use this, is it possible that you can add "hook?" the "outline" of the model? Why this would be nice? could click anywhere on the model, and more importantly you can use it to detect animation somewhat, you can easy compare the models outline to lets say a static model outline if that makes any sense.
Thanks :)
e: Is it also easily possible to grab the map loaded?
Here is my ultra super duper late reply as I don't check this thread too often at all.. Plus I'm re-writing the DLL to make the API cleaner and easier and documented.. I forgot a ton of what each function does and OpenGL API is something I haven't touched in ages.. Practically refreshing myself brain.
Yes to both. I believe I've showed the map before? And I mentioned working on walking before (with Kasi) as well but I gave up on the walking because it was a lot of work to do by myself and really really hard + maintain a Simba include in both Lape and PS.
Anyway, you can enable Buffer hooks (I showed it last time on this thread on the same page as Trilez's post) if you like but I warn you of the LAG you're going to get if you decide to draw it on screen:
Removing ID's and textures to lag less:

Using partial hook (no floors/tiles or tree leaves and all stuff like the above but various modes):



So many points on just one model.. I drew them using *'s so its easier to see.. I think my projection of the points are a tiny bit off though but yeah.. If I were to do this, transferring that Data to Simba would probably not be pretty and I'd question if Simba would even be able to handle all of it at once seeing as we're still using Pascal Script. I'd also have to make an wrapper-iterator for PascalScript so that it can iterate the Pointer to all those points.
It's why I held off on OGL updates so long because Lape isn't ready and the official Smart was never pushed/ready.
From: Brandon
It's why I held off on OGL updates so long because Lape isn't ready and the official Smart was never pushed/ready.
IMO you should just ditch pascalscript, lape is coming along nicely and is getting closer and closer to being Simba's default interpreter.
And i was more speaking of something like this
post (the picture, returning it as a TPA for a certain id).