Advertisement
imk0tter

Untitled

Jul 22nd, 2011
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 2.69 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.       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,3600);
  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.   var
  79.      w, h: Integer;
  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