From: weequ
I knew javascript bots would come with html5 update but the progress have just been really slow so far. I'm going to take a course on javascript in the next period so maybe html5 client hacking could teach me something… Good job, looks interesting.
Iunno what I can do to help you and I really hate js.. However I do have the following and you should note that not all of them are 100% correct. I just skimmed through the deminified js pretty quickly..
You might find it useful, you might find it useless :( but here goes:
var q = function(M, L) <--- ModelView Matrix. Copies Matrix M to Matrix L.
//------------------------------------------------------------
var x = function(L) <--- Creates Identity Matrix:
[1, 0, 0, 0]
[0, 1, 0, 0]
[0, 0, 1, 0]
[0, 0, 0, 1]
//------------------------------------------------------------
var p = function(Z) <--- Seems to be finding inverse of a specified matrix? :S
//------------------------------------------------------------
var K = function(M, L) <--- Copies Matrix M to L and sets the eye position to 0, 0, 0, 1.
//------------------------------------------------------------
var d = function(L) <--- Simply returns the Matrix L as a string comma delimited.
//------------------------------------------------------------
a.prototype._bi = function(r) <--- Loads the vertex shader and fragment shader, compiles/links to it, and deletes/frees the allocated memory.
<--- It then goes on to get the uniform variable location specified by i.name and its attribute.
//------------------------------------------------------------
var lg = function() <--- The source-code of a shader (usual language is GLSL). Returns the source as a string for loading later.
//------------------------------------------------------------
var vv = function() <--- The source-code of a shader (usual language is GLSL). Returns the source as a string for loading later.
---ALL shaders have \n and \t's written into them within quotes--- This is how you identify them. Some are fragment shaders, others are vertex and geometric shaders.'
---ALL shaders are written in GLSL a C-Style language for shaders---
//-----------------------------------------------------------
var rz = function() <--- Not sure if this is unicode UTF8 to UTF16 conversion but it really seems like it or some sort of string encryption/decryption.
<--- I believe this function has something to do with rendering Bitmap fonts along with: var u = function(P, K, S).
//-----------------------------------------------------------
var ph = function() <--- Definitely a fragment shader and it is definitely written in GLSL - Standard most used shading language (very much like C/C++).
<--- Because of this, I believe all the shaders are written in GLSL because you cannot write shaders in two different languages for OGL (HLSL + GLSL).
//-----------------------------------------------------------
var byl = function() <--- Seems to be rendering fonts. Similar to OpenGLs display list fonts. Note: a bitmap-font/display-list font can only have 256 characters.
//-----------------------------------------------------------
var jg = function(a) <--- Switching languages/encoding.
//-----------------------------------------------------------
var gm = function() <--- Creates and removes mouselisteners (i think).
//-----------------------------------------------------------
var brs = function() <--- Initialization function. Checks if WebGL is supported, instantiates a canvas, some textures and buffers (vertex, frame, etc..)
//-----------------------------------------------------------
y.webGL = function(P) <--- Part of the initialisation function. This is the function that initializes the game. Think of this as "Main" as it initialises all texture
required for loading the game successfully, all shaders, buffers, and variables necessary for running. Also sets up the matrices, storage,
audio, etc..
//------------------------------------------------------------
var blg = function() <--- Sets up caching.
//------------------------------------------------------------
r = ax.getElementById("gamefps"); <--- I believe this retrieves FPS. I''m not 100% sure yet though.
//------------------------------------------------------------
var cr = function() <--- I believe this is the "LinkedList" constructor function.
//------------------------------------------------------------
var bdm = function() <--- Renders a model.
Info:
p.gl.bindBuffer(p.gl.ARRAY_BUFFER, c); <--- binds a vertex buffer with the ID#: c.
p.gl.bufferData(p.gl.ARRAY_BUFFER, r, p.gl.STATIC_DRAW); <--- r is the sizeof the vertex buffer in bytes.
p.gl.bindBuffer(p.gl.ELEMENT_ARRAY_BUFFER, b); <--- binds an index buffer with the ID#: b.
p.gl.bufferData(p.gl.ELEMENT_ARRAY_BUFFER, h, p.gl.STATIC_DRAW); <--- h is the sizeof the index buffer in bytes.
//If rendering a buffer, do NOT forget to use the stride to get each vertex as specified index + stride offset.
n.gl.vertexAttribPointer(A._ten(bqn._dnh.id), 2, n.gl.FLOAT, false, 16, 8); <--- set the vertex pointer as well as the stride and type of vertices (float).
n.gl.drawElements(n.gl.TRIANGLES, 6, n.gl.UNSIGNED_SHORT, 0) <--- Draw a model. A call to drawElements always means a model is being rendered.
gl.readPixels <--- A call to this function means you can simply pass the colour buffer to Simba. The current plugin does this and supplies the Smart buffer.
var D = p.bindTexture(vy._gnk, A._esu(), p.gl.TEXTURE_2D); <--- Binds a texture. Usually binding a texture means that the next couple calls are either going to shade it or immediately draw it to the screen.
d.texImage2D(d.TEXTURE_CUBE_MAP_POSITIVE_X + c, 0, d.RGBA, this.width, this.height, 0, d.RGBA, d.UNSIGNED_BYTE, b) <--- A texture''s info. The buffer containing the textre as well as the width and height and encoding.
//------------------------------------------------------------
var x = function(O, I, H, R, A, E, G, D, Q) <--- seems extremely similar to projection of a point to the screen via gluProject/gluUnProject. Then again,
it really seems to just be setting the viewing area/frustrum/clipping area.
//------------------------------------------------------------
var p = function(C, B) <--- Normalizes a vector C and stores the result in B as well as returns the result.
//------------------------------------------------------------
var bxi = function() <--- Class for decoding and encoding audio.
var bzo = function() <--- Class for audio playback (I think).
//------------------------------------------------------------
var bch = { //Seems like an Enum of some sort. Might be useful.
_kdp: kh._pqj("SFX_SUB"),
_nch: kh._pqj("MUSIC_SUB"),
_nci: kh._pqj("DIALOG_SUB"),
_ncj: kh._pqj("PLAYER_ANIMATION_SUB"),
_nck: kh._pqj("NPC_ANIMATION_SUB"),
_ncm: kh._pqj("LOCATION_ANIMATION_SUB"),
_ncn: kh._pqj("GENERAL_ANIMATION_SUB"),
_nco: kh._pqj("LOCATIONS_SUB"),
_ncq: kh._pqj("LOCATION_RANDOM_SUB"),
_ncr: kh._pqj("LOCATION_GENERIC_SUB")
};
var vh = {
_vmj: kh._pqj("MASTER"),
_vml: kh._pqj("SFX"),
_vmm: kh._pqj("MUSIC"),
_vmo: kh._pqj("MUSIC_LOGIN"),
_vmp: kh._pqj("AMBIENT"),
_vmq: kh._pqj("VOICEOVER")
};
//----------------------------------------------------------
b.prototype.toString = function() { <--- Not sure yet..
return "(x: " + this.x + ", z: " + this._bnf + ", level: " + this.level + ")"
};
//----------------------------------------------------------
var m = d.clientParameters._umb.value._tqu + ".com"; <--- Loads the client. Altogether, I believe it translates to: [url]https://runescape.com/l=LanguageID[/url]
var o = k ? "https://" : "http://";
return o + n + "." + m + "/l=" + d.clientParameters._uml.value.id + "/a=" + d.clientParameters._umm.value + p + "/"
//----------------------------------------------------------
var bdf = function(a) <--- Allows the user to specify which game they want to load. Runecape, Transformers, StellarDawn, etc..
//----------------------------------------------------------
var bsm = function() <--- Sets ALL the strings used for EVERY interface in the game (including right-clicks, etc..). Can be used to identify text on screen/interfaces or simply eliminate some variables from the obfuscated code.
Very SMALL!! example (source-code):
var aO = [];
aO[jg._vaf.id] = "This is the developer console. To close, press the ALT-`, ALT-\xb2 or ALT-\xa7 keys on your keyboard.";
aO[jg._vai.id] = "Das ist die Entwicklerkonsole. Zum Schlie\xdfen, die Tasten ALT+`, ALT+\xb2 oder ALT+\xa7 dr\xfccken.";
aO[jg._vaj.id] = "Ceci est la console de d\xe9veloppement. Pour la fermer, appuyez sur les touches ALT+`, ALT+\xb2 ou ALT+\xa7.";
aO[jg._vam.id] = "Este \xe9 o painel de controle do desenvolvedor. Para fechar, pressione ALT-`, ALT-\xb2 ou ALT-\xa7.";
aO[jg._vat.id] = "Esta es la consola de desarrolador. Para cerrarla, pulsa las teclas ALT-`, ALT-\xb2 or ALT-\xa7 en tu teclado.";
var cu = [];
cu[jg._vaf.id] = "The developer console can be accessed with ALT-`, ALT-\xa7 or ALT-\xb2.";
cu[jg._vai.id] = "Die Entwicklerkonsole kann mit ALT+`, ALT+\xa7 oder ALT+\xb2 aktiviert werden.";
cu[jg._vaj.id] = "La console de d\xe9veloppement est accessible gr\xe2ce aux touches ALT+`, ALT+\xa7 ou ALT+\xb2.";
cu[jg._vam.id] = "O painel de controle do desenvolvedor pode ser acessado com ALT-`, ALT-\xa7 ou ALT-\xb2.";
cu[jg._vat.id] = "Puedes acceder a la consola de desarrollador con ALT-`, ALT-\xa7 o ALT-\xb2.";
var bF = [];
bF[jg._vaf.id] = "There was an error executing the command.";
bF[jg._vai.id] = "Es gab einen Fehler beim Ausf\xfchren des Befehls.";
bF[jg._vaj.id] = "Une erreur s'est produite lors de l'ex\xe9cution de la commande.";
bF[jg._vam.id] = "Houve um erro quando o comando foi executado.";
bF[jg._vat.id] = "Se produjo un error al ejecutar el comando.";
var aG = [];
aG[jg._vaf.id] = "Unknown developer command: ";
aG[jg._vai.id] = "Unbekannter Befehl: ";
aG[jg._vaj.id] = "Commande inconnue : ";
aG[jg._vam.id] = "Comando desconhecido: ";
aG[jg._vat.id] = "Comando desconocido: ";
var p = [];
p[jg._vaf.id] = "Cancel";
p[jg._vai.id] = "Abbrechen";
p[jg._vaj.id] = "Annuler";
p[jg._vam.id] = "Cancelar";
p[jg._vat.id] = "Cancelar";
var t = [];
t[jg._vaf.id] = "#Player";
t[jg._vai.id] = "#Spieler";
t[jg._vaj.id] = "#Joueur";
t[jg._vam.id] = "#Jogador";
t[jg._vat.id] = "#Jugador";
var s = [];
s[jg._vaf.id] = "Login to a members' server to use this object.";
s[jg._vai.id] = "Du musst auf einer Mitglieder-Welt sein, um diesen Gegenstand zu benutzen.";
s[jg._vaj.id] = "Connectez-vous \xe0 un serveur d'abonn\xe9s pour utiliser cet objet.";
s[jg._vam.id] = "Acesse um servidor para membros para usar este objeto.";
s[jg._vat.id] = "Accede a un servidor para miembros para usar este objeto.";
var aE = [];
aE[jg._vaf.id] = "Swap this note at any bank for the equivalent item.";
aE[jg._vai.id] = "Dieses Zertifikat kann in einer Bank entsprechend eingetauscht werden.";
aE[jg._vaj.id] = "\xc9changez ce re\xe7u contre l'objet correspondant dans la banque de votre choix.";
aE[jg._vam.id] = "V\xe1 a qualquer banco para trocar esta nota pelo objeto equivalente.";
aE[jg._vat.id] = "Cambia este vale en cualquier banco por el objeto equivalente.";
var a6 = [];
a6[jg._vaf.id] = "Discard";
a6[jg._vai.id] = "Ablegen";
a6[jg._vaj.id] = "Jeter";
a6[jg._vam.id] = "Descartar";
a6[jg._vat.id] = "Descartar";
var m = [];
m[jg._vaf.id] = "Discard";
m[jg._vai.id] = "Ablegen";
m[jg._vaj.id] = "Jeter";
m[jg._vam.id] = "Descartar";
m[jg._vat.id] = "Descartar";
var b1 = [];
b1[jg._vaf.id] = "Take";
b1[jg._vai.id] = "Nehmen";
b1[jg._vaj.id] = "Prendre";
b1[jg._vam.id] = "Pegar";
b1[jg._vat.id] = "Agarrar";
var cs = [];
cs[jg._vaf.id] = "Drop";
cs[jg._vai.id] = "Fallen lassen";
cs[jg._vaj.id] = "Poser";
cs[jg._vam.id] = "Largar";
cs[jg._vat.id] = "Dejar";
var bk = [];
bk[jg._vaf.id] = "Ok";
bk[jg._vai.id] = "Okay";
bk[jg._vaj.id] = "OK";
bk[jg._vam.id] = "Ok";
bk[jg._vat.id] = "OK";
var bY = [];
bY[jg._vaf.id] = "Select";
bY[jg._vai.id] = "Ausw\xe4hlen";
bY[jg._vaj.id] = "S\xe9lectionner";
bY[jg._vam.id] = "Selecionar";
bY[jg._vat.id] = "Seleccionar";
var cg = [];
cg[jg._vaf.id] = "Continue";
cg[jg._vai.id] = "Weiter";
cg[jg._vaj.id] = "Continuer";
cg[jg._vam.id] = "Continuar";
cg[jg._vat.id] = "Continuar";
//Code actually continues. Simply finding the function above will allow you to view ALL the variables containing text.
//----------------------------------------------------------------------------------
g.getWorldPosition = function(t, v) <--- Returns position of t within the world and stores it in v.
//----------------------------------------------------------------------------------
var dn = function() <--- Overhead icons: Prayer Icon, Skulled-Player Icon, etc..
//-----------------------------------------------------------------------------------
Example of a model being rendered using the a shader (most likely vertex shader).
S.gl.bindBuffer(S.gl.ARRAY_BUFFER, R._gcs);
S.gl.bindBuffer(S.gl.ELEMENT_ARRAY_BUFFER, R._gct);
S.gl.uniformMatrix4fv(M._tek(bqn._dfj.id), false, O);
S.gl.vertexAttribPointer(M._ten(bqn._dmw.id), 2, S.gl.FLOAT, false, 16, 0);
S.gl.vertexAttribPointer(M._ten(bqn._dnh.id), 2, S.gl.FLOAT, false, 16, 8);
S.gl.drawElements(S.gl.TRIANGLES, 6, S.gl.UNSIGNED_SHORT, 0)
//-----------------------------------------------------------------------------------
var Y = function(bI) <--- Sets custom cursor.
//-----------------------------------------------------------------------------------
var aN = function(aX) <--- Example of drawing a texture using a shader and buffer. (Basically draws a texture like a model)
//-----------------------------------------------------------------------------------
var qc = function(b) <--- Socket class
Example code:
p._vfr = function() {
return {
available: r(),
writesFromServer: q,
readsFromClient: s,
writesFromClient: g,
sendTime: o,
_vft: (o / g),
_vfu: k === undefined ? 0 : k.bufferedAmount,
totalBytesRead: d,
totalBytesWritten: x
}
};
j = undefined;
return p
G = qc({
inBufferSize: 1000000,
outBufferSize: 100000,
bufferWrites: true,
url: (K ? "wss://" : "ws://") + J + ":" + L,
protocol: "jagex"
})
//------------------------------------------------------------------------------------
c.prototype._npo = function() {
if (this._nmu !== _jyt && this._nmu._tcd() === true) {
var d = this._nmu._tce(this._hd.gameState, this._hd.gameState); <--- GameState variable.
if (d === undefined || d === _jyt) {
return false
}
}
return true
};
//-----------------------------------------------------------------------------------
var zt = function() <--- Handles unicode and current locale.
//-----------------------------------------------------------------------------------
qg._kcv(m, false, n, true, d, h << WorldScale._btb, i << WorldScale._btb, e << WorldScale._btb, g << WorldScale._btb) <--- WorldScale needed for projection.
//----------------------------------------------------------------------------------
var blo = function() <--- Class for the developers console. Contains important info such as player position and camera eye.
Example code:
if (S === "commands" || S === "help") {
o("commands - This command");
o("cls - Clear console");
o("displayfps - Toggle FPS and other information");
o("getcamerapos - Print location and direction of camera for use in bug reports");
return
}
if (S === "cls") {
e = 0;
d = 0;
return
}
if (S === "displayfps") {
a._cnn._njq();
if (a._cnn._njs()) {
o("FPS on")
} else {
o("FPS off")
}
return
}
if (S === "getcamerapos") {
var aa = a._cnh._lec();
if (aa._ji()) {
var Q = yo.create();
aa._exw(Q);
var U = rv._cwi(Q);
o("Camera look: xa: " + U._cwj + ", ya:" + U._cwk); //Camera's Look at location!!
var W = a._cjq();
if (W !== undefined) {
var P = W._ifl();
if (P !== undefined) {
var Z = uj();
P._uyc(Z, false);
o("Player pos: " + Z.level + "," + Math.floor(Z.x / 64) + "," + Math.floor(Z._bnf / 64) + "," + (Z.x % 64) + "," + (Z._bnf % 64)) <--- Player position within the entire world!!
}
}
return
} else {
o("Camera not available yet")
}
}
//----------------------------------------------------------------------------------------------
var bzi = function() <--- Class for handling game time. Day, Month, Year, etc..
//----------------------------------------------------------------------------------------------
var bdc = function() <--- Function containing the switch statement for all libraries loaded and configurations. Ex: Jaggl, Jaclib, WorldMap data, etc..
//----------------------------------------------------------------------------------------------
var qa = { <--- Enum for IO flags..
MOUSE: 0,
KEYPRESS: 1,
KEYHELD: 2
};
//----------------------------------------------------------------------------------------------
var kt = function() <--- Scene cache class.
//----------------------------------------------------------------------------------------------
var kw = function() <--- Debugger for textures, models, buffers and particle rendering..
//----------------------------------------------------------------------------------------------
Yeah I know I mentioned "class"; not really classes but they really should be.. Some of the functions are literally a page and a half in size :|
Anyway, best of luck! =) you're doing great so far. I really hope the above helps out somewhat though. Good luck.