• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Nw-rom

Junior Spellweaver
Joined
Jul 9, 2014
Messages
168
Reaction score
53
Hi to all.
Wanna to share new thing for fun - db editor(for 6.2-, latest versions can require structs changes), based on my previous C# editor and imported to node/nw.js.

So, how it works?
It supports not all, but not bad part of those *.db files. Entry point is views/index.js with following content:

Code:
var edge = require('edge');
var data, _get, _set;


(function(){    
    try{
        _get = edge.func("sharp/Edit.cs");        
        _set = edge.func("sharp/Edit.cs");


        var result=_call(_get, "questdetailobject");


        data=result;
        _modify(data);


        //var changed=_call(_set, "questdetailobject", result);
        console.log("Done");
    }
    catch(ex){
        console.log(ex);
    }
})();




function _modify(result){    
    /*for(var i in result){
        result[i].GUID=100000;
    }
    result.push(result[0]);
    console.log(result.length);*/
}

Part, which u need, are those _get and _set functions. First one would return content of your db file by it name(without .db, for ex., "questdetailobject"), second one would update existing table using changed data. For simplier usage u can use _call wrapper like it used in code.

After u had execute this code, you can use data as usual array of objects directly from console(for nw.js) or just make modify/display logic inside file. For nw.js you can use jQuery as wrapper for some funny things like that:

Code:
$(data).filter(function(index, x){
return x.GUID>425000;
}); //return array of objects with GUID > 425000




NW.js site:
NW.js downloads:


If you would have some errors with edge.js, try to rebuild it as described here:
 
Junior Spellweaver
Joined
Jul 9, 2014
Messages
168
Reaction score
53
Hi.
No need to compile it, it's enough to download nw.js and type "nw ." in commandline from project folder.
If you have more questions, ask at skype.
 
Initiate Mage
Joined
Nov 23, 2015
Messages
1
Reaction score
0
Would be nice if you can prepare some of easy tutorials to your projects like with examples how some things work in exacly usefull files etc.
Sadly not all of us understand, tkanks for your effort.
 
Junior Spellweaver
Joined
Jul 9, 2014
Messages
168
Reaction score
53
Those editors usually require some knowledges in used languages. Also, there is example in first post. You get array of objects, what you need to do with it - it's only your choice, but you would need to have some knowledges of JS to do it.
 
Back
Top