Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
domesticwarlord86 committed May 26, 2024
2 parents 2cb2253 + 43193a4 commit 9e6ff66
Show file tree
Hide file tree
Showing 16 changed files with 250 additions and 695 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,6 @@ csharp_space_after_keywords_in_control_flow_statements=true

# CS0649: Field 'LocalPlayerExtensions.Offsets.CurrentGC' is never assigned to, and will always have its default value
dotnet_diagnostic.CS0649.severity = silent

dotnet_diagnostic.CA1416.severity = none

1 change: 0 additions & 1 deletion AssemblyProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Reflection;
using System.Windows.Media;
using ff14bot;
Expand Down
2 changes: 1 addition & 1 deletion ClientDataHelpers/UiManagerProxy.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using ff14bot;
using LlamaLibrary.Memory;
Expand Down
1 change: 0 additions & 1 deletion Enums/World.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using LlamaLibrary.Extensions;

// ReSharper disable IdentifierTypo
Expand Down
4 changes: 1 addition & 3 deletions Extensions/EnumExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using ff14bot.Enums;
using LlamaLibrary.Enums;
using System.ComponentModel.DataAnnotations;
using System.Reflection;

namespace LlamaLibrary.Extensions
{
Expand Down
24 changes: 12 additions & 12 deletions Extensions/LocalPlayerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace LlamaLibrary.Extensions
public static class LocalPlayerExtensions
{
public const uint TheEndeavor = 900;
public const uint TheEndeaver_Ruby = 1163;
public const uint TheEndeaverRuby = 1163;

internal static class Offsets
{
Expand All @@ -28,7 +28,7 @@ internal static class Offsets

//PlayerID 8byte ulong ID unique to that character which is included in MB listings
[Offset("Search 48 8B 05 ? ? ? ? 48 8D 0D ? ? ? ? 41 8B DC Add 3 TraceRelative")]
internal static IntPtr PlayerID;
internal static IntPtr PlayerId;

[Offset("Search 0F B6 05 ? ? ? ? 88 83 ? ? ? ? Add 3 TraceRelative")]
internal static IntPtr RunWalk;
Expand All @@ -52,7 +52,7 @@ public static bool IsFishing(this LocalPlayer play)

public static bool IsOnFishingBoat(this LocalPlayer play)
{
return WorldManager.RawZoneId == TheEndeavor || WorldManager.RawZoneId == TheEndeaver_Ruby;
return WorldManager.RawZoneId == TheEndeavor || WorldManager.RawZoneId == TheEndeaverRuby;
}

public static Location Location(this LocalPlayer play)
Expand Down Expand Up @@ -127,7 +127,7 @@ public static bool CheckCondition(this LocalPlayer player, byte condition)

public static ulong PlayerId(this LocalPlayer player)
{
return Core.Memory.Read<ulong>(Offsets.PlayerID);
return Core.Memory.Read<ulong>(Offsets.PlayerId);
}

public static World HomeWorld(this Character? character)
Expand All @@ -140,27 +140,27 @@ public static int CurrentMount(this LocalPlayer player)
return Core.Memory.Read<int>(player.Pointer + Offsets.CurrentMount);
}

public static bool IsTank(this ClassJobType CurrentJob)
public static bool IsTank(this ClassJobType currentJob)
{
return CurrentJob == ClassJobType.Gladiator || CurrentJob == ClassJobType.Marauder || CurrentJob == ClassJobType.Paladin || CurrentJob == ClassJobType.Warrior || CurrentJob == ClassJobType.DarkKnight || CurrentJob == ClassJobType.Gunbreaker;
return currentJob == ClassJobType.Gladiator || currentJob == ClassJobType.Marauder || currentJob == ClassJobType.Paladin || currentJob == ClassJobType.Warrior || currentJob == ClassJobType.DarkKnight || currentJob == ClassJobType.Gunbreaker;
}

//IsHealer
public static bool IsHealer(this ClassJobType CurrentJob)
public static bool IsHealer(this ClassJobType currentJob)
{
return CurrentJob == ClassJobType.Conjurer || CurrentJob == ClassJobType.WhiteMage || CurrentJob == ClassJobType.Scholar || CurrentJob == ClassJobType.Astrologian;
return currentJob == ClassJobType.Conjurer || currentJob == ClassJobType.WhiteMage || currentJob == ClassJobType.Scholar || currentJob == ClassJobType.Astrologian;
}

//IsMeleeDps
public static bool IsMeleeDps(this ClassJobType CurrentJob)
public static bool IsMeleeDps(this ClassJobType currentJob)
{
return CurrentJob == ClassJobType.Pugilist || CurrentJob == ClassJobType.Lancer || CurrentJob == ClassJobType.Rogue || CurrentJob == ClassJobType.Samurai || CurrentJob == ClassJobType.Monk || CurrentJob == ClassJobType.Dragoon || CurrentJob == ClassJobType.Ninja;
return currentJob == ClassJobType.Pugilist || currentJob == ClassJobType.Lancer || currentJob == ClassJobType.Rogue || currentJob == ClassJobType.Samurai || currentJob == ClassJobType.Monk || currentJob == ClassJobType.Dragoon || currentJob == ClassJobType.Ninja;
}

//IsRangedDps
public static bool IsRangedDps(this ClassJobType CurrentJob)
public static bool IsRangedDps(this ClassJobType currentJob)
{
return CurrentJob == ClassJobType.Archer || CurrentJob == ClassJobType.Machinist || CurrentJob == ClassJobType.Dancer || CurrentJob == ClassJobType.Bard;
return currentJob == ClassJobType.Archer || currentJob == ClassJobType.Machinist || currentJob == ClassJobType.Dancer || currentJob == ClassJobType.Bard;
}

public static GearSet[] SortedGearSets(this LocalPlayer player)
Expand Down
2 changes: 1 addition & 1 deletion Extensions/OtherExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static string GetOrderJson(this IEnumerable<Order> orders)
return JsonConvert.SerializeObject(orders.OrderBy(i => i.Type), Formatting.Indented, settings);
}

public static bool Contains(this string source, string toCheck, StringComparison comp)
public static bool Contains(this string? source, string toCheck, StringComparison comp)
{
return source?.IndexOf(toCheck, comp) >= 0;
}
Expand Down
19 changes: 5 additions & 14 deletions Extensions/RetainerTaskAskExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,16 @@ public static class RetainerTaskAskExtensions
{
public static bool CanAssign()
{
var WindowByName = RaptureAtkUnitManager.GetWindowByName("RetainerTaskAsk");
if (WindowByName == null)
{
return false;
}
var windowByName = RaptureAtkUnitManager.GetWindowByName("RetainerTaskAsk");

var remoteButton = WindowByName.FindButton(40);
return remoteButton != null && remoteButton.Clickable;
var remoteButton = windowByName?.FindButton(40);
return remoteButton is { Clickable: true };
}

public static string GetErrorReason()
{
var WindowByName = RaptureAtkUnitManager.GetWindowByName("RetainerTaskAsk");
if (WindowByName == null || WindowByName.FindLabel(39) == null)
{
return "";
}

return WindowByName.FindLabel(39).Text;
var windowByName = RaptureAtkUnitManager.GetWindowByName("RetainerTaskAsk");
return windowByName?.FindLabel(39) == null ? "" : windowByName.FindLabel(39).Text;
}
}
}
10 changes: 5 additions & 5 deletions Helpers/GeneralFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1676,21 +1676,21 @@ public static async Task TurninSkySteelGathering()
if (turninItems.Any())
{
await InteractWithDenys(3);
await Coroutine.Wait(10000, () => ShopExchangeItem.Instance.IsOpen);
if (ShopExchangeItem.Instance.IsOpen)
await Coroutine.Wait(10000, () => LlamaLibrary.RemoteWindows.ShopExchangeItem.Instance.IsOpen);
if (LlamaLibrary.RemoteWindows.ShopExchangeItem.Instance.IsOpen)
{
Log.Information($"Window Open");
foreach (var turnin in turninItems)
{
var reward = GatheringItems[turnin.RawItemId].Reward;
var amt = turnin.Count / GatheringItems[turnin.RawItemId].Cost;
Log.Information($"Buying {amt}x{DataManager.GetItem(reward).CurrentLocaleName}");
await ShopExchangeItem.Instance.Purchase(reward, amt);
await LlamaLibrary.RemoteWindows.ShopExchangeItem.Instance.Purchase(reward, amt);
await Coroutine.Sleep(500);
}

ShopExchangeItem.Instance.Close();
await Coroutine.Wait(10000, () => !ShopExchangeItem.Instance.IsOpen);
LlamaLibrary.RemoteWindows.ShopExchangeItem.Instance.Close();
await Coroutine.Wait(10000, () => !LlamaLibrary.RemoteWindows.ShopExchangeItem.Instance.IsOpen);
}
}
}
Expand Down
20 changes: 9 additions & 11 deletions Helpers/LoadServerProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Media;
using System.Xml.Linq;
using Buddy.Coroutines;
using ff14bot;
using ff14bot.Behavior;
using ff14bot.Enums;
using ff14bot.Helpers;
using ff14bot.Managers;
using ff14bot.NeoProfiles;
using ff14bot.RemoteWindows;
using LlamaLibrary.Helpers;
using LlamaLibrary.Helpers.NPC;
using LlamaLibrary.Logging;
using LlamaLibrary.RemoteAgents;
using LlamaLibrary.RemoteWindows;
Expand Down Expand Up @@ -127,12 +123,12 @@ public class LoadServerProfile

private static readonly ShuffleCircularQueue<string> _greetingQueue = new ShuffleCircularQueue<string>(Greetings);

private static ShuffleCircularQueue<string> _greetingQueueCustom;
//private static ShuffleCircularQueue<string> _greetingQueueCustom;

public static ChatBroadcaster PartyBroadcaster = new ChatBroadcaster(MessageType.Party);
public static ChatBroadcaster EmoteBroadcaster = new ChatBroadcaster(MessageType.StandardEmotes);

public static async Task LoadProfile(string profileName, int QueueType, bool GoToBarracks, bool sayHello, bool sayHelloCustom, string sayHelloMessages)
public static async Task LoadProfile(string profileName, int QueueType, bool GoToBarracks, bool sayHello = false, bool sayHelloCustom = false, string sayHelloMessages = "")
{
Log.Information("Loading Profile");

Expand Down Expand Up @@ -492,8 +488,6 @@ await Coroutine.Wait(-1,

Log.Information("Should be in duty");

ShuffleCircularQueue<string> _greetingQueueCustom = new ShuffleCircularQueue<string>(SayHelloMessages.Split('/'));

if (DirectorManager.ActiveDirector is ff14bot.Directors.InstanceContentDirector director)
{
var time = new TimeSpan(1, 29, 59);
Expand Down Expand Up @@ -524,9 +518,13 @@ await Coroutine.Wait(-1,

if (sayHelloCustom && sayHello)
{
var sentcustomgreeting = _greetingQueueCustom.Dequeue();
Log.Information($"Saying '{sentcustomgreeting}' the group");
await PartyBroadcaster.Send(sentcustomgreeting);
ShuffleCircularQueue<string> greetingQueueCustomNew = new ShuffleCircularQueue<string>(SayHelloMessages.Split('/'));
if (greetingQueueCustomNew.Any)
{
var sentcustomgreeting = greetingQueueCustomNew.Dequeue();
Log.Information($"Saying '{sentcustomgreeting}' the group");
await PartyBroadcaster.Send(sentcustomgreeting);
}
}

await Coroutine.Wait(-1, () => director.TimeLeftInDungeon < time);
Expand Down
2 changes: 1 addition & 1 deletion LastCommit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-05-15T12:30:53-05:00
2024-05-22T18:16:19-04:00
Loading

0 comments on commit 9e6ff66

Please sign in to comment.