Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update with upstream master #5

Open
wants to merge 160 commits into
base: master
Choose a base branch
from

Conversation

jmichelsen
Copy link
Owner

No description provided.

mf022 and others added 30 commits February 23, 2020 12:57
GameAction fix to not create games
* Addition of [Europe] [USWest] [USEast] [Asia] [Ladder] [Hardcore] [Classic]
* Bo getting for HC players
* minor fix for ToolsThread.js
* revert previous changes from #37 related to BoGetting
* Add option to clear river as part of Hephasto script

* Add Hephasto options to config
* Add "wait" option to Wakka

The hard coded 1minute timeout was often too short if bots are doing
other things in a game

* Update Config.js

Co-authored-by: mf022 <41995123+mf022@users.noreply.github.com>
* Add doChores before muling if lowGold is set

When lowGold is set the bot will pick up junk to sell, and this will
trigger muling if muling conditions are met. The junk will then end up
being muled along with real drops.

This change makes the bot sell the junk before muling.
* Auto completion for modern IDE's

* Added module sdk.js
Thanks to @david1602 for having a sharp eye =)
* fix off-by-one error in game creation numbering

* use unique colors for previous/next area vectors

* add some side areas to mapthread

* allow potions with fastpick / disallow gold

* +1 to 0 ping to prevent delay(0) in single player

* hide map vectors when cube is open
* add loading of PickThread.js + minor changes

use Config.AutoMap and Config.PublicMode with D2BotMap entry script

* add PickThread.js

* add note about Config.FastPick + minor changes

also add river of flame to Config.ChestMania.Act4

* fix an error in a CTA line

* add Config.ManualPlayPick as a separate option

* add ManualPlayPick option

* change if condition for loading PickThread.js

use Config.ManualPlayPick instead of Config.FastPick
#75)

* Numpad '+' also print merc stats and remove magic numbers using sdk.js

* add require sdk

Co-authored-by: ChefKeeper <ChefKeeper@no-reply.com>
Co-authored-by: ChefKeeper <ChefKeeper@no-reply.com>
Instead of waiting for the bridge to pop up after doing meph, it activates the bridge before coming
theBGuy and others added 28 commits June 13, 2022 13:31
- fix merc infinity check
- fix typo
* Fix missed sdk name change

- NihlathakPlatform to NihlathaksPlatform
- FrozenAnyaPlatform to FrozenAnyasPlatform

* change monster type prototypes to be a little clearer

- change dolls to isDoll and ghosts to isGhost, I think that makes the use a bit clearer.

* Small Fixes

- fix checkScrolls for Tome of Identity when we are using FieldID
- add delay in initNPC
- fix bug in Misc.openChest, only saw with sorc but it wasn't moving to the chest so broke the check into > than 5 then move to and if  < 5 click

* Change prototypes to be clearer

- unit.boss to unit.isBoss
- unit.primeEvil to unit.isPrimeEvil

* Update Prototypes.js

- add sockets prototype, returns number of sockets an item has
- add basetype flag to checkItem, checks if an item is normal or superior

* Update Pickit.js

- only use 500k gold check if no pickit files are loaded

* Update sdk.js

- Add HolyFreeze state

* Clean up BaalAssistant

- fix wrong realm login for other multiplayer

* Update Pather.js

- fix for clearPath since its sometimes passed in as a number (Ex: in Attack.clearLevel) for the spectype

* Update BaalAssistant.js

- minor formatting
* Fix missed sdk name change

- NihlathakPlatform to NihlathaksPlatform
- FrozenAnyaPlatform to FrozenAnyasPlatform

* change monster type prototypes to be a little clearer

- change dolls to isDoll and ghosts to isGhost, I think that makes the use a bit clearer.

* Small Fixes

- fix checkScrolls for Tome of Identity when we are using FieldID
- add delay in initNPC
- fix bug in Misc.openChest, only saw with sorc but it wasn't moving to the chest so broke the check into > than 5 then move to and if  < 5 click

* Change prototypes to be clearer

- unit.boss to unit.isBoss
- unit.primeEvil to unit.isPrimeEvil

* Update Prototypes.js

- add sockets prototype, returns number of sockets an item has
- add basetype flag to checkItem, checks if an item is normal or superior

* Update Pickit.js

- only use 500k gold check if no pickit files are loaded

* Update sdk.js

- Add HolyFreeze state

* Clean up BaalAssistant

- fix wrong realm login for other multiplayer

* Update Pather.js

- fix for clearPath since its sometimes passed in as a number (Ex: in Attack.clearLevel) for the spectype

* Update BaalAssistant.js

- minor formatting

* Changed skill handling

- remove most of the skills from precastables, now thats used for a different purpose
- create Skill.skills object, track what we have to reduce a ton of me.getSkill calls when we don't need to
- create Skill.canUse, takes skillid. Mostly for ease of accessing Skill.skills object
- minor fixes for Common.Diablo, for doing Fast diablo
- param to checkQuest in ancients
- re-order skill checks for better lazy evaluation,if we are forcing precast a skill we don't need to also know if we are in that state as we don't care
- re-cast cold armor 30 seconds before expiration
- remove unneeded functions in Attacks\Druid.js -> have that covered now with the new Skill function

* Had forgotten to save these

- replace Precast.precastables

* Update Prototypes.js

- add basetype flag to haveSome and haveAll

* Missed some getSkill calls

* Formatting mostly

- quick return on essentials when not using a pickit

* Wereforms

- add some more skills to getBetterSlot
- get better slot for shapeshifting

* Missed some spots with new Skill.canUse function

- replace unneeded functions in Assassin and Wereform attacks

* Update Misc.js

- add handler for skills we always have

* Update Misc.js

- remove more magic numbers, slowly but surely making progress on them. So many though...sigh

* Check if we are already in wanted area in moveToExit

- don't go through rest of the checks if we are already in the area we want
- fix typo in Precast.doPrecast

* Update Pather.js

- small delay after calling getPresetUnit, in moveToPreset and moveNearPreset

* Update D2BotCleaner.dbj

- make it easier to clean a whole range of profiles without having to type out each individual one

* Update D2BotCleaner.dbj

- add option to exclude characters when using the option "all"

* Formatting mostly

- added some more keys to sdk

* Clean up, add more static paths in a5

- add static path from malah to stash/wp, and portalspot to stash/wp. Reduced A5 crashes
- add check in Common.Baal.killBaal, while we wait for baal to leave throne if we are getting hit to to clear around us because that means failed to clear something
- fix typo in Pickit.fastPick
- comment out FastMod settings as its patched
- add another parameter to Town,buyPots to accept an npc unit.

* Update Misc.js

- refactor Skill.skills have function, ty noah

* restructure Skill.skills again

- restructured the skills object, much cleaner looking now
- fix typo in goToTown, not sure how but it hada double me.inTown if statement so probably a bad copy and paste
- if we fail to interact with an npc its generally the getUnit bug which is sometimes resolved by going to a different act, add handler to attempt going to one of our other valid acts if it happens
- better canTpToTown check

* Update Misc.js

- missed variable name replacement

* keep track of last interacted npc in town

* minor fixes

- changed unit prototype use to work with tomes
- cleaned up Town.goToTown checks
- changed some of the me.ping delays, they seem to cause issues

* formatting mostly, always more magic numbers to remove

- still slowly making progress on changing over magic nums

* Update Pather.js

- fix typo in nextAreas

* Little bit of cleanup and better location checking

- check classid of mob during Attack.validSpot check, this fixes ignoring monster objects and floor check or skills that need a floor (they only check if the mob can fly)
- add handler to ensure we don't attempt to sell an unsellable item
- fix comment in StarterConfig.js and D2BotChannel.dbj regarding using an array of channels to join
- always check if unit is still valid before going through doCast

* Mostly just more clean-up

* Handle A5 gate in Pather.openDoors

- open the gate if it's blocking our way, previously was only done in journeyTo

* Update Common.js

- fix diablo lights event

* Last clean-up I think

- handle tk on chests a bit better, if we fail to cast go to the next iteration rather than wait for the chest mode to change when we didn't even interact with it
- handle clearPath a bit better if the value is passed in as a number instead of boolean
- only check collison for doors in walkTo if we failed to move
- better keeping track of last npc in town
-removed almost all of the magic numbers in Common.js

* Update Town.js

 - allow disabling tk when moving to townspot
