The Edge of Nowhere Forum Index
The Edge of Nowhere
Boooooooooo Spain!
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Home | Forums | IRC | BHFiles

[Bot] Trap Claw Shopbot
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    The Edge of Nowhere Forum Index -> Diablo II Bots and Programs
Author Message
eff3ct
User
User


Joined: 20 Nov 2007
My Posts

PostPosted: Tue Nov 20, 2007 12:30 am    Post subject: how to do this ?! Reply with quote

hi, i would like to edit this..but i dunno how to edit it
can someone help me ?
i want that the bot only buy claws with +2assa +3 ls +(mods) or +3trap +3ls +(mods) or +3shadow +3venom +(mods)

mods = not a must

Code:
if (stats.Length > 7)
{
Console.WriteLine(stats + "===================");
//if (((stats.Contains("+2 to Assassin Skills") || stats.Contains("+3 to Traps")) && stats.Contains("to Lightning Sentry")) || (stats.Contains("+3 to Shadow Disciplines") && (stats.Contains("to Fade") || stats.Contains("to Burst of Speed") || stats.Contains("to Shadow Master"))))
if ((stats.Contains("+2 to Assassin Skills") && stats.Contains("to Lightning Sentry")) || (stats.Contains("+3 to Shadow Disciplines") && (stats.Contains("to Fade") || stats.Contains("to Burst of Speed") || stats.Contains("to Shadow Master"))) || stats.Contains("+3 to Traps"))


would be nice if someone can edit this for me =)


regardz
eff3ct
Back to top
Gary13579
User
User


Joined: 09 Oct 2006
My Posts

PostPosted: Tue Nov 20, 2007 8:04 am    Post subject: Re: how to do this ?! Reply with quote

eff3ct wrote:
hi, i would like to edit this..but i dunno how to edit it
can someone help me ?
i want that the bot only buy claws with +2assa +3 ls +(mods) or +3trap +3ls +(mods) or +3shadow +3venom +(mods)

mods = not a must

Code:
if (stats.Length > 7)
{
Console.WriteLine(stats + "===================");
//if (((stats.Contains("+2 to Assassin Skills") || stats.Contains("+3 to Traps")) && stats.Contains("to Lightning Sentry")) || (stats.Contains("+3 to Shadow Disciplines") && (stats.Contains("to Fade") || stats.Contains("to Burst of Speed") || stats.Contains("to Shadow Master"))))
if ((stats.Contains("+2 to Assassin Skills") && stats.Contains("to Lightning Sentry")) || (stats.Contains("+3 to Shadow Disciplines") && (stats.Contains("to Fade") || stats.Contains("to Burst of Speed") || stats.Contains("to Shadow Master"))) || stats.Contains("+3 to Traps"))


would be nice if someone can edit this for me =)


regardz
eff3ct


You are wasting time with only those mods. Other claws sell very well on JSP, and the few you selected you could go weeks/months/years before finding a claw.
Back to top
excaliber-908872
User
User


Joined: 10 Sep 2007
My Posts

PostPosted: Sun Nov 25, 2007 1:46 pm    Post subject: Reply with quote

The below script was edited by myself to shop armors as well as claws. Same deal as before, set up by anya etc...bla bla bla...The first run with this may be a little slow, but all runs thereafter speed up nicely.WITH armors, i am shopping @ 440 runs per hour. If you dont have /dnd on you WILL have a problem with this. Also, I havent found the way to block all text from showing on screen yet...such as enter bnet, exit bnet, enter game messages. Any of those will lead your character to quah-kehk.

Anyways, try this out (add your item list into it and recompile) and let me know how it works for you. Heres my 1 night list.:

Jewelers Ancient Armor of Stability - 4 os 24 FHR 225 def lvl 47 req

Jewelers Ancient Armor of Stability - 4 os 24 FHR 227 def lvl 47 req

Artisans Gothic Shield of Blocking (3 os 15 FBR 10 ICoB) lvl 25 req

Artisans Gothic Shield of Blocking (3 os 15 FBR 10 ICoB) lvl 25 req

