When I compiled and ran it, I had problems that Compot didn't detect my Rappelz window, but that one was easy to fix.
Also I noticed that it doesn't detect HP/MP, also I saw some people talking about it.
Not sure if it's fixed or not yet, but this should fix it:
Code:
public static int AnalyseHeroHP()
{
Bitmap bild = Tools.GetBitmap(MainWindow.BasisX + 7, MainWindow.BasisY + 70, 200, 3);
//other code
Code:
public static int AnalyseHeroMP()
{
Bitmap bild = Tools.GetBitmap(MainWindow.BasisX + 7, MainWindow.BasisY + 83, 200, 3);
//other code
Only offsets changed, they shouldn't change with different resolutions, just make sure you don't move Rappelz window after Compot has been started
EDIT:
To find out Mobs HP:
Put this attachment to same place as rappelz_window.bmp
You need two variables in MainWindow.cs:
Code:
static public int MobWindowX;
static public int MobWindowY;
Put this code into LogikTimer_Tick(), it will keep searching for mob info window:
Code:
MainWindow.MobWindowX = 0;
MainWindow.MobWindowY = 0;
Bitmap bild = Tools.GetBitmap(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Bottom - 300);
Bitmap MobWindow = null;
try { MobWindow = new Bitmap(@"..\..\bitmaps\MobWindow.bmp"); }
catch { throw (new Exception("Can't open MobWindow.bmp")); }
int x = 0;
int y = 0;
if (Tools.SucheBildimBild(bild, MobWindow, ref x, ref y) == true) {
Bitmap bild2 = Tools.GetBitmap(x, y, 20, 20);
MainWindow.mainWindow.pictureBox1.Image = bild2;
MainWindow.MobWindowX = x;
MainWindow.MobWindowY = y;
}
Put this into Tools.cs:
Code:
public static int AnalyzeMobHP() {
if (MainWindow.MobWindowX < 1 || MainWindow.MobWindowY < 1) return -1;
Bitmap bild = Tools.GetBitmap(MainWindow.MobWindowX + 5, MainWindow.MobWindowY+30, 200, 1);
int black = 0;
for (int q = 0; q < 200; q++) {
Color c = bild.GetPixel(q, 0);
if (c.B <= 50 && c.G <= 50 && c.R <= 50) black++;
}
double calc = 100 - (black * 100) / 200;
return (int)calc;
}
Now in MainWindow.cs use Tools.AnalyzeMobHP() to call procedure, it will return -1 if MobWindow not found, and number 0 to 100 would mean Mobs HP in %
Note: Tools.AnalyzeMobHP() must be called after code, which finds MobWindow, else if will identify grass as HP Bar