- fix portalspot for using tkrange
- disable tk if we fail to moveToSpot in town twice

* Magic num cleanup mostly

- fixed tk'ing chests when we are right next to them
- fixed some incorrect labeling in sdk
- removed most of the magic numbers in sdk

* More clean-up/formatting
* Small typos fixes and Stop rushee in hell when rusher says bye

* auto detect if rushee needs to stop profile

- check if we are the bumper, or if there is a bumper in the game, then restart rather than stop the profile so we can join next game. Otherwise check if we are in hell and if the rush is complete we shut down the profile

* Fix changed sdk quest id key, check char lvl in rushee

- Fixed highestQuest prototype for changed sdk key
- added check to ensure that rushee quits if they are set to bumper but not a high enough level

* HolyShield, static fixes

- fix static field range calculation
- check if we have a shield to use for precasting holyshield
- small clean up in wakka
- new unit prototype usingShield

* Create Game object for get unittype functions

- remove object, item, and monster functions
- Game class handles these now
  - Game.getMonster
  - Game.getObject
  - Game.getItem
ect

* Update sdk.js

- add two more locale text ids

* Create Time class object in Util

- move time helper functions into Time class and replace all instances of the old functions

* Fix questing, add isMonster proto

- fix unreachable variable in makePortal
- add console.error, same thing as errorReport might remove errorReport in favor of it. Keeping both for now

* Update WPGetter.js

- fix wpgetter to correctly pick last wp
* add email set/verify controls

- add ControlAction.setEmail, takes email and domain parameters

* Update OOG.js

- formatting + fix other multiplayer login

* Update OOG.js

- restart after 5 minutes for LoginError text, to try again
* Clean up Attack.js

- When Attack.clear is called with a bossId, print when we are attacking the boss and when they are killed or if we failed to kill them
- remove magic numbers related to ClassAttack result
- replace getUnit calls with Game.getMonster calls
- create Unit.inArea(area) prototype

* Lots of cleanup

- basically re-wrote battleorders, it attempt waiting until everyone who needs a bo is present.
- Better longDistance help in AutoBaal, switch to using pvprange for the duration then switch back when we are done. Also if we are in town still and either thronecheck of baalCheck message has been sent go into throne
- fix diablo helpers getting stuck in the wait loop because they missed the light event packet
- add nextup command to mfhelper to improve speed of ending script when leader is going to be running diablo or baal next
- going along with that added an announce into Loader.js if either of those is our next script and we are MFLeader and we are on public mode
- a lot of re-write in Wakka, checking the light event, checking which seals are done
- fix color in Failed to Clear print message in Attack.clear
- add Misc.getPlayerArea
- fix delay of 0 in usePortal
- fix bug where pickit was loaded before Storage had been defined
- add way to enable/disable precasting

* Change AutoBaal long distance cast spot

- moved it to the side where the current casting spot is for regular long distance casters

* Slightly faster exit in DiabloHelper + Pather cleanup

- include Worldstone level 3 in leader area check for DiabloHelper quit
- include extra check in Util/includeCommonLibs function in case we fail to get our files for some reason
- remove more magic numbers in Pather
- use checkForMobs function in moveNear and moveTo as it's a bit faster than getMobCount check

* Update BattleOrders.js

- fix name check

* Fix nested if statement AutoBaal

- nested if in londRangeSupport wasn't needed, if we can't attack we should shift to the next unit
- fixed undefined variable in torchsystem, they were declared in the main loop so unreachable by the event function

* Add more key codes to sdk

- change spy gear hotkey to check if we have a player selected to log their gear, otherwise log our own
- add hot key delete to quick exit a game

* missing comma in sdk

* Update sdk.js

- add monster types

* Better keeping track of party memebers bo-ed

- keep track of names of party members who have been given bo
- fix typo in Time.seconds, it was converting to minutes instead of seconds

* new util function, fix setEmail stuck loop

* OrgTorch cleanup + sellable fix

* Update sdk.js

- add some of the common key codes

* Update Town.js

- town cleanup

* Update Util.js

- add utility functions for preset units

* Misc cleanup

- created Item.js to move the Item class out of Misc

* Update OOG.js

- make sure Util.js has been included

* Formatting

* Rushee cleanup mostly

- fix nextgame check to exclude rusher
- should fix clearThrone for avoiding dolls
- formatting and removing more magic numbers

* Update RushThread.js

* Update RushThread.js

- make sure rusher doesn't have MFLeader set in their config. If they do they will open tp's that mess up the rushee. Fix getPartyCount for ignoring ourselves in the count

* Fix wpgetting for Rushee

- don't try and get a wp that's far away
- non-questers talk to nps if we are going to be getting wps
- rusher ask for questinfo again after a minute and then after two minutes in case rushee wasn't ready

* Rushee/Questing fixes

- Non-quester talks to npcs so they can access waypoints
- Questing.js, try and make room for quest items if we don't have enough
- Rushthread, missing check for the Failed to get wp message and increase clear range during cairn stone sequence

* Pickit cleanup, shenk improvment

- If we open the special chest during Eldritch script it can leave is far from shenk. Check distance from wp and if too far tp to town to use the waypoint as its faster
- fix onGroundOrDropping unit prototype

* Lots of cleanup

- added some more functions to Packet class, so its cleaner to use them over having a bunch of sendPacket calls repeated
- fixed typo for skeleton mages summons
- use Packet.telekinesis by default for objects
- general cleanup

* More magic num replacment

- switched over unittype values

* More magic num removal

- changed out getPresetUnit(s) unittypes, and getUnit to use the game object functions instead

* More magic num replacment

- replaced uiflag magic nums
- replaces some more areaIds and unittypes

* Magic num removal Cubing/Runeword

- been putting this one off as they were the two largest sources of magic numbers but finally formatted them

* Double check for organs in OrgTorch

- try and make sure we actually pick the organs if we failed to do so with Pickit.pickItems

* More magic number removal

- got a pretty big portion of what's left

* Fix occasional bug with getShrinesInArea

- add shrine we are looking for into ignorelist so NodeAction doesn't grab the shrine and cause Misc.getShrineInArea to fail even though we found the correct shrine

* Fix typo for SuperChest

* Add Bishibosh and CreepingFeature scripts

- might add some of the other super uniques, but none of the others seemed easy to get to
- also added option to just kill bishibosh during bloodraven script

* Update ToolsThread.js

- add item dump info as numpad decimal hotkey

* Cubing cleanup mostly

- last bit of cleanup for tonight, did some refactoring
- added unit prototype isOnMain, replaces checks for unit.bodylocation === 4 || unit.bodylocation === 5

* More cleanup

- added sdk.skills.hand and sdk.skills.get, to get rid of those magic numbers
- removed instances of getUnit(100) and getUnit(101)
- cleaned up attack monsted id's and spectypes
- refactored Misc.townCheck function and created Town.needPotions

* More magic num removal (always)

- added sdk.items.flags, sdk.items.cost, sdk.skills.subindex, sdk.clicktype.shift and added more to sdk.skills.hand and sdk.clicktypes.click

* Update OrgTorch.js

- fix oops commit, equipping an item isn't complete yet

* More cleanup

- got (all I think) instances 0, 3 for inStorage itemmode and Inventory location values

* Cleaned up clickItem and clickItemAndWait

- replaced the clicktype magic nums
- added missing Warriv locale text id
- added missing AccountAlreadyExits locale text id, ty aimtokill

* Clean up Class attack files

- removed magic numbers for result of doAttack/doCast

* add sdk.collisions and sdk.party

- remove collision magic numbers and add sdk.party for the NoParty id number

* Add sdk.quest.states

- only common states for now, until I figure out a good way to do the others

* Add BattlemaidSarina and Fangskin scripts

- add BattlemaidSarina super unique (by lam essens tome)
- add Fangskin super unique (by viper amulet altar)

* replace rest of skill hand nums and quest ids

- I think I've gotten all the skill hand nums and found some quest ids I missed in pather

* little bit of attack clean-up

- added some more print info to attack.kill, clear, hurt
- little bit of magic num removal in prototypes
- add dummy moster id's 149, 268

* Replaced player/monster/object modes

- added sdk.units.player, and sdk.units.objects.mode

* Should be the rest of the collisions

* Update configs for new scripts

* Little refactor and cleanup

- added me.deadOrInSequence (verbose I know but couldn't think of anything else)
- added me.moving
- add Attack.useTeleStomp to get rid of repeated check in all classattack files
- little bit of cleanup in manualplay files, still need to do the vectorhooks (sigh)

* Add sdk.units.exits.preset

- add all the preset exit id's for stairs unittype

* Create Common.Toolsthread

- move common functions from Toolsthread and Maptoolsthread to Common.js

* More cleanup - nearing the end I think

- think I got all the getStat, getStatEx, and getState values
- added openBnet support when making account

* Standardized to use double quotes

* Add sdk.controls, Fix magic nums for ItemHooks

- also make sure rusher moves back to where rushees are before telling them to go back through portal

* Formatting mostly

- disabled eslint indent rule for config files
- updated _BaseConfigFile.js
- changed format of Attack.result to be Attack.Result.RESULT as it stands out better. Did the same thing for Pickit.result
- missed some quest id magic numbers

* Update Misc.js

- typo

* Fix typo in BoBarbHelper

* Missed some collisions

* Small cleanup

- D2BotChannel should now allow following leader game and potential game names
- fix delay in Attack.checkInfinity when merc is dead

* Add console.time and console.timeEnd

polyfill for console functions time and timeEnd, useful for tracking how long something takes. Not sure how I want the output format to be though. Currently just the ms

* Update Util.js

- add console.trace, outputs the current stack to easily view
- changed console.time to use getTickCount rather than date object

* Update Paladin.js

- separation between tele and non-tele based hammer reposition check

* Moved console to Polyfill.js

- think it makes more sense for it to be in Polyfill rather than Util.js
- added Game.getDistance
- fix delay when creating first portal from town chicken
- use includeIfNotIncluded with includeCommonLibs and log the stack trace if something fails

* Formatting Leeching section of configs a bit

- broke it up into Pure Leech and Helper. Added note that MFHelper ends when leader is in Chaos or Baal

* Remove console.errorReport, add console.info

- format all the console output functions
- change the usage of them to be more appropriate. Warning when its a warning log, error when its an error log, ect
- fix melee char positioning during Common.Baal.clearWaves
- fix palaidn using cleansing when poisioned during clearWaves. He will now still cast hammers just with cleansing active until he is no longer poisioned
- If not killing baal during BaalHelper, the helper will go to town and wait. Previously just idled in throne. I think this still needs improvment as it doesn't allow running anything else after since its an infinite loop
- add Config.SkipId, used if there is just a monster you don't ever want to attack (in my case I'm using it to avoid fire towers)

* Fix D2Bot color magic nums

- fix naming of charm itemtypes, sdk.itemtype.MediumCharm is now sdk.itemtype.LargeCharm and sdk.itemtype.LargeCharm is now sdk.itemtype.GrandCharm
- add sdk.node. Its not used anywhere but just documenting the values

* add some more locale string text ids to sdk

* small cleanup

- added Unit prototype isShield and PresetUnit prototype realCoords
- cleaned up some more local string ids

* Some missed nums

- missed some magic nums
- changed pather.init behavior to only init open wp at game start if we have Config.UseWaypoint set to false
- added Pather.getDistanceToExit

* Update D2BotPubJoin.dbj

- remove some debug lines

* Last of the nums I think

- Hopefully last of the nums

* Bodylocations and Collisions

- missed some refrences to bodyLocations and some collisions
- added alias sdk.stats.EnhancedDamage for MinDamagePercent as I never remembered that

* Missed some D2Bot color numbers

* Add some missing general skills

- cleanup autobuildthread
- add missing general skill ids and Alias to ConversionLevel stat id

* Update Pickit.js

- don't mule if we don't need to

* Update CrushTele.js

- somehow missed this file

* More cleanup, missed some numbers

* Add sdk.packet

- add packet values and replace some more magic num references that I missed

* Reformat sdk a bit

- removed sdk.units and broke it up into its separate pieces
- sdk.players
- sdk.monsters
- sdk.summons
- sdk.npcs
- sdk.mercs
- sdk.exits
- sdk.objects
- Added the item related things under the item object
- sdk.items.class
- sdk.items.mode
- sdk.items.type
- sdk.items.quality

* manualplay cleanup

- I think I have gotten everything now, said that before but forreal this time.

* Missed some numbers still

- added Town waypoints ids under sdk.objects

* Add Config.Tombs.KillDuriel to base configs

- didn't realize this was missing from the base configs

* Small cleanup

- added unit.prototype isNPC

* Update ControlBot.js

- missed the area id's

* Add runwalk prototypes

- me.running and me.walking to check what our current runwalk is set to
- me.run() to set runwalk to 1
- me.walk() to set runwalk to 0

* Update Pather.js

- previousAreas and nextAreas id's

* Cleanup useraddon.js

* Update Prototypes.js

- Hide mobCount from for in loops, fixes bug with getBodyLoc
- get some missed numbers

* Refactor leaderTracker background worker

- Fix TristramLeech and TravincalLeech for not exiting script properly once leader has moved on
- add autoLeaderDetect into TravincalLeech

* Replace me.area checks with me.inArea(area)

- use unit prototype me.inArea for cleaner checks

* Better check for unit prototype use

- I noticed under high ping or varying ping that use would sometimes fail. Polling the result a fixed it

* Better clarity for cow options

- Cow script now seperated out the config options to DontMakePortal and JustMakePortal, if both are false it runs as normal
- remove paladin debug lines

* Always use vigor in town if we have it

- changed condition check so even if we are set to not use vigor we still use it in town if we have it

* Small cleanup

- changed slot magic nums to sdk
- changed portalMap from sparse array to object

* Replace ChestMania area id's

* Update Prototypes.js

- wait until game is ready to cancel ui flags, prevents strict warning with high ping

* Update NTItemParser.dbl

- format to const
Update id assignment of hooks so that callbacks are deleted properly
- factored out the antiidle addition into it's own thread in tools
- moved the loose functions into Mule class so it's cleaner (might take the new class and put it in it's own file so the entry is just entry stuff, but undecided currently)
This reverts commit 0ef4b6c.
* Init upload of small fixes

- Remove reference to ClassAttack.curseState in AutoBaal.longRangeSupport
- Clean up ControlBot, mostly just minified the code where I could
- Increase wait time for diabloPrep if the light even didn't trigger yet for Diablo Helpers
- Add more to Attack.monsterObjects
- Fix typo in Amazon ClassAttack's. skills.unitimed had been double copied
- minify Paladin ClassAttack file
- add Common.Diablo.diaWaitTime initialized at 30 seconds for diabloPrep
- add Config.Loaded, and Config.UseWarcries
- Minify code in Misc.js
- add Packet.buyScroll, normal buyItem didn't take into account if we weren't shift buying scrolls that our total itemcount wouldn't change so buyScroll takes the book as a param to check the quantity
-  Still trying to figure out why sometimes Pather.recursion doesn't get reset casuing the bot to stop clearing while pathing. For now added a stack check to see if we have recursion going on
- Increase Config.MinColumn check in Pickit.init from 0 to 1. Still needs better work in town so if we have no belt we don't run to town everytime we use a single potion
- add Precast.warCries. sometimes warcries fail generally do to high ping so this allows rety's and a state check to break if we succeeded in casting
- Fix some typos in prototypes, and add new ones for easier monster type checking.
- Added isMonsterObject, isMonsterEgg, isMonsterNest, isBaalTentacle
- Change initNPC behavior when we just want to sell items that aren't unid to use the closest npc, TODO: handle using gamble npc's. Not using them right now because town needs a task list to check if the npc we are moving to is also nearest our next task
- Add Config.UseWarcries, self-explantory but give option to have barbs use their warcries or not. Hellpful if you are using a high level barb to get warcries from so you don't overwrite it with a lower level one
- add DiablosBoneCage to sdk

* Formatting

- re-organized precast and pickit files to have the functions arranged in order with the main ones at the bottom doPrecast for Precast.js and pickItems for Pickit.js
- re-name Precast.precastSkill to Precast.cast
- re-name Precast.precastables tp Precast.skills

* Add ClearRadius config for DIablo/DiabloHelper

- allow control over radius cleared at each node while following path to seals during Diablo scripts

* Missed some references to Precast.skills.battleOrders

* Update sdk.js

- add locale string id for Ghostly, Fanatic, and Berserker

* Update Prototypes.js

- add more monster type prototypes
- add monster enchant prototypes
- add unit prototype hasEnchant to check if a monster has a certain enchant
- add polyfill (sorta?) for modern js object operator .? just basic functionaility to test if an object has a key without d2bs throwing an undefined error.

* Update Misc.js

- Better collision check for tk on chests

* Update Prototypes.js

- add me.getWeaponQuantity - for using throwing weapons
- add me.inShop - not used but checks if we are currently in shop or interacting with an npc
- add Unit.isBeetle
- add last parameter to prototype test function to return a null value instead of empty obj if we want a value returned

* Update Prototypes.js

- lower delay for Unit.use

* Update Town.js

- fix typo for sdk locale string id in reviveMerc

* Update Barbarian.js

- add support for throw barbs to check weapon quantity before attempting attack

* Update Prototypes.js

- add monster case to Unit getter "attacking"

* Update Pather.js

- refactor the move functions

* Update Attack.js

- check if boss is actually dead during Attack.clear if used with a bossID

* Update Prototypes.js

- added Unit.oneOrTwoHanded and Unit.strictlyTwoHanded to handle item checking better

* Update Necromancer.js

- small clean-up

* D2BotMule cleanup

- lots of clean-up
- moved the anti-idle stuff into it's own thread

* Update Common.js

- small cleanup

* Update Prototypes.js

- fix for in loops

* Update Util.js

- remove arrow syntax, keep const to prevent reassignment of these functions

* Update Util.js

- fix dumb mistake. Tried to use function before it was defined right below it

* Update Util.js

- typo...oof

* Update ControlBot.js

- fix wp list

* Add config option to LootFilter for MapMode

- add UseOwnItemFilter option to configure whether or not it starts with the default filter active or your own (pickit file based)
- clear title message with .hide

* Add Config.UseCta

- option to not use our own cta, helpful if running with a bo barb

* add portal check to Harrogath -> Nihlathaks Temple

- check for existing portal, if no portal but we've completed the pre-req then talk to anya
- add Object.values and Object.entries polyfills
- fix unit check, and partyUnit act check
If the character is started outside of A1 and is set as NOT the portal maker, it will wait indefinitely, removing the In Town check from before `Town.goToTown(1)` on line 128 resolves this.
* Update sdk.js

- add sdk.clicktypes.click.map values (THANK YOU XCON)
- separated sdk.clicktypes.click into click.map and click.item

* Update libs with new sdk values

* Update D2BotMule.dbj

- fix clearing scrolls in D2BotMule
#346
- Issue was once the item had been identified it was being checked as a junk item and field id keep vs drop only deals with wanted or unwanted
- Starter.gameInfo wasn't being set in d2botmap
- AutoMule, ect aren't included in that entry which was causing OOG to throw an error when the followers requested a game
* Fix failing to mule due to early status set

- Status was being set prematurely, causing the mules to leave before the muler arrived
- Cleaned up some of the code, refactoring and minimizing
- added item unit prototypes isAnni, isTorch, and isGheeds
- added static String function isEqual, check if two strings are equal by converting both string to lowercase then checking equality
- added Array.prototype.at, get element at index using positive numbers to start from the beginning and negative to start from the end
- load antiidle thread from default.dbj for automule, (might change this later, torn on how to set everything cleanly)

* Update D2BotMule.dbj

- add mainloop label and continue next iteration after making a new mule character. Should fix hitting game refresh causing the mule to hangout in the lobby instead of going back into game

* Handle fail to join due to full game with continuous muling

- keep track of our items rather than all items on the ground in case there are multiple mulers
- check player count before picking items back up, in case mule is just busy.
- Increase timeout delay before re-picking items
- add a timeout in the case of a mule game being full, might need work but for now static delay of 3 minutes
- break from pick item loop with continuous mule if there are no items left on the ground
- when waiting on continuous mode recheck after 10 minutes.

* Clean up main in d2botmule

- refactored some of the sections of main into separate functions.
- added Worker module to handle antiIdle
- added prettyPrint unit prototype to handle easily getting full name of item
- log name of items to console that a bot is muling, seems helpful to know
- add Town.ignoreType -- use to replace the repeated check of Town.ignoreItemTypes.includes/indexOf...ect

* Update D2BotMule.dbj

- fix reference for recheckTick
- fix scope for item

* Update D2BotMule.dbj

- fix bug with continuous muling when multiple mulers and joining/leaving causing status to get reset to waiting due to the gameevent firing
- minor cleanups and some additional checks to hopefully prevent weird bug where we are not in game but attempting to init anyway
- increase ingameTimeout times in case there is some lag while joining game

* Update D2BotMule.dbj

- fix location check, don't restart if location is equal to null

* Update default.dbj

- remove commented out antiidle thread, I went with a background worker instead
* Bug fixes for SealLeecher and Diablo scripts

- SealLeecher wasn't able to follow leader commands if the command array got polluted
- wrap in try - finally to remove event listener when done
- When Config.Diablo.WalkClear was used, it could leak over to scripts afterwards so wrap in try - finally to reset value of Pather.teleport

* Remove event listeners when done with script

- add distance checks to Worldstone.js to speed up moving from WSK1 to WSK3

* Update MFHelper.js

- if player gives us a command and we aren't in town and not in their area then go to their town
- check if we are in the correct town before first attempting to take leader player's portal
`sdk.locale.text.UsenameIncludedIllegalChars` -> `sdk.locale.text.UsernameIncludedIllegalChars`
`sdk.locale.text.UsenameIncludedDisallowedwords` -> `sdk.locale.text.UsernameIncludedDisallowedwords`
* GemHunter reverted

* let Pather also Pick gems while Hunting

* autopick and keep base and upgraded  gems
* Update Pickit.js

- fix `Pickit.canMakeRoom` to take into account items in inventory we don't want or can sell to make room

* Update AutoMule.js

- prevent junk items from being muled

* Update AutoMule.js

- use !isWanted check

* Squashed commit of the following:

commit 97a6b07
Author: Georg R <39526093+icommitdesnet@users.noreply.github.com>
Date:   Sun Jan 29 18:52:33 2023 +0100

    Gem Hunter (#354)

    * GemHunter reverted

    * let Pather also Pick gems while Hunting

    * autopick and keep base and upgraded  gems

commit bbcfe4d
Author: Georg R <39526093+icommitdesnet@users.noreply.github.com>
Date:   Sat Jan 28 17:42:03 2023 +0100

    fix typos (#359)

    `sdk.locale.text.UsenameIncludedIllegalChars` -> `sdk.locale.text.UsernameIncludedIllegalChars`
    `sdk.locale.text.UsenameIncludedDisallowedwords` -> `sdk.locale.text.UsernameIncludedDisallowedwords`
* fix wrong creation of itemCodeByClassIdAndQuality
quality set was overwritten, when uniqe and set of same class
occured when set item dropped that had unique of same classid

* keys 7,8,9, numdash may now be pressed without
settings being displayed

* ActionHook cleanup + gemhunter bug fixes

- ActionHooks changes:
  - Changed order of ActionHokks.event switch case to check the key toggles first
  - Changed blockKeyEventFlags array into blockKeyEvent function and removed the duplicate calls with the re-ordered case structure
  - Changed the getHook check for the settings menu to just use TextHooks.displaySettings rather than boolean casting a possible failed get
  - wrapped event in try - catch - finally as we are playing manual and a failed event shouldn't kill mapthread, we are present so just log the error for our info. Also finally ensures that action is always reset to null

- GemHunter fixes
  - Removed Town.storeGem from Town.doChores. We shouldn't always carry gems it takes invo space
  - Changed canStashGem to return true if we aren't currently running the GemHunter script, again to make sure we don't fill our invo with gems
  - Changed storeGem to getGem for a clearer meaning, and only have it run if we are in the GemHunter script currently. Likely to change that behavior later as it makes sense that if we come across a gem shrine during travels to go get our best gem from the stash first
  - Fixed how pickit handles keeping gems, We now only keep them for GemHunter, and we only keep 1 of each type wanted. Also changed the result to be accurate rather than use cubing result

---------

Co-authored-by: theBGuy <60308670+theBGuy@users.noreply.github.com>
- update discord link
@noah- noah- deleted the branch jmichelsen:master February 26, 2023 03:01
@noah- noah- deleted the master branch February 26, 2023 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet