Skip to content

Commit

Permalink
v 1.0.0.0 does not allow the courier to leave the fountain
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpAttacker committed Jan 2, 2016
1 parent 156b633 commit 198b788
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 0 deletions.
22 changes: 22 additions & 0 deletions AntiCourFeed/AntiCourFeed.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AntiCourFeed", "AntiCourFeed\AntiCourFeed.csproj", "{C7281A19-0500-461B-8052-AF24D07ABECD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C7281A19-0500-461B-8052-AF24D07ABECD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7281A19-0500-461B-8052-AF24D07ABECD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7281A19-0500-461B-8052-AF24D07ABECD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7281A19-0500-461B-8052-AF24D07ABECD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added AntiCourFeed/AntiCourFeed.v12.suo
Binary file not shown.
73 changes: 73 additions & 0 deletions AntiCourFeed/AntiCourFeed/AntiCourFeed.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C7281A19-0500-461B-8052-AF24D07ABECD}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AntiCourFeed</RootNamespace>
<AssemblyName>AntiCourFeed</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PreBuildEvent />
<PostBuildEvent />
<OutputPath>bin\Release</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ensage">
<HintPath>C:\Users\Jumbo\Downloads\LeagueSharp_2\System\Ensage.dll</HintPath>
</Reference>
<Reference Include="Ensage.Common">
<HintPath>C:\Users\Jumbo\Downloads\LeagueSharp_2\System\Ensage.Common.dll</HintPath>
</Reference>
<Reference Include="SharpDX">
<HintPath>C:\Users\Jumbo\Downloads\LeagueSharp_2\System\SharpDX.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
6 changes: 6 additions & 0 deletions AntiCourFeed/AntiCourFeed/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
78 changes: 78 additions & 0 deletions AntiCourFeed/AntiCourFeed/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using Ensage;
using Ensage.Common;
using Ensage.Common.Extensions;
using Ensage.Common.Menu;

namespace AntiCourFeed
{
internal static class Program
{
private static readonly Menu Menu = new Menu("Courier Blocker","cb",true);
private static bool _loaded;
private static Unit _fountain;

private static void Main()
{
Game.OnUpdate += Game_OnUpdate;
Menu.AddItem(new MenuItem("Lock", "Lock Courier").SetValue(false).SetTooltip("does not allow the courier to leave the fountain"));
//Menu.AddItem(new MenuItem("AntiReuse", "Anti Reuse").SetValue(false));
Menu.AddItem(new MenuItem("Cd", "Rate").SetValue(new Slider(50, 5, 200)));
Menu.AddItem(new MenuItem("MaxRange", "Max Range").SetValue(new Slider(500, 0, 2000)));
Menu.AddToMainMenu();
}

private static void Game_OnUpdate(EventArgs args)
{

if (!Utils.SleepCheck("acd.cd"))
return;

if (!Menu.Item("Lock").GetValue<bool>()/* && !Menu.Item("AntiReuse").GetValue<bool>()*/)
return;

var me = ObjectMgr.LocalHero;
if (!_loaded)
{
if (!Game.IsInGame || me == null)
{
return;
}
_loaded = true;
Game.PrintMessage(
"<font face='Comic Sans MS, cursive'><font color='#00aaff'>" + Menu.DisplayName +
" By Jumpering" +
" loaded!</font> <font color='#aa0000'>v" + Assembly.GetExecutingAssembly().GetName().Version,
MessageType.LogMessage);
_fountain = null;
}

if (!Game.IsInGame || me == null)
{
_loaded = false;
return;
}
if (Game.IsPaused) return;

var couriers = ObjectMgr.GetEntities<Courier>().Where(x => x.IsAlive && x.Team == me.Team);
if (_fountain == null || !_fountain.IsValid)
{
_fountain = ObjectMgr.GetEntities<Unit>()
.FirstOrDefault(x => x.Team == me.Team && x.ClassID == ClassID.CDOTA_Unit_Fountain);
}
foreach (var courier in couriers.Where(courier => courier.Distance2D(_fountain) > Menu.Item("MaxRange").GetValue<Slider>().Value))
{
Debug.Assert(_fountain != null, "_fountain != null");
var angle = (float)Math.Max(
Math.Abs(courier.RotationRad - Utils.DegreeToRadian(courier.FindAngleBetween(_fountain.Position))) - 0.20, 0);
// ReSharper disable once CompareOfFloatsByEqualityOperator
if (angle == 0) continue;
courier.Move(_fountain.Position);
Utils.Sleep(Menu.Item("Cd").GetValue<Slider>().Value, "acd.cd");
}
}
}
}
36 changes: 36 additions & 0 deletions AntiCourFeed/AntiCourFeed/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Управление общими сведениями о сборке осуществляется с помощью
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
// связанные со сборкой.
[assembly: AssemblyTitle("AntiCourFeed")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AntiCourFeed")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Параметр ComVisible со значением FALSE делает типы в сборке невидимыми
// для COM-компонентов. Если требуется обратиться к типу в этой сборке через
// COM, задайте атрибуту ComVisible значение TRUE для этого типа.
[assembly: ComVisible(false)]

// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
[assembly: Guid("69529a20-068a-4679-9109-9684f0b5a6ce")]

// Сведения о версии сборки состоят из следующих четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Редакция
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.

0 comments on commit 198b788

Please sign in to comment.