Advertisement
imk0tter

Untitled

Jul 22nd, 2011
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. program new;
  2. var
  3. socket : Integer;
  4. instanceJoinBitmap : Integer;
  5. skirmishBitmap : Integer;
  6. siegeOfGondamonBitmap : Integer;
  7. createBitmap : Integer;
  8. travelNowBitmap : Integer;
  9. continueQuestBitmap : Integer;
  10. endQuestBitmap : Integer;
  11. procedure FindAndClickBitmap(bitmap, tolerance : Integer);
  12. var
  13. x, y: Integer;
  14. w, h: Integer;
  15. begin
  16. while (FindBitmap(bitmap, x, y) = false) or ((x = 0) and (y = 0)) do
  17. begin
  18. Writeln('Searching for bitmap: ' + inttostr(tolerance));
  19. Sleep(1000);
  20. dec(tolerance);
  21. if tolerance < 0 then
  22. begin
  23. break;
  24. end
  25. end;
  26. GetBitmapSize(bitmap,w,h);
  27. if (x > 0) and (y > 0) then
  28. begin
  29. x := x + (w/2);
  30. y := y + (h/2);
  31. Writeln('Bitmap found.. Clicking Bitmap: ' + inttostr(w) + '/' + inttostr(h) + ' (' + inttostr(x) + ', ' + inttostr(y) +')');
  32. MoveMouse(x,y);
  33. HoldMouse(x,y,mouse_Left);
  34. Wait(1000);
  35. MoveMouse(x,y);
  36. ReleaseMouse(x,y,mouse_left);
  37. end
  38. end;
  39. procedure GondamonBegin;
  40. begin
  41. ActivateClient();
  42. FindAndClickBitmap(instanceJoinBitmap,100);
  43. Wait(1000);
  44. FindAndClickBitmap(skirmishBitmap,2);
  45. Wait(1000);
  46. FindAndClickBitmap(siegeOfGondamonBitmap,2);
  47. Wait(1000);
  48. FindAndClickBitmap(createBitmap,2);
  49. Wait(1000);
  50. FindAndClickBitmap(travelNowBitmap,2);
  51. Wait(1000);
  52. FindAndClickBitmap(continueQuestBitmap,100);
  53. end;
  54. procedure GondamonEnd;
  55. var
  56. x, y: Integer;
  57. begin
  58. FindAndClickBitmap(endQuestBitmap,5000);
  59. end;
  60. procedure HandleSockRead;
  61. var
  62. recv : String;
  63. packet : Integer;
  64. begin
  65. while true do
  66. begin
  67. recv := RecvSocketStr(socket);
  68. packet := StrToInt(recv);
  69. if packet = 1 then
  70. begin
  71. GondamonEnd;
  72. end else
  73. begin
  74. GondamonBegin;
  75. end;
  76. end;
  77. end;
  78. begin
  79. // socket := CreateSocket;
  80. // ConnectSocket( socket,'127.0.0.1','1337' );
  81. instanceJoinBitmap := LoadBitmap(ScriptPath + 'FINDCLICKINSTANCEJOIN.bmp');
  82. skirmishBitmap := LoadBitmap(ScriptPath + 'FINDCLICKSKIRMISH.bmp');
  83. siegeOfGondamonBitmap := LoadBitmap(ScriptPath +'FINDCLICKSIEGEOFGONDAMON.bmp');
  84. createBitmap := LoadBitmap(ScriptPath +'FINDCLICKCREATE.bmp');
  85. travelNowBitmap := LoadBitmap(ScriptPath + 'FINDCLICKTRAVELNOW.bmp');
  86. continueQuestBitmap := LoadBitmap(ScriptPath + 'FINDCLICKCONTINUEQUEST.bmp');
  87. endQuestBitmap := LoadBitmap(ScriptPath +'FINDCLICKTRAVELNOWEND.bmp');
  88. while true do
  89. begin
  90. Wait(5000);
  91. GondamonBegin();
  92. Wait(5000)
  93. GondamonEnd();
  94. end;
  95. // HandleSockRead();
  96. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement