- Board index Stealth Client in Russian Scripts
- Search
-
- It is currently 23.04.2024 23:23
- All times are UTC+02:00
Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7
Auto
Only working scripts
Re: Auto
mining
Code: Select all
Program Miner;
type
TMinTile = record
Tile, X, Y : Integer;
end;
var
MinTiles : Array of TMinTile;
k : Integer;
Healers : Array of TPoint;
{Config vards}
UnloadPoint : TPoint;
UnloadChest : Cardinal;
WhereUnload : String;
SmeltPoint : TPoint;
ForgeId : Cardinal;
OreMine : TPoint;
procedure SetConfig(CharName : String);
begin
case CharName of
'Lestreid' :
begin
UnloadPoint.X := 2394;
UnloadPoint.Y := 942;
UnloadChest := $42163484 ;
WhereUnload := '';
SmeltPoint.X := 2394;
SmeltPoint.Y := 942;
ForgeId := $429E5458;
OreMine.X := 2389;
OreMine.Y := 906;
end;
'Enoh Drebber' :
begin
UnloadPoint.X := 2394;
UnloadPoint.Y := 942;
UnloadChest := $42163484 ;
WhereUnload := '';
SmeltPoint.X := 2394;
SmeltPoint.Y := 942;
ForgeId := $429E5458;
OreMine.X := 2446;
OreMine.Y := 891;
end;
'James Hathfield' :
begin
UnloadPoint.X := 2394;
UnloadPoint.Y := 942;
UnloadChest := $42163484 ;
WhereUnload := '';
SmeltPoint.X := 2394;
SmeltPoint.Y := 942;
ForgeId := $429E5458;
OreMine.X := 2325;
OreMine.Y := 820;
end;
end;
end;
procedure WaitLag(WaitMS : Integer);
begin
CheckLag(60000);
Wait(WaitMS);
end;
procedure AddHealer(X, Y : Word);
begin
SetLength(Healers, Length(Healers)+1);
Healers[High(Healers)].X := X;
Healers[High(Healers)].Y := Y;
end;
procedure InitHealerPoints(CharName : String);
begin
if (CharName = 'Lestreid') or (CharName = 'Enoh Drebber') or (CharName = 'James Hathfield') then
begin
AddHealer(2325, 989);
AddHealer(2378, 998);
AddHealer(2429, 1002);
AddHealer(2515, 986);
AddHealer(2567, 998);
AddHealer(2619, 970);
end;
end;
procedure OnDeathGump(Serial, GumpID, X, Y: Cardinal);
begin
if GumpId = $B04C9A31 then
NumGumpButton(GetGumpsCount-1, 1);
end;
procedure OnDeath;
var
i : Integer;
begin
while Dead do
for i := 0 to Length(Healers)-1 do
NewMoveXY(Healers[i].X, Healers[i].Y, true, 1, true);
end;
procedure AddMinTile(fTile, fX, fY : Integer);
begin
SetLength(MinTiles, Length(MinTiles)+1);
with MinTiles[High(MinTiles)] do
begin
Tile := fTile;
X := fX;
Y := fY;
end;
end;
procedure SetMinTilesArray;
var
x,y,i : Integer;
TileInfo : TStaticCell;
begin
for x := (-1 * 20) to 20 do
for y := (-1 * 20) to 20 do
begin
TileInfo := ReadStaticsXY(GetX(self)+x, GetY(self)+y, GetZ(Self));
if TileInfo.StaticCount > 0 then
for i := Low(TileInfo.Statics) to High(TileInfo.Statics) do
if (TileInfo.Statics[i].Tile >= 1339) and (TileInfo.Statics[i].Tile <= 1359) and (TileInfo.Statics[i].z = GetZ(self)) then
AddMinTile(TileInfo.Statics[i].Tile, TileInfo.Statics[i].x, TileInfo.Statics[i].y);
end;
AddToSystemJournal(IntToStr(Length(MinTiles)));
end;
procedure CreateTool(Container : Cardinal);
var
gi : TGumpInfo;
begin
if FindType($0E86, Backpack) < 2 then
begin
if GetQuantity(FindTypeEx($1BF2, $0000, Backpack, True)) < 10 then
MoveItem(FindTypeEx($1BF2, $0000, Container, True), 30, Backpack, 0,0,0);
WaitLag(1500);
if FindType($1EB8, Backpack) <= 0 then
if FindType($1EB8, Container) > 0 then
MoveItem(FindType($1EB8, Container), 1, Backpack, 0,0,0)
else
begin
AddToSystemJournal('No tinker tools!');
Disconnect;
end;
WaitLag(1500);
UseObject(FindType($1EB8, Backpack));
WaitLag(1000);
GetGumpInfo(GetGumpsCount-1, gi);
if Length(gi.GumpButtons) > 9 then
NumGumpButton(GetGumpsCount-1, gi.GumpButtons[9].return_value)
else
exit;
WaitLag(1500);
if Length(gi.GumpButtons) > 51 then
NumGumpButton(GetGumpsCount-1, gi.GumpButtons[51].return_value)
else
exit;
WaitLag(2500);
end;
while FindType($1EB8, Backpack) > 0 do
begin
MoveItem(FindItem, 1, Container, 0,0,0);
WaitLag(500);
end;
end;
procedure Unload;
var
UnloadItems : Array of Word;
UnloadContainer : Cardinal;
i : Integer;
begin
UnloadItems := [$1BF2, $3198, $3195];
NewMoveXY(UnloadPoint.X, UnloadPoint.Y, true, 1, true);
if WhereUnload = 'Bank' then
begin
UOSay('Bank');
UnloadChest := ObjAtLayer(BankLayer);
end;
UnloadContainer := UnloadChest;
UseObject(UnloadChest);
Wait(1000);
FindTypeEx($1BF2, $0000, ObjAtLayer(BankLayer), True);
AddToSystemJournal('Iron in bank: ' + IntToStr(FindFullQuantity));
for i := 0 to Length(UnloadItems)-1 do
while FindType(UnloadItems[i], Backpack) > 0 do
begin
if Dead then OnDeath;
MoveItem(FindItem, 0, UnloadContainer, 0,0,0);
Wait(1000);
CheckLag(60000);
end;
if FindType($0E86, Backpack) < 2 then
if FindType($0E86, UnloadContainer) > 0 then
begin
if Dead then OnDeath;
MoveItem(FindType($0E86, UnloadContainer), 1, backpack, 0,0,0);
Wait(1000);
end;
CreateTool(UnloadContainer);
end;
function GetFoundItems(var Items: Array Of Cardinal): Integer;
var List: TStringList; i: Integer;
begin
List := TStringList.Create;
if GetFindedList(List) = False then Result := 0
else begin
SetLength(Items, List.Count);
for i := 0 to Length(Items)-1 do Items[i] := StrToInt('$'+List.Strings[i]);
Result := Length(Items);
end;
List.Free;
end;
procedure CombineOre;
var
CombineTypes : Array of Word;
i, k : Integer;
fItems : Array of Cardinal;
//fItem : Cardinal;
begin
CombineTypes := [$19B9, $19BA, $19B8];
for i := 0 to Length(CombineTypes)-1 do
begin
FindType(CombineTypes[i], Backpack);
if GetFoundItems(fItems) > 0 then
for k := 0 to Length(fItems)-1 do
begin
UseObject(fItems[k]);
if WaitForTarget(60000) then
TargetToObject(FindTypeEx($19B7, GetColor(fItems[k]), Backpack, True));
Wait(500);
end;
end;
end;
procedure Smelt;
var
SmeltItems : Array of Word;
Items : Array of Cardinal;
i, m : Integer;
begin
CancelTarget;
SmeltItems := [$19B9, $19BA, $19B8, $19B7];
NewMoveXY(SmeltPoint.X, SmeltPoint.Y, true, 0, true);
Wait(300);
for i := 0 to Length(SmeltItems)-1 do
begin
FindType(SmeltItems[i], Backpack);
if GetFoundItems(Items) > 0 then
for m := 0 to Length(Items)-1 do
if GetQuantity(Items[m]) >= 2 then
begin
if Dead then OnDeath;
UseObject(Items[m]);
if WaitForTarget(60000) then
TargetToObject(ForgeId);
Wait(100);
CheckLag(60000);
end;
end;
Unload;
end;
procedure MinOnTile(Idx : Integer);
var
i, k, z : Integer;
msgFizzle, msgEnd : String;
cTime : TDateTime;
begin
msgFizzle := 'put it in | loosen some rocks ';
msgEnd := 'is nothing|is no metal|cannot be seen| too far| mining in rock| cannot mine| no line| reach| not to mine|Try mining ';
if Dist(GetX(self), GetY(self), MinTiles[Idx].x, MinTiles[Idx].y) > 2 then
NewMoveXY(MinTiles[Idx].x, MinTiles[Idx].y, true, 1, true);
for k := 0 to 4 do
begin
if Dead then OnDeath;
if Weight > (MaxWeight-30) then
begin
CombineOre;
if Weight > (MaxWeight - 50) then
Smelt;
end;
if WarMode then SetWarMode(False);
//if UseType($0E86, $FFFF) = 0 then
if FindType($0E86, Backpack) > 0 then
begin
UseObject(FindItem);
CheckLag(30000);
if not WaitForTarget(30000) then
begin
ClientPrint('No pickaxes or shovels found...');
Smelt;
exit;
end
else
begin
cTime := Now;
z := GetZ(self);
//AddToSystemJournal(IntToStr(MinTiles[Idx].Tile) + ' ' + IntToStr(MinTiles[Idx].x) + ' ' + IntToStr(MinTiles[Idx].y) + ' ' + IntToStr(z));
TargetToTile(MinTiles[Idx].Tile, MinTiles[Idx].x, MinTiles[Idx].y, z);
for i := 0 to 150 do
begin
Wait(100);
CheckLag(30000);
if (InJournalBetweenTimes(msgFizzle, cTime, Now) <> -1) then break;
if (InJournalBetweenTimes(msgEnd, cTime, Now) <> -1) then exit;
end;
end;
end
else
begin
ClientPrint('No pickaxes or shovels found...');
Smelt;
exit;
end;
end;
ClientPrint('Tile finished.');
end;
procedure OnSpeech(Text, SenderName : String; SenderId : Cardinal);
begin
if BMSearch(1, Text, 'worn out') > 0 then
Unload;
end;
begin
MoveOpenDoor := True;
SetEventProc(evUnicodeSpeech, 'OnSpeech');
SetEventProc(evIncomingGump, 'OnDeathGump');
IgnoreReset;
InitHealerPoints(GetName(Self));
SetConfig(GetName(Self));
//CreateTool(UnloadChest);
Unload;
NewMoveXY(OreMine.X, OreMine.Y, true, 0, true);//MoveTo('Ore mine');
SetMinTilesArray;
while true do
for k:= 0 to Length(MinTiles)-1 do
begin
if Dead then OnDeath;
MinOnTile(k);
Wait(10);
end;
end.
Lumberjacking
Code: Select all
Program Lumberjacking;
type
TMinTile = record
x, y, z, Tile : Integer;
end;
var
MinTiles : Array of TMinTile;
currIndex, spotscount : Integer;
Spots : Array[0..2] of TPoint;
Healers : Array of TPoint;
//Config vars
UnloadPoint : TPoint;
UnloadChest : Cardinal;
//WhereUnload : String;
//SmeltPoint : TPoint;
//ForgeId : Cardinal;
//OreMine : TPoint;}
procedure SetFarmingSpots(CharName : String);
begin
case CharName of
'Moriarty' :
begin
Spots[0].X := 2400;
Spots[0].Y := 969;
Spots[1].X := 2331;
Spots[1].Y := 1008;
Spots[2].X := 2384;
Spots[2].Y := 1036;
end;
'DoctorVatson' :
begin
Spots[0].X := 2521;
Spots[0].Y := 960;
Spots[1].X := 2485;
Spots[1].Y := 1007;
Spots[2].X := 2526;
Spots[2].Y := 1041;
end;
'MissHudson' :
begin
Spots[0].X := 2309;
Spots[0].Y := 958;
Spots[1].X := 2302;
Spots[1].Y := 897;
Spots[2].X := 2288;
Spots[2].Y := 847;
end;
'Kranze' :
begin
Spots[0].X := 2000;
Spots[0].Y := 672;
Spots[1].X := 1984;
Spots[1].Y := 618;
Spots[2].X := 1962;
Spots[2].Y := 664;
end;
'Choco' :
begin
Spots[0].X := 1984;
Spots[0].Y := 718;
Spots[1].X := 1947;
Spots[1].Y := 706;
Spots[2].X := 1915;
Spots[2].Y := 696;
end;
'JippersCrippers' :
begin
Spots[0].X := 1979;
Spots[0].Y := 714;
Spots[1].X := 1947;
Spots[1].Y := 704;
Spots[2].X := 1913;
Spots[2].Y := 692;
end;
end;
end;
procedure AddHealer(X, Y : Word);
begin
SetLength(Healers, Length(Healers)+1);
Healers[High(Healers)].X := X;
Healers[High(Healers)].Y := Y;
end;
procedure InitHealerPoints(CharName : String);
begin
if (CharName = 'Moriarty') or (CharName = 'DoctorVatson') or (CharName = 'MissHudson') then
begin
AddHealer(2325, 989);
AddHealer(2378, 998);
AddHealer(2429, 1002);
AddHealer(2515, 986);
AddHealer(2567, 998);
AddHealer(2619, 970);
end;
if (CharName = 'Kranze') or (CharName = 'Choco') or (CharName = 'JippersCrippers') then
begin
AddHealer(1886, 748);
AddHealer(1923, 734);
AddHealer(1955, 748);
AddHealer(1994, 749);
AddHealer(2022, 758);
end;
end;
procedure SetConfig(CharName : String);
begin
if (CharName = 'Moriarty') or (CharName = 'DoctorVatson') or (CharName = 'MissHudson') then
begin
AddToSystemJournal('Config loaded for: ' + CharName);
SetFarmingSpots(CharName);
UnloadPoint.X := 2392;
UnloadPoint.Y := 942;
UnloadChest := $42163481;
end;
if (CharName = 'Kranze') or (CharName = 'Choco') or (CharName = 'JippersCrippers') then
begin
AddToSystemJournal('Config loaded for: ' + CharName);
SetFarmingSpots(CharName);
UnloadPoint.X := 2022;
UnloadPoint.Y := 661;
UnloadChest := $43015E52;
end;
end;
procedure OnDeathGump(Serial, GumpID, X, Y: Cardinal);
begin
if GumpId = $B04C9A31 then
NumGumpButton(GetGumpsCount-1, 1);
end;
procedure OnDeath;
var
i : Integer;
begin
while Dead do
for i := 0 to Length(Healers)-1 do
NewMoveXY(Healers[i].X, Healers[i].Y, true, 1, true);
end;
procedure Unload;
var
UnloadItems : Array of Word;
i : Integer;
begin
UnloadItems := [$1BF2, $3198, $3195, $1BDD, $3191, $2F5F, $3190, $3199, $318F];
NewMoveXY(UnloadPoint.X, UnloadPoint.Y, true, 1, true);
//UOSay('Bank');
UseObject(UnloadChest);
Wait(1000);
for i := 0 to Length(UnloadItems)-1 do
while FindType(UnloadItems[i], Backpack) > 0 do
begin
if Dead then OnDeath;
MoveItem(FindItem, 0, UnloadChest, 0,0,0);
Wait(1000);
CheckLag(60000);
end;
FindType($0F43, Backpack);
if FindCount < 1 then
if FindType($0F43, UnloadChest) > 0 then
MoveItem(FindItem, 1, Backpack, 0,0,0);
end;
function GetFoundItems(var Items: Array Of Cardinal): Integer;
var List: TStringList; i: Integer;
begin
List := TStringList.Create;
if GetFindedList(List) = False then Result := 0
else begin
SetLength(Items, List.Count);
for i := 0 to Length(Items)-1 do Items[i] := StrToInt('$'+List.Strings[i]);
Result := Length(Items);
end;
List.Free;
end;
procedure AddMinTile(fTile, fX, fY : Integer);
begin
SetLength(MinTiles, Length(MinTiles)+1);
with MinTiles[High(MinTiles)] do
begin
Tile := fTile;
X := fX;
Y := fY;
end;
end;
procedure GetTilesToFarm;
var
ATiles : Array of Integer;
x,y,i,k : Integer;
TileInfo : TStaticCell;
begin
ATiles := [3274,3275,3277,3280,3283,3286,3288,3290,3293,3296,3299,3302,3320,3323,3326,3329,3393,3394,3395,3396,3415,3416,3417,3418,3419,3438,3439,3440,3441,3442,3460,3461,3462,3476,3478,3480,3482,3484,3492,3496];
for x := (-1 * 20) to 20 do
for y := (-1 * 20) to 20 do
begin
//AddToSystemJournal(IntToStr(Length(ATiles)));
TileInfo := ReadStaticsXY(GetX(self)+x, GetY(self)+y, 0);
if TileInfo.StaticCount > 0 then
for i := Low(TileInfo.Statics) to High(TileInfo.Statics) do
for k := 0 to Length(ATiles)-1 do
begin
//AddToSystemJournal(IntToStr(TileInfo.Statics[i].Tile) + ' + ' + IntToStr(ATiles[k]));
if (TileInfo.Statics[i].Tile = ATiles[k]) then
AddMinTile(TileInfo.Statics[i].Tile, TileInfo.Statics[i].x, TileInfo.Statics[i].y);
end;
end;
AddToSystemJournal(IntToStr(Length(MinTiles)));
end;
procedure MinOnTile(Idx : Integer);
var
i, k, z : Integer;
msgFizzle, msgEnd : String;
cTime : TDateTime;
begin
msgFizzle := 'put it in | loosen some rocks| hack| chop ';
msgEnd := 'is nothing|is no metal|cannot be seen| too far| mining in rock| cannot mine| no line| reach| not to mine|Try mining| not enough ';
//AddToSystemJournal(IntToStr(MinTiles[Idx].x) + ' ' + IntToStr(MinTiles[Idx].y));
if Dist(GetX(self), GetY(self), MinTiles[Idx].x, MinTiles[Idx].y) > 1 then
NewMoveXY(MinTiles[Idx].x, MinTiles[Idx].y, true, 1, true);
for k := 0 to 4 do
begin
if ObjAtLayer($02) = 0 then
begin
Equip(LhandLayer, FindType($0F43, Backpack));
Wait(1000);
end;
//CancelTarget;
if Weight > (MaxWeight-20) then
Unload;
if Dead then OnDeath;
if WarMode then SetWarMode(False);
if UseType($0F43, $FFFF) = 0 then
UseType($0F43, $FFFF);
CheckLag(30000);
if not WaitForTarget(3000) then
begin
ClientPrint('No pickaxes or shovels found...');
Unload;
exit;
end
else
begin
cTime := Now;
z := GetZ(self);
//AddToSystemJournal(IntToStr(MinTiles[Idx].Tile) + ' ' + IntToStr(MinTiles[Idx].x) + ' ' + IntToStr(MinTiles[Idx].y) + ' ' + IntToStr(z));
TargetToTile(MinTiles[Idx].Tile, MinTiles[Idx].x, MinTiles[Idx].y, z);
for i := 0 to 70 do
begin
Wait(100);
CheckLag(30000);
if (InJournalBetweenTimes(msgFizzle, cTime, Now) <> -1) then break;
if (InJournalBetweenTimes(msgEnd, cTime, Now) <> -1) then exit;
end;
end;
end;
ClientPrint('Tile finished.');
end;
begin
//SetEventProc(evUnicodeSpeech, 'OnSpeech');
SetEventProc(evIncomingGump, 'OnDeathGump');
IgnoreReset;
MoveOpenDoor := True;
SetConfig(GetName(Self));
InitHealerPoints(GetName(Self));
Unload;
while true do
for spotscount := 0 to 2 do
begin
NewMoveXY(Spots[spotscount].x, Spots[spotscount].y, true, 1, true);
SetLength(MinTiles, 0);
GetTilesToFarm;
for currIndex := 0 to Length(MinTiles)-1 do
MinOnTile(currIndex);
end;
end.
P.S. По 25$ за штуку на кошелек - Z240260777396