Jewelers Ancient Armor of the Whale - 95 life 4 os

Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        public const int XUNIQUES_Color = 9732707;
        public const int SETS_Color = 1638144;
        public const int XRARES_Color = 14596707;
        public const int MAGICS_Color = 5394861;
        public const int GRAYS_Color = 5394770;
        public const int WHITES_Color = 13027270;
        public const int UNID_RED_Color = 11879729;
        public const int XUNIQUES_Color_A2 = 10259034;
        public const int SETS_Color_A5 = 575256;
        public const int MOUSEDELAY = 50;
        public static int XDiff = 0;
        public static int YDiff = 0;
        public static int Xbase = 0;
        public static int Ybase = 0;
        //shop colors
        public const int ANYACOLOR = 10821887;
        public const int HARROGATH = 10821887;
        public const int TEMPLE = 11879729;
        public const int TEMPLEBOX = 1638144;
        public const int ANYAMENU = 575256;
        public const int SHOPCHECKSUM = 72982579;
        public const int SHOPTABCHECKSUM = 145491443;
        public static int[,] CLAWPOS = new int[12, 3];//changed from 6 to 22(JERTSC)
        //
        public static int totalRuns = 1;
        public static Window D2Window = new Window(FindWindow(null, "Diablo III"));
        public static Bitmap D2bmp, D2bmp2;
        public static Random rand = new Random();

        public static int[] PixelSearch(int wLeft, int wTop, int wRight, int wBottom, int colorRGB)
        {
            Color checkColor = RGBDecToColor(colorRGB);
            //try
            //{
            for (int col = wLeft; col <= wRight; col++)
            {
                for (int row = wTop; row <= wBottom; row++)
                {
                    if (D2bmp.GetPixel(col, row).Equals(checkColor))
                    {
                        return new int[] { col, row };
                    }
                }
            }
            //}
            //catch { }
            return null;//Changed from unidentifiable.
        }
        public static int[] PixelSearch(int wLeft, int wTop, int wRight, int wBottom, int colorRGB, int resolution)
        {
            Color checkColor = RGBDecToColor(colorRGB);
            if (resolution >= 1)
            {
                //try
                //{
                for (int col = wLeft; col <= wRight; col += resolution)
                {
                    for (int row = wTop; row <= wBottom; row += resolution)
                    {
                        if (D2bmp.GetPixel(col, row).Equals(checkColor))
                        {
                            return new int[] { col, row };
                        }
                    }
                }
                //}
                //catch { }
            }
            return null;
        }
        public static void Calibrate()
        {
            DumpWindow(ref D2bmp);
            int[] CPoint = PixelSearch(15, 565, 35, 585, 15189908);
            if (CPoint != null)
            {
                Xbase = 23;
                Ybase = 574;
                XDiff = CPoint[0] - Xbase;
                YDiff = CPoint[1] - Ybase;
                CLAWPOS[0, 0] = 112;
                CLAWPOS[0, 1] = 167;
                CLAWPOS[0, 2] = 52142560;
                CLAWPOS[1, 0] = 138;
                CLAWPOS[1, 1] = 167;
                CLAWPOS[1, 2] = 61873780;
                CLAWPOS[2, 0] = 112;
                CLAWPOS[2, 1] = 254;
                CLAWPOS[2, 2] = 40960110;
                CLAWPOS[3, 0] = 138;
                CLAWPOS[3, 1] = 254;
                CLAWPOS[3, 2] = 43392643;
                CLAWPOS[4, 0] = 112;
                CLAWPOS[4, 1] = 341;
                CLAWPOS[4, 2] = 40960110;
                CLAWPOS[5, 0] = 138;
                CLAWPOS[5, 1] = 341;
                CLAWPOS[5, 2] = 43392643;//Added all below this for clawpos (JERTSC)
                CLAWPOS[6, 0] = 164;
                CLAWPOS[6, 1] = 167;
                CLAWPOS[6, 2] = 52142560;
                CLAWPOS[7, 0] = 224;
                CLAWPOS[7, 1] = 166;
                CLAWPOS[7, 2] = 52142560;
                CLAWPOS[8, 0] = 170;
                CLAWPOS[8, 1] = 251;
                CLAWPOS[8, 2] = 43392643;
                CLAWPOS[9, 0] = 230;
                CLAWPOS[9, 1] = 244;
                CLAWPOS[9, 2] = 43392643;
                CLAWPOS[10, 0] = 166;
                CLAWPOS[10, 1] = 333;
                CLAWPOS[10, 2] = 43392643;
                CLAWPOS[11, 0] = 229;
                CLAWPOS[11, 1] = 334;
                CLAWPOS[11, 2] = 43392643;
               
               
               
             



            }
            else
            {
                MessageBox.Show("Calibration failed.  Make sure Windows is in 16 bit color mode.");
            }
        }
        public static string ItemDescBox(int mode)
        {
            DumpWindow(ref D2bmp);
            int X_Start, X_Stop, Y_Start, Y_Stop, X, Y, Xleft, Xright, Ytop, Apix, BlockTest, XSStart, XSStop, XSearch, YSearch;
            X_Start = 3 + XDiff;
            X_Stop = 795 + XDiff;
            Y_Start = 25 + YDiff;
            Y_Stop = 615 + YDiff;
            X = 0;
            Y = 0;
            Xleft = 0;
            Xright = 0;
            Ytop = 0;
            Apix = 0;
            BlockTest = 0;
            XSStart = 0;
            XSStop = 0;
            XSearch = 0;
            YSearch = 0;
            for (Y = Y_Start; Y <= Y_Stop; Y += 12)
            {
                for (X = X_Start; X <= X_Stop; X += 49)
                {
                    Apix = RGBColorToDec(D2bmp.GetPixel(X, Y));
                    if ((Apix == XUNIQUES_Color) || (Apix == XRARES_Color) || (Apix == MAGICS_Color) || (Apix == SETS_Color) || (Apix == GRAYS_Color) || (Apix == WHITES_Color) || (Apix == SETS_Color_A5) || (Apix == XUNIQUES_Color_A2))
                    {
                        Xleft = X;
                        do
                        {
                            Xleft--;
                            BlockTest = RGBColorToDec(D2bmp.GetPixel(Xleft, Y));
                        }
                        while (BlockTest == Apix);
                        Xright = X;
                        do
                        {
                            Xright++;
                            BlockTest = RGBColorToDec(D2bmp.GetPixel(Xright, Y));
                        }
                        while (BlockTest == Apix);
                        if ((Xright - Xleft) > 45)
                        {
                            Ytop = Y;
                            do
                            {
                                Ytop--;
                                BlockTest = RGBColorToDec(D2bmp.GetPixel(X, Ytop));
                            }
                            while (BlockTest == Apix);
                            XSStart = Xleft - 250;
                            if (XSStart < 0)
                            {
                                XSStart = 0;
                            }
                            XSStop = Xleft + 350;
                            if (XSStop > 800)
                            {
                                XSStop = 800;
                            }

                            string[] Ys_DB = new string[700];
                            int Apix1, Apix2, Apix3;
                            for (YSearch = Ytop + 30; YSearch < (625 + YDiff); YSearch += 2)
                            {
                                Apix1 = RGBColorToDec(D2bmp.GetPixel(Xright - 52, YSearch));
                                Apix2 = RGBColorToDec(D2bmp.GetPixel(Xright + 2, YSearch));
                                Apix3 = RGBColorToDec(D2bmp.GetPixel(Xright + 20, YSearch));
                                Ys_DB[YSearch] = (Apix1.ToString() + Apix2.ToString() + Apix3.ToString());
                            }
                            string[] Xs_DB = new string[805];
                            for (XSearch = XSStart; XSearch <= XSStop; XSearch += 2)
                            {
                                Apix1 = RGBColorToDec(D2bmp.GetPixel(XSearch, Ytop - 15));
                                Apix2 = RGBColorToDec(D2bmp.GetPixel(XSearch, Ytop + 8));
                                Apix3 = RGBColorToDec(D2bmp.GetPixel(XSearch, Ytop + 30));
                                Xs_DB[XSearch] = (Apix1.ToString() + Apix2.ToString() + Apix3.ToString());
                            }
                            int[] OldMousePos = new int[2] { Cursor.Position.X, Cursor.Position.Y };
                            D2Window.MouseMove(790, 610);
                            DumpWindow(ref D2bmp2);
                            for (XSearch = XSStart; XSearch <= XSStop; XSearch += 2)
                            {
                                Apix1 = RGBColorToDec(D2bmp2.GetPixel(XSearch, Ytop - 15));
                                Apix2 = RGBColorToDec(D2bmp2.GetPixel(XSearch, Ytop + 8));
                                Apix3 = RGBColorToDec(D2bmp2.GetPixel(XSearch, Ytop + 30));
                                if (!Xs_DB[XSearch].Equals(Apix1.ToString() + Apix2.ToString() + Apix3.ToString()))
                                {
                                    break;
                                }
                            }
                            int LeftBox = XSearch + 1;
                            if (XSStart % 2 == 0)
                            {
                                XSearch = ((Xleft + 80) - (Xleft % 2));
                            }
                            else
                            {
                                XSearch = Xleft;
                            }
                            for (; XSearch <= XSStop; XSearch += 2)
                            {
                                Apix1 = RGBColorToDec(D2bmp2.GetPixel(XSearch, Ytop - 15));
                                Apix2 = RGBColorToDec(D2bmp2.GetPixel(XSearch, Ytop + 8));
                                Apix3 = RGBColorToDec(D2bmp2.GetPixel(XSearch, Ytop + 30));
                                if (Xs_DB[XSearch].Equals(Apix1.ToString() + Apix2.ToString() + Apix3.ToString()))
                                {
                                    break;
                                }
                            }
                            int RightBox = XSearch - 2;
                            for (YSearch = Ytop + 30; YSearch <= (YDiff + 625); YSearch += 2)
                            {
                                Apix1 = RGBColorToDec(D2bmp2.GetPixel(Xright - 52, YSearch));
                                Apix2 = RGBColorToDec(D2bmp2.GetPixel(Xright + 2, YSearch));
                                Apix3 = RGBColorToDec(D2bmp2.GetPixel(Xright + 20, YSearch));
                                if (Ys_DB[YSearch].Equals(Apix1.ToString() + Apix2.ToString() + Apix3.ToString()))
                                {
                                    break;
                                }
                            }
                            int BottomBox = YSearch - 2;
                            //MOUSEMOVE back to D2bmp
                            int DownLines = ((BottomBox - (Ytop + 12)) / 16);
                            Ytop++;

                            if (mode == 1)
                            {
                                string Qualname;
                                switch (Apix)
                                {
                                    case XUNIQUES_Color:
                                    case XUNIQUES_Color_A2:
                                        {
                                            Qualname = "Unique ";
                                            break;
                                        }
                                    case SETS_Color:
                                    case SETS_Color_A5:
                                        {
                                            Qualname = "Set ";
                                            break;
                                        }
                                    case XRARES_Color:
                                        {
                                            Qualname = "Rare ";
                                            break;
                                        }
                                    case MAGICS_Color:
                                        {
                                            Qualname = "Magic ";
                                            break;
                                        }
                                    case GRAYS_Color:
                                        {
                                            Qualname = "Gray ";
                                            break;
                                        }
                                    case WHITES_Color:
                                        {
                                            Qualname = "White ";
                                            break;
                                        }
                                    default:
                                        {
                                            Qualname = "Unknown Quality ";
                                            break;
                                        }
                                }
                                string ItemName = ReadLine(1, Apix, Ytop, Xright, RightBox);
                                if (ItemName.Contains(" Rune"))
                                {
                                    Qualname = "";
                                }
                                return Qualname + ItemName;
                            }

                            if (mode == 2)
                            {
                                int LineInc = 1;
                                string Stats, LineText;
                                Stats = "";
                                do
                                {
                                    LineText = ReadLine(2, MAGICS_Color, Ytop + (16 * LineInc), LeftBox, RightBox);
                                    if (!LineText.Equals(String.Empty) && LineText.Length > 7)
                                    {
                                        Stats += (LineText + (char)13 + (char)10);
                                    }
                                    LineInc++;
                                }
                                while (LineInc <= DownLines);
                                return Stats;
                            }
                        }
                    }
                }
                X = X_Start;
            }
            return "";
        }

        public static string ReadLine(int mode, int ColorFont, int YTOP_STR, int Xleft, int Xright)
        {
            if (mode > 1)
            {
                if (PixelSearch(Xleft + 20, YTOP_STR + 11, Xright - 20, YTOP_STR + 11, WHITES_Color) != null)
                {
                    return "";
                }
            }
            int[] Apix = PixelSearch(Xleft, YTOP_STR + 11, Xleft + 280, YTOP_STR + 11, ColorFont);
            if (Apix != null)
            {
                Xleft = Apix[0];
            }
            else
            {
                return "";
            }

            string[] Char = new string[200];
            int Yread, Yreadsub, Xread, CharIndex, Space, Xreadstart, Apix1;
            string CodeA, CodeB;
            Yread = YTOP_STR + 11;
            Yreadsub = YTOP_STR + 12;
            Xread = Xleft;
            CharIndex = 1;
            while (true)
            {
                Space = 0;
                CodeA = "";
                CodeB = "";
                Xreadstart = Xread;
                while (true)
                {
                    Apix1 = RGBColorToDec(D2bmp.GetPixel(Xread, Yread));
                    Xread++;
                    if (Apix1 != ColorFont)
                    {
                        CodeA += "0";
                        Space++;
                        if (Space > 1)
                        {
                            CodeA = CodeA.TrimEnd(new char[1] { '0' });
                            if (CodeA.Length < 5)
                            {
                                Space = 0;
                                while (true)
                                {
                                    Apix1 = RGBColorToDec(D2bmp.GetPixel(Xreadstart, Yreadsub));
                                    Xreadstart++;
                                    if (Apix1 != ColorFont)
                                    {
                                        CodeB += "0";
                                        Space++;
                                        if (Space > 1)
                                        {
                                            CodeB = CodeB.TrimEnd(new char[1] { '0' });
                                            if (CodeB.Equals(String.Empty))
                                            {
                                                CodeB = "0";
                                            }
                                            goto ExitLoop2;
                                        }
                                    }
                                    else
                                    {
                                        CodeB += "1";
                                        Space = 0;
                                    }
                                }
                            }
                            break;
                        }
                    }
                    else
                    {
                        CodeA += "1";
                        Space = 0;
                    }
                }
            ExitLoop2:
                Char[CharIndex] = CodeToChar(CodeA, CodeB);
                CharIndex++;

                while (true)
                {
                    Apix1 = RGBColorToDec(D2bmp.GetPixel(Xread, Yread));
                    if (Apix1 != ColorFont)
                    {
                        Xread++;
                        Space++;
                        if (Xread >= Xright)
                        {
                            goto ExitLoop;
                        }
                        if (Space > 4)
                        {
                            Char[CharIndex] = " ";
                            CharIndex++;
                            Apix = PixelSearch(Xread, Yread, Xread + 20, Yread, ColorFont);
                            if (Apix != null)
                            {
                                if (Apix[0] >= Xright)
                                {
                                    goto ExitLoop;
                                }
                                else
                                {
                                    Xread = Apix[0];
                                    break;
                                }
                            }
                            else
                            {
                                goto ExitLoop;
                            }
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }
        ExitLoop:
            string TheString = "";
            for (int i = 1; i <= CharIndex - 1; i++)
            {
                TheString += Char[i];
            }
            if (mode > 1)
            {
                TheString = TheString.TrimEnd(new char[1] { (char)32 });
            }
            else
            {
                TheString = TheString.TrimEnd(new char[2] { (char)32, '?' });
                TheString = TheString.TrimStart(new char[2] { (char)32, '?' });
            }
            return TheString;
        }
        public static string CodeToChar(string CodeA, string CodeB)
        {
            if (!CodeB.Equals(String.Empty))
            {
                if (CodeA.Equals("11"))
                {
                    switch (CodeB)
                    {
                        case "0":
                            return "i";
                        case "1":
                            return "'";
                        case "11":
                            return "j";
                        case "111":
                            return ":";
                    }
                }
                if (CodeA.Equals("1011"))
                {
                    switch (CodeB)
                    {
                        case "0":
                            return "s";
                        case "1":
                            return "h";
                        case "1101":
                            return "3";
                        case "111":
                            return "6";
                        case "11":
                            return "7";
                        case "101":
                            return "8";
                        case "1111":
                            return "9";
                        case "1011":
                            return "z";
                    }
                }
                if (CodeA.Equals("111"))
                {
                    switch (CodeB)
                    {
                        case "1":
                            return "1";
                        case "111":
                            return "(";
                        case "11":
                            return "J";
                    }
                }
                if (CodeA.Equals("101"))
                {
                    switch (CodeB)
                    {
                        case "101":
                            return "-";
                        case "1":
                            return ")";
                        case "11":
                            return "I";
                    }
                }
                if (CodeA.Equals("1111"))
                {
                    return "S";
                }
                if (CodeA.Equals("1101"))
                {
                    switch (CodeB)
                    {
                        case "0":
                            return "B";
                        case "1":
                            return "F";
                    }
                }
                return "?";
            }
            switch (CodeA)
            {
                case "11101":
                    return "e";
                case "10101011":
                    return "a";
                case "1101101":
                    return "t";
                case "1010111":
                    return "n";
                case "10101111":
                    return "o";
                case "111101":
                    return "d";
                case "101101":
                    return "+";
                case "1011111":
                    return "g";
                case "111011":
                    return "c";
                case "10110101":
                    return "m";
                case "1010101":
                    return "r";
                case "10101":
                    return "l";
                case "11101011":
                    return "%";
                case "10110111":
                    return "D";
                case "1011011":
                    return "2";
                case "101010101":
                    return "A";
                case "101011":
                    return "k";
                case "10111101":
                    return "u";
                case "110111":
                    return "5";
                case "101011011":
                    return "0";
                case "1101111":
                    return "4";
                case "11011":
                    return "f";
                case "101011101":
                    return "M";
                case "110101":
                    return "L";
                case "11111":
                    return "p";
                case "101111":
                    return "E";
                case "11011011":
                    return "v";
                case "1110101":
                    return "C";
                case "11011101":
                    return "y";
                case "10111111":
                    return "x";
                case "10111":
                    return "b";
                case "1011101":
                    return "P";
                case "101011111":
                    return "O";
                case "101111011":
                    return "U";
                case "1110111":
                    return "H";
                case "101110111":
                    return "w";
                case "1101011":
                    return "/";
                case "11011111":
                    return "N";
                case "101101101":
                    return "T";
                case "1111011":
                    return "K";
                case "10111011":
                    return "q";
                case "11010101":
                    return "G";
                case "101111101011":
                    return "W";
                case "101101111":
                    return "V";
                case "10101101":
                    return "Z";
                case "101101011":
                    return "Q";
                case "101010111":
                    return "X";
                case "11010111":
                    return "R";
                case "101110101":
                    return "Y";
            }
            return "?";
        }
        public static System.Drawing.Bitmap PrintWindow(IntPtr WindowHandle)
        {

            System.Drawing.Bitmap clsRet = null;

            // get window size and location...
            System.Drawing.Size clsSize = GetWindowSize(WindowHandle);

            // get device context of the window...
            IntPtr hdcFrom = GetDC(WindowHandle);

            // create dc that we can draw to...
            IntPtr hdcTo = CreateCompatibleDC(hdcFrom);
            IntPtr ptrRet = CreateCompatibleBitmap(hdcFrom, clsSize.Width, clsSize.Height);

            //  validate...
            if (!ptrRet.Equals(IntPtr.Zero))
            {
                // copy...
                IntPtr hcdLocal = (IntPtr)(SelectObject(hdcTo, ptrRet));
                PrintWindow(WindowHandle, hdcTo, 0);
                SelectObject(hdcTo, hcdLocal);
                //  create bitmap for window image...
                clsRet = System.Drawing.Image.FromHbitmap(ptrRet);
            }

            //  release ...
            ReleaseDC(WindowHandle, hdcFrom);
            DeleteDC(hdcTo);
            DeleteObject(ptrRet);

            //  return...
            return clsRet;

        }

        [DllImport("user32.dll", EntryPoint = "PrintWindow")]
        public static extern bool PrintWindow(IntPtr hwnd, IntPtr hDC, uint nFlags);

        [DllImport("user32.dll", EntryPoint = "GetDC")]
        public extern static IntPtr GetDC(IntPtr hWnd);

        [DllImport("user32.dll", EntryPoint = "ReleaseDC")]
        public extern static IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDc);

        [DllImport("gdi32.dll", EntryPoint = "DeleteDC")]
        public extern static IntPtr DeleteDC(IntPtr hDc);

        [DllImport("gdi32.dll", EntryPoint = "DeleteObject")]
        public extern static IntPtr DeleteObject(IntPtr hDc);

        [DllImport("gdi32.dll", EntryPoint = "CreateCompatibleBitmap")]
        public extern static IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight);

        [DllImport("gdi32.dll", EntryPoint = "CreateCompatibleDC")]
        public extern static IntPtr CreateCompatibleDC(IntPtr hdc);

        [DllImport("gdi32.dll", EntryPoint = "SelectObject")]
        public extern static IntPtr SelectObject(IntPtr hdc, IntPtr bmp);

        [DllImport("user32.dll", SetLastError = true)]
        static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

        public static System.Drawing.Size GetWindowSize(IntPtr WindowHandle)
        {
            RECT clsRect = new RECT();
            GetWindowRect(WindowHandle, ref clsRect);
            return new System.Drawing.Size(clsRect.right - clsRect.left, clsRect.bottom - clsRect.top);
        }
        [StructLayout(LayoutKind.Sequential)]
        public struct RECT
        {
            public int left;
            public int top;
            public int right;
            public int bottom;
        }
        [System.Runtime.InteropServices.DllImport("User32.dll",
             EntryPoint = "GetWindowRect",
             ExactSpelling = false,
             CharSet = System.Runtime.InteropServices.CharSet.Auto,
             SetLastError = true)]
        public static extern IntPtr GetWindowRect(IntPtr hWnd, ref RECT rect);
        public static void DumpWindow(ref Bitmap dump)
        {
            do
            {
                dump = PrintWindow(D2Window.Handle.Handle);
            }
            while (dump.GetPixel(rand.Next(20, 750), rand.Next(40, 580)).R == 0);
        }
        public static int RGBColorToDec(Color co)
        {
            return Convert.ToInt32(Convert.ToString(co.R, 16) + Convert.ToString(co.G, 16) + Convert.ToString(co.B, 16), 16);
        }
        public static Color RGBDecToColor(int co)
        {
            return Color.FromArgb((co >> 16) & 255, (co >> 8) & 255, co & 255);
        }
        public static int PixelCheckSum(int left, int top, int right, int bottom)
        {
            int checkSum = 0;
            for (int col = left; col <= right; col++)
            {
                for (int row = top; row <= bottom; row++)
                {
                    checkSum += RGBColorToDec(D2bmp.GetPixel(col, row));
                }
            }
            return checkSum;
        }
        public static int WhereAreWe()
        {
            D2Window.MouseMove(790, 600);
            DumpWindow(ref D2bmp);
            if (PixelCheckSum(750, 345, 755, 350) == SHOPCHECKSUM)
            {
                return 0;//Anya's shop
            }
            else
            {
                if (RGBColorToDec(D2bmp.GetPixel(650, 75)) == HARROGATH)
                {
                    if (PixelSearch(0, 0, 600, 300, ANYAMENU, 4) != null)
                    {
                        return 2;//Anya's menu
                    }
                    return 1;//Harrogath
                }
                else
                {
                    if (RGBColorToDec(D2bmp.GetPixel(675, 75)) == TEMPLE)
                    {
                        return 3;//Temple
                    }
                    return 4;//don't know where we are
                }
            }
        }
        public static void ClearMenu()
        {
            DumpWindow(ref D2bmp);
            while (PixelCheckSum(750, 345, 755, 350) == SHOPCHECKSUM)
            {
                D2Window.SendKey(Keys.Space);
                Thread.Sleep(100);
                DumpWindow(ref D2bmp);
            }
        }
        public static void FixMe()
        {
            int[] coord;
            switch (WhereAreWe())
            {
                case 1:
                    {
                        D2Window.SendKey(Keys.Space, 20, 2);
                        Thread.Sleep(100);
                        DumpWindow(ref D2bmp);
                        coord = PixelSearch(3, 22, 802, 574, ANYACOLOR);
                        if (coord != null)
                        {
                            D2Window.Click(coord[0], coord[1]);
                        }
                        else
                        {
                            D2Window.Click(556, 312);
                        }
                        break;
                    }
                case 3:
                    {
                        D2Window.SendKey(Keys.Space);
                        D2Window.Click(375, 368);
                        Thread.Sleep(200);
                        DumpWindow(ref D2bmp);
                        coord = PixelSearch(3, 300, 802, 574, TEMPLEBOX);
                        if (coord != null)
                        {
                            D2Window.Click(coord[0] + 40, coord[1] - 130);
                        }
                        break;
                    }
            }
            Thread.Sleep(1000);
        }
        public static void Shop()
        {
            string stats;
            Console.Clear();
            Console.WriteLine("Run # " + totalRuns.ToString());
            Console.WriteLine();
            D2Window.MouseMove(790, 600);
            for (int loop = 0; loop <= 11; loop++)//Changed from loop <= 5 to loop <= 11 (JERTSC)
            {
                if (PixelCheckSum(CLAWPOS[loop, 0], CLAWPOS[loop, 1], CLAWPOS[loop, 0] + 11, CLAWPOS[loop, 1] + 11) != CLAWPOS[loop, 2])//Changed from +5 to +11 (JERTSC)
                {
                    D2Window.MouseMove(CLAWPOS[loop, 0], CLAWPOS[loop, 1]);
                    stats = ItemDescBox(2);
                    if (stats.Length > 7)
                    {
                        Console.WriteLine(stats + "===================");
                        //if (((stats.Contains("+2 to Assassin Skills") || stats.Contains("+3 to Traps")) && stats.Contains("to Lightning Sentry")) || (stats.Contains("+3 to Shadow Disciplines") && (stats.Contains("to Fade") || stats.Contains("to Burst of Speed") || stats.Contains("to Shadow Master"))))



                        if (
                       
                        (stats.Contains("Put Stats Here") && stats.Contains("And Here"))


                        )
                        {
                            D2Window.Click(CLAWPOS[loop, 0], CLAWPOS[loop, 1], ClickType.Right);
                            Thread.Sleep(50);
                            D2Window.Click(CLAWPOS[loop, 0], CLAWPOS[loop, 1], ClickType.Right);
                            File.AppendAllText("ClawLog2.txt", stats + "===================" + (char)13 + (char)10);
                        }
                    }
                }
            }
        }
        static void Main(string[] args)
        {
            bool GoToAnya = true;//going to anya or going to temple
            int errorLevel = 0;//calls FixMe if errorLevel reaches 2
            int[] coord = new int[2];//temp coordinates
            int timeout = 0;
            if (!File.Exists("ClawLog2.txt"))
            {
                File.Create("ClawLog2.txt");
            }
            D2Window.Activate();
            Win32.SetWindowPos(D2Window.Handle, 0, 0);
            Calibrate();
            Thread.Sleep(250);
            while (true)
            {
                if (errorLevel >= 2)
                {
                    FixMe();
                }
                switch (WhereAreWe())
                {
                    case 0://we are in the shop
                        {
                            errorLevel = 0;
                            if (GoToAnya)
                            {
                                timeout = 0;
                                do
                                {
                                    Shop();
                                    D2Window.Click(180, 80);//click weapons tab in shop
                                    Thread.Sleep(150);
                                    timeout++;
                                    DumpWindow(ref D2bmp);
                                }
                                while (PixelCheckSum(237, 97, 241, 101) != SHOPTABCHECKSUM && timeout < 30);
                                Shop();//shop for itemz
                                totalRuns++;
                                GoToAnya = false;//now we are going to the temple
                            }
                            ClearMenu();//exit the shop
                            Thread.Sleep(150);
                            break;
                        }
                    case 1://we are standing in Harrogath
                        {
                            timeout = 0;
                            do//looking for Anya
                            {
                                D2Window.MouseMove(790, 600);
                                Thread.Sleep(100);
                                DumpWindow(ref D2bmp);
                                coord = PixelSearch(0, 0, 500, 500, ANYACOLOR, 6);
                                timeout++;
                            }
                            while (coord == null && timeout < 30);
                            if (timeout >= 30)
                            {
                                errorLevel++;
                                break;//couldn't find Anya
                            }
                            if (GoToAnya)
                            {
                                errorLevel = 0;
                                D2Window.Click(coord[0] + 20, coord[1] + 40);//click Anya
                                Thread.Sleep(200);
                                D2Window.MouseMove(790, 600);
                                timeout = 0;
                                do//running to Anya
                                {
                                    D2Window.MouseMove(790, 600);
                                    Thread.Sleep(100);
                                    DumpWindow(ref D2bmp);
                                    coord = PixelSearch(0, 0, 500, 500, ANYACOLOR, 4);
                                    timeout++;
                                }
                                while (coord == null && timeout < 30);
                                if (timeout >= 30)
                                {
                                    errorLevel++;
                                }
                            }
                            else//done shopping, going to temple
                            {
                                D2Window.Click(coord[0] + 120, coord[1] + 130);//click red portal
                                timeout = 0;
                                do
                                {
                                    Thread.Sleep(250);
                                    timeout++;
                                }
                                while (WhereAreWe() != 3 && timeout < 30);
                                if (timeout >= 30)
                                {
                                    errorLevel++;
                                }
                                Thread.Sleep(200);
                            }
                            break;
                        }
                    case 2://Anya's chat menu is open
                        {
                            errorLevel = 0;
                            if (GoToAnya)
                            {
                                D2Window.MouseMove(790, 600);
                                DumpWindow(ref D2bmp);
                                coord = PixelSearch(0, 0, 600, 300, ANYAMENU, 4);
                                if (coord != null)
                                {
                                    Thread.Sleep(200);//added a delay here before clicking trade.
                                    D2Window.Click(coord[0] + 25, coord[1] + 17);//click "Trade"
                                    Thread.Sleep(200);
                                }
                            }
                            else
                            {
                                D2Window.SendKey(Keys.Space);
                                Thread.Sleep(150);
                            }
                            break;
                        }
                    case 3://we are in Nihlathak's Temple
                        {
                            GoToAnya = true;
                            D2Window.MouseMove(790, 600);
                            timeout = 0;
                            do
                            {
                                Thread.Sleep(150);
                                DumpWindow(ref D2bmp);
                                coord = PixelSearch(200, 250, 500, 500, TEMPLEBOX, 5);
                                timeout++;
                            }
                            while (coord == null && timeout < 30);
                            if (timeout >= 30)
                            {
                                errorLevel++;
                                break;//could not find green block
                            }
                            D2Window.Click(coord[0] + 40, coord[1] - 130);
                            timeout = 0;
                            Thread.Sleep(250);
                            do//wait to enter Harrogath
                            {
                                Thread.Sleep(300);
                                timeout++;
                            }
                            while (WhereAreWe() != 1 && timeout < 30);
                            if (timeout >= 30)
                            {
                                errorLevel++;
                            }
                            Thread.Sleep(250);
                            break;
                        }
                    case 4://turn on the map
                        {
                            D2Window.SendKey(Keys.Tab);
                            Thread.Sleep(100);
                            break;
                        }
                }
            }
        }
    }
}
Back to top
excaliber-908872
User
User


Joined: 10 Sep 2007
My Posts

PostPosted: Mon Nov 26, 2007 2:34 am    Post subject: Reply with quote

Huge flaw in my code here...forget this post existed >< The above posting is still in working order.
Back to top
punkpenguin12
User
User


Joined: 13 Nov 2007
My Posts

PostPosted: Mon Nov 26, 2007 11:04 am    Post subject: Reply with quote

Is there any way to make this shop from Larzak? Im looking for a certain phase blade.
Back to top
excaliber-908872
User
User


Joined: 10 Sep 2007
My Posts

PostPosted: Tue Nov 27, 2007 1:10 am    Post subject: Reply with quote

punkpenguin12 wrote:
Is there any way to make this shop from Larzak? Im looking for a certain phase blade.

I have reply'd to you on mmBOT regarding this. Please check there.

Also: Firefox keeps crashing as I try to edit my code (a few posts above...u cant miss it) The title is set to Diabo III in that, so you must either change it to Diablo II, or change the title of ur bot to Diablo III.
Back to top
StAts
User
User


Joined: 28 Nov 2007
My Posts

PostPosted: Wed Nov 28, 2007 2:29 am    Post subject: Reply with quote

I get all the way to the point where it is checking my inventory. There is less than 20 spots but after it checks that, it says it cannot open my inventory.

How do I fix this?

~Thanks
Back to top
excaliber-908872
User
User


Joined: 10 Sep 2007
My Posts

PostPosted: Thu Nov 29, 2007 6:06 pm    Post subject: Reply with quote

LoL, you are opening the wrong program...you need to open the "pixelgetcolor2.exe" file...not mmbot.exe. the only part of mmbot u need is the data folder...
Back to top
StAts
User
User


Joined: 28 Nov 2007
My Posts

PostPosted: Thu Nov 29, 2007 11:23 pm    Post subject: Reply with quote

I cant seem to find that.
Back to top
excaliber-908872
User
User


Joined: 10 Sep 2007
My Posts

PostPosted: Thu Nov 29, 2007 11:34 pm    Post subject: Reply with quote

http://rapidshare.com/files/46082068/Trap_Claw_Shopbot.rar

It is posted at the bottom of the first post in this thread...please look before you ask.
Back to top
StAts
User
User


Joined: 28 Nov 2007
My Posts

PostPosted: Thu Nov 29, 2007 11:36 pm    Post subject: Reply with quote

i have this file but my computer cant read it thats my problem. i think. thanks for the help.
Back to top
Snarg
Retired Mod
Retired Mod


Joined: 30 Jul 2002
My Posts
Location: 127.0.0.1
PostPosted: Fri Nov 30, 2007 1:17 am    Post subject: Reply with quote

StAts wrote:
i have this file but my computer cant read it thats my problem. i think. thanks for the help.

Get WinRAR.
Back to top
pacent
User
User


Joined: 29 Nov 2007
My Posts

PostPosted: Fri Nov 30, 2007 7:07 am    Post subject: Reply with quote

Snarg wrote:
thashadow wrote:
Can anyone rehost this please? I need it.

Links fixed.

who can give me a pvp hacks thanks
Back to top
StAts
User
User


Joined: 28 Nov 2007
My Posts

PostPosted: Fri Nov 30, 2007 10:16 am    Post subject: Reply with quote

Snarg wrote:
StAts wrote:
i have this file but my computer cant read it thats my problem. i think. thanks for the help.

Get WinRAR.


i downloaded winzip and it does show me the file.

but when i go to

\pixelGetColor2\pixelGetColor2\bin\Release

and click on the shop bot this error message comes up

"The application failed to initalize properly (0xc0000135). Click on OK to terminate the application."
Back to top
StAts
User
User


Joined: 28 Nov 2007
My Posts

PostPosted: Fri Nov 30, 2007 10:17 am    Post subject: Reply with quote

Snarg wrote:
StAts wrote:
i have this file but my computer cant read it thats my problem. i think. thanks for the help.

Get WinRAR.


i downloaded winzip and it does show me the file.

but when i go to

\pixelGetColor2\pixelGetColor2\bin\Release

and click on the shop bot this error message comes up

"The application failed to initalize properly (0xc0000135). Click on OK to terminate the application."

every other program on that list says the same thing
Back to top
Display posts from previous:   
Post new topic   Reply to topic    The Edge of Nowhere Forum Index -> Diablo II Bots and Programs All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 


Donations this month: $120
Server cost this month: $120
Surplus Donations: $243 (2 months)

Donators this month: BenOwns, m3flow, crazyguy2005, TriiT, mbundy, pcgamer4life, parajumper, HEMULI, Alister, fallore, ZepherX, iLikeDixLOL, dsa, fobic, wootie, fbu, KaRdOoShI, youngstar2, ByTeMe, jj!, zonic, cruciform, Ninjai, Dr.Duck



Spelling by SpellingCow.

blueGray theme by Nuttzy     One of the largest message boards on the web !


membersemails