Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.51 KB | None | 0 0
  1. program Crafter;
  2.  
  3. Const
  4. Name = 'i peter i';
  5. Pass = '';
  6. ClickOdotus = 30;
  7. MoveOdotus = 13;
  8. DebugSpeed = False;
  9.  
  10. type
  11. AikaRecord = record
  12. Arvo, MOdotus, COdotus: Integer;
  13. end;
  14.  
  15. var
  16. x1, ShopX, ShopY, ShopXX, ShopYY: Integer;
  17.  
  18.  
  19. procedure FindClient;
  20. var
  21. I: Integer;
  22. begin
  23. for I := 0 to 600 do
  24. begin
  25. if ((GetColor(I, 420) = 2437688) or (GetColor(I, 420) = 789522)) then x1 := I;
  26. if x1 > 0 then
  27. begin
  28. WriteLn('Clientti loyty (X='+IntToStr(x1)+')');
  29. Exit;
  30. end;
  31. end;
  32. end;
  33.  
  34.  
  35. function LoggedIn: Boolean;
  36. begin
  37. Result := not ((GetColor(300+X1, 300) = 47851) or (GetColor(300+X1, 300) = 52223));
  38. end;
  39.  
  40. function Login: Boolean;
  41. var
  42. x, y, I, II: Integer;
  43. begin
  44. if LoggedIn then Exit;
  45. ClickMouse(530-257+X1, 190, True);
  46. Wait(300);
  47. SendKeys(Name+Chr(13));
  48. Wait(300);
  49. SendKeys(Pass);
  50. repeat
  51. SendKeys(Chr(13));
  52. if I > 0 then SendKeys(Chr(13));
  53. II := 0;
  54. while not FindColor(x, y, 920735, 813-257+X1, 16, 821-257+X1, 22) do
  55. begin
  56. Inc(II);
  57. if II = 60 then Break;
  58. Wait(1000);
  59. end;
  60. Inc(I);
  61. if I > 20 then
  62. begin
  63. WriteLn('20 failed logins.');
  64. TerminateScript;
  65. end;
  66. until(II < 60);
  67. Result := True;
  68. Wait(1000);
  69. KeyDown(VK_UP);
  70. Wait(5000);
  71. KeyUp(VK_UP);
  72. Wait(500);
  73. end;
  74.  
  75. function ShopScreen: Boolean;
  76. begin
  77. Result := (GetColor(222+x1, 41) = 2070783);
  78. end;
  79.  
  80.  
  81. procedure CloseShop;
  82. var
  83. I: Integer;
  84. begin
  85. while ShopScreen do
  86. begin
  87. MoveMouse(697-258+X1, 37);
  88. Wait(30);
  89. if ShopScreen then ClickMouse(697-258+X1, 37, True);
  90. while ShopScreen and (I < 350) do
  91. begin
  92. Wait(10);
  93. Inc(I);
  94. end;
  95. if I < 350 then Exit;
  96. I := 0;
  97. end;
  98. end;
  99.  
  100.  
  101. procedure CompassNorth;
  102. var
  103. WallDTM, CompassDTM, x, y: Integer;
  104. begin
  105. WallDTM := DTMFromString('78DA639CCECCC090CC80023E3F7DCF2009A41' +
  106. '981F83F103082D4C4E25603026035E144A80924428D377E350027' +
  107. '16171C');
  108. CompassDTM := DTMFromString('78DA633462666060634001869AB20C5C409A1' +
  109. '188FF030123480D3B448E058B1A1060D443A861C5A10600A9AC06' +
  110. '3E');
  111. 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
  112. begin
  113. KeyDown(VK_LEFT);
  114. Wait(5);
  115. KeyUp(VK_LEFT);
  116. Wait(2);
  117. end;
  118. FreeDTM(WallDTM);
  119. FreeDTM(CompassDTM);
  120. end;
  121.  
  122.  
  123. procedure WalkMMDot;
  124. var
  125. DTM, x, y, I, II: Integer;
  126. begin
  127. CompassNorth;
  128. DTM := DTMFromString('78DA636C646660086240012FA1342310FF070' +
  129. '2C65AA09A7888181754AEAEB8904117AA06AC3605A8C61FC26681' +
  130. '8A793A39326820AB6903AA2982B0D9A1626F5E7F6610445203003' +
  131. '7420DC7');
  132. if FindDTM(DTM, x, y, 827-257+X1, 9, 971-257+X1, 136) then
  133. begin
  134. WriteLn('DTM FOUND =)');
  135. MoveMouse(x+16, y-7);
  136. Wait(200);
  137. ClickMouse(x+16, y-7, True);
  138. Wait(1000);
  139. repeat
  140. if not FindColor(x, y, 255, 822-257+X1, 10, 969-257+X1, 132) then I := I + 1
  141. else I := 0;
  142. Inc(II);
  143. Wait(10);
  144. until((I = 15) or (II=500));
  145. Wait(1000);
  146. end;
  147. FreeDTM(DTM);
  148. end;
  149.  
  150.  
  151.  
  152. procedure OpenShop;
  153. var
  154. x, y, I, III, A, MMTries: Integer;
  155. NewX: Integer;
  156. begin
  157. repeat
  158. Login;
  159. if IsFKeyDown(10) then TerminateScript;
  160. MoveMouse(ShopX-257+X1, ShopY);
  161. while (CountColorTolerance(53199, 315-258+X1, 5, 360-258+X1, 15, 40) < 7) do
  162. begin
  163. Wait(10);
  164. A := A + 1;
  165. if A = 150 then
  166. begin
  167. Login;
  168. MoveMouse(790-258+X1, 263);
  169. Wait(80);
  170. ClickMouse(790-258+X1, 263, True);
  171. Wait(80);
  172. ClickMouse(790-258+X1, 263, True);
  173. Wait(80);
  174. MoveMouse(ShopX-257+X1, ShopY);
  175. Wait(80);
  176. end;
  177. if A = 300 then
  178. begin
  179. Login;
  180. for A := 300 to 400 do
  181. begin
  182. NewX := ShopXX+A-300;
  183. MoveMouse(NewX-257+X1, ShopYY);
  184. Wait(100);
  185. if (CountColorTolerance(255463, 315-258+X1, 5, 360-258+X1, 15, 35) > 6) then Break;
  186. NewX := ShopXX-A+300;
  187. MoveMouse(NewX-257+X1, ShopYY);
  188. Wait(100);
  189. if (CountColorTolerance(255463, 315-258+X1, 5, 360-258+X1, 15, 35) > 6) then Break;
  190. end;
  191. if A < 400 then ShopX := NewX
  192. else begin
  193. ShopX := ShopXX;
  194. ShopY := ShopYY;
  195. if MMTries > 5 then TerminateScript;
  196. MMTries := MMTries + 1;
  197. WalkMMDot;
  198. A := 0;
  199. Continue;
  200. end;
  201. end;
  202. end;
  203. ClickMouse(ShopX-257+X1, ShopY, False);
  204. III := 0;
  205. while (III < 50) do
  206. begin
  207. if FindColor(x, y, 65535, ShopX-280+X1, ShopY-30, ShopX-255+X1, ShopY+80) then
  208. begin
  209. ClickMouse(ShopX-257+X1, Y+20, True);
  210. Break;
  211. end;
  212. Inc(III);
  213. Wait(5)
  214. end;
  215. if III > 49 then Continue;
  216. //Wait(100);
  217. //ClickMouse(ShopX-258+X1, ShopY+42, True);
  218. I := 0;
  219. repeat
  220. Wait(10);
  221. I := I+1;
  222. until(ShopScreen or (I > 200));
  223. until(ShopScreen);
  224. MoveMouse(445-258+X1, 130);
  225. Wait(50);
  226. ClickMouse(445-258+X1, 130, False);
  227. while not FindColor(x, y, 65536, 445-258+X1, 130, 450-257+X1, 135) do Wait(5);
  228. ClickMouse(435-258+X1, 216, True);
  229. Wait(50);
  230. CloseShop;
  231. end;
  232.  
  233.  
  234. function Clicks(ClickWait, MoveWait: Integer): Integer;
  235. var
  236. T, II: Integer;
  237. begin
  238. Login;
  239. MoveMouse(953-258+X1, 445);
  240. Wait(50);
  241. repeat
  242. Wait(10);
  243. II := II+1
  244. until(((GetColor(960-258+X1, 450) <> 3357765) and (GetColor(920-258+X1, 450) <> 3357765))) or (II > 200);
  245. T := GetTimeRunning;
  246. repeat
  247. if IsFKeyDown(10) then TerminateScript;
  248. Login;
  249. MoveMouse(953-258+X1, 445);
  250. Wait(MoveWait);
  251. ClickMouse(953-258+X1, 445, True);
  252. Wait(ClickWait);
  253. MoveMouse(931-258+X1, 445);
  254. Wait(MoveWait);
  255. ClickMouse(931-258+X1, 445, True);
  256. Wait(ClickWait);
  257. until(GetColor(960-258+X1, 450) = 3357765) or (GetColor(920-258+X1, 450) = 3357765);
  258. Result := GetTimeRunning-T;
  259. ClickMouse(790-258+X1, 263, True);
  260. Wait(10);
  261. ClickMouse(790-258+X1, 263, True);
  262. Wait(10);
  263. ClickMouse(790-258+X1, 263, True);
  264. Wait(15);
  265. end;
  266.  
  267. begin
  268. Wait(3000);
  269. FindClient;
  270. Login;
  271. //GetMousePos(ShopX, ShopY);
  272. CompassNorth;
  273. WalkMMDot;
  274. ShopXX := 517;
  275. ShopYY := 167;
  276. ShopX := ShopXX;
  277. ShopY := ShopYY;
  278. repeat
  279. case DebugSpeed of
  280. False: Clicks(ClickOdotus, MoveOdotus);
  281. True: WriteLn(IntToStr(Clicks(ClickOdotus, MoveOdotus)));
  282. end;
  283. OpenShop;
  284. until(false);
  285. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement