Advertisement
alindom

To help understand syntax used by kolbot in pickit lists

Sep 23rd, 2021
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Source https://darcvigilante.site/showthread.php?tid=9
  2. ======================================================
  3.  
  4. Pickit walk-through
  5.  
  6. First off familiarize yourself with some important and useful information.
  7.  
  8. NTItemAlias.ntj will answer 99% of item names/stats questions
  9.  
  10. Everything in the mpqdata folder, particularly weapons.txt and armor.txt
  11.  
  12. You could also see the max stats of items using Arreat Summit ToGo v.1.2b.
  13. NIP lines
  14.  
  15. NIP lines are of the format: {PROPERTIES} # {STATS} # {MAXQUANTITY}
  16.  
  17. [Item-parser Syntax Information]
  18.  
  19. [Keyword] separates into two groups
  20. [Property Keywords] = [Type], [Name], [Class], [Quality], [Flag], [Level], [Prefix], [Suffix]
  21. [Stat Keywords] = [{Number or NTItemAlias keyword}] or [Description] (description allow access to any text found in the item hover)
  22. [Maxquantity Keywords] = [Maxquantity] (used to limit the quantity kept)
  23.  
  24.  
  25. [Keyword] must be surrounded by '[' and ']'
  26. [Property Keywords] must be placed first
  27.  
  28.  
  29. Insert '#' symbol between [Property Keywords] and [Stat Keywords]
  30. Use '+', '-', '*', '/', '(', ')', '&&', '||', '>', '>=', '<', '<=', '==', '!=' symbols for comparison
  31. Use '//' symbol for comment
  32.  
  33.  
  34. There is no getting around learning the NIP syntax. You simply have to bite the bullet and do it. No one here can learn it for you. While it is not the most user-friendly language, it is fairly easy to understand once you start working with it.
  35.  
  36. The NIP files you are using are configured in your character configuration file. You can include/exclude NIP files on a per character basis within that file. Anything that appears on a NIP line past the "//" symbol is ignored (we call this a comment).
  37.  
  38. Each NIP has 3 sections separated by # signs where the keywords associated with that section are found: {PROPERTY} # {STATS} # {QUANTITY}. Each section is comprised of what are commonly called attribute-value pairs. An AV pair is a keyword name that is assigned a value using an operator like this: [type] == circlet. These AV pairs are then grouped using logical conjunctions like "&&' (for and) and "||" (for or) to create a NIP.
  39.  
  40. Now this was pretty straight forward to me, but to some it seems to be a little confusing.
  41.  
  42. Think Of [Property] Keywords as "constants" that will remain the same no matter what.
  43.  
  44. These all go before the # (was pretty easy for me as I already tend to use item #'s).
  45.  
  46. This doesn't mean that they can't vary, just means that no matter what end item is still gonna be "boots".
  47.  
  48. If you were writing a line for all rare boots, the constants would be
  49.  
  50. [Type] && [Quality], those aren't gonna change no matter what you do.
  51.  
  52. Now think of [Stat] Keywords as "variables" things that you may want to be flexible with.
  53.  
  54. Like above, it doesn't mean that it can't have a Set Value.
  55.  
  56. Again I'll use boots as an example, we already know we want "[Type] == Boots && [Quality] == rare" but we also want them to have some FasterRunwalk and a little Fire Res.
  57.  
  58. So now we have [Type] && [Quality] # [Stat] && [Stat]
  59.  
  60. And when added it would look like this
  61.  
  62. [Type] == boots && [Quality] == rare # [FRW] >= 10 && [FireResist] >= 10
  63.  
  64. Now if you can't determine what goes before the # and what goes after the # simply open up NTItemalias.ntj and CTRL+F what it is you're trying to find.
  65.  
  66. You can tell whether its a [Property] or a [Stat] simply by locating its alias, everything has an alias, just a matter of finding it.
  67. Order of pickit lines
  68.  
  69. Things that go before the #
  70.  
  71. [Type], [Name], [Class], [Quality], [Flag], [Level], [Prefix], [Suffix]
  72.  
  73. NTIPAliasType
  74. NTIPAliasClassID(name)
  75. NTIPAliasClass(Norm-elite)
  76. NTIPAliasQuality
  77. NTIPAliasFlag
  78.  
  79.  
  80. Things that go after the #
  81.  
  82. [Stat Keywords] : [Number or Alias]
  83.  
  84. NTIPAliasStat(skills,stats etc)
  85.  
  86. The odd-man out seems to be [Level] as its used as [Property], but in NTAlias its listed as a [Stat]
  87.  
  88. [Level] != [ItemLevelreq]
  89.  
  90. There is only one comparison symbol I can think of that really needs explaining, but I'll try and briefly give a rundown
  91.  
  92. "||" basically means OR
  93.  
  94. "()" Basically means TOGETHER/GROUP
  95.  
  96. "!=" Basically means DOES NOT EQUAL
  97.  
  98. The rest are pretty self explanatory.
  99.  
  100. Now I'll use the same example for boots but this time I want rare boots with 30FRW and FR and either CR or LR or dex
  101.  
  102. [Type] == boots && [Quality] == rare # [FRW] >= 10 && [FireResist] >= 10 && ([LIghtResist] >= 10 || [ColdResist] >= 10 || [Dexterity] >=1)
  103.  
  104. It's the same premise for any item, so once you have it figured out its pretty easy.
  105.  
  106. Using the same example lets say I wanted only boots of exceptional quality.
  107.  
  108. Well Normal, Exceptional, Elite = Class. I know this because i opened up NTItemAlias.ntj and CTRL+F "exceptional"
  109.  
  110. I know that Class = Property so in turn I know it goes before the #
  111.  
  112. So the same boots, but only exceptional versions becomes
  113.  
  114. [Type] == boots && [Class] == Exceptional && [Quality] == rare # [FRW] >= 10 && [FireResist] >= 10 && ([LIghtResist] >= 10 || [ColdResist] >= 10 || [Dexterity] >=1)
  115.  
  116. Adding too many qualifiers to any one line will make it harder for a novice to find any mistakes they have made.
  117.  
  118. Remember the simpler it is for you to read, the better.
  119.  
  120. Don't be afraid of using simple qualifiers. I hate writing rings/ammys/circlets and usually just use a couple of your standard catch-all lines.
  121.  
  122. [Type] == circlet && [Quality] == rare # ([ItemAddClassSkills] >= 2 || [ItemAddSkillTab] >= 2) && [FCR] == 20 && ([Strength] >= 10 || [Dexterity] >= 10 || [FRW] >= 30 || [Sockets] == 2 || [MaxHP]+[MaxMana] >= 35)
  123.  
  124. Now is that gonna grab junk? yea probably but look at this line
  125.  
  126. [Type] == circlet && [Quality] == rare # ([ItemAddClassSkills] >= 2 || [ItemAddSkillTab] >= 2) && [FCR] == 20 && ([Strength] >= 15 || [Dexterity] >= 15) && ([FRW] >= 30 || [Sockets] == 2 || [MaxHP]+[MaxMana] >= 35)
  127.  
  128. Guess what happens if your bot finds a rare Circlet with 2skills/20fcr/12str OR 12dex and 2soc?
  129.  
  130. A good basic catch all should simply have 2stats you want & a selction of other stats.
  131.  
  132. For instance I use this in my pickit for rare Amazon helms
  133.  
  134. [Type] == circlet && [Quality] == rare && [Flag] != ethereal # [AmazonSkills] == 2 && [FRW] == 30 && [Sockets] == 2
  135.  
  136. Remember Magic items can only get 2 affix, 1 prefix and 1 suffix
  137.  
  138. Rares Get 6 affix, 3 prefix and 3 suffix
  139.  
  140. Crafts Get 4 affix + craft mods, still limited to 3 prefix Or suffix max
  141.  
  142. That's pretty much all there is to writing a pickit in D2Etal. Remember that everyone makes simple mistakes, I ported my entire pickit from 1.7 and thought the new parser couldn't read it due to lots of #codes and name IDs...So I redid the whole thing and turns out I just had an odd syntax caused by a stray ^^.
  143.  
  144. Guess I should go into pickit and syntax errors, but unfortunately I very rarely get them and when I do it's usually an extra "[" or ")" missing.
  145.  
  146. Try searching for [Keyword] and (xxx || xxx) in your pickit.
  147.  
  148. Bot really seems to hate extra and missing "()"
  149. Common bot pickit errors
  150.  
  151. Syntax error 64
  152.  
  153. Usally means problem is after #​
  154.  
  155. Syntax Error 64 (missing ; )
  156.  
  157. Missing or extra "][" or ")("​
  158.  
  159. Syntax Error 64 (invalid left hand assignment)
  160.  
  161. having "=" instead of "=="">=""<="​
  162.  
  163. Syntax Error 64 (xxx isn't defined)
  164.  
  165. having keyword missing "[]" or typo​
  166.  
  167. Syntax Error 60
  168.  
  169. Usually means Problem is before #​
  170.  
  171. Syntax Error 60 (xxx isn't defined)
  172.  
  173. having keyword missing "[]" or typo​
  174.  
  175. Syntax Error 60 (missing ; )
  176.  
  177. Misplaced or missing "#"(usually see a bunch of white writing)​
  178.  
  179. Syntax Error 60 (Syntax error)
  180.  
  181. Missing or extra "][" or ")("​
  182.  
  183. Syntax Error 111
  184.  
  185. This is not an error in your pickit, but has to do with potions, usually grabbing + drinking.
  186. And keep in mind just because you're not getting any errors from bot, that doesn't mean that your pickit isn't without mistakes.​
  187. FAQ pickit
  188.  
  189. Q: Why does my bot pick up and stash junk?
  190. A: Because it's on your pickit.
  191.  
  192. Q: How do I make bot keep "XXX" unid?
  193. A: By having no qualifying [Stat]. Example: [Name] == Corona && [Quality] == Unique
  194.  
  195. Q: How do I add trap claws?
  196. A: Same way you add anything else, only they are like orbs and have 2x different types. I use names just like I do with orbs.
  197. [Name] == GreaterClaws
  198. [Name] == GreaterTalons
  199. [Name] == ScissorsQuhab
  200. ([Name] >= Handscythe && [Name] <= ScissorsSuwayyah)
  201.  
  202. Q: I noticed you use "[Name] >= && [Name] <=" just wondering why?
  203. A: Simply easier than writing out each individual item name, but it has its drawbacks, for instance in the case of orbs I also wind up picking up all normal/exceptional amazon weapons(because they are between orbs) not a biggie on orbs but imagine if you put >= Crystalsword(#29) and <= Phaseblade(#225)
  204.  
  205. Q: Why does my bot keep picking up magic items when I have none on my pickit?
  206. A: If you're certain you don't have any magics on your pickt it is usually caused by >= or <= on normal or rares
  207.  
  208. Q: How can I pick and sell items for gold
  209. A: By adding only an impossible affix after the #
  210. [class] == elite # [strength] >= 1000
  211.  
  212. Q: How come for viperskin you only have FireRes?
  213. A: Unique items with all res only need one res to look for. If i have [FireResist] == 35, there is no need for it to look at any other qualifiers, Not like maras/vipers/metalgrids can spawn with 35fr,30LR,21Pr,30cr Same goes for charms, you only need 2 of the 4 Res to pickup an all res SC.
  214.  
  215. Q: What is the difference between [Itemlevelreq] and [Level]?
  216. A: Well [Level] is kinda odd as although its listed as a [Stat] in NTitemAlias its actually used as a [Property], so If you want items under a certain level you would use [Name] && [Quality] # [ItemLevelReq] <=
  217. If you want to keep items of a certain Ilvl you would use [Name] && [Quality] && [Level]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement