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;
- reviveBitmap : Integer;
- retreatBitmap : Integer;
- procedure FindAndClickBitmap(bitmap, tolerance : Integer);
- var
- x, y: Integer;
- ox, oy: 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
- ActivateClient();
- Wait(200);
- GetMousePos(ox,oy);
- 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(50);
- ClickMouse(x,y,mouse_Left);
- MoveMouse(ox, oy);
- end
- end;
- procedure Death;
- begin
- FindAndClickBitmap(retreatBitmap,2);
- end;
- procedure MathiBegin;
- begin
- FindAndClickBitmap(continueQuestBitmap,2);
- Wait(100);
- end;
- procedure MathiEnd;
- var
- x, y: Integer;
- begin
- FindAndClickBitmap(endQuestBitmap,5);
- Wait(1000);
- FindAndClickBitmap(instanceJoinBitMap,100);
- Wait(1000);
- FindAndClickBitmap(skirmishBitmap,2);
- Wait(1000);
- FindAndClickBitmap(siegeOfGondamonBitmap,2);
- Wait(1000);
- FindAndClickBitmap(createBitmap,2);
- Wait(1000);
- FindAndClickBitmap(travelNowBitmap,2);
- end;
- procedure HandleSockRead(socket : Integer);
- var
- packet : String;
- begin
- packet := RecvSocketStr(socket);
- if packet = 'Died' then
- begin
- Writeln('Handeling death packet');
- Death();
- end;
- if packet = 'MathiEnd' then
- begin
- Writeln('Handeling Mathi End packet');
- MathiEnd();
- end;
- if packet = 'MathiBegin' then
- begin
- Writeln('Handeling Mathi Begin packet');
- MathiBegin();
- end;
- end;
- var
- listenSock, mainSocket: Integer;
- begin
- mainSocket := CreateSocket();
- 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');
- reviveBitmap := LoadBitmap(ScriptPath + 'FINDCLICKREVIVE.bmp');
- retreatBitmap := LoadBitmap(ScriptPath + 'FINDCLICKRETREAT.bmp');
- SetTimeout(mainSocket,3600000);
- ConnectSocket(mainSocket,'127.0.0.1','1337');
- Wait(1000);
- while true do
- begin
- HandleSockRead(mainSocket);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement