• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Quack! Log out timer.

    Discussion in 'Plugins' started by Exmortem, Jun 29, 2014.

    1. WolfpackPB

      WolfpackPB Member

      Joined:
      Oct 15, 2014
      Messages:
      163
      Likes Received:
      5
      Trophy Points:
      18
      View attachment Quack.zip

      I went ahead and fixed the plugin until the original developer picks it back up, I've done some minor testing and it's working well for me.
       
    2. tishat

      tishat Member

      Joined:
      May 29, 2015
      Messages:
      735
      Likes Received:
      7
      Trophy Points:
      18
      You're the man.. man!
       
    3. FredrichChoppin

      FredrichChoppin New Member

      Joined:
      Jul 26, 2014
      Messages:
      17
      Likes Received:
      0
      Trophy Points:
      1
      the plugin that you provided does not teleport. It only stops the bot. Is there a way to fix that?


      EDIT:

      Some more info, my bot actually just starts running into the scenery of whatever I'm near and doesn't actually teleport.

      2nd edit:

      Got it to work by changing the way the bot logs out. Ill post the code snippet.

      Quack.cs
      Code:
      using System.Diagnostics;
      using System.Threading;
      using ff14bot;
      using ff14bot.Helpers;
      using ff14bot.Interfaces;
      using ff14bot.Managers;
      using ff14bot.Objects;
      using ff14bot.Behavior;
      using Newtonsoft.Json;
      using System;
      using System.IO;
      using Quack.Settings;
      using System.Configuration;
      using System.Runtime.InteropServices;
      
      namespace Quack_
      {
          public class Quack : IBotPlugin
          {
              #region Necessary Stuff
              public string Author { get { return "Exmortem"; } }
              public string Description { get { return "Logs out based on settings."; } }
              public Version Version { get { return new Version(0, 0, 1); } }
              public bool Equals(IBotPlugin other)
              {
                  throw new NotImplementedException();
              }
              public void OnInitialize()
              {
                  settings.Enabled = false;
              }
              public void OnShutdown()
              {
      			Logging.Write("[Quack!] OnShutdown.");
              }
              public void OnEnabled()
              {
                  settings.Enabled = false;
              }
              public void OnDisabled()		
              {
      			Logging.Write("[Quack!] Disabled.");
              }
              public string Name
              {
                  get { return "Quack!"; }
              }
              public bool WantButton
              {
                  get { return true; }
              }
              public string ButtonText
              {
                  get { return "Quack!"; }
              }
              public void OnButtonPress()
              {
                  if (_form == null || _form.IsDisposed || _form.Disposing)
                      _form = new frmMain();
      
                  _form.ShowDialog();    
              }
              #endregion
              #region Variables
              public static QuackSettings settings = QuackSettings.Instance;
              private frmMain _form;
              #endregion
      
              public void OnPulse()
              {
      
                  if (settings.Enabled)
                  {
                      if (System.DateTime.Now >= settings.TimeEnd)
                      {
                          if (Core.Player.InCombat)
      					{
      						Logging.Write("[Quack!] Waiting for combat to end.");
                              return;
      
      					}
      					else
      					{
      						Logging.Write("[Quack!] Starting stop sequence");
      						if (settings.Teleport)
      						{
      							if (Core.Player.IsMounted)
      							{
      								Logging.Write("[Quack!] Mounted, attempting dismount.");
      								Thread.Sleep(1000);
      								Actionmanager.Dismount();
      								Thread.Sleep(1000);
      							}
      							CommonBehaviors.MoveStop();
      							Logging.Write("[Quack!] Teleporting to {0}.",settings.TeleportLocation);
      							CommonBehaviors.MoveStop();
      							switch (settings.TeleportLocation)
      							{
      								case "New Gridania":
      									CommonBehaviors.MoveStop();
      									WorldManager.TeleportById(2);
      									Thread.Sleep(20000);
      									break;
      								case "Limsa Lominsa":
      									CommonBehaviors.MoveStop();
      									WorldManager.TeleportById(8);
      									Thread.Sleep(20000);
      									break;
      								case "Ul'dah":
      									CommonBehaviors.MoveStop();
      									WorldManager.TeleportById(9);
      									Thread.Sleep(20000);
      									break;
      							}
      							Thread.Sleep(20000);
      
      						}
      						
      						Logging.Write("[Quack!] Stopping Bot!");
      						TreeRoot.Stop();
      						
      						if (settings.Logout)
      						{
      			   
      							Logging.Write("[Quack!] Closing FFXIV.");
      
      							Process[] ffxiv = Process.GetProcessesByName("ffxiv");
      
      							foreach (Process p in ffxiv)
      								p.Kill();
      
      						}
      						
      					}
                      }
                  }
      
              }
          } 
      }
      
      #region Settings
      namespace Quack.Settings
      {
          public class QuackSettings : JsonSettings
          {
              [JsonIgnore]
              private static QuackSettings _instance;
              public static QuackSettings Instance { get { return _instance ?? (_instance = new QuackSettings("QuackSettings")); } }
              public QuackSettings(string filename) : base(Path.Combine(CharacterSettingsDirectory, "Quack.json")) { }
      
              [Setting]
              public bool Enabled { get; set; }
      
              #region Time Settings
              [Setting]
              public int HoursElapsed { get; set; }
              [Setting]
              public int MinutesElapsed { get; set; }
              [Setting]
              public DateTime TimeEnd { get; set; }
              [Setting]
              public DateTime TimeStart { get; set; }
              #endregion
              #region Action Settings
              [Setting]
              public bool Teleport { get; set; }
              [Setting]
              public string TeleportLocation { get; set; }
              [Setting]
              public bool Logout { get; set; }
              #endregion
          }
      }
      #endregion
      
      
      Edit 3:

      I'm fully aware that my code is sloppy. But it works and all it's doing is logging out so I don't really care that I'm calling things probably more than I need to.
       
    4. tishat

      tishat Member

      Joined:
      May 29, 2015
      Messages:
      735
      Likes Received:
      7
      Trophy Points:
      18
      Thanks man
       
    5. DBG

      DBG New Member

      Joined:
      Jul 16, 2014
      Messages:
      52
      Likes Received:
      0
      Trophy Points:
      0
      Still not working for me, even with the updated .cs work by FC, however I will actually do some testing tonight and figure out why this is (I believe it's just another condition that hasn't been tested yet - in my case, no space in inventory but the bot is still trying to gather. causing issues). I will update this post when I know more!

      Edit: Please ignore this - my own W.I.P. Triad Card Game botbase was the one causing it not to function properly.
       
      Last edited: Dec 17, 2015
    6. dreamer000

      dreamer000 New Member

      Joined:
      Jun 24, 2015
      Messages:
      1
      Likes Received:
      0
      Trophy Points:
      1
      Doesn't work on stormblood :(
       
    7. Parappa

      Parappa New Member

      Joined:
      Jun 5, 2016
      Messages:
      4
      Likes Received:
      1
      Trophy Points:
      1
      Wow, I didn't know this was a thing. I wish this could be working again
       
    8. zmsl

      zmsl New Member

      Joined:
      Jul 20, 2017
      Messages:
      8
      Likes Received:
      4
      Trophy Points:
      3
      Here's a working file for Stormblood
       

      Attached Files:

      Bishop56 and y2krazy like this.
    9. bross30

      bross30 New Member

      Joined:
      Jun 4, 2014
      Messages:
      29
      Likes Received:
      0
      Trophy Points:
      1
      Cheers buddy works well
       
    10. Yambo99

      Yambo99 Member

      Joined:
      May 5, 2011
      Messages:
      42
      Likes Received:
      2
      Trophy Points:
      8
      Does anyone have a working version of this by chance?
       

    Share This Page