Advertisement
imk0tter

Untitled

Jul 22nd, 2011
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.71 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.       Wait(100);
  34.       HoldMouse(x,y,mouse_Left);
  35.       Wait(500);
  36.       MoveMouse(x,y);
  37.       Wait(100);
  38.       ReleaseMouse(x,y,mouse_left);
  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,5000);
  61.   end;
  62.   procedure HandleSockRead;
  63.   var
  64.     recv : String;
  65.     packet : Integer;
  66.   begin
  67.     while true do
  68.     begin
  69.       recv := RecvSocketStr(socket);
  70.       packet := StrToInt(recv);
  71.       if packet = 1 then
  72.       begin
  73.         GondamonEnd;
  74.       end else
  75.       begin
  76.         GondamonBegin;
  77.       end;
  78.     end;
  79.   end;
  80. begin
  81.    // socket := CreateSocket;
  82.    // ConnectSocket( socket,'127.0.0.1','1337' );
  83.     instanceJoinBitmap := LoadBitmap(ScriptPath + 'FINDCLICKINSTANCEJOIN.bmp');
  84.     skirmishBitmap :=  LoadBitmap(ScriptPath + 'FINDCLICKSKIRMISH.bmp');
  85.     siegeOfGondamonBitmap := LoadBitmap(ScriptPath +'FINDCLICKSIEGEOFGONDAMON.bmp');
  86.     createBitmap := LoadBitmap(ScriptPath +'FINDCLICKCREATE.bmp');
  87.     travelNowBitmap := LoadBitmap(ScriptPath + 'FINDCLICKTRAVELNOW.bmp');
  88.     continueQuestBitmap := LoadBitmap(ScriptPath + 'FINDCLICKCONTINUEQUEST.bmp');
  89.     endQuestBitmap := LoadBitmap(ScriptPath +'FINDCLICKTRAVELNOWEND.bmp');
  90.     while true do
  91.     begin
  92.       Wait(5000);
  93.       GondamonBegin();
  94.       Wait(5000)
  95.       GondamonEnd();
  96.     end;
  97.    // HandleSockRead();
  98. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement