Quote:
Originally Posted by BEanErzzz
Fixed your timer function. It won't crash when co exits now. and disables timer.
Code:
private unsafe void timer_Tick(object sender, EventArgs e) {
if (curProcess.HasExited == false) {
pReader.ReadProcess = curProcess;
pReader.OpenProcess();
byte[] bytesLev = pReader.ReadProcessMemory((IntPtr)CHAR_LEVEL_ADDRESS, 1, out bytesReaded);
lblLevel.Text = "Level: " + bytesLev[0];
byte[] bytesExp = pReader.ReadProcessMemory((IntPtr)CHAR_EXPERIENCE_ADDRESS, 8, out bytesReaded);
lblPercent.Text = "Percent: " + convert.ConvertToPc(bytesLev[0], BitConverter.ToUInt32(bytesExp, 0)) + "%";
pReader.CloseHandle();
} else {
lblLevel.Text = "NULL";
lblPercent.Text = "NULL";
((Timer)sender).Enabled = false;
fetchAndDisplayAccounts();
}
}
|
Thanks for pointing out the HasExited property, I think i have been programing in java for to long and have goten used to having a downloaded API sitting on my desktop and am unfimiliar with some of the C# ways of doing things, I will be making a revised edition with tidy code later because people seem to be using it.
@michaelcao, this is a very simple application and im surprised my instructions in the first post wernt good enough. Simply run the application with administrative priviliges, click the Fetch accounts button, select the account you wish to monitor and hit the Go/Stop button and it will display the level and percent. I really cant explain it better than that, this tool is for people who do water farming and who dont want to constantly ALT+TAB back to the water babies window to check the percent.
@everyone, I would like to make this program compatible with this CID proxy program but I will implement the mini-map thingy first. As i said, i have no idea what to expect with CID proxy, tho it might be something like different memory addresses, if someone can check to see if the following memory addresses are correct whilst using CID proxy that would be a great help.
Character Name: 0x5DAA38
Character Level: 0x5DB470
Character EXP: 0x5DB490