Bonsoir,
Je viens de finir mon code source en C mais je ne suis pas encore sur mon travail, pouvez-vous le lire et me dire si le script est un e près bon.
Il sert a un bot sur le jeux [Do*fus] pour utiliser les flèches pour déscendre/monter/tourner droite-gauche.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
#include <windows.h>
    #include <stdio.h>
    #include <stdlib.h>
 
    /*
    Bienvenue dans ce nouveau bot qui a pour but de facilliter les déplacements.
    Celui ci fonctionne grace à des pixels teste : il va essayé de trouver la position des changeurs de maps.
    Passons maintenant au code source.
    */
 
    const SHORT Mask = 32768;
 
    int TT[9];
 
    int wil,preci;
 
    /*
    TT est un tableau contenant les valeur de la configuration :
    en 0, il s'agit de la touche Up
    en 1, il s'agit de la touche DOWN
    en 2, il s'agit de la touche LEFT
    en 3, il s'agit de la touche RIGHT
    en 4, il s'agit de la touche PAUSE
    en 5, il s'agit de la tocuhe STOP
    en 6, il s'agit de la position x initial
    en 7, il s'agit de la position y initial
 
    Enfin, ceci sera fait dans une autre version^^
    */
 
    fctconfig()
    {
        wil=0;
 
        printf("configuration\n");
 
        TT[0]=1;
        TT[1]=1;
        TT[2]=1;
        TT[3]=1;
        TT[4]=1;
        TT[5]=1;
 
        POINT pos;
        long R,G,B;
        int x,y,fora,forb,xx,yy,tot,ok,no;
        HDC dc = GetDC(NULL);
        COLORREF pix;
 
        printf("\ncalité inferieur et mode fenetré 100%, vous devez être connecté\n");
        printf("\nconfiguration écran : veuillez placez votre souris en haut à gauche de la fenètre dofus et appuez sur F3 une fois votre souris placée\n");
        printf("\nune fois que cela est fait, revennez sur la console, la configuration n'est pas tout à fait terminé\n");
        ok=0;
        no=0;
 
        while(ok!=1)
        {
            if (GetKeyState(VK_F3) & Mask)  ok=1;
            sleep(1);
        }
 
        GetCursorPos(&pos);
 
        /*
        la, on récupère la position du haut gauche de la fenêtre,
        mais c'est ps évidant de se placer au pixel pret
        alors on va faire ça bien avec une petite aide
        */
 
        x=pos.x;
        y=pos.y;
 
        x-=30;
        y-=30;
 
        fora=x+60;
        forb=y+60;
 
        for(yy=y;yy<forb;yy++)
        {
            for (xx=x;xx<fora;xx++)
            {
                pix = GetPixel(dc, xx, yy);
                R = GetRValue(pix);
                G = GetGValue(pix);
                B = GetBValue(pix);
                tot=R+G+B;
 
 
 
                if(tot==765)
                {
                    x=xx;
                    y=yy;
                    xx=fora;
                    yy=forb;
                    no=1;
                    printf("\nmode ''présition+'' activé\n");
                }
 
                if((tot != 0) && (tot != 765))
                {
                    xx=fora;
                    yy=forb;
                    printf("\néchec de l'activation du mode ''précision+'' (erreur1), ce n'est pas grave, le bot fonctionnera quand même.\n");
                    x=pos.x;
                    y=pos.y;
                    no=1;
                }
            }
        }
 
        if(no==0)
        {
            printf("\néchec de l'activation du mode ''précision+'' (erreur2), ce n'est pas grave, le bot fonctionnera quand même.\n");
            x=pos.x;
            y=pos.y;
        }
 
        TT[6]=x+2;
        TT[7]=y+2;
        SetCursorPos(TT[6],TT[7]);
        printf("\nentrez le degré d'écard de la recherche (valeur entre 0et50)");
        scanf("%d",&preci);
        printf("\n\n");
    }
 
 
    main()
    {
 
 
 
 
        int R,G,B,x,y,xm,ym,mom,fora,forb,forc;
        HDC dc = GetDC(NULL);
        COLORREF pix;
        char C;
 
        printf("bienvenue dans ce bot créer exclusivement pour Free9k\n");
        printf("\nsi vous n'avez pas téléchargé ce bot sur Free9k, merci de contacter XXXXXXXXXXXXXXXX\n");
        printf("\npassons à la configuration du bot\n");
 
        C='P';
 
        do
        {
              if(C=='P')
              fctconfig();
 
              if (wil==0)
              {
                  printf("\nconfiguration terminée, pour continué, appuyez sur A, pour recommencé la configuration, appuyez sur P");
                  wil=1;
              }       
              C = getch();
              C = toupper(C);
        }
        while((C != 'A'));
 
        xm = TT[6];
        ym = TT[7];
 
        printf("\nça commence ! utilisez vos touches directionnelles, la touche fin pour quitté et la touche home pour mettre en pause\n\n\n");
 
        wil=1;
 
        while(wil==1)
        {
 
            sleep(10);
 
            if (GetKeyState(VK_UP) & Mask)
            {
                //donc si on a appuyé sur UP
                printf("UP\n");
                fora=ym+70;         
                mom=0;
                forc=0;
 
                for (y=ym;y<=fora;y++)
                {
 
                    forb=xm+740-forc;
                    forc++;
 
                    for(x=xm+forc;x<=forb;x++)
                    {
                        pix = GetPixel(dc, x, y);
                        R = GetRValue(pix);
                        G = GetGValue(pix);
                        B = GetBValue(pix);
 
                        R= abs(R-255);
                        G= abs(G-200);
                        B= abs(B-11);
 
                        if (R <= preci && G <= preci && B<= preci)
                        mom++;
                        else
                        mom=0;
 
                        if (mom==3)
                        {
                            SetCursorPos(x-1, y);
                            SetCursorPos(x, y);
                            sleep(5);
                            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
                            sleep(5);
                            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
                            x=forb+1;
                            y=fora+1;
                        }
                    }             
                }
            }
 
            if (GetKeyState(VK_DOWN) & Mask)
            {
 
                //donc si on a appuyé sur DOWN
                printf("DOWN\n");
                fora=ym+431;
                mom=0;
                forc=70;
                for (y=ym+361;y<=fora;y++)
                {
 
                    forb=xm+740-forc;
                    forc--;
 
                    for(x=xm+forc;x<=forb;x++)
                    {
                        pix = GetPixel(dc, x, y);
                        R = GetRValue(pix);
                        G = GetGValue(pix);
                        B = GetBValue(pix);
 
                        R= abs(R-255);
                        G= abs(G-200);
                        B= abs(B-11);
 
                        if (R <= preci && G <= preci && B<= preci)
                        mom++;
                        else
                        mom=0;
 
                        if (mom==3)
                        {
                            SetCursorPos(x-1, y);
                            SetCursorPos(x, y);
                            sleep(5);
                            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
                            sleep(5);
                            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
                            x=forb+1;
                            y=fora+1;
                        }
                    }             
                }
            }
 
            if (GetKeyState(VK_LEFT) & Mask)
            {
                //donc si on a appuyé sur LEFT
                printf("LEFT\n");
                fora=ym+431;
                mom=0;
                forc=70;
                for (y=ym;y<=fora;y++)
                {
 
                    forb=xm+70;
                    if (forc>=0)
                    forb-=forc;
 
                    forc--;
 
                    for(x=xm;x<=forb;x++)
                    {
                        pix = GetPixel(dc, x, y);
                        R = GetRValue(pix);
                        G = GetGValue(pix);
                        B = GetBValue(pix);
 
                        R= abs(R-255);
                        G= abs(G-200);
                        B= abs(B-11);
 
                        if (R <= preci && G <= preci && B<= preci)
                        mom++;
                        else
                        mom=0;
 
                        if (mom==3)
                        {
                            SetCursorPos(x-1, y);
                            SetCursorPos(x, y);
                            sleep(5);
                            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
                            sleep(5);
                            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
                            x=forb+1;
                            y=fora+1;
                        }
                    }             
                }
            }
 
            if (GetKeyState(VK_RIGHT) & Mask)
            {
                //donc si on a appuyé sur RIGHT
                printf("RIGHT\n");
                fora=ym+431;
                mom=0;
                forc=0;
                for (y=ym;y<=fora;y++)
                {
 
                    forb=xm+741;
                    if(forc>=0)
                    forb-=forc;
 
                    forc--;
 
                    for(x=xm+671;x<=forb;x++)
                    {
                        pix = GetPixel(dc, x, y);
                        R = GetRValue(pix);
                        G = GetGValue(pix);
                        B = GetBValue(pix);
 
                        R= abs(R-255);
                        G= abs(G-200);
                        B= abs(B-11);
 
                        if (R <= preci && G <= preci && B<= preci)
                        mom++;
                        else
                        mom=0;
 
                        if (mom==3)
                        {
                            SetCursorPos(x-1, y);
                            SetCursorPos(x, y);
                            sleep(5);
                            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
                            sleep(5);
                            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
                            x=forb+1;
                            y=fora+1;
                        }
                    }             
                }
            }
            if (GetKeyState(VK_END) & Mask)
            wil = 2;
 
            if (GetKeyState(VK_HOME) & Mask)
            {
                printf("\npause activé\n");
                printf("appuez sur inser pour désactiver la pause\n");
                while(wil==1)
                {
                    sleep(10);
                    if (GetKeyState(VK_INSERT) & Mask)
                    wil=2;
                }
                wil=1;
                printf("pause désactivé\n\n");
            }
        }
 
        ReleaseDC(NULL, dc);
 
    }

Merci