Skip to content

Commit

Permalink
code
Browse files Browse the repository at this point in the history
  • Loading branch information
Eternita-S committed Nov 22, 2021
1 parent d3af944 commit 8af8aef
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 4 deletions.
2 changes: 2 additions & 0 deletions AntiAfkKick-ACT/AntiAfkKick-ACT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@
<ItemGroup>
<Compile Include="AntiAfkKick.cs" />
<Compile Include="Native.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Advanced Combat Tracker">
<HintPath>..\..\act\Advanced Combat Tracker.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Windows.Forms" />
Expand Down
5 changes: 3 additions & 2 deletions AntiAfkKick-ACT/AntiAfkKick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class AntiAfkKick: IActPluginV1
{
int NextKeyPress = 0;
volatile bool running = true;
Process proc = null;

public void DeInitPlugin()
{
Expand All @@ -26,10 +25,11 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText)
((TabControl)pluginScreenSpace.Parent).TabPages.Remove(pluginScreenSpace);
new Thread((ThreadStart)delegate
{
pluginStatusText.Text = "Thread started";
while (running)
{
Thread.Sleep(10000);
Console.WriteLine("Cycle begins");
//Console.WriteLine("Cycle begins");
try
{
if (Environment.TickCount > NextKeyPress)
Expand All @@ -52,6 +52,7 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText)
}
catch (Exception) { }
}
pluginStatusText.Text = "Thread stopped";
}).Start();
}
}
Expand Down
33 changes: 33 additions & 0 deletions AntiAfkKick-ACT/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AntiAfkKick_ACT.Properties")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AntiAfkKick_ACT.Properties")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("22d0d4d2-fc17-4980-9456-eec94c95a24f")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
9 changes: 8 additions & 1 deletion AntiAfkKick/AntiAfkKick-Standalone.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F15D6CA9-CEE5-4FC7-A7A1-87C70DBBC6FD}</ProjectGuid>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<RootNamespace>AntiAfkKick</RootNamespace>
<AssemblyName>AntiAfkKick</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
Expand Down Expand Up @@ -35,17 +35,24 @@
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="AntiAfkKick.cs" />
<Compile Include="Native.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
11 changes: 10 additions & 1 deletion AntiAfkKick/AntiAfkKick.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,18 @@ static void Main(string[] args)
MessageBox.Show("Application already running");
return;
}
Icon icon;
try
{
icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
}
catch (Exception)
{
icon = SystemIcons.Application;
}
n = new NotifyIcon
{
Icon = SystemIcons.Application,
Icon = icon,
Visible = true,
ContextMenu = new ContextMenu(new MenuItem[] {
new MenuItem("Exit", delegate { n.Dispose(); Environment.Exit(0); })
Expand Down
33 changes: 33 additions & 0 deletions AntiAfkKick/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AntiAfkKick.Properties")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AntiAfkKick.Properties")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b4c67313-975d-4f3d-aefd-003272caefc5")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
Binary file added AntiAfkKick/icon.ico
Binary file not shown.

0 comments on commit 8af8aef

Please sign in to comment.