NightmareXIV / AntiAfkKick

An application, Dalamud and ACT plugin for preventing being auto-kicked from FFXIV due to inactivity.
GNU Affero General Public License v3.0
109 stars 21 forks source link

Non-issue Enhancement Ideas - Time out option, and Randomize time between clicks #6

Closed patrat46 closed 2 years ago

patrat46 commented 2 years ago

Hello~, I was wondering if adding a config file with a min/max delay and a random might be a good idea so that there is not a left control key stoke at exactly 2 mins (or what ever its set to). Also maybe a Max Run time too.

I am terrible and rusty with the coding I do know... so forgive me if I butchered things

This is the project file I was working on. If there are any passwords they were all set to Password. Thoughts.zip

I added app setting and a config file so save/adjust setting for the time between clicks.

    <appSettings>
        <add key="DelayMinMinutes" value="10"/>
        <add key="DelayMaxMinutes" value="25"/>
        <add key="Pause" value="True"/>
    </appSettings>

I never got around to messing with the pause...

On the AntiafkKick.cs I added some menu to the notification icon so you could see what config you had setup. I was going to add a drop down with about 5 options for min and max. Probably 1,2,5,10 for min and 5,10,15,20,25 for max, with max replacing the min if a user is silly enough to go low on the max and high on the min. But I was lazy and out of practice so I didn't figurer out the dropdown on the notification menu and just placed the values in the config file and manual update them as I want.

                String DMinMin;
                String DMaxMin;
                DMinMin = ConfigurationManager.AppSettings.Get("DelayMinMinutes");
                DMaxMin = ConfigurationManager.AppSettings.Get("DelayMaxMinutes");
                Console.WriteLine(": The value of DelayMinMinutes is " + DMinMin);
                Console.WriteLine(": The value of DelayMaxMinutes is " + DMaxMin);

                n = new NotifyIcon
                {
                    Icon = icon,
                    Visible = true,
                    Text = "Anti AFK Kick",
                    ContextMenu = new ContextMenu(new MenuItem[]
                    {
                        new MenuItem("Anti AFK Kick"),
                        new MenuItem("-"),
                        new MenuItem("Min Delay is set to: " + DMinMin),
                        new MenuItem("Max Delay is set to: " + DMaxMin),
                        new MenuItem("Exit", delegate { n.Dispose(); Environment.Exit(0); }),
                    }),
                };

And I adjusted the key press tickcount adding the random from the min/max in the config file. I didnt idiot proof it so incorrect min/max can cause issues.

                               Random rnd = new Random();
                                int rInt = rnd.Next(int.Parse(DMinMin), int.Parse(DMaxMin));
                                Console.WriteLine(": The value of random is " + rInt);
                                NextKeyPress = Environment.TickCount + rInt * 60 * 1000;

I also tossed in a bunch of comments because as I mentioned I'm nub at coding... I haven't done anything in 10 years+ and even then I was only through some basics.

I was thinking of adding to it somewhere... to add a stop/start to the menu and a time out period to the config file. Adding a time out to allow people set a max run time, say 2 hours? The anti-afk kick program would stop at that point. They could turn it back on by going back in to the stop/start on the menu and reset the count timer?

Last thought I had for people that are worried about game TOS/EULA violations is potentially making it a pop up reminder with a "AFK Wake" button every set period of time. Making it so they are actually pressing the key to wake their character. Have it pop up at a set interval by the user and put a count down timer based off 30 mins minus inactive window time. Potentially adding a chime or sound notification to go with it.

I dont know... As is works for me~.

Thanks for the program

Limiana commented 2 years ago

Hello!

Thank you for your contributions and concerns.

There is no point at all in randomizing time between clicks since afk timeout is handled entirely by the client itself, literally nothing is being sent to server. As long as CTRL key remains being unbound to anything that results server interaction, that is.

As for limiting maximum afk amount, I do like this idea and will look forward to adding it.

As for notifications... might fit better into NotificationMaster plugin if allowed by XIVLauncher's developers. Regardless, I will see what is possible to do there.

patrat46 commented 2 years ago

I randomized it as an anti-detection process. But I guess your right if the sever doesn't get anything and your afk timer is set to 30+ minutes it doesn't matter what to do. If your afk timer in game is set to 5 mins. Then randomly between 2 and 28 minutes your character wakes from afk then the people around you have little to no grounds to say you are using a macro to stay online. If your not afk more then an hour it wouldn't mater but with queue times... Logging in on lunch or last break, will likely be need to be online after work, but you might get in 3 hours or more early.

The AFK status also has a perk of lowering FPS to reduce power consumption. So having a longer period between clicks is beneficial. people can also just set their inactive window setting instead and minimize the window. Dungeons do have a different timer so adjusting the time may be beneficial for palace of the dead, Savage content, and hanging out/pooping out for a meal.

I'm a bit paranoid.Though we know they don't load spyware, they still do ban bots for repeat behavior. Afk is hard to prove because if you are really AFKing most of the day tabbing in a second here and there isn't against any rules, and why would you scroll up through your chat to reply to a GM if one pinged you while you are busy... So detection of macro or bot to stay awake isn't really as concerning or probable as long as one doesn't go out and shout that they are botting.

Limiana commented 2 years ago

fyi you can opt-out of afk status in the ffxiv's configuration completely legitimately, it has nothing to do with autokick as for fps lowering, there is also option to lower it when game is inactive (you're in another window) I'd recommend against afking for prolonged periods of time like more than 10 hours, then it's obvious that you're circumventing afk kick for GMs if they ever decide to watch logs, which honestly I doubt as they don't even ban real bots. But better to be safe. I'll likely add these options you suggested, but I might first take my time to finish msq and such. Dalamud plugin is updated btw, but should be decently tested first. Which I'm actually doing right now.