-
Notifications
You must be signed in to change notification settings - Fork 332
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
Pathing improvements for walking bots #1381
Open
MikeKGilmore
wants to merge
8
commits into
kolton:master
Choose a base branch
from
MikeKGilmore:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2a771d9
Pathing Update: Improve Pathing Behavior for Walking Bots
MikeKGilmore 0bbda90
Correct syntax in Misc.js
MikeKGilmore 9ca4361
Disable Pathing Debug Drawing
MikeKGilmore dbbd06c
Change Pather.pathTo back to Pather.moveTo
MikeKGilmore 0efa2b0
Replace missed pathTo calls in Town.js with moveTo
MikeKGilmore f4927c5
Pathing updates - remove maneuverTo, add actions to moveTo, add act t…
MikeKGilmore a4f6c65
Behavior improvements - Reduce log verbosity and take more direct rou…
MikeKGilmore 3e5a909
Implement support for transitioning via NPC from act 2->3
MikeKGilmore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -551,7 +551,6 @@ var Attack = { | |
} | ||
|
||
ClassAttack.afterAttack(pickit); | ||
this.openChests(range, orgx, orgy); | ||
|
||
if (attackCount > 0 && pickit) { | ||
Pickit.pickItems(); | ||
|
@@ -722,7 +721,6 @@ var Attack = { | |
} | ||
|
||
ClassAttack.afterAttack(true); | ||
this.openChests(30); | ||
|
||
if (attackCount > 0) { | ||
Pickit.pickItems(); | ||
|
@@ -863,7 +861,7 @@ var Attack = { | |
|
||
var room, result, rooms, myRoom, currentArea, previousArea; | ||
|
||
function RoomSort(a, b) { | ||
function RoomSort (a, b) { | ||
return getDistance(myRoom[0], myRoom[1], a[0], a[1]) - getDistance(myRoom[0], myRoom[1], b[0], b[1]); | ||
} | ||
|
||
|
@@ -905,7 +903,7 @@ var Attack = { | |
result = Pather.getNearestWalkable(room[0], room[1], 18, 3); | ||
|
||
if (result) { | ||
Pather.moveTo(result[0], result[1], 3, spectype); | ||
Pather.moveTo(result[0], result[1], 3, spectype, true); | ||
previousArea = result; | ||
//this.countUniques(); | ||
|
||
|
@@ -1008,42 +1006,6 @@ var Attack = { | |
return true; | ||
}, | ||
|
||
// Open chests when clearing | ||
openChests: function (range, x, y) { | ||
if (!Config.OpenChests) { | ||
return false; | ||
} | ||
|
||
if (x === undefined || y === undefined) { | ||
x = me.x; | ||
y = me.y; | ||
} | ||
|
||
var i, unit, | ||
list = [], | ||
ids = ["chest", "chest3", "weaponrack", "armorstand"]; | ||
|
||
unit = getUnit(2); | ||
|
||
if (unit) { | ||
do { | ||
if (unit.name && getDistance(unit, x, y) <= range && ids.indexOf(unit.name.toLowerCase()) > -1) { | ||
list.push(copyUnit(unit)); | ||
} | ||
} while (unit.getNext()); | ||
} | ||
|
||
while (list.length) { | ||
list.sort(Sort.units); | ||
|
||
if (Misc.openChest(list.shift())) { | ||
Pickit.pickItems(); | ||
} | ||
} | ||
|
||
return true; | ||
}, | ||
|
||
buildMonsterList: function () { | ||
var monster, | ||
monList = []; | ||
|
@@ -1093,7 +1055,7 @@ var Attack = { | |
return false; | ||
} | ||
|
||
function sortGrid(a, b) { | ||
function sortGrid (a, b) { | ||
//return getDistance(a.x, a.y, idealPos.x, idealPos.y) - getDistance(b.x, b.y, idealPos.x, idealPos.y); | ||
return getDistance(b.x, b.y, unit.x, unit.y) - getDistance(a.x, a.y, unit.x, unit.y); | ||
} | ||
|
@@ -1120,7 +1082,7 @@ var Attack = { | |
if (typeof index === "number") { | ||
//print("Dodge build time: " + (getTickCount() - tick)); | ||
|
||
return Pather.moveTo(grid[index].x, grid[index].y, 0); | ||
return Pather.moveTo(grid[index].x, grid[index].y, 0, false); | ||
} | ||
|
||
return false; | ||
|
@@ -1251,13 +1213,14 @@ var Attack = { | |
|
||
if ((unit.spectype & 0x7) && Config.SkipException && Config.SkipException.indexOf(unit.name) > -1) { | ||
print("ÿc1Skip Exception: " + unit.name); | ||
|
||
return true; | ||
} | ||
|
||
var i, j, rval, | ||
tempArray = []; | ||
|
||
EnchantLoop: // Skip enchanted monsters | ||
EnchantLoop: // Skip enchanted monsters | ||
for (i = 0; i < Config.SkipEnchant.length; i += 1) { | ||
tempArray = Config.SkipEnchant[i].toLowerCase().split(" and "); | ||
|
||
|
@@ -1327,7 +1290,7 @@ EnchantLoop: // Skip enchanted monsters | |
} | ||
} | ||
|
||
ImmuneLoop: // Skip immune monsters | ||
ImmuneLoop: // Skip immune monsters | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these should not be indented |
||
for (i = 0; i < Config.SkipImmune.length; i += 1) { | ||
tempArray = Config.SkipImmune[i].toLowerCase().split(" and "); | ||
|
||
|
@@ -1342,7 +1305,7 @@ ImmuneLoop: // Skip immune monsters | |
} | ||
} | ||
|
||
AuraLoop: // Skip monsters with auras | ||
AuraLoop: // Skip monsters with auras | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these should not be indented |
||
for (i = 0; i < Config.SkipAura.length; i += 1) { | ||
rval = true; | ||
|
||
|
@@ -1550,7 +1513,7 @@ AuraLoop: // Skip monsters with auras | |
Pather.walkTo(unit.x, unit.y, 3); | ||
} | ||
} else { | ||
Pather.moveTo(unit.x, unit.y, 0); | ||
Pather.moveTo(unit.x, unit.y, 0, false); | ||
} | ||
|
||
return !CollMap.checkColl(me, unit, coll); | ||
|
@@ -1598,12 +1561,12 @@ AuraLoop: // Skip monsters with auras | |
if (getDistance(me, coords[i]) < 6 && !CollMap.checkColl(me, coords[i], 0x5)) { | ||
Pather.walkTo(coords[i].x, coords[i].y, 2); | ||
} else { | ||
Pather.moveTo(coords[i].x, coords[i].y, 1); | ||
Pather.moveTo(coords[i].x, coords[i].y, 1, false); | ||
} | ||
|
||
break; | ||
default: | ||
Pather.moveTo(coords[i].x, coords[i].y, 1); | ||
Pather.moveTo(coords[i].x, coords[i].y, 1, false); | ||
|
||
break; | ||
} | ||
|
@@ -1620,4 +1583,4 @@ AuraLoop: // Skip monsters with auras | |
|
||
return false; | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should not be indented