forked from atom0s/Cure-Please
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Form4.cs
80 lines (62 loc) · 2.55 KB
/
Form4.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
namespace CurePlease
{
using EliteMMO.API;
using System;
using System.Windows.Forms;
using static Form1;
public partial class Form4 : Form
{
private Form1 f1;
public Form4(Form1 f)
{
this.StartPosition = FormStartPosition.CenterScreen;
InitializeComponent();
f1 = f;
if (f1.setinstance2.Enabled == true)
{
#region "== First generate all current chat entries."
_ELITEAPIPL = new EliteAPI((int)f1.activeprocessids.SelectedItem);
characterNamed_label.Text = "Chatlog for character: " + _ELITEAPIPL.Player.Name + "\n";
EliteAPI.ChatEntry cl = new EliteAPI.ChatEntry();
while ((cl = _ELITEAPIPL.Chat.GetNextChatLine()) != null)
{
chatlog_box.AppendText(cl.Text, cl.ChatColor);
chatlog_box.AppendText(Environment.NewLine);
}
chatlog_box.SelectionStart = chatlog_box.Text.Length;
chatlog_box.ScrollToCaret();
#endregion "== First generate all current chat entries."
}
else
{
chatlogscan_timer.Enabled = false;
MessageBox.Show("No character was selected as the power leveler, this can not be opened yet.");
}
}
private void CloseChatLog_button_Click(object sender, EventArgs e)
{
this.Close();
}
private void chatlogscan_timer_Tick(object sender, EventArgs e)
{
#region "== Now add any additional chat entries every set period of time"
EliteAPI.ChatEntry cl = new EliteAPI.ChatEntry();
while ((cl = _ELITEAPIPL.Chat.GetNextChatLine()) != null)
{
chatlog_box.AppendText(cl.Text, cl.ChatColor);
chatlog_box.AppendText(Environment.NewLine);
}
#endregion "== Now add any additional chat entries every set period of time"
}
private void chatlog_box_TextChanged(object sender, EventArgs e)
{
chatlog_box.SelectionStart = chatlog_box.Text.Length;
chatlog_box.ScrollToCaret();
}
private void SendMessage_botton_Click(object sender, EventArgs e)
{
_ELITEAPIPL.ThirdParty.SendString(ChatLogMessage_textfield.Text);
ChatLogMessage_textfield.Text = string.Empty;
}
}
}