-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathfrm_MainWindow.cs
138 lines (126 loc) · 5.46 KB
/
frm_MainWindow.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
* VoliBot GUI a.k.a. RitoBot GUI is part of the opensource VoliBot AutoQueuer project.
* Credits to: shalzuth, Maufeat, imsosharp
* Find assemblies for this AutoQueuer on LeagueSharp's official forum at:
* http://www.joduska.me/
* You are allowed to copy, edit and distribute this project,
* as long as you don't touch this notice and you release your project with source.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using LoLLauncher;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RitoBot
{
public partial class frm_MainWindow : Form
{
public frm_MainWindow()
{
InitializeComponent();
Print("VoliBot GUI RC2 Loaded.");
Print("Volibot's ready for Version: " + Program.cversion.Substring(0,4));
Print("brought to you by imsosharp.", 4);
}
public void Print(string text)
{
console.AppendText("[" + DateTime.Now + "] : " + text + "\n");
}
public void Print(string text, int newlines)
{
console.AppendText("[" + DateTime.Now + "] : " + text);
for (int i = 0; i < newlines; i++)
{
console.AppendText("\n");
}
}
public void ShowAccount(string account, string password, string queuetype)
{
LoadedAccounts.AppendText("A: " + account + " Pw: " + password + " Q: " + queuetype );
}
private void addAccountsBtn_Click(object sender, EventArgs e)
{
if (newUserNameInput.Text.Length == 0 || newPasswordInput.Text.Length == 0)
{
MessageBox.Show("Username and Password cannot be empty!!!");
}
else
{
if (QueueTypeInput.SelectedIndex == -1 && SelectChampionInput.SelectedIndex == -1) FileHandlers.AccountsTxt(newUserNameInput.Text, newPasswordInput.Text);
else if (SelectChampionInput.SelectedIndex == -1) FileHandlers.AccountsTxt(newUserNameInput.Text, newPasswordInput.Text, QueueTypeInput.SelectedItem.ToString());
else FileHandlers.AccountsTxt(newUserNameInput.Text, newPasswordInput.Text, QueueTypeInput.SelectedItem.ToString(), SelectChampionInput.SelectedItem.ToString());
Program.loadAccounts();
Thread.Sleep(1000);
queueLoop();
}
}
private void saveBtn_Click(object sender, EventArgs e)
{
FileHandlers.SettingsIni(LauncherPathInput.Text, MaxBotsInput.Text, MaxLevelInput.Text, DefaultChampionInput.SelectedItem.ToString(), Spell1Input.SelectedItem.ToString(), Spell2Input.SelectedItem.ToString(), RegionInput.SelectedItem.ToString(), BuyBoostInput.SelectedItem.ToString());
Program.loadConfiguration();
}
private void replaceConfigBtn_Click(object sender, EventArgs e)
{
Print("Game configuration was optimized successfuly!");
Program.gamecfg();
}
private void queueLoop()
{
foreach (string acc in Program.accounts)
{
int curRunning = 0;
try
{
Program.accounts2.RemoveAt(0);
string Accs = acc;
string[] stringSeparators = new string[] { "|" };
var result = Accs.Split(stringSeparators, StringSplitOptions.None);
console.ForeColor = Color.Lime;
curRunning += 1;
if (result[0].Contains("username"))
{
Print("No accounts found. Please add an account.", 2);
}
if (result[2] != null)
{
QueueTypes queuetype = (QueueTypes)System.Enum.Parse(typeof(QueueTypes), result[2]);
// RiotBot ritoBot = new RiotBot(result[0], result[1], Program.Region, Program.Path2, curRunning, queuetype, result[3]);
ShowAccount(result[0], result[1], result[2]);
}
else
{
QueueTypes queuetype = QueueTypes.ARAM;
//RiotBot ritoBot = new RiotBot(result[0], result[1], Program.Region, Program.Path2, curRunning, queuetype, result[3]);
ShowAccount(result[0], result[1], "ARAM");
}
Program.MainWindow.Text = " Volibot GUI | Currently connected: " + Program.connectedAccs;
if (curRunning == Program.maxBots)
break;
}
catch (Exception)
{
console.ForeColor = Color.Red;
Print("You may have an error in accounts.txt.");
Print("If you just started Volibot for the first time,");
Print("add a new account on the leftside panel.");
Print("If you keep getting this error,");
Print("Delete accounts.txt and restart voli.", 2);
}
}
}
private void frm_MainWindow_Load(object sender, EventArgs e)
{
Print("Starting Queue Loop");
queueLoop();
}
private void LauncherPathInput_Click(object sender, EventArgs e)
{
}
}
}