Skip to content
2 changes: 1 addition & 1 deletion Albion/Merlin/Console.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private struct Log
private List<Log> logs = new List<Log>();
private Vector2 scrollPosition;
private bool show;
private bool collapse;
private bool collapse = true;
private bool scroll = true;
private bool limit = true;

Expand Down
5 changes: 4 additions & 1 deletion Albion/Merlin/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ public static void Unload()
_coreObject = null;
}

public static string lastLog;
public static void Log(string message)
{
Debug.Log($"[{DateTime.Now}] {message}");
if (message != lastLog)
Debug.Log($"[{DateTime.Now}] {message}");
lastLog = message;
}

public static void Log(Exception e)
Expand Down
14 changes: 7 additions & 7 deletions Albion/Merlin/Profiles/Gatherer/Gatherer.Banking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ namespace Merlin.Profiles.Gatherer
{
public sealed partial class Gatherer
{
private WorldPathingRequest _worldPathingRequest;
private PositionPathingRequest _bankPathingRequest;
private WorldPathingRequest _worldPathingRequest;
private PositionPathingRequest _bankPathingRequest;
private PositionPathingRequest _bankFindPathingRequest;
private bool _isDepositing;
private bool _isDepositing;
private bool _movingToBank = false;
private static DateTime _nextBankAction;

Expand Down Expand Up @@ -46,10 +46,10 @@ public void Bank()
if (HandlePathing(ref _worldPathingRequest))
return;

if (HandlePathing(ref _bankFindPathingRequest, () => _client.GetEntities<BankBuildingView>((x) => { return true; }).Count > 0))
if (HandlePathing(ref _bankFindPathingRequest, () => _client.GetEntities<BankBuildingView>((x) => { return true; }).Count > 0))
return;

if (HandlePathing(ref _bankPathingRequest, null))
if (HandlePathing(ref _bankPathingRequest, null))
return;

Worldmap worldmapInstance = GameGui.Instance.WorldMap;
Expand Down Expand Up @@ -130,8 +130,7 @@ private bool moveObjectsToBank()
{
//Get inventory
var playerStorage = GameGui.Instance.CharacterInfoGui.InventoryItemStorage;
var vaultStorage = GameGui.Instance.MultiVaultGui.AdditionalViewVault.InventoryStorage;

var vaultStorage = GameGui.Instance.MultiVaultGui.MainViewVault.InventoryStorage;
var ToDeposit = new List<UIItemSlot>();

//Get all items we need that are visible. Need to find a way to get all items in player inventory.
Expand All @@ -150,6 +149,7 @@ private bool moveObjectsToBank()
}

_isDepositing = ToDeposit != null && ToDeposit.Count > 0;

foreach (var item in ToDeposit)
{
GameGui.Instance.MoveItemToItemContainer(item, vaultStorage.ItemContainerProxy);
Expand Down
6 changes: 6 additions & 0 deletions Albion/Merlin/Profiles/Gatherer/Gatherer.Combat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ public void Fight()
_combatTarget = _localPlayerCharacterView.GetAttackTarget();
_combatSpells = _combatPlayer.GetSpellSlotsIndexed().Ready(_localPlayerCharacterView).Ignore("ESCAPE_DUNGEON").Ignore("PLAYER_COUPDEGRACE").Ignore("AMBUSH");

if (_combatPlayer.GetIsChanneling())
{
Core.Log("You are channeling a spell. Wait for Channeling to finish!");
return;
}

if (_localPlayerCharacterView.IsCasting() || _combatPlayer.GetIsCasting())
{
Core.Log("You are casting. Wait for casting to finish");
Expand Down
12 changes: 6 additions & 6 deletions Albion/Merlin/Profiles/Gatherer/Gatherer.Harvest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,19 @@ public void Harvest()
#endregion [dTormentedSoul Area]

if (!ValidateTarget(_currentTarget))
{
{
Core.Log("Resource DepletedSearch for new one.");
_state.Fire(Trigger.DepletedResource);
return;
}

if (_currentTarget is HarvestableObjectView harvestableObject)
{
{
//Core.Log("Begin Harvest of Resource");
HarvestHarvestableObjec(harvestableObject);
}
else if (_currentTarget is MobView mob)
{
{
//Core.Log("Begin Harvest of Mob");
HarvestMob(mob);
}
Expand Down Expand Up @@ -291,12 +291,12 @@ public void HarvestMob(MobView mob)
//var attackRange = _localPlayerCharacterView.LocalPlayerCharacter.t2() + mob.Mob.x1().f9();

var minimumAttackRange = isMeleeWeapon ? MELEE_ATTACK_RANGE : RANGED_ATTACK_RANGE;
var isInLoS = _localPlayerCharacterView.IsInLineOfSight(mob);
//var isInLoS = _localPlayerCharacterView.IsInLineOfSight(mob);

if (HandlePathing(ref _harvestPathingRequest, () => centerDistance <= minimumAttackRange && isInLoS))
if (HandlePathing(ref _harvestPathingRequest, () => centerDistance <= minimumAttackRange))
return;

if (centerDistance >= minimumAttackRange || !isInLoS)
if (centerDistance >= minimumAttackRange)
{
if (_localPlayerCharacterView.TryFindPath(new ClusterPathfinder(), targetCenter, IsBlockedGathering, out List<Vector3> pathing))
{
Expand Down
23 changes: 13 additions & 10 deletions Albion/Merlin/Profiles/Gatherer/Gatherer.Search.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void Search()

if (_localPlayerCharacterView.GetLocalPlayerCharacter().HasAnyBrokenItem())
{
Core.Log("Damaged - Items fell below 10% durability. Head to Repair in home town");
Core.Log("Damaged - Items fell below 60% durability. Head to Repair in home town");
_state.Fire(Trigger.Damaged);
return;
}
Expand Down Expand Up @@ -144,15 +144,18 @@ private void Search()

public bool Loot()
{
//var silver = _client.GetEntities<SilverObjectView>(s => !s.IsLootProtected()).FirstOrDefault();
//if (silver != null)
//{
// Core.Log($"[Silver {silver.name}]");
// _localPlayerCharacterView.Interact(silver);
// return true;
//}

var loot = _client.GetEntities<LootObjectView>(l => l.CanLoot()).FirstOrDefault();
var silver = _client.GetEntities<SilverObjectView>(x => Vector3.Distance(_localPlayerCharacterView.transform.position, x.transform.position) < 8).FirstOrDefault();
if (silver != null)
{

Core.Log($"[Silver {silver.name}]");
_localPlayerCharacterView.Interact(silver);
return true;

}

var loot = _client.GetEntities<LootObjectView>(x => x.CanLoot() && Vector3.Distance(_localPlayerCharacterView.transform.position, x.transform.position) < 8).FirstOrDefault();

if (loot != null)
{
if (ContainKeepers(loot.transform.position))
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ We have a [Trello board](https://trello.com/b/eGLVeGbL/merlin) where you can see
Join us! :+1:

```javascript
https://discord.gg/Z4Qtjty
https://discord.gg/aPfbDgK
```

We have a [Discord Channel](https://discord.gg/Z4Qtjty) community to code tools for Albion Online.
We have a [Discord Channel](https://discord.gg/aPfbDgK) community to code tools for Albion Online.



Expand Down
8 changes: 8 additions & 0 deletions albion-load.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@ SET Target=Albion-Online.exe

SET LoadingAssembly=%AssemblyPath%\%AssemblyName%.dll

echo Unloading
if exist %UnloadAssembly% injector -dll %UnloadAssembly% -target %Target% -namespace %AssemblyName% -class Core -method Unload

echo Loading
if exist %UnloadAssembly% del %UnloadAssembly%

copy /y %LoadingAssembly% %UnloadAssembly%

injector -dll %LoadingAssembly% -target %Target% -namespace %AssemblyName% -class Core -method Load

13 changes: 10 additions & 3 deletions albion-unload.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@echo off

echo Unoading
injector -dll Albion\Release\Merlin-unload.dll -target Albion-Online.exe -namespace Merlin -class Core -method Unload
del Albion\Release\Merlin-unload.dll
SET AssemblyPath=Albion\Release
SET AssemblyName=Merlin

SET Target=Albion-Online.exe

SET UnloadAssembly=%AssemblyPath%\%AssemblyName%-unload.dll

echo Unloading
if exist %UnloadAssembly% injector -dll %UnloadAssembly% -target %Target% -namespace %AssemblyName% -class Core -method Unload
if exist %UnloadAssembly% del %UnloadAssembly%