//=========================================================================== // RedXIII's AntiFord Anti Random // Instructions: // 1. Include this file in your main program // 2. Certain functions used here are from SSI, so be sure to include // it too, and thank Stupid3ooo. // 3. In your main program, where you detect the other randoms like mime etc., // add the additional statement FindDoctorFord; // 4. If you want to include a status report to show the number of times // that Dr. Ford appeared, you can use the variable "drfords" which is // incremented from within FindDoctorFord every time his freaky hand is // recognised //============================================================================ //==============This Anti-Random uses Hue Saturation Value Colours============ //Skin Hue = 27+-4 //Wood Hue = 47+-4 Saturation > 80% //Parchment Hue = 44+-4 Saturation < 55% //Background Hue = 0 (<5) //============================================================================ //============================================================================ var drfords : integer; const RetryWhenThereisLag=true; function CheckHue(x,y :integer; hue, tolerance : extended):boolean; var colour, blue, green, red, min, max, delta : integer; detectedhue : extended; begin colour:=GetColor(x,y); blue:=(colour and $00ff0000) shr 16; green:=(colour and $0000ff00) shr 8; red:=colour and $000000ff ; if (red<=green) and (red<=blue) then min:=red; if (green<=red) and (green<=blue) then min:=red; if (blue<=green) and (blue<=red) then min:=blue; if (red>=green) and (red>=blue) then max:=red; if (green>=red) and (green>=blue) then max:=red; if (blue>=green) and (blue>=red) then max:=blue; delta:=max-min; if (delta>0) then begin if (red = max) then detectedhue := ( green - blue ) / delta; // between yellow & magenta if (green = max) then detectedhue := 2 + ( blue - red ) / delta; // between cyan & yellow if (blue = max) then detectedhue := 4 + ( red - green ) / delta; // between magenta & cyan end else begin if (red = max) then detectedhue := 1; // between yellow & magenta if (green = max) then detectedhue := 3; // between cyan & yellow if (blue = max) then detectedhue := 5; // between magenta & cyan end detectedhue := detectedhue*60; // degrees if (Abs(hue-detectedhue)<=tolerance) then result:=true; end; function GetHue(x,y :integer):integer; var colour, blue, green, red, min, max, delta : integer; detectedhue : integer; begin colour:=GetColor(x,y); blue:=(colour and $00ff0000) shr 16; green:=(colour and $0000ff00) shr 8; red:=colour and $000000ff ; if (red<=green) and (red<=blue) then min:=red; if (green<=red) and (green<=blue) then min:=red; if (blue<=green) and (blue<=red) then min:=blue; if (red>=green) and (red>=blue) then max:=red; if (green>=red) and (green>=blue) then max:=red; if (blue>=green) and (blue>=red) then max:=blue; delta:=max-min; if (delta>0) then begin if (red = max) then detectedhue := ( green - blue ) / delta; // between yellow & magenta if (green = max) then detectedhue := 2 + ( blue - red ) / delta; // between cyan & yellow if (blue = max) then detectedhue := 4 + ( red - green ) / delta; // between magenta & cyan end else begin if (red = max) then detectedhue := 1; // between yellow & magenta if (green = max) then detectedhue := 3; // between cyan & yellow if (blue = max) then detectedhue := 5; // between magenta & cyan end result:=detectedhue; end; function GetSaturation(x,y :integer):integer; var colour, blue, green, red, min, max, delta : integer; begin colour:=GetColor(x,y); blue:=(colour and $00ff0000) shr 16; green:=(colour and $0000ff00) shr 8; red:=colour and $000000ff ; if (red<=green) and (red<=blue) then min:=red; if (green<=red) and (green<=blue) then min:=red; if (blue<=green) and (blue<=red) then min:=blue; if (red>=green) and (red>=blue) then max:=red; if (green>=red) and (green>=blue) then max:=red; if (blue>=green) and (blue>=red) then max:=blue; delta:=max-min; if (max>0) then result := 100*delta / max; // s if(max=0) then result := 0; end; procedure ClickNextToContinue; var foundx, foundy, tstart : integer; begin tstart:=GetTickCount(); if not(FindColor(foundx, foundy,16711680 ,150,390,300,450)) then begin repeat Sleep(50); until(FindColor(foundx, foundy,16711680 ,150,390,300,450) or ((GetTickCount()-tstart)>5000)) end Mouse(foundx, foundy, 0,0,true); end; function ClickNextToContinueIfRequired : boolean; var foundx, foundy : integer; begin result:=false; if (FindColorSpiral(foundx, foundy,16711680 ,150,390,300,450)) then begin Mouse(foundx, foundy, 0,0,true); result:=true; end end; function freakyhand() : integer; //NOT by knightstreak.... var finger1, finger2, finger3, finger4 : boolean; startingtime , colour, background, timeout : integer; fingersheldup : string; begin timeout:=4000; background:=GetColor(30,30); finger1:=false; finger2:=false; finger3:=false; finger4:=false; Sleep(2000)//Anti-lag protection, wait for the correct hand to load startingtime:=GetTickCount(); colour:=background; while(((GetTickCount()-startingtime)80) and (GetSaturation(486,315)>80); if (FordFound) then begin writeln('Dr. Fords Freaky Hand noticed, identifying it...'); drfords:=drfords+1; choice:=freakyhand; sleep(5000); if not(choice=freakyhand) then begin writeln('The hand seems to have changed...!'); if RetryWhenThereisLag then choice:=freakyhand; if not(RetryWhenThereisLag) then begin writeln('Attempted to identify the hand, but failed'); writeln('Perhaps there is too much lag. Logging out.'); Logout; TerminateScript; end end if(choice=1)then Mouse(99, 299, 0, 0, true); if(choice=2)then Mouse(153,300, 0, 0,true); if(choice=3)then Mouse(211, 304, 0, 0,true); if(choice=4)then Mouse(265, 300, 0, 0,true); if(choice=5)then Mouse(320, 306, 0, 0,true); if(choice=6)then Mouse(374, 298, 0, 0,true); if(choice=7)then Mouse(431,299, 0, 0,true); waitstart:=GetTickCount(); if(GetColor(672,41)=0) and (GetColor(614,67)=0) and (GetColor(657,134)=0) and ((GetTickCount()-waitstart)<4000) then Sleep(500); //Wait till the answer has been selected. ClickNextToContinue; //Hmm... you seem to be ok... MoveMouseSmooth(300,100); //So that the blue text is not highlighted while(PleaseWait) do sleep(2000); ClickNextToContinue; //Any chance of getting a lolipop... MoveMouseSmooth(300,149); //So that the blue text is not highlighted while(PleaseWait) do sleep(2000); ClickNextToContinue; //Lolipops aren't good for you... MoveMouseSmooth(300,189); //So that the blue text is not highlighted while(PleaseWait) do sleep(2000); end end end;