Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

ПВМ

Only working scripts
Post Reply
Tiger89
Novice
Novice
Posts: 131
Joined: 28.11.2008 17:32

ПВМ

Post by Tiger89 »

Кто нибудь делал такой скрипт? поделитесь опытом советами?
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: ПВМ

Post by nah nah »

делал, но крашит постоянно на питоне

хм... советы не знаю скрипт отправляю тебе в личку
Tiger89
Novice
Novice
Posts: 131
Joined: 28.11.2008 17:32

Re: ПВМ

Post by Tiger89 »

Спасибо.
Скрипт будь здоров по размерам, жаль питон не изучал ещё, у нас на сервере есть мобы разных типов: это которых надо бить впритык, которых не стоит подпускать к себе, и стрелять из лука на дистанции. С этим что нибудь делал?
nah nah
Developer
Developer
Posts: 414
Joined: 13.07.2011 11:23
Contact:

Re: ПВМ

Post by nah nah »

нет. только мили. питон крашит часто
chernysh
Novice
Novice
Posts: 61
Joined: 05.06.2011 14:54
Location: Ukraine

Re: ПВМ

Post by chernysh »

Да питон вообще крашит, не только на автопвм. С потоками проблема...
Tiger89
Novice
Novice
Posts: 131
Joined: 28.11.2008 17:32

Re: ПВМ

Post by Tiger89 »

Кто может помочь с разработкой? идея такова:
Сканируем местность вокруг персонажа на расстоянии 24 тайла, далее находим все опасные объекты, и держимся от них на безопасном расстоянии, при этом начинаем шмалять из лука в самого ближнего.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: ПВМ

Post by Vizit0r »

проблема-то в чем? ищешь, проверяешь на тип, попутно берешь дистанцию, мобайлов с самой короткой дистанцией атакуешь.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Tiger89
Novice
Novice
Posts: 131
Joined: 28.11.2008 17:32

Re: ПВМ

Post by Tiger89 »

тут наверное надо юзать ивент который срабатывает каждые 100мс, и кстати расчитать точку обстрела LOS тоже не просто)
Voodoo
Posts: 3
Joined: 29.11.2012 20:12

Re: ПВМ

Post by Voodoo »

давно когдато написал такой скрипт, ходи выносил данж, на лодке одевал броню пухи и т д бинты, рубил драконов, резал их собирал всё ценное и межники и сортировал по разным сумкам на лодке, одним словом шик. Но дорабатывал его недели три чтоб без косяков всё было, иногда перс гонялся и за теми , кто хотел его с макроса снять и их валил и лутил.
aalexx
Novice
Novice
Posts: 69
Joined: 06.02.2012 20:43
Location: Латвия\Англия
Contact:

Re: ПВМ

Post by aalexx »

Когда-то.. А сейчас этот скрипт у тебя ещё есть ?
Voodoo
Posts: 3
Joined: 29.11.2012 20:12

Re: ПВМ

Post by Voodoo »

Нашёл ещё раннюю бета версию, может будет интересно, пошарю если найду финальную то и ее выложу

Code: Select all

program serpent_automat;

var
enemy,corpse,i,CorpseCount,EnemyCount: Integer;

const
Point1X = 869;
Point1Y = 1680;
Point2X = 863;
Point2Y = 1687;
Point3X = 858;
Point3Y = 1695;
Point4X = 858;
Point4Y = 1688;
Point5X = 860;
Point5Y = 1684;
Point6X = 855;
Point6Y = 1687;
Point7X = 850;
Point7Y = 1684;
Point8X = 848;
Point8Y = 1680;

Point9X = 848;
Point9Y = 1686;

Point10X = 843;
Point10Y = 1689;

Point11X = 842;
Point11Y = 1693;

Point12X = 852;
Point12Y = 1690;

Point13X = 857;
Point13Y = 1680;

Point14X = 864;
Point14Y = 1687;

Point15X = 868;
Point15Y = 1686;

ResX = 1857;
ResY = 875;
EnemyType = $0190;
EnemyType2 = $0191;
CorpesType = $2006;
WeaponType = $1401;
ShielType = $1B76;
BandageType = $0E21;
BloodBandageType = $0E20;
SerpentType = $0EED;
DaggerType = $0F51;
Trap = $6F2B1059;
NearX = 1832;
NearY = 796;
LodkaZ = -2;
LodkaX = 1824;
LodkaY = 796;

{$Include 'all.inc'}

procedure fullheal;
begin
If TargetPresent Then CancelTarget;
if (GetHP(self) < MaxHP) then
  begin
  SetGlobal('stealth','TestVar4','Heal');
  repeat
  WaitTargetSelf;
  UseObject(FindType(BandageType,BackPack));
  Wait(1000);
  until (GetHP(self) = MaxHP);
  end;
//if (Count(BloodBandageType) > 0) then stack(BloodBandageType,$0000);
end;

procedure checkbandages;
begin
FindType(BandageType,BackPack);
if (FindQuantity < 25) then
  begin
  FindType(BandageType,Ground);
  Addtosystemjournal('Бинтов на лодке осталось всего - '+intToStr(findfullquantity)+'. Берём ещё немного в пак.');
  MoveItem(Finditem,150,Backpack,0,0,0);
  Wait(500);
  end;
end;

procedure checkequip;
begin
if (GetType(ObjAtLayer(RhandLayer)) <> WeaponType) then
  begin
  FindType(WeaponType,Ground);
  if (Findcount > 0) then
    begin
    equip(RhandLayer, Finditem);
    Addtosystemjournal('Пушек в запасе осталось - '+intToStr(findfullquantity-1));
    Wait(500);
    end;
  end;
if (GetType(ObjAtLayer(LhandLayer)) <> ShielType) then
  begin
  FindType(ShielType,Ground);
  if (Findcount > 0) then
    begin
    equip(LhandLayer, Finditem);
    Addtosystemjournal('Щитов в запасе осталось - '+intToStr(findfullquantity-1));
    Wait(500);
    end;
  end;
end;

procedure checkcoord;
begin
if (GetZ(self) = LodkaZ) then
  begin
  repeat
  MoveXY(LodkaX,LodkaY, True, 0, True);
  UseObject(Trap);
  Raw_Move(2,True);
  wait(500);
  Raw_Move(2,True);
  wait(500);
  until (GetZ(self) <> LodkaZ);
  end;
end;

procedure GotoOnBoad;
begin
if not Dead then
  begin
  MoveXY(NearX,NearY, False, 0, True);
  If TargetPresent Then CancelTarget;
  repeat
  UseObject(Trap);
  wait(1000);
  until (GetZ(self) = LodkaZ);
  if (Count(SerpentType) > 0) then stack(SerpentType,$0000);
  FindType(SerpentType,Ground);
  Addtosystemjournal('Чешуи насобирали - '+intToStr(findfullquantity));
  Hungry(1,ground);
  checkbandages;
  checkequip;
  checkcoord;
  end;
end;

procedure checkcorpes;
begin
SetGlobal('stealth','TestVar4','CkCorpse');
if not Dead then
  begin
  If TargetPresent Then CancelTarget;
  if (CountGround(CorpesType) > 0) then
    begin
    repeat
    FindType(CorpesType,Ground);
    corpse:=Finditem;
    SetGlobal('stealth','TestVar5','CorpseGround '+IntToStr(FindCount));
    SetGlobal('stealth','TestVar1','Loot Х:'+IntToStr(GetX(corpse))+' Y:'+IntToStr(GetY(corpse)));
    NewMoveXY(GetX(corpse),GetY(corpse), True, 0, True);
    //WaitTargetObject(corpse);
    //UseObject(FindType(DaggerType,Backpack));
    //WaitJournalLine(Now, 'You plase|You cannot', 3000);
    FindType(SerpentType,corpse);
    if (Findcount > 0 ) then MoveItem(Finditem,FindQuantity,Backpack,0,0,0);
    Wait(500); 
    Ignore(corpse);
    CorpseCount := CorpseCount + 1;
    SetGlobal('stealth','TestVar3','Corpse looted: '+IntToStr(CorpseCount));
    until (CountGround(CorpesType) = 0)
    end;
  end;
end;

procedure checkall;
begin
if (GetType(ObjAtLayer(RhandLayer)) <> WeaponType) then GotoOnBoad;
if (GetType(ObjAtLayer(LhandLayer)) <> ShielType) then GotoOnBoad;
if (Count(SerpentType) > 30) then GotoOnBoad;
if (Count(SerpentType) > 30) then GotoOnBoad;
if (Count(BandageType) < 25) then GotoOnBoad;
end;

procedure killenemy;
begin
FindDistance:=10;
repeat
FindType(EnemyType,Ground);
SetGlobal('stealth','TestVar5','Men found: '+IntToStr(FindCount));
if (Findcount > 0) then
  begin
  SetGlobal('stealth','TestVar4','Go Kill Men');
  Attack(Finditem);
  EnemyCount := EnemyCount + 1;
    SetGlobal('stealth','TestVar2','Enemy Atatcked: '+IntToStr(EnemyCount));
  enemy:=WarTargetID
  NewMoveXY(GetX(enemy),GetY(enemy), True, 1, True);
  SetGlobal('stealth','TestVar1','Attack Х:'+IntToStr(GetX(enemy))+' Y:'+IntToStr(GetY(enemy)));
  Wait(500);
  WaitJournalLine(Now, 'You see', 5000);
  checkcorpes;
  fullheal;
//  checkall;
  end;
until (FindType(EnemyType,Ground) = 0);

repeat
FindType(EnemyType2,Ground);
SetGlobal('stealth','TestVar5','Women found: '+IntToStr(FindCount));
if (Findcount > 0) then
  begin
  SetGlobal('stealth','TestVar4','Go Kill Women');
  Attack(Finditem);
  EnemyCount := EnemyCount + 1;
    SetGlobal('stealth','TestVar2','Enemy Atatcked: '+IntToStr(EnemyCount));
  enemy:=WarTargetID
  NewMoveXY(GetX(enemy),GetY(enemy), True, 1, True);
  SetGlobal('stealth','TestVar1','Attack Х:'+IntToStr(GetX(enemy))+' Y:'+IntToStr(GetY(enemy)));
  Wait(500);
  WaitJournalLine(Now, 'You see', 5000);
  checkcorpes;
  fullheal;
//  checkall;
  end;
until (FindType(EnemyType2,Ground) = 0);
end;

procedure checkhp;
begin
if Dead then
  begin
  MoveXY(ResX,ResY, True, 0, True);
  repeat
  Wait(3000);
  until (GetHP(self) = 50);
//  checkall;
  end;
end;

Begin
SetARStatus(True);
Addtosystemjournal('Понаехали тут .. Go!!! ');
SetGlobal('stealth','TestVar1','-Cleared-');
SetGlobal('stealth','TestVar2','-Cleared-');
SetGlobal('stealth','TestVar3','-Cleared-');
SetGlobal('stealth','TestVar4','-Cleared-');
SetGlobal('stealth','TestVar5','-Cleared-');
CorpseCount :=0;
EnemyCount :=0;
while true do
 begin
 IgnoreReset;
 Ignore(self);
 for i := 0 to 5 do 
  begin 
  ClearJournal;
  checkhp;
  Hungry(1,backpack); 
//  checkall;

  AddToSystemJournal('Осталось бандаг: ' + IntToStr(Count($0E21)));

  AddToSystemJournal('Осталось еды: ' + IntToStr(Count($097B)));
  SetGlobal('stealth','TestVar4','Move');    
  NewMoveXY(Point1X,Point1Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 1 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point2X,Point2Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 2 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point3X,Point3Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 3 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point4X,Point4Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 4 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point5X,Point5Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 5 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point6X,Point6Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 6 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point7X,Point7Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 7 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point8X,Point8Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 8 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point9X,Point9Y, True, 0, True);
  killenemy;
  Wait(500);
  SetGlobal('stealth','TestVar4','Move');
  Addtosystemjournal('Точка 9 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  NewMoveXY(Point10X,Point10Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 10 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point11X,Point11Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 11 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point12X,Point12Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 12 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point13X,Point13Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 13 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point14X,Point14Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 14 проидена... Gold в паке: ' + FloatToStr(GOLD));
  checkhp;
  SetGlobal('stealth','TestVar4','Move');
  NewMoveXY(Point15X,Point15Y, True, 0, True);
  killenemy;
  Wait(500);
  Addtosystemjournal('Точка 15 проидена... Gold в паке: ' + FloatToStr(GOLD));
  
  end;
 end;
End.
Enkidoo
Neophyte
Neophyte
Posts: 26
Joined: 22.08.2012 15:58

Re: ПВМ

Post by Enkidoo »

С какого шарда? Есть скрипт на мили мобов под варриора, для лучника сложно сделать процедуру отбегания...
Post Reply