Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/template/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ character:
useMerc: true
stashToShared: false
useTeleport: true # If set to false, bot will not use teleport skill and will walk to the destination
useTeleStomp: true # If set to false, bot will clear closest monsers first

game:
minGoldPickupThreshold: 500000 # If total gold amount is less than this, bot will pick up and sell magic+ items
Expand Down
12 changes: 12 additions & 0 deletions internal/action/step/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ func ensureEnemyIsInRange(monster data.Monster, maxDistance, minDistance int) er
distanceToMonster := ctx.PathFinder.DistanceFromMe(monster.Position)
hasLoS := ctx.PathFinder.LineOfSight(currentPos, monster.Position)

if ctx.CharacterCfg.Character.UseTeleStomp {
// We have line of sight, and we are inside the attack range, we can skip
if hasLoS && distanceToMonster <= 3 {
return nil
}

// move directly to target to telestomp
if distanceToMonster >= 3 {
return MoveTo(monster.Position)
}
}

// We have line of sight, and we are inside the attack range, we can skip
if hasLoS && distanceToMonster <= maxDistance && distanceToMonster >= minDistance {
return nil
Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ type CharacterCfg struct {
UseMerc bool `yaml:"useMerc"`
StashToShared bool `yaml:"stashToShared"`
UseTeleport bool `yaml:"useTeleport"`
UseTeleStomp bool `yaml:"useTeleStomp"`
BerserkerBarb struct {
FindItemSwitch bool `yaml:"find_item_switch"`
SkipPotionPickupInTravincal bool `yaml:"skip_potion_pickup_in_travincal"`
Expand Down
5 changes: 3 additions & 2 deletions internal/run/nihlathak.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ func (n Nihlathak) Run() error {
action.MoveToCoords(o.Position)

// Try to position in the safest corner
action.MoveToCoords(n.findBestCorner(o.Position))

if !n.ctx.CharacterCfg.Character.UseTeleStomp {
action.MoveToCoords(n.findBestCorner(o.Position))
}
// Disable item pickup before the fight
n.ctx.DisableItemPickup()

Expand Down
11 changes: 11 additions & 0 deletions internal/server/assets/js/character_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ document.addEventListener('DOMContentLoaded', function () {
const novaSorceressOptions = document.querySelector('.nova-sorceress-options');
const bossStaticThresholdInput = document.getElementById('novaBossStaticThreshold');
const mosaicAssassinOptions = document.querySelector('.mosaic-assassin-options');
const teleportEnabled = document.querySelector('input[name="characterUseTeleport"]');
const teleStompEnabled = document.querySelector('input[name="characterUseTeleStomp"]');

if (bossStaticThresholdInput) {
bossStaticThresholdInput.addEventListener('input', handleBossStaticThresholdChange);
Expand All @@ -128,6 +130,13 @@ document.addEventListener('DOMContentLoaded', function () {
schedulerSettings.style.display = schedulerEnabled.checked ? 'grid' : 'none';
}

function toggleTeleStompVisibility(){
if (!teleportEnabled.checked){
teleStompEnabled.checked = false;
}
teleStompEnabled.disabled = teleportEnabled.checked ? false : true;
}

function updateCharacterOptions() {
const selectedClass = characterClassSelect.value;
const noSettingsMessage = document.getElementById('no-settings-message');
Expand Down Expand Up @@ -196,8 +205,10 @@ document.addEventListener('DOMContentLoaded', function () {
// Set initial state
toggleSchedulerVisibility();
updateNovaSorceressOptions();
toggleTeleStompVisibility();

schedulerEnabled.addEventListener('change', toggleSchedulerVisibility);
teleportEnabled.addEventListener('change', toggleTeleStompVisibility);

document.querySelectorAll('.add-time-range').forEach(button => {
button.addEventListener('click', function () {
Expand Down
1 change: 1 addition & 0 deletions internal/server/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ func (s *HttpServer) characterSettings(w http.ResponseWriter, r *http.Request) {
cfg.Character.Class = r.Form.Get("characterClass")
cfg.Character.StashToShared = r.Form.Has("characterStashToShared")
cfg.Character.UseTeleport = r.Form.Has("characterUseTeleport")
cfg.Character.UseTeleStomp = r.Form.Has("characterUseTeleStomp")

// Berserker Barb specific options
if cfg.Character.Class == "berserker" {
Expand Down
6 changes: 6 additions & 0 deletions internal/server/templates/character_settings.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
<input type="checkbox" name="characterUseTeleport" {{ if .Config.Character.UseTeleport }}checked{{ end }}/>
Use teleport when available
</label>
<label>
<input type="checkbox" name="characterUseTeleStomp" {{ if .Config.Character.UseTeleStomp }}checked{{ end }}/>
Use telestomp attack
</label>
<label>
<input type="checkbox" name="characterStashToShared" {{ if .Config.Character.StashToShared }}checked{{ end }}/>
Always stash to shared tab
Expand All @@ -154,6 +158,8 @@
<input type="checkbox" name="useCentralizedPickit" {{ if .Config.UseCentralizedPickit }}checked{{ end }}/>
Use centralized pickit
</label>
<label>
</label>
<label>
<input type="checkbox" name="useCainIdentify" {{ if .Config.Game.UseCainIdentify }}checked{{ end }}/>
Identify with Cain
Expand Down