Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program new;
- var
- socket : Integer;
- instanceJoinBitmap : Integer;
- skirmishBitmap : Integer;
- siegeOfGondamonBitmap : Integer;
- createBitmap : Integer;
- travelNowBitmap : Integer;
- continueQuestBitmap : Integer;
- endQuestBitmap : Integer;
- procedure FindAndClickBitmap(bitmap, tolerance : Integer);
- var
- x, y: Integer;
- w, h: Integer;
- begin
- while (FindBitmap(bitmap, x, y) = false) or ((x = 0) and (y = 0)) do
- begin
- Writeln('Searching for bitmap: ' + inttostr(tolerance));
- Sleep(1000);
- dec(tolerance);
- if tolerance < 0 then
- begin
- break;
- end
- end;
- GetBitmapSize(bitmap,w,h);
- if (x > 0) and (y > 0) then
- begin
- x := x + (w/2);
- y := y + (h/2);
- Writeln('Bitmap found.. Clicking Bitmap: ' + inttostr(w) + '/' + inttostr(h) + ' (' + inttostr(x) + ', ' + inttostr(y) +')');
- MoveMouse(x,y);
- Wait(100);
- HoldMouse(x,y,mouse_Left);
- Wait(500);
- ReleaseMouse(x,y,mouse_left);
- end
- end;
- procedure GondamonBegin;
- begin
- ActivateClient();
- FindAndClickBitmap(instanceJoinBitmap,100);
- Wait(1000);
- FindAndClickBitmap(skirmishBitmap,2);
- Wait(1000);
- FindAndClickBitmap(siegeOfGondamonBitmap,2);
- Wait(1000);
- FindAndClickBitmap(createBitmap,2);
- Wait(1000);
- FindAndClickBitmap(travelNowBitmap,2);
- Wait(1000);
- FindAndClickBitmap(continueQuestBitmap,100);
- end;
- procedure GondamonEnd;
- var
- x, y: Integer;
- begin
- FindAndClickBitmap(endQuestBitmap,3600);
- end;
- procedure HandleSockRead;
- var
- recv : String;
- packet : Integer;
- begin
- while true do
- begin
- recv := RecvSocketStr(socket);
- packet := StrToInt(recv);
- if packet = 1 then
- begin
- GondamonEnd;
- end else
- begin
- GondamonBegin;
- end;
- end;
- end;
- var
- w, h: Integer;
- begin
- // socket := CreateSocket;
- // ConnectSocket( socket,'127.0.0.1','1337' );
- instanceJoinBitmap := LoadBitmap(ScriptPath + 'FINDCLICKINSTANCEJOIN.bmp');
- skirmishBitmap := LoadBitmap(ScriptPath + 'FINDCLICKSKIRMISH.bmp');
- siegeOfGondamonBitmap := LoadBitmap(ScriptPath +'FINDCLICKSIEGEOFGONDAMON.bmp');
- createBitmap := LoadBitmap(ScriptPath +'FINDCLICKCREATE.bmp');
- travelNowBitmap := LoadBitmap(ScriptPath + 'FINDCLICKTRAVELNOW.bmp');
- continueQuestBitmap := LoadBitmap(ScriptPath + 'FINDCLICKCONTINUEQUEST.bmp');
- endQuestBitmap := LoadBitmap(ScriptPath +'FINDCLICKTRAVELNOWEND.bmp');
- while true do
- begin
- Wait(5000);
- GondamonBegin();
- Wait(5000)
- GondamonEnd();
- end;
- // HandleSockRead();
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement