uses SysUtils;
procedure RandomClicksThread(d: integer);
var X, Y, Z: integer;
begin
X:= User.X; // set coordinates of point
Y:= User.Y; // near which we will move
Z:= User.Z;
while Delay(1000) do begin // run an endless loop
if (Engine.Status = lsOnline) then begin // if we are in the game then
if (User.DistTo(X, Y, Z) > 2*d*d) then begin // if the base point has changed,
Print(Format('[RandomClicksThread] Base point coordinates updated: (%d, %d) -> (%d, %d)', [X, Y, User.X, User.Y]));
X:= User.X; // update coordinates
Y:= User.Y;
Z:= User.Z;
end;
if (not User.Moved) and (not User.Sitting) // if we are not moving and not sitting
and (not User.InCombat) and (User.Cast.EndTime = 0) // not in fight and dont cast anything
and ((User.Target = nil) or (User.Target.Dead)) then begin // and we dont have a target or our target is dead, then
if Engine.DMoveTo(X+Random(2*d)-d, Y+Random(2*d)-d, User.Z) then // make a random step to the side
Delay(1000+Random(5000)); // and wait for random delay
end;
end;
end;
end;
begin
Script.NewThread(@RandomClicksThread, Pointer(150)); // start the thread, second argument indicate max distance from the base point
// code...
Delay(-1);
end.
- Adrenaline
-
Classes
- TL2Control
- TL2Object
- TL2StaticObject
- TL2Spawn
- TL2Live
- TL2Char
- TL2User
- TL2Npc
- TL2Pet
- TL2Drop
- TL2Buff
- TL2Skill
- TLearnItem
- TL2Cast
- TL2Item
- TL2AucItem
- TL2List
- TSpawnList
- TCharList
- TNpcList
- TPetList
- TDropList
- TItemList
- TSkillList
- TBuffList
- TL2Warehouse
- TL2Auction
- TInventory
- TParty
- TConfirmDlg
- TMessages
- TChatMessage
- TBot
- TPaxEngine
- TGps
- TGpsPoint
- TL2Base
- TBaseList
- TBaseObject
- TBaseItem
- TBaseSkill
- TBaseAction
- TBaseNpc
- Enums
- Objects
- Methods
- Units
- NexTarget
- TRadar
- Scripts
- Scripts Examples
- Scripts Catalog
- Order a script
- Useful
- Navigation
- Cabinet
- Bot's site
- Buy Adrenaline
- Instructions
- Game IDs DB
- Tech. support