Pokerbot
-
Hi
Ich habe ein kleines Problem und da ich Anfänger bin, weiß ich nicht ob ich da was falsch gemacht habe.
Und zwar, das Problem ist das ich bei den 3 Pixeln , die ich abfrage, das gleiche Ergebnis für die Karte 4 und das Ass bekomme. Das habe ich versucht zu lösen, mit einem 4. Pixel. Aber wenn ich den Code starte wird mir nur das Ass angezeigt.
Also es gibt mit dem Ass und der 4 ein Problem.
Ich wollte einfach nur wissen ob ich da einen Anfänger Fehler mache?
Danke im Voraus
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;namespace WindowsFormsApplication1
{public partial class Form1 : Form
{
[DllImport("user32.dll")]
static extern IntPtr GetDC(IntPtr hwnd);[DllImport("user32.dll")]
static extern Int32 ReleaseDC(IntPtr hwnd, IntPtr hdc);[DllImport("gdi32.dll")]
static extern uint GetPixel(IntPtr hdc, int nXPos, int nYPos);public Form1()
{
InitializeComponent();
}private void button1_Click(object sender, EventArgs e)
{//Karten Erkennungs Pixel...
int pc1x = 268; //Karte 1 Pixel 1
int pc1y = 226;
int pc2x = 273;//Karte 1 Pixel 2
int pc2y = 226;
int pc3x = 278;//Karte 1 Pixel 3
int pc3y = 226;
int pp1x = 271;//Pixel Patch 1 für 4 und Ass
int pp1y = 226;int pc4x = 268+59; //Karte 2 Pixel 1
int pc4y = 226;
int pc5x = 273+59;//Karte 2 Pixel 2
int pc5y = 226;
int pc6x = 278+59;//Karte 2 Pixel 3
int pc6y = 226;
int pp2x = 271+59;//Pixel Patch 2
int pp2y = 226;int pc7x = 268+118; //Karte 3 Pixel 1
int pc7y = 226;
int pc8x = 273+118;//Karte 3 Pixel 2
int pc8y = 226;
int pc9x = 278+118;//Karte 3 Pixel 3
int pc9y = 226;
int pp3x = 271+118;//Pixel Patch 3
int pp3y = 226;int pc10x = 268+177; //Karte 4 Pixel 1
int pc10y = 226;
int pc11x = 273+177;//Karte 4 Pixel 2
int pc11y = 226;
int pc12x = 278+177;//Karte 4 Pixel 3
int pc12y = 226;
int pp4x = 271+177;//Pixel Patch 4
int pp4y = 226;int pc13x = 268+236; //Karte 5 Pixel 1
int pc13y = 226;
int pc14x = 273+236;//Karte 5 Pixel 2
int pc14y = 226;
int pc15x = 278+236;//Karte 5 Pixel 3
int pc15y = 226;
int pp5x = 271 + 236;//Pixel Patch 5
int pp5y = 226;int ps1x = 296;//Karte 1 Symbol Pixel 1
int ps1y = 265;
int ps2x = 291; //Karte 1 Symbol Pixel 2
int ps2y = 276;int ps3x = 296+59;//Karte 2 Symbol Pixel 1
int ps3y = 265;
int ps4x = 291+59; //Karte 2 Symbol Pixel 2
int ps4y = 276;int ps5x = 296+118;//Karte 3 Symbol Pixel 1
int ps5y = 265;
int ps6x = 291+118; //Karte 3 Symbol Pixel 2
int ps6y = 276;int ps7x = 296+177;//Karte 4 Symbol Pixel 1
int ps7y = 265;
int ps8x = 291+177; //Karte 4 Symbol Pixel 2
int ps8y = 276;int ps9x = 296+236;//Karte 5 Symbol Pixel 1
int ps9y = 265;
int ps10x = 291+236; //Karte 5 Symbol Pixel 2
int ps10y = 276;//Karten
//int Karte1 = 0; // Kreuz 2 = 1 Karo 2 = 2 Pik 2 = 3 Herz 2 = 4; Kreuz 3 = 5..............
//int Karte2 = 0;
//int Karte3 = 0;
//int Karte4 = 0;
//int Karte5 = 0;IntPtr hdc = GetDC(IntPtr.Zero);//Desktop holen
uint pc1 = GetPixel(hdc, pc1x, pc1y);//Pixel abfragen//ReleaseDC(IntPtr.Zero, hdc);//Desktop lösen
if (pc1 == 2190660) //Überprüfen ob die ersten 3 Karten da sind
{
MessageBox.Show("Beendet");
}
else
{
//MessageBox.Show("Los");
//IntPtr hdc1 = GetDC(IntPtr.Zero);//Desktop holen
uint pc2 = GetPixel(hdc, pc2x, pc2y); //Pixel abfragen für karte 1
uint pc3 = GetPixel(hdc, pc3x, pc3y);
uint ps1 = GetPixel(hdc, ps1x, ps1y);
uint ps2 = GetPixel(hdc, ps2x, ps2y);
//ReleaseDC(IntPtr.Zero, hdc1);//Desktop lösen
uint pc4 = GetPixel(hdc, pc4x, pc4y);//Pixel abfragen für Karte 2
uint pc5 = GetPixel(hdc, pc5x, pc5y);
uint pc6 = GetPixel(hdc, pc6x, pc6y);
uint ps3 = GetPixel(hdc, ps3x, ps3y);
uint ps4 = GetPixel(hdc, ps4x, ps4y);uint pc7 = GetPixel(hdc, pc7x, pc7y);//Pixel abfragen für Karte 3
uint pc8 = GetPixel(hdc, pc8x, pc8y);
uint pc9 = GetPixel(hdc, pc9x, pc9y);
uint ps5 = GetPixel(hdc, ps5x, ps5y);
uint ps6 = GetPixel(hdc, ps6x, ps6y);//uint pp1 = GetPixel(hdc, pp1x, pp1y); //Pixel für Karte 4 und Ass...
//uint pp2 = GetPixel(hdc, pp2x, pp2y);
//uint pp3 = GetPixel(hdc, pp3x, pp3y);
//uint pp4 = GetPixel(hdc, pp4x, pp4y);
// uint pp5 = GetPixel(hdc, pp5x, pp5y);//Ausgabe zum Testen...
string a1 = Convert.ToString(pc1);
string a2 = Convert.ToString(pc2);
string a3 = Convert.ToString(pc3);
string a4 = Convert.ToString(ps1);
string a5 = Convert.ToString(pc1x);
string a6 = Convert.ToString(pc1y);
string a7 = Convert.ToString(ps2);string a8 = Convert.ToString(pc4);
string a9 = Convert.ToString(pc5);
string a10 = Convert.ToString(pc6);
string a11 = Convert.ToString(ps3);
string a12 = Convert.ToString(ps4);
string a13 = Convert.ToString(pc7);
string a14 = Convert.ToString(pc8);
string a15 = Convert.ToString(pc9);
string a16 = Convert.ToString(ps5);
string a17 = Convert.ToString(ps6);
//string a18 = Convert.ToString(pp1);
// string a19 = Convert.ToString(pp2);
// string a20 = Convert.ToString(pp3);
textBox1.Text = a1;
label1.Text = a5;
label2.Text = a6;
textBox2.Text = a2;
textBox3.Text = a4;
textBox5.Text = a3;
textBox4.Text = a7;
textBox7.Text = a8;
textBox8.Text = a9;
textBox9.Text = a10;
textBox10.Text = a11;
textBox11.Text = a12;
textBox12.Text = a13;
textBox13.Text = a14;
textBox14.Text = a15;
textBox15.Text = a16;
textBox16.Text = a17;
// textBox6.Text = a18;
// textBox17.Text = a19;
// textBox18.Text = a20;//Karte 1
uint pp1 = GetPixel(hdc, pp1x, pp1y);
if (pc1 == 2302755 && pc2 == 0 && pc3 == 16777215 || pc1 == 9934847 && pc2 == 255 && pc3 == 16777215 || pc1 == 2302975 && pc2 == 255 && pc3 == 16777215)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz 2"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo 2"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik 2"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz 2"); }
}if (pc1 == 6250335 && pc2 == 0 && pc3 == 16777215 || pc1 == 6250495 && pc2 == 255 && pc3 == 16777215)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz 3"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo 3"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik 3"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz 3"); }
}if (pc1 == 16777215 && pc2 == 0 && pc3 == 16777215 && pp1 == 14408667 || pc1 == 16777215 && pc2 == 255 && pc3 == 16777215 && pp1 == 14408703)
{
//MessageBox.Show("2");
//uint pp1 = GetPixel(hdc, pp1x, pp1y);// if (pp1 == 14408667 || pp1 == 14408703)
// {
if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz 4"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo 4"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik 4"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz 4"); }// }
}if (pc1 == 1907997 && pc2 == 0 && pc3 == 7631988 || pc1 == 1908223 && pc2 == 255 && pc3 == 7632127)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz 5"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo 5"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik 5"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz 5"); }
}if (pc1 == 9276813 && pc2 == 0 && pc3 == 16777215 || pc1 == 9276927 && pc2 == 255 && pc3 == 16777215)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz 6"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo 6"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik 6"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz 6"); }
}if (pc1 == 0 && pc2 == 0 && pc3 == 0 || pc1 == 255 && pc2 == 255 && pc3 == 255)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz 7"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo 7"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik 7"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz 7"); }
}if (pc1 == 14606046 && pc2 == 0 && pc3 == 16382457 || pc1 == 14606079 && pc2 == 255 && pc3 == 16382463)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz 8"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo 8"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik 8"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz 8"); }
}if (pc1 == 14606046 && pc2 == 0 && pc3 == 16777215 || pc1 == 14606079 && pc2 == 255 && pc3 == 16777215)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz 9"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo 9"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik 9"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz 9"); }
}if (pc1 == 0 && pc2 == 12698049 && pc3 == 0 || pc1 == 255 && pc2 == 12698111 && pc3 == 255)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz 10"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo 10"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik 10"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz 10"); }
}if (pc1 == 16777215 && pc2 == 16777215 && pc3 == 12171705 || pc1 == 16777215 && pc2 == 16777215 && pc3 == 12171775)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz Bube"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo Bube"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik Bube"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz Bube"); }
}if (pc1 == 10526880 && pc2 == 0 && pc3 == 7895160 || pc1 == 10526975 && pc2 == 255 && pc3 == 7895295)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz Dame"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo Dame"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik Dame"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz Dame"); }
}if (pc1 == 0 && pc2 == 16514043 && pc3 == 3421236 || pc1 == 255 && pc2 == 16514047 && pc3 == 3421439)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz König"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo König"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik König"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz König"); }
}if (pc1 == 16777215 && pc2 == 0 && pc3 == 16777215 || pc1 == 16777215 && pc2 == 255 && pc3 == 16777215 || pc1 == 16382463 && pc2 == 255 && pc3 == 16777215)
{
//MessageBox.Show("2");if (ps1 == 16777215 && ps2 == 255)
{ label5.Text = ("Herz Ass"); }if (ps1 == 255 && ps2 == 255)
{ label5.Text = ("Karo Ass"); }if (ps1 == 0 && ps2 == 0)
{ label5.Text = ("Pik Ass"); }if (ps1 == 0 && ps2 == 16777215)
{ label5.Text = ("Kreuz Ass"); }
}//Karte 2
uint pp2 = GetPixel(hdc, pp2x, pp2y);
if (pc4 == 2302755 && pc5 == 0 && pc6 == 16777215 || pc4 == 9934847 && pc5 == 255 && pc6 == 16777215 || pc4 == 2302975 && pc5 == 255 && pc6 == 16777215)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz 2"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo 2"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik 2"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz 2"); }
}if (pc4 == 6250335 && pc5 == 0 && pc6 == 16777215 || pc4 == 6250495 && pc5 == 255 && pc6 == 16777215)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz 3"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo 3"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik 3"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz 3"); }
}if (pc4 == 16777215 && pc5 == 0 && pc6 == 16777215 && pp2 == 14408667 || pc4 == 16777215 && pc5 == 255 && pc6 == 16777215 && pp2 == 14408703)
{
//MessageBox.Show("2");
//uint pp2 = GetPixel(hdc, pp2x, pp2y);//if (pp2 == 14408667 || pp2 == 14408703)
// {
if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz 4"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo 4"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik 4"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz 4"); }// }
}if (pc4 == 1907997 && pc5 == 0 && pc6 == 7631988 || pc4 == 1908223 && pc5 == 255 && pc6 == 7632127)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz 5"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo 5"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik 5"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz 5"); }
}if (pc4 == 9276813 && pc5 == 0 && pc6 == 16777215 || pc4 == 9276927 && pc5 == 255 && pc6 == 16777215)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz 6"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo 6"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik 6"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz 6"); }
}if (pc4 == 0 && pc5 == 0 && pc6 == 0 || pc4 == 255 && pc5 == 255 && pc6 == 255)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz 7"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo 7"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik 7"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz 7"); }
}if (pc4 == 14606046 && pc5 == 0 && pc6 == 16382457 || pc4 == 14606079 && pc5 == 255 && pc6 == 16382463)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz 8"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo 8"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik 8"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz 8"); }
}if (pc4 == 14606046 && pc5 == 0 && pc6 == 16777215 || pc4 == 14606079 && pc5 == 255 && pc6 == 16777215)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz 9"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo 9"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik 9"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz 9"); }
}if (pc4 == 0 && pc5 == 12698049 && pc6 == 0 || pc4 == 255 && pc5 == 12698111 && pc6 == 255)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz 10"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo 10"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik 10"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz 10"); }
}if (pc4 == 16777215 && pc5 == 16777215 && pc6 == 12171705 || pc4 == 16777215 && pc5 == 16777215 && pc6 == 12171775)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz Bube"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo Bube"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik Bube"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz Bube"); }
}if (pc4 == 10526880 && pc5 == 0 && pc6 == 7895160 || pc4 == 10526975 && pc5 == 255 && pc6 == 7895295)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz Dame"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo Dame"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik Dame"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz Dame"); }
}if (pc4 == 0 && pc5 == 16514043 && pc6 == 3421236 || pc4 == 255 && pc5 == 16514047 && pc6 == 3421439)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz König"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo König"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik König"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz König"); }
}if (pc4 == 16777215 && pc5 == 0 && pc6 == 16777215 || pc4 == 16777215 && pc5 == 255 && pc6 == 16777215 || pc4 == 16382463 && pc5 == 255 && pc6 == 16777215)
{
//MessageBox.Show("2");if (ps3 == 16777215 && ps4 == 255)
{ label6.Text = ("Herz Ass"); }if (ps3 == 255 && ps4 == 255)
{ label6.Text = ("Karo Ass"); }if (ps3 == 0 && ps4 == 0)
{ label6.Text = ("Pik Ass"); }if (ps3 == 0 && ps4 == 16777215)
{ label6.Text = ("Kreuz Ass"); }
}//Karte 3
uint pp3 = GetPixel(hdc, pp3x, pp3y);if (pc7 == 2302755 && pc8 == 0 && pc9 == 16777215 || pc7 == 9934847 && pc8 == 255 && pc9 == 16777215 || pc7 == 2302975 && pc8 == 255 && pc9 == 16777215)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz 2"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo 2"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik 2"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz 2"); }
}if (pc7 == 6250335 && pc8 == 0 && pc9 == 16777215 || pc7 == 6250495 && pc8 == 255 && pc9 == 16777215)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz 3"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo 3"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik 3"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz 3"); }
}if (pc7 == 16777215 && pc8 == 0 && pc9 == 16777215 && pp3 == 14408667 || pc7 == 16777215 && pc8 == 255 && pc9 == 16777215 && pp3 == 14408703)
{
//MessageBox.Show("2");
//uint pp3 = GetPixel(hdc, pp3x, pp3y);//if (pp3 == 14408667 || pp3 == 14408703)
//{
if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz 4"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo 4"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik 4"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz 4"); }//}
}if (pc7 == 1907997 && pc8 == 0 && pc9 == 7631988 || pc7 == 1908223 && pc8 == 255 && pc9 == 7632127)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz 5"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo 5"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik 5"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz 5"); }
}if (pc7 == 9276813 && pc8 == 0 && pc9 == 16777215 || pc7 == 9276927 && pc8 == 255 && pc9 == 16777215)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz 6"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo 6"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik 6"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz 6"); }
}if (pc7 == 0 && pc8 == 0 && pc9 == 0 || pc7 == 255 && pc8 == 255 && pc9 == 255)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz 7"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo 7"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik 7"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz 7"); }
}if (pc7 == 14606046 && pc8 == 0 && pc9 == 16382457 || pc7 == 14606079 && pc8 == 255 && pc9 == 16382463)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz 8"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo 8"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik 8"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz 8"); }
}if (pc7 == 14606046 && pc8 == 0 && pc9 == 16777215 || pc7 == 14606079 && pc8 == 255 && pc9 == 16777215)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz 9"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo 9"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik 9"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz 9"); }
}if (pc7 == 0 && pc8 == 12698049 && pc9 == 0 || pc7 == 255 && pc8 == 12698111 && pc9 == 255)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz 10"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo 10"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik 10"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz 10"); }
}if (pc7 == 16777215 && pc8 == 16777215 && pc9 == 12171705 || pc7 == 16777215 && pc8 == 16777215 && pc9 == 12171775)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz Bube"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo Bube"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik Bube"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz Bube"); }
}if (pc7 == 10526880 && pc8 == 0 && pc9 == 7895160 || pc7 == 10526975 && pc8 == 255 && pc9 == 7895295)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz Dame"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo Dame"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik Dame"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz Dame"); }
}if (pc7 == 0 && pc8 == 16514043 && pc9 == 3421236 || pc7 == 255 && pc8 == 16514047 && pc9 == 3421439)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz König"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo König"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik König"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz König"); }
}if (pc7 == 16777215 && pc8 == 0 && pc9 == 16777215 || pc7 == 16777215 && pc8 == 255 && pc9 == 16777215 || pc7 == 16382463 && pc8 == 255 && pc9 == 16777215)
{
//MessageBox.Show("2");if (ps5 == 16777215 && ps6 == 255)
{ label7.Text = ("Herz Ass"); }if (ps5 == 255 && ps6 == 255)
{ label7.Text = ("Karo Ass"); }if (ps5 == 0 && ps6 == 0)
{ label7.Text = ("Pik Ass"); }if (ps5 == 0 && ps6 == 16777215)
{ label7.Text = ("Kreuz Ass"); }
}}
//Karte 4
uint pc10 = GetPixel(hdc, pc10x, pc10y);//Pixel abfragen für Karte 4
if (pc10 == 3442528)
{
MessageBox.Show("Keine Karte an der vierten Stelle");
}else
{
uint pc11 = GetPixel(hdc, pc11x, pc11y);//Pixel Abfragen für Karte 4
uint pc12 = GetPixel(hdc, pc12x, pc12y);
uint ps7 = GetPixel(hdc, ps7x, ps7y);
uint ps8 = GetPixel(hdc, ps8x, ps8y);
uint pp4 = GetPixel(hdc, pp4x, pp4y);//Karte 4
if (pc10 == 2302755 && pc11 == 0 && pc12 == 16777215 || pc10 == 9934847 && pc11 == 255 && pc12 == 16777215 || pc10 == 2302975 && pc11 == 255 && pc12 == 16777215)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz 2"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo 2"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik 2"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz 2"); }
}if (pc10 == 6250335 && pc11 == 0 && pc12 == 16777215 || pc10 == 6250495 && pc11 == 255 && pc12 == 16777215)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz 3"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo 3"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik 3"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz 3"); }
}if (pc10 == 16777215 && pc11 == 0 && pc12 == 16777215 && pp4 == 14408667 || pc10 == 16777215 && pc11 == 255 && pc12 == 16777215 && pp4 == 14408703)
{
//MessageBox.Show("2");
//uint pp4 = GetPixel(hdc, pp4x, pp4y);//if (pp4 == 14408667 || pp4 == 14408703)
//{
if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz 4"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo 4"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik 4"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz 4"); }//}
}if (pc10 == 1907997 && pc11 == 0 && pc12 == 7631988 || pc10 == 1908223 && pc11 == 255 && pc12 == 7632127)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz 5"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo 5"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik 5"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz 5"); }
}if (pc10 == 9276813 && pc11 == 0 && pc12 == 16777215 || pc10 == 9276927 && pc11 == 255 && pc12 == 16777215)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz 6"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo 6"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik 6"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz 6"); }
}if (pc10 == 0 && pc11 == 0 && pc12 == 0 || pc10 == 255 && pc11 == 255 && pc12 == 255)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz 7"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo 7"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik 7"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz 7"); }
}if (pc10 == 14606046 && pc11 == 0 && pc12 == 16382457 || pc10 == 14606079 && pc11 == 255 && pc12 == 16382463)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz 8"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo 8"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik 8"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz 8"); }
}if (pc10 == 14606046 && pc11 == 0 && pc12 == 16777215 || pc10 == 14606079 && pc11 == 255 && pc12 == 16777215)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz 9"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo 9"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik 9"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz 9"); }
}if (pc10 == 0 && pc11 == 12698049 && pc12 == 0 || pc10 == 255 && pc11 == 12698111 && pc12 == 255)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz 10"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo 10"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik 10"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz 10"); }
}if (pc10 == 16777215 && pc11 == 16777215 && pc12 == 12171705 || pc10 == 16777215 && pc11 == 16777215 && pc12 == 12171775)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz Bube"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo Bube"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik Bube"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz Bube"); }
}if (pc10 == 10526880 && pc11 == 0 && pc12 == 7895160 || pc10 == 10526975 && pc11 == 255 && pc12 == 7895295)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz Dame"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo Dame"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik Dame"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz Dame"); }
}if (pc10 == 0 && pc11 == 16514043 && pc12 == 3421236 || pc10 == 255 && pc11 == 16514047 && pc12 == 3421439)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz König"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo König"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik König"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz König"); }
}if (pc10 == 16777215 && pc11 == 0 && pc12 == 16777215 || pc10 == 16777215 && pc11 == 255 && pc12 == 16777215 || pc10 == 16382463 && pc11 == 255 && pc12 == 16777215)
{
//MessageBox.Show("2");if (ps7 == 16777215 && ps8 == 255)
{ label8.Text = ("Herz Ass"); }if (ps7 == 255 && ps8 == 255)
{ label8.Text = ("Karo Ass"); }if (ps7 == 0 && ps8 == 0)
{ label8.Text = ("Pik Ass"); }if (ps7 == 0 && ps8 == 16777215)
{ label8.Text = ("Kreuz Ass"); }
}}
//Karte 5
uint pc13 = GetPixel(hdc, pc13x, pc13y);//Pixel abfragen für Karte 5
string a18 = Convert.ToString(pc13);
// string a19 = Convert.ToString(pp2);
// string a20 = Convert.ToString(pp3);
textBox6.Text = a18;if (pc13 == 2585932)
{
MessageBox.Show("Keine Karte an der 5. Stelle");
}else
{
uint pc14 = GetPixel(hdc, pc14x, pc14y);//Pixel abfragen für Karte 5
uint pc15 = GetPixel(hdc, pc15x, pc15y);
uint ps9 = GetPixel(hdc, ps9x, ps9y);
uint ps10 = GetPixel(hdc, ps10x, ps10y);
uint pp5 = GetPixel(hdc, pp5x, pp5y);if (pc13 == 2302755 && pc14 == 0 && pc15 == 16777215 || pc13 == 9934847 && pc14 == 255 && pc15 == 16777215 || pc13 == 2302975 && pc14 == 255 && pc15 == 16777215)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz 2"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo 2"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik 2"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz 2"); }
}if (pc13 == 6250335 && pc14 == 0 && pc15 == 16777215 || pc13 == 6250495 && pc14 == 255 && pc15 == 16777215)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz 3"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo 3"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik 3"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz 3"); }
}if (pc13 == 16777215 && pc14 == 0 && pc15 == 16777215 && pp5 == 14408667 || pc13 == 16777215 && pc14 == 255 && pc15 == 16777215 && pp5 == 14408703)
{
//MessageBox.Show("2");// if (pp5 == 14408667 || pp5 == 14408703)
// {
if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz 4"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo 4"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik 4"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz 4"); }// }
}if (pc13 == 1907997 && pc14 == 0 && pc15 == 7631988 || pc13 == 1908223 && pc14 == 255 && pc15 == 7632127)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz 5"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo 5"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik 5"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz 5"); }
}if (pc13 == 9276813 && pc14 == 0 && pc15 == 16777215 || pc13 == 9276927 && pc14 == 255 && pc15 == 16777215)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz 6"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo 6"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik 6"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz 6"); }
}if (pc13 == 0 && pc14 == 0 && pc15 == 0 || pc13 == 255 && pc14 == 255 && pc15 == 255)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz 7"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo 7"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik 7"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz 7"); }
}if (pc13 == 14606046 && pc14 == 0 && pc15 == 16382457 || pc13 == 14606079 && pc14 == 255 && pc15 == 16382463)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz 8"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo 8"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik 8"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz 8"); }
}if (pc13 == 14606046 && pc14 == 0 && pc15 == 16777215 || pc13 == 14606079 && pc14 == 255 && pc15 == 16777215)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz 9"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo 9"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik 9"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz 9"); }
}if (pc13 == 0 && pc14 == 12698049 && pc15 == 0 || pc13 == 255 && pc14 == 12698111 && pc15 == 255)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz 10"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo 10"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik 10"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz 10"); }
}if (pc13 == 16777215 && pc14 == 16777215 && pc15 == 12171705 || pc13 == 16777215 && pc14 == 16777215 && pc15 == 12171775)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz Bube"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo Bube"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik Bube"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz Bube"); }
}if (pc13 == 10526880 && pc14 == 0 && pc15 == 7895160 || pc13 == 10526975 && pc14 == 255 && pc15 == 7895295)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz Dame"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo Dame"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik Dame"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz Dame"); }
}if (pc13 == 0 && pc14 == 16514043 && pc15 == 3421236 || pc13 == 255 && pc14 == 16514047 && pc15 == 3421439)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz König"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo König"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik König"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz König"); }
}if (pc13 == 16777215 && pc14 == 0 && pc15 == 16777215 || pc13 == 16777215 && pc14 == 255 && pc15 == 16777215 || pc13 == 16382463 && pc14 == 255 && pc15 == 16777215)
{
//MessageBox.Show("2");if (ps9 == 16777215 && ps10 == 255)
{ label9.Text = ("Herz Ass"); }if (ps9 == 255 && ps10 == 255)
{ label9.Text = ("Karo Ass"); }if (ps9 == 0 && ps10 == 0)
{ label9.Text = ("Pik Ass"); }if (ps9 == 0 && ps10 == 16777215)
{ label9.Text = ("Kreuz Ass"); }
}}
}
}
}
-
Speziell geht es um diesen Abschnitt...
//Karte 1 uint pp1 = GetPixel(hdc, pp1x, pp1y); if (pc1 == 2302755 && pc2 == 0 && pc3 == 16777215 || pc1 == 9934847 && pc2 == 255 && pc3 == 16777215 || pc1 == 2302975 && pc2 == 255 && pc3 == 16777215) { //MessageBox.Show("2"); if (ps1 == 16777215 && ps2 == 255) { label5.Text = ("Herz 2"); } if (ps1 == 255 && ps2 == 255) { label5.Text = ("Karo 2"); } if (ps1 == 0 && ps2 == 0) { label5.Text = ("Pik 2"); } if (ps1 == 0 && ps2 == 16777215) { label5.Text = ("Kreuz 2"); } } if (pc1 == 6250335 && pc2 == 0 && pc3 == 16777215 || pc1 == 6250495 && pc2 == 255 && pc3 == 16777215) { //MessageBox.Show("2"); if (ps1 == 16777215 && ps2 == 255) { label5.Text = ("Herz 3"); } if (ps1 == 255 && ps2 == 255) { label5.Text = ("Karo 3"); } if (ps1 == 0 && ps2 == 0) { label5.Text = ("Pik 3"); } if (ps1 == 0 && ps2 == 16777215) { label5.Text = ("Kreuz 3"); } } if (pc1 == 16777215 && pc2 == 0 && pc3 == 16777215 && pp1 == 14408667 || pc1 == 16777215 && pc2 == 255 && pc3 == 16777215 && pp1 == 14408703) { //MessageBox.Show("2"); //uint pp1 = GetPixel(hdc, pp1x, pp1y); // if (pp1 == 14408667 || pp1 == 14408703) // { if (ps1 == 16777215 && ps2 == 255) { label5.Text = ("Herz 4"); } if (ps1 == 255 && ps2 == 255) { label5.Text = ("Karo 4"); } if (ps1 == 0 && ps2 == 0) { label5.Text = ("Pik 4"); } if (ps1 == 0 && ps2 == 16777215) { label5.Text = ("Kreuz 4"); } // } }
-
lol ...
-
@µ
Warum lol?
-
Das ist der schlimmste Code den ich seit langem gesehen habe.
Wirf den Müll weg, lerne etwas über Methoden und andere Grundlagen und versuche es erneut.Btw. ein Bot ist nichts für den Anfang. Just saying.
-
@µ
Ist der echt so schlimm?
Ich mein eigentlich funktioniert es ganz gut, bis auf die 4 und das Ass.
Meinst du damit das der Code total unsortiert ist oder das man es einfacher machen kann?
-
Taurus1985 schrieb:
Ist der echt so schlimm?
Jup.
Taurus1985 schrieb:
Ich mein eigentlich funktioniert es ganz gut, bis auf die 4 und das Ass.
Dann mach doch weiter so.
Taurus1985 schrieb:
Meinst du damit das der Code total unsortiert ist oder das man es einfacher machen kann?
Du bist offenbar mit Basistechniken nicht vertraut und solltest Dich noch nicht an einen Bot wagen. Der muss ja irgendwann auch schlau handeln. Ohne funktionale Zerlegung und Schleifen über Arrays?!
-
Ich wollte dann mit goto arbeiten.
-
nochmal lol
-
Taurus1985 schrieb:
@volkard
Ich wollte dann mit goto arbeiten.Hab ich auch heute. Es geht mir nicht um irgendwelche Dogmen der Heiligen Strukturierten Programmierung, sondern auch erstmal darum, daß es geht.
#include <iostream> #include <algorithm> using namespace std; int main(){ int digits[9]={1,2,3,4,5,6,7,8,9,}; do{ for(int i=1;i<=9;++i) if(accumulate(digits,digits+i,0,[](int x,int d){return 10*x+d;})%i!=0) goto nix; for(auto d:digits) cout<<d; cout<<'\n'; nix:; }while(next_permutation(begin(digits),end(digits))); }
Von mir kriegste keine Tipps mehr.
-
Hallo Taurus1985,
nur so als Tipp: einzelnen Methoden oder Funktionen sollten i.d.R. nicht größer als eine Bildschirmseite sein (also max. 20 - 40 Zeilen) - und jetzt schau dir deinen Code noch mal an
Und die ganzen "Magic Numbers" wirst du selber auch nach ein paar Wochen nicht mehr verstehen.
"Copy & Paste"-Code ist das grausamste was es in der Programmierung gibt. Leider meinen Anfänger wohl, viel Code wäre guter Code. Aber genau das Gegenteil ist der Fall!
-
So ich hab das Problem durch herumprobieren gelöst.
Warum es jetzt geht ist mir zwar schleierhaft aber es funktioniert.
Ich hab einfach bei allen Assen den Pixel Patch(pp1-pp5) angewendet.
if (pc1 == 16777215 && pc2 == 0 && pc3 == 16777215 && pp1 == 0 || pc1 == 16777215 && pc2 == 255 && pc3 == 16777215 && pp1 == 255 || pc1 == 16382463 && pc2 == 255 && pc3 == 16777215 && pp1 == 255) { //MessageBox.Show("2"); if (ps1 == 16777215 && ps2 == 255) { label5.Text = ("Herz Ass"); } if (ps1 == 255 && ps2 == 255) { label5.Text = ("Karo Ass"); } if (ps1 == 0 && ps2 == 0) { label5.Text = ("Pik Ass"); } if (ps1 == 0 && ps2 == 16777215) { label5.Text = ("Kreuz Ass"); } }
-
Mir ist es schleierhaft wie ich den ganzen Code in eine Bildschirm Seite quetschen kann.
-
Mach dir ein hübsches Array mit "card detection rules".
Dann machst du ne Schleife die alle Rules durchgeht und prüft ob die Rule "erfüllt" ist.Also Sinngemäss:
List<CardDetectionRule> CardDetectionRules = new List<CardDetectionRule>() { new CardDetectionRule(...), new CardDetectionRule(...), new CardDetectionRule(...), ... }; CardDetectionRule DetectCard(DatenstrukturMitDenPixeldaten pixelHaufen) { foreach (var rule in CardDetectionRules) // Ja, ich weiss dass man das mit LINQ als Einzeiler schreiben kann if (rule.Matches(pixelHaufen)) return rule; return null; }
Wenn die Initialisierung von "CardDetectionRules" dabei zu riesig wird, z.B. weil der Konsturktoraufruf einer einzelnen CardDetectionRule schon mehrere Zeilen braucht, dann teil es weiter auf:
CardDetectionRule AceOfSpadesDetectionRule = new CardDetectionRule ( ... ... ); CardDetectionRule AceOfHeartsDetectionRule = new CardDetectionRule ( ... ... ); List<CardDetectionRule> CardDetectionRules = new List<CardDetectionRule>() { AceOfSpadesDetectionRule, AceOfHeartsDetectionRule, ... };
uswusf.
-
Sag mal wann und wo dein super Poker Bot spielt?
Ich will gegen den spielen. xD
-
Danke @hustbaer
Ich denke mal das ich noch ein wenig brauche, weil bin ja erst bei der Kartenerkennung.
-
Taurus1985 schrieb:
Warum es jetzt geht ist mir zwar schleierhaft aber es funktioniert.
Wenn Du nicht weißt warum es funktioniert, dann funktioniert es auch nicht sondern liefert bestenfalls zufällig ein Ergebnis das so aussieht wie Du glaubst das es sein sollte wenn es funktionieren würde.
-
Ich wollte eigentlich nur bei der 4 die Karten checken, aber da ich jetzt das Ass auch mit drin habe, geht es wundersamer weise und es scheint auch kein Zufalls Ergebnis zu sein. Ich hab das nämlich schon getestet.
-
Taurus1985 schrieb:
wundersamer weise und es scheint auch kein Zufalls
Du hast nicht verstanden was dir gesagt wurde
-
loks schrieb:
Wenn Du nicht weißt warum es funktioniert, dann funktioniert es auch nicht sondern liefert bestenfalls zufällig ein Ergebnis das so aussieht wie Du glaubst das es sein sollte wenn es funktionieren würde.
@loks: Schön gesagt..
solltest Philosoph werden.
Darf ich das in meine Signatur nehmen?? Gefällt mir sehr gut.