Question about pickit coding

Okay, so I would like to start off by just offering a little bit of background about myself to better give context to those of you who are smart beyond a whip when it comes to coding. I don’t by any means consider myself a pro at this, nor do the pros, but have put in tens if not hundred(s) of hours playing with nip scripts over the years. I have at times simply quit or passed over attempting to comprehend specific coding when it’s gotten too complicated, however, have never not been able to figure out and repair a mistake I made in the event of an error message . . until now.

So, having finally begun going back over my script to lower perfection parameters on a number of perfect items entries, I attempted to extrapolate from the surrounding coding entries at my disposal to come up with the following, however, immediately upon running profile (as I noticed it ~15 minutes/3 automule initiations later LOL) picked up literally every item, and it stated line #407 specifically as the error line, which, when I then indented, continued (went on) to pick up 2 diamond mails (a rare [kept unid and a white one as well] in addition to a magic blade bow [kept unid], and also shopped a magical phase blade of the vampire (/+8% ml//ilvl99), before I threw the kill switch, lol.

Here are the following pickit (.nip) entries that result in the problem (note lines 407 and 442 correspond with the bolded entries). I just want to say thank you in advance to anyone who takes the time to read this or can additionally shed some light on this for me.

//[type] == javelin && [quality] == rare && [flag] == ethereal # [enhanceddamage]+[maxdamage] >= 199 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == throwingknife && [quality] == rare && [flag] == ethereal # [enhanceddamage]+[maxdamage] >= 199 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == throwingaxe && [quality] == rare && [flag] == ethereal # [enhanceddamage]+[maxdamage] >= 199 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0) //[type] == sword && [quality] == rare && [flag] == ethereal # [enhanceddamage]+[maxdamage] >= 199 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == axe && [quality] == rare && [flag] == ethereal # [enhanceddamage]+[maxdamage] >= 199 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == claws && [quality] == rare && [flag] == ethereal # [enhanceddamage]+[maxdamage] >= 199 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == bow && [quality] == rare && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 199 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)

//[type] == throwingknife && [quality] == rare && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 299 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == throwingaxe && [quality] == rare && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 299 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == sword && [quality] == rare && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 299 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == axe && [quality] == rare && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 299 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == claws && [quality] == rare && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 299 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == bow && [quality] == rare && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 299 && [ias] >= 30 && [itemskillonhit] == 66 &&
//[type] == javelin && [quality] == rare && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 299 && [ias] >= 10 && [itemskillonhit] == 66 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)

//[type] == javelin && [quality] == rare && [class] == elite && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 159 && [ias] >= 10 && [itemskillonhit] == 66 && [itemtohitperlevel] >= 1 // template
//[type] == throwingknife && [quality] == rare && [class] == elite && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 159 && [ias] >= 10 && [itemskillonhit] == 66 && [itemtohitperlevel] >= 1 // template
//[type] == throwingaxe && [quality] == rare && [class] == elite && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 159 && [ias] >= 10 && [itemskillonhit] == 66 && [itemtohitperlevel] >= 1 // template
//[type] == sword && [quality] == rare && [class] == elite && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 159 && [ias] >= 10 && [itemskillonhit] == 66 && [itemtohitperlevel] >= 1 // template
//[type] == axe && [quality] == rare && [class] == elite && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 159 && [ias] >= 10 && [itemskillonhit] == 66 && [itemtohitperlevel] >= 1 // template
//[type] == claws && [quality] == rare && [class] == elite && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 159 && [ias] >= 10 && [itemskillonhit] == 66 && [itemtohitperlevel] >= 1 // template
//[type] == bow && [quality] == rare && [class] == elite && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 159 && [ias] >= 10 && [itemskillonhit] == 66 && [itemtohitperlevel] >= 1 // template
//[type] == javelin && [quality] == rare && [class] == elite && [flag] != ethereal # [enhanceddamage]+[maxdamage] >= 159 && [ias] >= 10 && [itemskillonhit] == 66 && [itemtohitperlevel] >= 1 // template

//[type] == throwingknife && [quality] == rare && [flag] == ethereal # ([enhanceddamage] >= 200 && [itemtohitperlevel] >= 1 || [enhanceddamage] >= 299) && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == throwingaxe && [quality] == rare && [flag] == ethereal # ([enhanceddamage] >= 200 && [itemtohitperlevel] >= 1 || [enhanceddamage] >= 299) && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == sword && [quality] == rare && [flag] == ethereal # ([enhanceddamage] >= 200 && [itemtohitperlevel] >= 1 || [enhanceddamage] >= 299) && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == sword && [quality] == rare && [flag] == ethereal # ([enhanceddamage] >= 179 && [itemtohitperlevel] >= 1 && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0) && [level] <= 48)
//[type] == axe && [quality] == rare && [flag] == ethereal # ([enhanceddamage] >= 179 && [itemtohitperlevel] >= 1 || [enhanceddamage] >= 299) && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == claws && [quality] == rare && [flag] == ethereal # ([enhanceddamage] >= 179 && [itemtohitperlevel] >= 1 || [enhanceddamage] >= 299) && ([itemreplenishdurability] > 0 || [itemreplenishquantity] > 0)
//[type] == bow && [quality] == rare && [flag] == ethereal # ([enhanceddamage] >= 299 && [itemtohitperlevel] >= 1 || [enhanceddamage] >= 399) && [ias] >= 30
//[type] == bow && [quality] == rare && [flag] == ethereal # ([enhanceddamage] >= 259 && [itemtohitperlevel] >= 1 || [enhanceddamage] >= 359) && [ias] >= 20 && [sockets] == 2

Both entries have a stray parenthesis. One way of avoiding it is to treat code as building logic from the ground up, instead of one or more lines of text. Right after you’ve typed a <, ´(, [, {` or whatever, type the ending one too and fill in the cotents later. Notepad++ and other editors can do it automatically.

In some programming languages, && has higher precedence than ||. In some, they’re grouped togehter and treated equally, which means that the associativiy (left-to-right or right-to-left) decides. Most operator groups are left-to-right, and you’ll know by pure common sense if someone isn’t.

So x || y && z can mean two different things in different languages, (x || y) && z or x || (y && z), which is why it’s good practice to put the parenthesises in there manually. It’s not cool, and Bill Gates isn’t gonna thank you for being professional, but it could save someone hours of pain some day.

PS: A fun fact about logical operators is that many languages guarantee lazy/short-circuit evaluation of them. In the expression if (getAnErection() && findAWoman()) {...}, the second function isn’t called if the first one returns false, because the value of the entire expression will be false whether the second operand should evaluate to false or true.

This only matters when the operands have side effects, i.e. anything other than just returning a value, for example altering a global variable, changing something on the screen or calling Joe Biden, but time for code to execute can be seen as a side effect too. Finding a woman doesn’t have to be a function call, it could be a simple look-up in a 4 000 000 000 element JavaScript array, which you don’t want to bother your computer with going through until you have an erection.

C was designed without this issue. A 70 character long line of code text can’t take five million years to execute, unless you call one or more functions and then it’s your responsibility to figure out how much memory use and processor time the function(s) could need. The downside with C is all the typing, you have to spell out everything and it becomes hard to read.

Summarizing: Scripting languages are more fun, more power, less typing, more of the absolute basic necessary stuff already done for you. In C you build basically everything from the bottom up. In scripting languages you build some of the stuff from the top down, what stuff depends on the language.

Tcl’s integer variables and calculations has been automatically unlimited in size since version 8.5, including the ** operator (“to the power of” without converting to floating point and back). You don’t have to think twice everytime if a + b could overflow on whatever processor you’re running on - 16-, 32-, or 64 bit - or #include bignumberlibrary and use function calls for all arithmetic operations. A bigger integer is stored in more bytes if necessary.

Tcl’s error handling system is the opposite of a low level languages. Instead of building your logic on what operation fails with nested if statements and/or returns, you catch posible errors if you want to. An open "filename.txt" call that fails, propagates back through the stack of function calls until one of them cathes the error with catch or it ends up at the main script level and terminates the script with a message.

Tcl’s fconfigure command allows you to alter settings for streams, though the default is usually fine. Socket streams has it’s input linebreak set to auto, which accepts CR, LF and CRLF, and it’s output linebreak set to the standardized CRLF. On Windows, Ctrl-Z is accepted as end of file, but not written, etc.

Some script languages’ advantages, or let’s rather call it features of languages of a higher level, was adapted by Bjarne Stroustrup in a futile and not so good attempt to combine the two, starting from C. The result was C++, which actually is nothing more than a huge language, complicated and full of problems and traps. What do you expect when you mate a bird with a cow?

I hope your bot has satisfied it’s shopping needs :slight_smile: