Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 17.22 KB | None | 0 0
  1. {.include projectSW [1.00]\library\projectSW.scar}
  2.  
  3. const
  4.   stopFKey = 12;
  5.   continueFKey = 11;
  6.   pauseFKey = 10;
  7.  
  8.   playerName = 'Gawanaka';
  9.  
  10. var
  11.   dtmTree, dtmTrader, PDMark, dtmAxe: Integer;
  12.   nameBox: TBox;
  13.   storedColors: TIntegerArray;
  14.  
  15. procedure walkTo(spot: string); forward;
  16.  
  17. procedure handleFKeys;
  18. begin
  19.   if(IsFKeyDown(PauseFKey))then
  20.   begin
  21.     if(TimeFromTimeMark(PDMark) <= 12000)then
  22.       PlaySound(ScriptPath + 'empty.wav');
  23.     while (not(IsFKeyDown(continueFKey)))and(not(IsFKeyDown(stopFKey))) do
  24.       Wait(1);
  25.   end;
  26.   if(IsFKeyDown(StopFKey))then
  27.     TerminateScript;
  28. end;
  29.  
  30. function PlayerDetected: Boolean;
  31. var
  32.   i, h: Integer;
  33.   TBA: TBooleanArray;
  34. begin
  35.   TBA:= [ChatboxDetection('', '', 'public', False, False),
  36.          ScreenDetection(nameBox)];
  37.   h:= High(TBA);
  38.   for i:= 0 to h do
  39.     if(not(Result))then
  40.       Result:= TBA[i];
  41.   SetArrayLength(TBA, 0);
  42. end;
  43.  
  44. procedure PDWait(Time: Integer);
  45. var
  46.   mark: Integer;
  47. begin
  48.   MarkTime(mark);
  49.   repeat
  50.     Wait(1);
  51.     handleFKeys;
  52.     if(PlayerDetected)then
  53.       if(TimeFromTimeMark(PDMark) >= 12000)then
  54.       begin
  55.         PlaySound(ScriptPath + 'siren.wav');
  56.         MarkTime(PDMark);
  57.       end;
  58.   until(TimeFromTimeMark(mark) >= Time);
  59. end;
  60.  
  61. function playerHasMoved: Boolean;
  62. var
  63.   i, h: Integer;
  64.   tempColors: TIntegerArray;
  65. begin
  66.   tempColors:= GetColors(getPoints(mmBox));
  67.   h:= High(tempColors);
  68.   if(h = High(storedColors))then
  69.     for i:= 0 to h do
  70.       if(not(Result))then
  71.         Result:= (tempColors[i] <> storedColors[i])
  72.       else
  73.         Break;
  74.   if((not(Result))and(High(storedColors) = h))then
  75.     Exit;
  76.   SetArrayLength(storedColors, 0);
  77.   SetArrayLength(storedColors, (h + 1));
  78.   for i:= 0 to h do
  79.     storedColors[i]:= tempColors[i];
  80.   SetArrayLength(tempColors, 0);
  81. end;
  82.  
  83. function AxeInBag: Boolean;
  84. var
  85.   tmpBx: TBox;
  86. begin
  87.   tmpBx:= GetBagSlot(29);
  88.   with tmpBx do
  89.     Result:= (GetColor((x1 + 4), (y1 + 8)) = 15922678);
  90. end;
  91.  
  92. function BagOpen: Boolean;
  93. begin
  94.   Result:= (GetColor(236, 27) = 15195854);
  95. end;
  96.  
  97. function BagFull: Boolean;
  98. begin
  99.   Result:= (GetColor(527, 380) = 9027283);
  100. end;
  101.  
  102. function FindAxe: Integer;
  103. var
  104.   i: Integer;
  105.   TIA: TIntegerArray;
  106. begin
  107.   Result:= -1;
  108.   TIA:= [485, 520, 555];
  109.   for i:= 0 to 2 do
  110.     if(GetColor(TIA[i], 369) = 15922678)then
  111.       Result:= i;
  112.   SetArrayLength(TIA, 0);
  113. end;
  114.  
  115. function FindTree(var x, y: Integer; xs, ys, xe, ye: Integer): Boolean;
  116. var
  117.   i, h: Integer;
  118.   bmpTree: TIntegerArray;
  119. begin
  120.   bmpTree:= [BitmapFromString(13, 5, 'beNpjYAACN1Ph2hj1jCC' +
  121.                                      'V6niVpWXaO5uNO1LV0z1EomyFQ62F1OQ4bFN1zKLUHY2Fkz1lsn1k' +
  122.                                      '60Jl+qLklmaqbM3XqA2RSnaXcjPkVZVjd8owMgxXcjIWiXWVzPaW7' +
  123.                                      'U1QXp6usTFHoy9GOcROxNlQwEKLS1eF0zhc1SHNwMNMPMVFPM9DvD' +
  124.                                      'FIpilQuj9aoTpKxc1KRFuZ01STw1KXR9VdzCpBy8VYLMZRNMNdqiZ' +
  125.                                      'csTddszFZIz9aJSZAxt1ayMOSz8mMnwEAWV8xYA=='),
  126.              BitmapFromString(13, 5, 'beNoNwckKgkAAAFBvL' +
  127.                                      'bSRpqRji43MmEPL2FgdChEnBNMKT0EJ1SGoPiG6BUE/Xe8Jwh/DYs' +
  128.                                      'ZRsoSHED739vfiXNcodqVgIHqkrsv5wZpYARojMZqC7VzPPHAPWs8' +
  129.                                      'N/KQ489SIqcwsAzlHE2r6BkXSatLczvRb2HvF+L3Dd97zhhI1a/1O' +
  130.                                      '0dAKyDdH8ci1lMhRUlc5LcF5oT145xBARqSuWsDtvG2UNCaTsO8gm' +
  131.                                      'Y8bCVOPfvcWW6cIpxzyBWCk7toValWFHziwJts='),
  132.              BitmapFromString(13, 5, 'beNoNwckKgkAYAGBv' +
  133.                                      'LbThNrhvozP6t6loU7i0HAIFg8BeoE5B9P63+j6O+4tsoWVBneBmj' +
  134.                                      '5/X6HtL7mVQgZj7Qop5xA/9Epw8IJZQLPXj2mhTvc/NZ40/F9Kmag' +
  135.                                      'FqZE4RP6B1bGYutUQWKseV0R+8V0XeJ9IzL/VFai5cZaxJIyvzg3I' +
  136.                                      'DDipCdAbUJXoXa4+d3eQ48kRVGtnK0NUmMsjeIQwtmRGpBrXJnL6i' +
  137.                                      'XUEuO8y2OmAe3Bl15twPruggZw==')];
  138.   h:= High(bmpTree);
  139.   for i:= 0 to h do
  140.   begin
  141.     if(not(Result))then
  142.       Result:= FindBitmapToleranceIn(bmpTree[i], x, y, xs, ys, xe, ye, 33);
  143.     FreeBitmap(bmpTree[i]);
  144.   end;
  145.   SetArrayLength(bmpTree, 0);
  146. end;
  147.  
  148. function FindDwarf(var x, y: Integer; xs, ys, xe, ye: Integer): Boolean;
  149. var
  150.   i, h: Integer;
  151.   bmpDwarf: TIntegerArray;
  152. begin
  153.   bmpDwarf:= [BitmapFromString(8, 6, 'beNoBkABv/29rYFtISUxUYWNr' +
  154.                                      'Wl1ld3mCw8PMzc7aaG98YFlBWlpcZU0/VD0wmW1StX9ernxcJioud' +
  155.                                      'XV3EAkFTTAeQiwfjmFErnhUjlc1kpKVTE1NFAoBFAYAKxoPa0gwWz' +
  156.                                      'QcLA0AlpaZY2VoJBsTEgEAFwcALBQAMxIALwwANi0lqaqsOzEpEAA' +
  157.                                      'AGwsAMxkDNBIAMREAc1VKKX0='),
  158.               BitmapFromString(8, 6, 'beNpLzg4N9HBwDgmLyA4ITs3M' +
  159.                                      'blq79sy27bdikmtC/R0DAmKiXOy9zQw6EoMWFMTNyotRUtPLyCjn4' +
  160.                                      '2B10ZazVpevC3OZlRVS52fa1DTV2cVXiJNRiJVBXZw/3sEgUE9GnZ' +
  161.                                      'uhtXVmRFSGgoSwACODCBuDuhCDngCDFjeDgYbqtOlrTHU0+RgYJLg' +
  162.                                      'Y9MSYgeI6/AxpADP5JiQ='),
  163.               BitmapFromString(8, 6, 'beNoLz/Z297C0DvHxzXbzTI2N' +
  164.                                      'a5ox48yChbcCw2u83Rzd3GL8beydDAwqQoN6k+PaE2PkFPWio8t52' +
  165.                                      'Flt1ORMlOXzfVzaY0PyXUyLiqZa2/jyczDyszIoifAHWxi4a8oocz' +
  166.                                      'GUls709c+QERXmY2QQYmVQ5mfQ4GNQ5WTQUlZtaVmjp6bJw8Agysm' +
  167.                                      'gIcysycegxssQBQAgTSLr'),
  168.               BitmapFromString(8, 6, 'beNrzz3Zx9DAxC3F1y3ZwSg0J' +
  169.                                      'berqOjNx0i0v/xoXe0cHhxgPM3sbbYMc36CGqLjqiBhpOb3g4HJuN' +
  170.                                      'lYzJTl9eflUV5fq0JBUO9OMjKlmZr587Ix8LAzyQvw+xgaOqjLynA' +
  171.                                      'xZWTPdPDIkhYV5GRkEWBnk+RhUeBmUOBjUFFQrKtZoKWtyMzAIczC' +
  172.                                      'oCDGr8jIo8zAEAgBniyDH'),
  173.               BitmapFromString(8, 6, 'beNpzzrQyd9fRC7K2yTSzSHb3' +
  174.                                      'aCgtPVFdc83eucrKzMHMLMpWz85YVT/GMSDHJybDK0pcUtfNrZSLl' +
  175.                                      'VVPVk5DWj7U2jnDIyjU1CQiYpKeng8PGyMPC4MUP7+Dtr65vIw0B0' +
  176.                                      'NU1DQb2zRRAWFuRgY+FgZpHgZ5bgYZdgZFadXUtJUqchpcDAwC7Az' +
  177.                                      'y/MxAcTkuBlcAP0wdXg==')];
  178.   h:= High(bmpDwarf);
  179.   for i:= 0 to High(bmpDwarf) do
  180.   begin
  181.     if(not(Result))then
  182.       Result:= FindBitmapToleranceIn(bmpDwarf[i], x, y, xs, ys, xe, ye, 33);
  183.     FreeBitmap(bmpDwarf[i]);
  184.   end;
  185.   SetArrayLength(bmpDwarf, 0);
  186. end;
  187.  
  188. function GetTreeSpot: Integer;
  189. var
  190.   x, y, i, h: Integer;
  191.   TIA: TIntegerArray;
  192. begin
  193.   TIA:= [164, 184, 204, 224, 244, 264, 284];
  194.   h:= High(TIA);
  195.   Result:= -1;
  196.   if(FindTree(x, y, 151, 186, 164, 291))then
  197.     for i:= h downto h do
  198.       if(TIA[i] = y)then
  199.       begin
  200.         Result:= i;
  201.         Break;
  202.       end;
  203.   SetArrayLength(TIA, 0);
  204. end;
  205.  
  206. function getChopSpot: Integer;
  207. var
  208.   dtmChopSpot, x, y: Integer;
  209. begin
  210.   Result:= -1;
  211.   dtmChopSpot:= DTMFromString('78DA63D461626058C080029C1C2DC1342394C' +
  212.                  'FC80754330155CDB9E35B51D56860AA99D2558CAAC602A8A61F55' +
  213.                  '4D4FA026AA1A63A09AE5A86AAE9D5E8BAA4618538DA8391F8A1A0' +
  214.                  '0B7EB0CDB');
  215.   if(FindDTM(dtmChopSpot, x, y, mmBox.X1, mmBox.Y1, mmBox.X2, mmBox.Y2))then
  216.     if((x = 556)and(InRange(y, 160, 166)))then
  217.       Result:= (y - 160);
  218.   FreeDTM(dtmChopSpot);
  219. end;
  220.  
  221. procedure WalkToTreeSpot;
  222. var
  223.   theSpot, x, y, tempTime, PHNM, phmMark: Integer;
  224. begin
  225.   theSpot:= (Random(7) + 1);
  226.   if(GetTreeSpot = theSpot)then
  227.     Exit;
  228.   if(FindTree(x, y, 3, 24, 250, 444))then
  229.   begin
  230.     SWClick((x + 60), ((y - 72) + (theSpot * 20)), 0, 0, 0, 0, 1, True, 'clientCorner');
  231.     MarkTime(tempTime);
  232.     repeat
  233.       if((TimeFromTimeMark(tempTime) >= 2000)or(PHNM > 10))then
  234.         Break;
  235.       if((TimeFromTimeMark(phmMark) = 0)or(TimeFromTimeMark(phmMark) >= 50))then
  236.       begin
  237.         if(not(PlayerHasMoved))then
  238.           Inc(PHNM)
  239.         else
  240.           PHNM:= 0;
  241.         MarkTime(phmMark);
  242.       end;
  243.       PDWait(1);
  244.     until(InRange(getChopSpot, 0, 6));
  245.     MarkTime(tempTime);
  246.     while (FindAxe <> 2) do
  247.     begin
  248.       ScrollQuickItemBarEx(29);
  249.       PDWait(1);
  250.       if(TimeFromTimeMark(tempTime) >= 5000)then
  251.         Break;
  252.     end;
  253.   end;
  254.   if(PHNM < 10)then
  255.   begin
  256.     PHNM:= 0;
  257.     MarkTime(phmMark);
  258.     repeat
  259.       PDWait(1);
  260.       if(TimeFromTimeMark(phmMark) > 66)then
  261.       begin
  262.         if(not(PlayerHasMoved))then
  263.           Inc(PHNM)
  264.         else
  265.           PHNM:= 0;
  266.         MarkTime(phmMark);
  267.       end;
  268.       if(not(InRange(getChopSpot, 0, 6)))then
  269.         Break;
  270.     until(PHNM > 2);
  271.     PDWait(10);
  272.   end;
  273.   if(not(InRange(getChopSpot, 0, 6)))then
  274.     WalkToTreeSpot
  275.   else
  276.     PDWait(50);
  277. end;
  278.  
  279. procedure SellLogs;
  280. var
  281.   i, i2, x, y: Integer;
  282.   tempTM: Integer;
  283. begin
  284.   handleFKeys;
  285.   if(BagFull)then
  286.   begin
  287.     if(FindDwarf(x, y, 180, 58, 379, 259))then
  288.     begin
  289.       MarkTime(tempTM);
  290.       while (GetColor(53, 364) <> 15987699) do
  291.       begin
  292.         if(FindDwarf(x, y, 180, 58, 379, 259))then
  293.           SWClick(x + 4, y + 18, 0, 0, 0, 0, 1, True, 'clientCorner');
  294.         if(TimeFromTimeMark(tempTM) >= 5000)then
  295.           SellLogs;
  296.         PDWait(1);
  297.       end;
  298.       SWClick(61, 370, 0, 0, 0, 0, 1, True, 'clientCorner');
  299.       MarkTime(tempTM);
  300.       while (not(GetColor(238, 199) = 5535633)) do
  301.       begin
  302.         if(TimeFromTimeMark(tempTM) >= 5000)then
  303.           SellLogs;
  304.         PDWait(1);
  305.       end;
  306.       SWClick(533, 383, 0, 0, 0, 0, 2, True, 'clientCorner');
  307.       SWClick(389, 381, 0, 0, 0, 0, 1, True, 'clientCorner');
  308.       SWClick(493, 383, 0, 0, 0, 0, 2, True, 'clientCorner');
  309.       SWClick(389, 381, 0, 0, 0, 0, 1, True, 'clientCorner');
  310.       for i:= 1 to 9 do
  311.       begin
  312.         for i2:= 1 to 3 do
  313.           SWClick(462, 377, 0, 0, 0, 0, 1, True, 'clientCorner');
  314.         for i2:= 1 to 3 do
  315.         begin
  316.           case i2 of
  317.             1: SWClick(573, 381, 0, 0, 0, 0, 2, True, 'clientCorner');
  318.             2: SWClick(533, 381, 0, 0, 0, 0, 2, True, 'clientCorner');
  319.             3: SWClick(493, 381, 0, 0, 0, 0, 2, True, 'clientCorner');
  320.           end;
  321.           SWClick(389, 379, 0, 0, 0, 0, 1, True, 'clientCorner');
  322.         end;
  323.       end;
  324.       SWClick(409, 147, 0, 0, 0, 0, 1, True, 'clientCorner');
  325.       WalkTo('Tree');
  326.     end;
  327.   end else
  328.     WalkTo('Tree');
  329. end;
  330.  
  331. procedure WalkTo(spot: string);
  332. var
  333.   x, y, i, ttl, dstnc, nwAngl, olAngl: Integer;
  334.   s, drctn: string;
  335.   cBx, sBox: TBox;
  336.   cPtMM, cPt, wPt: TPoint;
  337.   TPA: TPointArray;
  338.   walkBoxArr: TBoxArray;
  339.   b: Boolean;
  340. begin
  341.   sBox:= IntToBox(walkingSpot[140].x1, walkingSpot[140].y1, walkingSpot[220].x2, walkingSpot[220].y2);
  342.   cBx:= GetAreaBoxByID(180);
  343.   cPt:= IntToPoint((cBx.x1 + 9), (cBx.y1 + 9));
  344.   cPtMM:= IntToPoint (533, 174);
  345.   dstnc:= (Distance(wsBox.x1, wsBox.y1, wsBox.x2, wsBox.y2) / 2);
  346.   s:= Lowercase(spot);
  347.   repeat
  348.     case s of
  349.       'tree': b:= FindDTM(dtmTree, x, y, mmBox.x1, mmBox.y1, mmBox.x2, mmBox.y2);
  350.       'trader': b:= FindDTM(dtmTrader, x, y, mmBox.x1, mmBox.y1, mmBox.x2, mmBox.y2);
  351.     end;
  352.     if(b)then
  353.     begin
  354.       drctn:= Lowercase(mmCoordsToDirection(x, y));
  355.       if(drctn = 'center')then
  356.         if(Distance(cPtMM.x, cPtMM.y, x, y) < 12)then
  357.           Break;
  358.       nwAngl:= GetAngle(cPtMM, IntToPoint(x, y));
  359.       if(nwAngl <> olAngl)then
  360.       begin
  361.         wPt:= GetTPointByXYDA(cPt, dstnc, nwAngl);
  362.         TPA:= TPointLine(cPt, wPt);
  363.         PickEveryXTPointFromTPA(4, TPA);
  364.         walkBoxArr:= GetAreaBoxsByTPA(TPA);
  365.         SkipTBoxsByArea(walkBoxArr, sBox, False);
  366.         ttl:= GetArrayLength(walkBoxArr);
  367.         olAngl:= nwAngl;
  368.       end;
  369.       if(ttl > 0)then
  370.       begin
  371.         i:= Random(ttl);
  372.         ClickMouse((walkBoxArr[i].x1 + 9), (walkBoxArr[i].y1 + 9), True);
  373.       end;
  374.       PDWait(1);
  375.     end;
  376.     PDWait(1);
  377.   until(False);
  378.   ClickMouse((wsCBox.X1 + 5), (wsCBox.Y1 + 5), True);
  379.   SetArrayLength(walkBoxArr, 0);
  380.   SetArrayLength(TPA, 0);
  381.   case s of
  382.     'tree': WalkToTreeSpot;
  383.     'trader': SellLogs;
  384.   end;
  385. end;
  386.  
  387. procedure Cut;
  388. var
  389.   x, y, tempTM, tempSpot, tmpETM, ET: Integer;
  390. begin
  391.   while (FindAxe < 0) do
  392.   begin
  393.     ScrollQuickItemBarEx(29);
  394.     PDWait(1);
  395.   end;
  396.   if(FindTree(x, y, 3, 24, 250, 444))then
  397.     if(not(InRange(getChopSpot, 0, 6)))then
  398.       WalkToTreeSpot;
  399.   repeat
  400.     if(BagFull)then
  401.       Break;
  402.     SWClick(555, 369, 0, 0, 0, 0, 1, False, 'clientCorner')
  403.     FindTree(x, y, 151, 186, 164, 291);
  404.     SWClick((x + 5), y, 0, 0, 0, 0, 1, True, 'clientCorner');
  405.     SWClick(488, 263, 0, 0, 0, 0, 1, True, 'clientCorner');
  406.     MarkTime(tempTM);
  407.     while ((not(BagOpen))and(TimeFromTimeMark(tempTM) < 2000)) do
  408.       PDWait(1);
  409.     if(TimeFromTimeMark(tempTM) >= 2000)then
  410.       Cut;
  411.     MarkTime(tempTM);
  412.     while ((BagOpen)and(TimeFromTimeMark(tempTM) < 5500)) do
  413.       PDWait(1);
  414.     if(BagOpen)then
  415.     begin
  416.       SWClick(236, 29, 0, 0, 0, 0, 1, True, 'clientCorner');
  417.       MarkTime(tempTM);
  418.       while (BagOpen) do
  419.       begin
  420.         MarkTime(tmpETM);
  421.         PDWait(1);
  422.         ET:= (TimeFromTimeMark(tmpETM) - 1);
  423.         if((TimeFromTimeMark(tempTM) - ET) >= 10000)then
  424.           TerminateScript;
  425.       end;
  426.       tempSpot:= GetTreeSpot;
  427.       if((getChopSpot < 6)and(getChopSpot > 0))then
  428.         SendArrow(2)
  429.       else
  430.         SendArrow(0);
  431.       MarkTime(tempTM);
  432.       repeat
  433.         if(TimeFromTimeMark(tempTM) >= 500)then
  434.           Break;
  435.         PDWait(1);
  436.       until(tempSpot = (GetTreeSpot + 1))or(tempSpot = (GetTreeSpot - 1));
  437.       WalkToTreeSpot;
  438.       Cut;
  439.     end else
  440.       if(TimeFromTimeMark(tempTM) >= 5500)then
  441.       begin
  442.         if(not(FindTree(x, y, 151, 186, 164, 291)))then
  443.           if(FindTree(x, y, 3, 24, 250, 444))then
  444.             WalkToTreeSpot
  445.           else
  446.             TerminateScript;
  447.       end;
  448.     PDWait(1);
  449.   until(BagFull);
  450.   WalkTo('Trader');
  451. end;
  452.  
  453. function ReadyForUsing: Boolean;
  454. var
  455.   bmp, i, x, y, tmr, bs: Integer;
  456.   box: TBox;
  457.   b: Boolean;
  458. begin
  459.   bs:= -1;
  460.   for i:= 0 to 3 do
  461.     CloseMenu;
  462.   OpenMenu('Inventory');
  463.   MarkTime(tmr);
  464.   repeat
  465.     if(TimeFromTimeMark(tmr) > 1000)then
  466.       Break;
  467.     b:= MenuOpen('Inventory');
  468.     Wait(10);
  469.   until(b);
  470.   if(b)then
  471.   begin
  472.     if(FindDTM(dtmAxe, x, y, bBox.X1, bBox.Y1, bBox.X2, bBox.Y2))then
  473.       bs:= CoordsToBagSlot(x, y);
  474.     if(bs <> 29)then
  475.       if(InRange(bs, 0, 28))then
  476.       begin
  477.         box:= GetBagSlot(29);
  478.         KeyDown(18);
  479.         ClickMouse((box.x1 + 12), (box.y1 + 12), True);
  480.         KeyUp(18);
  481.         MarkTime(tmr);
  482.         repeat
  483.           if(TimeFromTimeMark(tmr) > 1000)then
  484.             Break;
  485.           b:= MenuOpen('Item View');
  486.           Wait(10);
  487.         until(b);
  488.         if(not(b))then
  489.         begin
  490.           DragItem(bs, 29);
  491.           MarkTime(tmr);
  492.           repeat
  493.             if(TimeFromTimeMark(tmr) > 2000)then
  494.               Break;
  495.             b:= FindItemInBagSlot(dtmAxe, 29, 'DTM');
  496.             Wait(10);
  497.           until(b);
  498.           if(not(b))then
  499.             Exit;
  500.         end else
  501.           Exit;
  502.       end else
  503.         Exit;
  504.   end else
  505.     Exit;
  506.   if(b)then
  507.   begin
  508.     for i:= 0 to 2 do
  509.       MoveMouse(4, 24);
  510.     Wait(100);
  511.     bmp:= BitmapFromString(0, 0, '');
  512.     CopyClientToBitmap(bmp, bBox.X1, bBox.Y1, bBox.X2, bBox.Y2);
  513.     if(MD5(BitmapToString(bmp)) <> '49d2c066e8bbae661006710d107d0ec2')then
  514.     begin
  515.       FreeBitmap(bmp);
  516.       Exit;
  517.     end;
  518.     FreeBitmap(bmp);
  519.   end;
  520.   if(b)then
  521.   begin
  522.     MarkTime(tmr);
  523.     repeat
  524.       if(TimeFromTimeMark(tmr) > 2000)then
  525.         Break;
  526.       ScrollQuickItemBarEx(29);
  527.       Wait(100);
  528.       b:= FindItemInQuickBarSlot(dtmAxe, 29, 'DTM');
  529.     until(b);
  530.     CloseMenu;
  531.     if(not(b))then
  532.       Exit;
  533.   end;
  534.   AddToReport('chopspot: ' + IntToStr(getChopSpot));
  535.   if(b)then
  536.     if(not(InRange(getChopSpot, 0, 6)))then
  537.       Exit;
  538.   Result:= True;
  539. end;
  540.  
  541. procedure ScriptTerminate;
  542. begin
  543.   PlaySound(ScriptPath + 'empty.wav');
  544.   FreeDTM(dtmTrader);
  545.   FreeDTM(dtmTree);
  546.   FreeDTM(dtmAxe);
  547.   SetArrayLength(storedColors, 0);
  548.   SetClientPos(False);
  549.   StopProjectSW;
  550. end;
  551.  
  552. begin
  553.   dtmAxe:= DTMFromString('78DA63BCC8C0C0F08201052498F3836946289' +
  554.        'FF128907882AAE6DBD74FA86A1E02891FA86A8C043850D59C0612' +
  555.        '0F51D5ECDFB90AAE8609A6E615AA9A3BB76FC2D53003310000FE1' +
  556.        '12B');
  557.   dtmTree:= DTMFromString('78DA636466626038C88002A22283C0342394C' +
  558.                           'F0852731455CDDED86454352C40353B50D558DB48A2AAE105AA59' +
  559.                           '8066CEAEA5A86AFE02594B50D59C3AB207450D00C38B0C22');
  560.   dtmTrader:= DTMFromString('78DA63B4606260E86740013D819A609A11CA6' +
  561.                             '7D400AA9980AA664A5731AA1A1DA09A05A86A9C1C2D51D59800D5' +
  562.                             '2C4355F3FCFE56143500603E0904');
  563.   nameBox:= nameCoordinates(playerName);
  564.   StartProjectSW;
  565.   ActivateClient;
  566.   Wait(1000);
  567.   if(not(ReadyForUsing))then
  568.     TerminateScript;
  569.   repeat
  570.     handleFKeys;
  571.     Cut;
  572.     PDWait(1);
  573.   until(IsFKeyDown(StopFKey));
  574. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement