You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.
Okay, so I'm using couchdb + node.js to make a bot in a pet capacity.
i.e., you an use text commands to level it up, teach it tricks, and so on and so forth.
Or at least that's the idea, as I can't seem to get couchdb to work. I'm not a big
fan of the RAM useage of MySQL, and mongo ticks me off to no end, but couch
seems relatively easy.
I've tried felix-couchdb, and cradle, but nano works best for me.
Basically, through calling other functions, vars change. Primarily 'exp' and 'level'.
However, when these change, and mSave(); (the function to insert, see below)
is called, the changes aren't noted. Let's say it saves with Level:2 and Exp:50.
When I restart the node process, and it gets the information, it has the default value of 0.
global.mDBName='pet2';global.mHunger=100;global.mExp=0;global.mLevel=0;global.mName='BotOne';global.mType=1;global.mUserId='4fb1c582aaa5cd1b4900001e';Log("Connecting to couchdb");global.nano=require('nano')('http://localhost:5984');Log("Finding database");nano.db.create(mDBName,function(a){a ? Log("db found, connecting") : Log("db not found, creating")});global.mSave=function(){store.insert({name:mName,type:mType,exp:mExp,hunger:mHunger,level:mLevel},mUserId,function(a,b){a||console.log(a)})Log('Bot Saved')};store.get(mUserId,function(b,a){if(b&&"not_found"==b.error){mSave(),Log("Doc not found, creating")}else{if(b){returnconsole.log(b)}Log("Connected to doc: name:"+a.name+", type:"+a.type+", level:"+a.level+", exp:"+a.exp+", hunger:"+a.hunger);mHunger=a.hunger;mExp=a.exp;mLevel=a.level}});
The text was updated successfully, but these errors were encountered:
Will do! And yeah, I'm far too lazy to sit around and have other people fix my problems for me. I post issues when I have them, then spend the time trying to fix them. If someone posts before I do, then great! And yeah, one I get around to it, I'd be happy to post it on the wiki!
Okay, so I'm using couchdb + node.js to make a bot in a pet capacity.
i.e., you an use text commands to level it up, teach it tricks, and so on and so forth.
Or at least that's the idea, as I can't seem to get couchdb to work. I'm not a big
fan of the RAM useage of MySQL, and mongo ticks me off to no end, but couch
seems relatively easy.
I've tried felix-couchdb, and cradle, but nano works best for me.
Basically, through calling other functions, vars change. Primarily 'exp' and 'level'.
However, when these change, and mSave(); (the function to insert, see below)
is called, the changes aren't noted. Let's say it saves with Level:2 and Exp:50.
When I restart the node process, and it gets the information, it has the default value of 0.
The text was updated successfully, but these errors were encountered: