I've decided to make a bot using the coco language.
http://pastebin.com/difZ6mJz
The bot doesn't work yet (and very little code). But I thought it would be good to show what code in coco looks like as compared to javascript.
This is what it looks like in javascript:
http://pastebin.com/qb3MSvNg
I'm making a bot using coco
Re: I'm making a bot using coco
when will it be done
"My IRC en multiplay naam is Andrie"
Groete Andrie
Groete Andrie
Re: I'm making a bot using coco
I have no expirience in bot writing, but I know somthing about js and programming and have some note about you code:camellia0x++ wrote:I've decided to make a bot using the coco language.
http://pastebin.com/difZ6mJz
The bot doesn't work yet (and very little code). But I thought it would be good to show what code in coco looks like as compared to javascript.
This is what it looks like in javascript:
http://pastebin.com/qb3MSvNg
you can use version control system for you code. Store it on github.com or bitbucket.com and you can easy share you code.
You should use code named convention recommended for javascript total_cost_enemy totalCostEnemy
Code: Select all
for (_i = 0, _len = (_ref = enumDroid(me, DROID_CONSTRUCT)).length; _i < _len; ++_i) {
Code: Select all
var ref = enum(....);
for index in ref:
var obj = ref[index]
Code: Select all
if (v_group) {
for (_i = 0, _len = v_group.length; _i < _len; ++_i)
Code: Select all
function __of(x, arr){
var i = 0, l = arr.length >>> 0;
while (i < l) if (x === arr[i++]) return true;
return false;
}
Code: Select all
return _ref = visibleObjects[_key = object.id], delete visibleObjects[_key], _ref;
PS. Spend some time for javascript. It will help a lot. http://www.codecademy.com/en/tracks/javascript
http://addons.wz2100.net/ developer