Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Crafter;
- Const
- Name = 'i peter i';
- Pass = '';
- ClickOdotus = 30;
- MoveOdotus = 13;
- DebugSpeed = False;
- type
- AikaRecord = record
- Arvo, MOdotus, COdotus: Integer;
- end;
- var
- x1, ShopX, ShopY, ShopXX, ShopYY: Integer;
- procedure FindClient;
- var
- I: Integer;
- begin
- for I := 0 to 600 do
- begin
- if ((GetColor(I, 420) = 2437688) or (GetColor(I, 420) = 789522)) then x1 := I;
- if x1 > 0 then
- begin
- WriteLn('Clientti loyty (X='+IntToStr(x1)+')');
- Exit;
- end;
- end;
- end;
- function LoggedIn: Boolean;
- begin
- Result := not ((GetColor(300+X1, 300) = 47851) or (GetColor(300+X1, 300) = 52223));
- end;
- function Login: Boolean;
- var
- x, y, I, II: Integer;
- begin
- if LoggedIn then Exit;
- ClickMouse(530-257+X1, 190, True);
- Wait(300);
- SendKeys(Name+Chr(13));
- Wait(300);
- SendKeys(Pass);
- repeat
- SendKeys(Chr(13));
- if I > 0 then SendKeys(Chr(13));
- II := 0;
- while not FindColor(x, y, 920735, 813-257+X1, 16, 821-257+X1, 22) do
- begin
- Inc(II);
- if II = 60 then Break;
- Wait(1000);
- end;
- Inc(I);
- if I > 20 then
- begin
- WriteLn('20 failed logins.');
- TerminateScript;
- end;
- until(II < 60);
- Result := True;
- Wait(1000);
- KeyDown(VK_UP);
- Wait(5000);
- KeyUp(VK_UP);
- Wait(500);
- end;
- function ShopScreen: Boolean;
- begin
- Result := (GetColor(222+x1, 41) = 2070783);
- end;
- procedure CloseShop;
- var
- I: Integer;
- begin
- while ShopScreen do
- begin
- MoveMouse(697-258+X1, 37);
- Wait(30);
- if ShopScreen then ClickMouse(697-258+X1, 37, True);
- while ShopScreen and (I < 350) do
- begin
- Wait(10);
- Inc(I);
- end;
- if I < 350 then Exit;
- I := 0;
- end;
- end;
- procedure CompassNorth;
- var
- WallDTM, CompassDTM, x, y: Integer;
- begin
- WallDTM := DTMFromString('78DA639CCECCC090CC80023E3F7DCF2009A41' +
- '981F83F103082D4C4E25603026035E144A80924428D377E350027' +
- '16171C');
- CompassDTM := DTMFromString('78DA633462666060634001869AB20C5C409A1' +
- '188FF030123480D3B448E058B1A1060D443A861C5A10600A9AC06' +
- '3E');
- while not (FindColor(x, y, 1911089, 817-257+X1, 6, 820-257+x1, 7) and FindDTM(WallDTM, x, y, 822-257+X1, 10, 975-257+X1, 132)) do
- begin
- KeyDown(VK_LEFT);
- Wait(5);
- KeyUp(VK_LEFT);
- Wait(2);
- end;
- FreeDTM(WallDTM);
- FreeDTM(CompassDTM);
- end;
- procedure WalkMMDot;
- var
- DTM, x, y, I, II: Integer;
- begin
- CompassNorth;
- DTM := DTMFromString('78DA636C646660086240012FA1342310FF070' +
- '2C65AA09A7888181754AEAEB8904117AA06AC3605A8C61FC26681' +
- '8A793A39326820AB6903AA2982B0D9A1626F5E7F6610445203003' +
- '7420DC7');
- if FindDTM(DTM, x, y, 827-257+X1, 9, 971-257+X1, 136) then
- begin
- WriteLn('DTM FOUND =)');
- MoveMouse(x+16, y-7);
- Wait(200);
- ClickMouse(x+16, y-7, True);
- Wait(1000);
- repeat
- if not FindColor(x, y, 255, 822-257+X1, 10, 969-257+X1, 132) then I := I + 1
- else I := 0;
- Inc(II);
- Wait(10);
- until((I = 15) or (II=500));
- Wait(1000);
- end;
- FreeDTM(DTM);
- end;
- procedure OpenShop;
- var
- x, y, I, III, A, MMTries: Integer;
- NewX: Integer;
- begin
- repeat
- Login;
- if IsFKeyDown(10) then TerminateScript;
- MoveMouse(ShopX-257+X1, ShopY);
- while (CountColorTolerance(53199, 315-258+X1, 5, 360-258+X1, 15, 40) < 7) do
- begin
- Wait(10);
- A := A + 1;
- if A = 150 then
- begin
- Login;
- MoveMouse(790-258+X1, 263);
- Wait(80);
- ClickMouse(790-258+X1, 263, True);
- Wait(80);
- ClickMouse(790-258+X1, 263, True);
- Wait(80);
- MoveMouse(ShopX-257+X1, ShopY);
- Wait(80);
- end;
- if A = 300 then
- begin
- Login;
- for A := 300 to 400 do
- begin
- NewX := ShopXX+A-300;
- MoveMouse(NewX-257+X1, ShopYY);
- Wait(100);
- if (CountColorTolerance(255463, 315-258+X1, 5, 360-258+X1, 15, 35) > 6) then Break;
- NewX := ShopXX-A+300;
- MoveMouse(NewX-257+X1, ShopYY);
- Wait(100);
- if (CountColorTolerance(255463, 315-258+X1, 5, 360-258+X1, 15, 35) > 6) then Break;
- end;
- if A < 400 then ShopX := NewX
- else begin
- ShopX := ShopXX;
- ShopY := ShopYY;
- if MMTries > 5 then TerminateScript;
- MMTries := MMTries + 1;
- WalkMMDot;
- A := 0;
- Continue;
- end;
- end;
- end;
- ClickMouse(ShopX-257+X1, ShopY, False);
- III := 0;
- while (III < 50) do
- begin
- if FindColor(x, y, 65535, ShopX-280+X1, ShopY-30, ShopX-255+X1, ShopY+80) then
- begin
- ClickMouse(ShopX-257+X1, Y+20, True);
- Break;
- end;
- Inc(III);
- Wait(5)
- end;
- if III > 49 then Continue;
- //Wait(100);
- //ClickMouse(ShopX-258+X1, ShopY+42, True);
- I := 0;
- repeat
- Wait(10);
- I := I+1;
- until(ShopScreen or (I > 200));
- until(ShopScreen);
- MoveMouse(445-258+X1, 130);
- Wait(50);
- ClickMouse(445-258+X1, 130, False);
- while not FindColor(x, y, 65536, 445-258+X1, 130, 450-257+X1, 135) do Wait(5);
- ClickMouse(435-258+X1, 216, True);
- Wait(50);
- CloseShop;
- end;
- function Clicks(ClickWait, MoveWait: Integer): Integer;
- var
- T, II: Integer;
- begin
- Login;
- MoveMouse(953-258+X1, 445);
- Wait(50);
- repeat
- Wait(10);
- II := II+1
- until(((GetColor(960-258+X1, 450) <> 3357765) and (GetColor(920-258+X1, 450) <> 3357765))) or (II > 200);
- T := GetTimeRunning;
- repeat
- if IsFKeyDown(10) then TerminateScript;
- Login;
- MoveMouse(953-258+X1, 445);
- Wait(MoveWait);
- ClickMouse(953-258+X1, 445, True);
- Wait(ClickWait);
- MoveMouse(931-258+X1, 445);
- Wait(MoveWait);
- ClickMouse(931-258+X1, 445, True);
- Wait(ClickWait);
- until(GetColor(960-258+X1, 450) = 3357765) or (GetColor(920-258+X1, 450) = 3357765);
- Result := GetTimeRunning-T;
- ClickMouse(790-258+X1, 263, True);
- Wait(10);
- ClickMouse(790-258+X1, 263, True);
- Wait(10);
- ClickMouse(790-258+X1, 263, True);
- Wait(15);
- end;
- begin
- Wait(3000);
- FindClient;
- Login;
- //GetMousePos(ShopX, ShopY);
- CompassNorth;
- WalkMMDot;
- ShopXX := 517;
- ShopYY := 167;
- ShopX := ShopXX;
- ShopY := ShopYY;
- repeat
- case DebugSpeed of
- False: Clicks(ClickOdotus, MoveOdotus);
- True: WriteLn(IntToStr(Clicks(ClickOdotus, MoveOdotus)));
- end;
- OpenShop;
- until(false);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement