I tried to anwser all your questions at once in this code example since most of people gave you anwsers with syntaxe/logic errors in (exept for chelsa) You can compile it without problem Code (Text): program Example; var x,y,red,cpt,bitmap :integer ; ColorFound : Boolean ; procedure findColorExample; // find a color in a specified area begin red:= 255; //search for the color in the square //(0,0)-(0,500)-(500,0)-(500,500) //no other way to use findcolor, must use //xs,ys,xe,ye //but you maybe search in a square of 1 pixel ColorFound := FindColor(x,y,red,0,0,500,500) ; if(ColorFound) then begin KeyDown(65); //press key "A" wait(15); Keyup(65); end; end; //end of procedure procedure getColorExample; begin if( getcolor(500,500) = 255 ) then begin for cpt:= 0 to 1 do begin Writeln('looping'); end; end else //if else example begin KeyDown(65); //press key "A" wait(15); Keyup(65); end; end; //end of procedure procedure FindBitmapExample; begin Bitmap := BitmapFromString(7, 6, 'z78DA7DCA3912C0200800' + 'C02FA1A0600911FFFFA41CA670C29866AB157226D532982D49A32' + '40E7D3846D9EE39FDFF8CDD29AFEE7EB55E2947018A027C27B6D5' + '78DE89875FE77177A627E9E23A72'); //green arrow of scar if( FindBitmap(bitmap,x,y) ) then begin Writeln('Bitmap found !'); end; //OR, you can search in a spcified area if( FindBitmapIn(bitmap,x,y,0,0,500,500) ) then begin Writeln('Bitmap found in the square specified'); end; end;//end of procedure begin //main program end. //end of main program pm me to have my msn email (if you want live conversation)
ok, wow thank you so much for all of that information. i still have two more questions for this Code (Text): procedure FindBitmapExample; begin Bitmap := BitmapFromString(7, 6, 'z78DA7DCA3912C0200800' + 'C02FA1A0600911FFFFA41CA670C29866AB157226D532982D49A32' + '40E7D3846D9EE39FDFF8CDD29AFEE7EB55E2947018A027C27B6D5' + '78DE89875FE77177A627E9E23A72'); //green arrow of scar if( FindBitmap(bitmap,x,y) ) then begin Writeln('Bitmap found !'); end; do i just put x,y after find bitmap. if not what do i put there (that is for finding a bitmap anywhere on the screen right?). also, for the find color, how do i get it to find similar colors. ill give you an example Code (Text): program New; begin case getcolor(x,y) of 122344// or simalar. how do i say that?// :keydown(74) 24324321//or similar// :keydown(73) end. how would i say that with the similar? i am pretty sure that it is possible but i am not sure how to do it.
nah you don't need to put anything else apart from x and y (or whatever the bitmap's variables are if you want it to click the bitmap (as i think you do) just put the code Code (Text): clickmouse(x,y,true) after Code (Text): then i have no idea whatsoever sorry to that one
so if i did this Code (Text): procedure FindBitmapExample; begin Bitmap := BitmapFromString(7, 6, 'z78DA7DCA3912C0200800' + 'C02FA1A0600911FFFFA41CA670C29866AB157226D532982D49A32' + '40E7D3846D9EE39FDFF8CDD29AFEE7EB55E2947018A027C27B6D5' + '78DE89875FE77177A627E9E23A72'); //green arrow of scar if( FindBitmap(bitmap,x,y) ) then begin clickmouse(x,y); end; then it will click on the bitmap. also, i am sorry if i am asking way too many questions, but dont worry, i am a fast learner.
do this instead (just one tiny change Code (Text): FindBitmapExample; begin Bitmap := BitmapFromString(7, 6, 'z78DA7DCA3912C0200800' + 'C02FA1A0600911FFFFA41CA670C29866AB157226D532982D49A32' + '40E7D3846D9EE39FDFF8CDD29AFEE7EB55E2947018A027C27B6D5' + '78DE89875FE77177A627E9E23A72'); //green arrow of scar if( FindBitmap(bitmap,x,y) ) then clickmouse(x,y); end;
aobut the similar color command, i did a little research and it is Code (Text): FindColorTolerance(var x,y: Integer; color, xs, ys, xe, ye: Integer; Tolerance: Integer): Boolean but you see, i have no clue how to use it, can you help me?
Sure this si pretty simple, Code (Text): procedure findColorExample; // find a color in a specified area begin red:= 255; //search for the color in the square //(0,0)-(0,500)-(500,0)-(500,500) //no other way to use findcolor, must use //xs,ys,xe,ye //but you maybe search in a square of 1 pixel ColorFound := FindColorTolerance(x,y,red,0,0,500,500,20) ;//this will search for a color between 235 and 275 because the tolerance is 20 if(ColorFound) then begin KeyDown(65); //press key "A" wait(15); Keyup(65); end; end; //end of procedure
you should become a programmer. also, what about the first set of zeros in the coordinates, why dont you enter anything there. i am guessing that 0,500 is one corner and 500,500 is another corner but i dont understand. please explain xs,ys,xe,ye to me. would deformed bitmap work in a similar way? also, do i enter coordinates where it says x,y?
ok so the 0,0,500,500 are the co-ordinates of the box the first zero is for the x axis start point and the second zero is for the y value at that point the two 500s are the x and y values at the other point now with those two points, scar draws lines at right angles to make a box in which scar looks for the color does that help?
yes, but two, well, three, more yhings. first, what do i put in the x,y values, or do i use a variable called x,y there. ok, i just solved my second question, but ill ask it anyways so that box would start in the corner of the screen and go up to a square box of 500 x 500 pixels. i am just making sure that i understand. lastly, does finddeformedbitmap (or something like that) detect color changes too?
to your second question, 0,0,500,500 means a box with points at 0,0 0,500 500,0 and 500,500 to your third question i don't know but look in the list of bitmap functions i posted and it should tell you there
Code (Text): function FindDeformedBitmapToleranceIn(bitmap: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; tolerance: Integer; Range: Integer; AllowPartialAccuracy: Boolean; var accuracy: Extended): Boolean; - Works similar to FindBitmapToleranceIn but allows searching for partially covered or transformed bitmaps. If range is 0, it checks pixels at positions that match bitmap we are looking for; if Range ir 1, it checks neighbor pixels as well, if range is bigger, it checks further. AllowPartialAccuracy allows accuracy that is not 100% match. accuracy returns accuracy of found bitmap to bitmap we are looking for. accuracy = 1.0 means it was 100% perfect match. Example: we are searching for . 1. Target bitmap: FindDeformedBitmapToleranceIn(b, x, y, 0, 0, 100, 100, 70, 0, True, acc); Results: acc = 0.825745682889 FindDeformedBitmapToleranceIn(b, x, y, 0, 0, 100, 100, 70, 1, True, acc); Results: acc = 1.000000000000 2. Target bitmap: FindDeformedBitmapToleranceIn(b, x, y, 0, 0, 100, 100, 70, 0, True, acc); acc = 0.585557299843 FindDeformedBitmapToleranceIn(b, x, y, 0, 0, 100, 100, 70, 1, True, acc); acc = 0.751962323391 this is what it says in the instructions but now i am even more confused
-yes deformed bitmaps work the same -yes its corners -with xs,ys,xe,ye a box is created in witch scar operate, the box is built this way If you noticed well, the x and y axis are not the same as we see often in math, the origine is at the top left of your screen.
so this would be a good example Code (Text): if FindDeformedBitmapToleranceIn(bitmap1, x, y, 100, 100, 200, 200, 85, 1, true, acc) then keydown(72); what should i put for x,y? a variable named x,y or coordinates?
so this would work Code (Text): program New; var x: integer; var y: integer; var bitmap1: string; begin bitmap1 :='213234455412345678901348890134' if FindDeformedBitmapToleranceIn(bitmap1, x, y, 100, 100, 200, 200, 85, 1, true, acc) then keydown(72); end. ok, i will tell you what i am (attempting to) making a script for, only if you dont make it your self. i am trying to make one for trouble at national neopean, would i only need to get a bitmap of one of each of the guys and use deformed bitmaps or do i need like 50 bitmaps of each variation of a character?
that is a very hard game to make it for and all of the scripts i have tried for it have failed i don't know whether or not you need a deformed bitmap or 50 ordinary bitmaps but i would say that you don't need the latter
Mine works with constant colors (there are some on each caracter), but it's not finished yet(do 8-9 level), scar programing is only useful if you want trophies. Else if you want to do a good amount of neopoints you need to work on a badass aber or sponsors doer (mine does only 20k).