Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program EvasivConstructionT;
- {$DEFINE SMART}
- {$i AeroLib/AeroLib.Simba}
- {$i Reflection/Reflection.simba}
- var
- reflectPlayer: TReflectLocalPlayer;
- phase,currentId,currentNoteId,currentState,currentFurnitureSId,currentFurnitureOId,nrNeeded,x,y:Integer;
- phials: TReflectNpc;
- currentString:String;
- plankI,planknoteI,oakI,oaknoteI,currentPlankI,currentPlankNoteI: TReflectInvItem;
- portalHO,portalOO,chairSpace,chair,currentFurnitureS,currentFurnitureO,bookCaseSpace,bookCase,larder,larderSpace: TReflectObject;
- coords:TPoint;
- tia:TReflectInvItemArray;
- const
- plankId = 960;
- plankNoteId = 961;
- oak = 8778;
- oakNote = 8779;
- portalH = 4525;
- portalO = 15478;
- chair1 = 4517;
- chair2 = 4516;
- bookCaseId = 4521;
- procedure updateIds();
- begin
- if(phase=1)then
- begin
- currentId:=plankId;
- currentNoteId:=plankNoteId;
- currentString:='Plank';
- currentFurnitureS:=chairSpace;
- currentFurnitureO:=chair;
- nrNeeded:=2;
- currentFurnitureSId:=4517;
- currentFurnitureOId:=6752;
- coords:=Point(294, 46);
- end;
- if(phase=2 or phase=3) then
- begin
- currentId:=oak;
- currentNoteId:=oakNote;
- if(phase=2)then
- begin
- coords:=Point(50, 114);
- currentFurnitureS:=bookCaseSpace;
- currentFurnitureO:=bookCase;
- nrNeeded:=4;
- end else if(phase=3) then
- begin
- currentFurnitureS:=larderSpace;
- currentFurnitureO:=larder;
- nrNeeded:=8;
- end;
- currentId:=oak;
- currentNoteId:=oakNote;
- currentString:='Oak Plank';
- end;
- end;
- function DistFromPlayer(tile : TTile) : single;
- var
- playerTile: TTile;
- begin
- playerTile := reflectPlayer.GetTile;
- exit (Sqrt(power(playerTile.X - tile.X, 2) + power(playerTile.Y - tile.Y, 2)));
- end;
- procedure walk(tile : TTile; acc : integer);
- begin
- repeat
- reflectPlayer.BlindWalkMM(tile,acc);
- sleep(1000+random(100));
- until(DistFromPlayer(tile)<=acc);
- end;
- procedure removeFurniture(id:integer);
- var
- furniture:TReflectObject;
- begin
- repeat
- WriteLn('Removing A Piece of Furniture!');
- sleep(1000+random(100));
- furniture.Find(objGame,id,8);
- repeat
- HumanMMouse(furniture.GetMSPoint,3,3);
- sleep(100+random(39));
- until(not(Reflect.Text.IsUpText('Walk here')));
- fastClick(Mouse_Right);
- while(not(chooseOption('Remove'))) do sleep(100+random(22));
- while(not(Reflect.Chat.NpcChooseOption('Yes'))) do sleep(100+random(33));
- Reflect.Chat.NpcChooseOption('Yes');
- sleep(1000+random(121));
- until(not(furniture.Find(objGame,id,8)));
- end;
- procedure getPlanks();
- begin
- phials.Find('Phials');
- walk(phials.GetTile,1);
- gameTab(TAB_INV);
- currentPlankNoteI.Find(currentNoteId);
- repeat
- WriteLn(currentNoteId);
- HumanMMouse(currentPlankNoteI.GetMSPoint,3,3);
- sleep(300+random(100));
- until(Reflect.Text.IsUpText(currentString));
- fastClick(Mouse_Left);
- repeat
- humanMMouse(phials.GetMSPoint,2,2);
- sleep(100+random(10));
- until(Reflect.Text.IsUpText('Phials'));
- Reflect.Mouse.Click(Mouse_Left);
- While(Reflect.Chat.NpcChooseOption('Exchange All')=false) do sleep(100);
- Reflect.Chat.NpcChooseOption('110');
- exit;
- end;
- procedure toPortal();
- begin
- if(not(portalOO.Find(objGame,portalO,30))) then
- begin
- WriteLn('Couldnt find outside portal');
- terminatescript;
- end;
- walk(portalOO.GetTile,2);
- repeat
- HumanMMouse(portalOO.GetMSPoint,3,3);
- sleep(300+random(100));
- until(Reflect.Text.IsUpText('Portal'));
- fastClick(Mouse_left);
- while(not(Reflect.Chat.NpcChooseOption('(building mode)'))) do sleep(100);
- Reflect.Chat.NpcChooseOption('(building mode)');
- while(not(portalHO.Find(objGame,portalH,10))) do sleep(100);
- end;
- procedure switchChair();
- begin
- if(currentFurnitureSid=4517) then
- begin
- currentFurnitureSId:= 4516;
- end else if(currentFurnitureSid=4516) then
- currentFurnitureSId:=4517;
- end;
- procedure work();
- var
- tile:TTile;
- tempPlank:integer;
- begin
- tile:=portalHO.GetTile;
- if(DistFromPlayer(Point(tile.X+1,tile.Y+9))>0)then
- walk(Point(tile.X+1,tile.Y+9),0);
- currentFurnitureS.Find(objGame,currentFurnitureSId,20);
- repeat
- tia.Get(currentId);
- if(length(tia)<=nrNeeded)then
- exit;
- if(phase=1) then
- begin
- currentFurnitureS.Find(objGame,chair1,10);
- repeat
- sleep(100+random(10));
- while(reflectPlayer.IsMoving) do sleep(100);
- repeat
- HumanMMouse(currentFurnitureS.GetMSPoint,2,3);
- sleep(300+random(30));
- while(reflectPlayer.IsMoving) do sleep(100);
- fastClick(Mouse_Right);
- while(reflectPlayer.IsMoving) do sleep(100);
- until(chooseOption('Build Chair'));
- chooseOption('Build Chair');
- Wait(RandomRange(1200, 1500));
- GaussMouseBox(49, 69, 58, 90, 1);
- if(Reflect.Text.IsUpText('Build'))then
- begin
- tempPlank:=Reflect.Inv.Count;
- WriteLn('tempplank',tempPlank);
- fastClick(Mouse_Left);
- repeat
- sleep(100);
- until(Reflect.Inv.Count<>tempPlank);
- removeFurniture(currentFurnitureOId);
- end;
- until (currentPlankI.GetQuantity<nrNeeded);
- WriteLn('SAIU DO REPEAT');
- end else
- begin
- repeat
- until (not(currentFurnitureS.Find(objGame,currentFurnitureSId,10)));
- end;
- tia.Get(currentId);
- until(length(tia));
- end;
- procedure workDone();
- begin
- walk(portalHO.GetTile,1);
- portalHO.Find(objGame,portalH,5);
- repeat
- HumanMMouse(portalHO.GetMSPoint,3,3);
- sleep(300+random(100));
- until(Reflect.Text.IsUpText('Portal'));
- fastClick(Mouse_left);
- while(not(portalOO.Find(objGame,portalO,5))) do sleep(100);
- end;
- function getState():integer;
- begin
- updateIds;
- if(not(Reflect.Inv.IsFull)) and (phials.Find('Phials')) then
- begin
- exit(1);
- end else if((Reflect.Inv.Count=28) and (phials.Find('Phials'))) then
- begin
- exit(2);
- end else if((currentPlankI.Find(currentId)) and (portalHO.Find(objGame,portalH,30))) then
- begin
- exit(3);
- end else if((not((currentPlankI.Find(currentId))) and (portalHO.Find(objGame,portalH,30))) or (currentPlankI.GetQuantity<nrNeeded)) then
- begin
- exit(4);
- end;
- terminatescript;
- end;
- procedure executeState(State: Integer);
- begin
- case (State) of
- 1: getPlanks();// Get more planks from phials
- 2: toPortal(); // Got planks, going back home
- 3: work(); // build
- 4: workDone(); // no more planks exiting portal
- end;
- sleep(Random(100,200));
- end;
- begin
- initAL('C:\Javas\Java3\jre1.8.0_91\bin\javaw.exe');
- Reflect.Setup;
- reflectPlayer.Username := 'stijnvanloom@gmail.com';
- reflectPlayer.Password := 'weedpw123';
- reflectPlayer.Active := True;
- Me.Member := True;
- reflectPlayer.Create;
- reflectPlayer.Login;
- phase:=1;
- repeat
- //getRealMousePos(x, y);
- //smartGetMousePos(OS_SMART.__TARGET, x, y);
- WriteLn('portal',portalHO.GetTile);
- WriteLn(reflectPlayer.GetTile);
- //WriteLn('Anim ',reflectPlayer.IsAnimating);
- currentState:=getState();
- WriteLn('State: ',currentState);
- executeState(currentState);
- sleep(500);
- until(false);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement