Advertisement
imk0tter

Untitled

Jul 22nd, 2011
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.29 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.     ox, oy: Integer;
  15.     w, h: Integer;
  16.   begin
  17.     while (FindBitmap(bitmap, x, y) = false) or ((x = 0) and (y = 0)) do
  18.     begin
  19.       Writeln('Searching for bitmap: ' + inttostr(tolerance));
  20.       Sleep(1000);
  21.       dec(tolerance);
  22.       if tolerance < 0 then
  23.       begin
  24.         break;
  25.       end
  26.     end;
  27.     GetBitmapSize(bitmap,w,h);
  28.     if (x > 0) and (y > 0) then
  29.     begin
  30.       GetMousePos(ox,oy);
  31.       x := x + (w/2);
  32.       y := y + (h/2);
  33.       Writeln('Bitmap found.. Clicking Bitmap: ' + inttostr(w) + '/' + inttostr(h) + ' (' + inttostr(x) + ', ' + inttostr(y) +')');
  34.       MoveMouse(x,y);
  35.       HoldMouse(x,y,mouse_Left);
  36.       Wait(200);
  37.       ReleaseMouse(x,y,mouse_left);
  38.       MoveMouse(ox, oy);
  39.     end
  40.   end;
  41.   procedure GondamonBegin;
  42.   begin
  43.     ActivateClient();
  44.     FindAndClickBitmap(instanceJoinBitmap,100);
  45.     Wait(1000);
  46.     FindAndClickBitmap(skirmishBitmap,2);
  47.     Wait(1000);
  48.     FindAndClickBitmap(siegeOfGondamonBitmap,2);
  49.     Wait(1000);
  50.     FindAndClickBitmap(createBitmap,2);
  51.     Wait(1000);
  52.     FindAndClickBitmap(travelNowBitmap,2);
  53.     Wait(1000);
  54.     FindAndClickBitmap(continueQuestBitmap,100);
  55.   end;
  56.   procedure GondamonEnd;
  57.   var
  58.     x, y: Integer;
  59.   begin
  60.     FindAndClickBitmap(endQuestBitmap,3600);
  61.   end;
  62. begin
  63.     instanceJoinBitmap := LoadBitmap(ScriptPath + 'FINDCLICKINSTANCEJOIN.bmp');
  64.     skirmishBitmap :=  LoadBitmap(ScriptPath + 'FINDCLICKSKIRMISH.bmp');
  65.     siegeOfGondamonBitmap := LoadBitmap(ScriptPath +'FINDCLICKSIEGEOFGONDAMON.bmp');
  66.     createBitmap := LoadBitmap(ScriptPath +'FINDCLICKCREATE.bmp');
  67.     travelNowBitmap := LoadBitmap(ScriptPath + 'FINDCLICKTRAVELNOW.bmp');
  68.     continueQuestBitmap := LoadBitmap(ScriptPath + 'FINDCLICKCONTINUEQUEST.bmp');
  69.     endQuestBitmap := LoadBitmap(ScriptPath +'FINDCLICKTRAVELNOWEND.bmp');
  70.     while true do
  71.     begin
  72.       Wait(5000);
  73.       GondamonBegin();
  74.       Wait(5000)
  75.       GondamonEnd();
  76.     end;
  77. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement