kolton / d2bot-with-kolbot

d2bot game manager by D3STROY3R with kolbot libs by kolton for d2bs
346 stars 332 forks source link

kolbot "stop" working Error222 #457

Open ayanamireipl opened 6 years ago

ayanamireipl commented 6 years ago

Hi Guys!, 2 days ago, kolbot running, but now he is stop... i have got that on game

[Strict Warning (162)] File(kolbot\libs\ntitemparser.dbl:562) reference to undefined property p_section[i].split(...)[1] [Error (222)] File(kolbot\libs\ntitemparser.dbl:562) TypeError: p_section[i].split(...)[1] is undefined

and that is part of my code

switch (p_keyword.toLowerCase()) { case "maxquantity": value = Number(p_section[i].split("==")[1].match(/\d+/g));

            if (!isNaN(value)) {
                p_result[2].MaxQuantity = value;
            }

            break;

i try on "==" give "&&" or number's but doesn't work... any one have that problem? or know what schould to do?

sorry for my eng :)

Hutt001 commented 6 years ago

U solved it? Have the same problem

ayanamireipl commented 6 years ago

hi, yeah i think, i just remove == between " "

and part of my code is

    for (i = 1; i < p_section.length; i += 9) {
        p_end = p_section[i].indexOf("]");
        p_keyword = p_section[i].substring(0, p_end);

        switch (p_keyword.toLowerCase()) {
        case "maxquantity":
            value = Number(p_section[i].split("")[9].match(/\d+/g));

            if (!isNaN(value)) {
                p_result[2].MaxQuantity = value;
            }

and that working :)

atomdivad commented 5 years ago

I got the same error but maybe i found the solution, did i remove the // from this line [name] == flawlessamethyst # # [maxquantity] = 3 and its " [maxquantity] = 3 " it can't be parsed since the selector is using "==" so, i changed it to [name] == flawlessamethyst # # [maxquantity] == 3 now everything works fine. :)

sgtshepherd commented 4 years ago

I had the same error. The cause for me was the pickit nip file having " [MaxQuantity] " without " == 1 " or any other integer "==2".

e.g.

[name] == elrune # # [MaxQuantity] [name] == eldrune # # [MaxQuantity]

Hope that helps someone.

ChainsOfDishonor commented 4 years ago

I had the same error and had a similar error as the post above me.

I had written:

[name] == topaz # # [maxquantity] = 2

where it should have been:

[name] == topaz # # [maxquantity] == 2

Hope this also helps someone.

oryxcrake commented 4 years ago

I had the same error, problem was a simple one - me being stupid. In the kolton.nip file i had put this at the end of a line

"[MaxQuantity] >= 1"

Changed it to

"[MaxQuantity] == 1"

and that solved the issue.

Obviously, putting ">=1" makes no sense for a MaxQuantity lmao.