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

Auto Champion Killer - for crowd of chars [Inceptum]

Only working scripts
Post Reply
Nefrid
Posts: 4
Joined: 01.07.2014 0:32

Auto Champion Killer - for crowd of chars [Inceptum]

Post by Nefrid »

Всем привет, впервые выкладываю своё творчество, т.к. подзабил в очередной раз на УО.

Краткая суть:
Бегаете одним чаром, за Вами на прицепе толпа ботов, которая уничтожает всё, что не друзья.

Подробности:
Вам понадобится 1+N персонажей, где 1=Ваш основной чар, N=боты-прицепы, количество можно увеличивать до бесконечности.
К основному персонажу никаких требований нет, хоть гостом гонять. С ботами хуже: правильная раскачка, правильная одёжка, а именно: обязательно Necromancy, Spirit Speak, Magery; очень желательно фулл-лрк и резисты по 70. Дальше - по желанию, но очевидно, что чем больше у чаров ХП, лмк, сди, манарегена - тем неубиваемей становится система.
Автоматически принимает воскрешение (будьте осторожны, чтобы Вас не ресскиллили);
Автоматически запоминает во что одет персонаж при запуске скрипта (по айдишнику объекта в NeckLayer) и после воскрешения одевается;
Автоматически находит Slayer - книги в паке и одевает при убийстве соответствующего босса;
Автоматом выкашивает врагов в заданном радиусе: если врагов более 1, то использует Wither, если враг 1 - проверяет, нет ли особых указаний (надеть слеер/кастовать спелл и тд).
Автолечилка друг-друга (FindSomeOneToHeal), работает следующим образом:

Code: Select all

if (self = CharIDOne) or (self = CharIDTwo) then
два персонажа начинают лечить, если HP<23 (помним, у чара максимум 25хп), третий подключается, если меньше 20, все кидаются хилить, если хп меньше 15.
Сам прыгает в Wraith Form, вызывает Shadow Wisp.
Автоприём группы от ведущего чара (CheckParty).
Чат-команды (CheckParty):
cbol - очищает список непроходимых препятствий, особенно необходимо, если персонаж стоял парализованный во время попытки следования за ведущим;
drop trash - бросает на пол вещи из массива Trash;
drop loot - бросает на пол вещи из массива Loot;
step south/east/west/north - сделать шаг в направлении, удобно для захода/выхода из подземелий;
enter gate - подтвердить перемещение порталом (в основном в мир Фелюкка);
и др.

На боссе Medusa добавлен код для автовызова фей с помощью Spellweaving - не до конца оттестировано, но вроде работало.

Trash - массив типов мусора.
Loot - массив типов лута.
Friends - массив айдишников друзей.
Enemies - массив типов врагов (некоторые типы закомменчены, например Wraith - чтобы прицепы не реагировали друг на друга).

С уважением,
Nefrid Damodred
Code

Code: Select all

/// script by Nefrid Damodred
/// bot-driver for Inceptum shard (uogames.ru)
///

Program AutoChampion;
const

//Chars you want to remember
DiesIrae=$00189f2f;
Nefrid=$0002266E; //Nefrid Inceptum
IamMaestro=$001E65E5;
Elminster=$0006DB42;
Egoiste=$0002f902;
Disturbed=$0003f5d1;
Helin=$0002b3f4;
Flexfixxit=$0006dfb9;

//Main char to follow
CharToFollow=Nefrid;    //NefridDamodred 
CharToFollowName='Nefrid';

//Healers
CharIDOne=DiesIrae;
CharIDTwo=IamMaestro;
CharIDThree=Elminster;

                   
//Server-specific IDs
TravestyEntryCrate=$404E8149;     
TravestyDoorOne=$40029997;
StygianEntryGate=$4011bd5c;
ResurrectionGumpID=$B04C9A31;
IgnoredGumpID=$F22EE4C6;

//Distance to follow
FollowDistance=   2;
//Distance to find enemies
MobsFindDistance= 4;

SpellBook=$0EFA; 
PowerScrollType=$14F0; //power scroll  
TrashBarrelType=$0E77;            
var
CharToHealIndex:integer;
Friends:Array of Cardinal;
Enemies:Array of Word;
Trash,Loot:Array of Word;
i,enemiesCount:integer;
IsCasting:Boolean;
OneEnemy:Cardinal;
Following:Boolean;
Scrappers, RepondSlayer, DragonSlayer, UndeadSlayer, DemonSlayer, SpiderSlayer:Cardinal;

procedure SetSpellBooks;
var BookRec : TClilocRec;
var BookItemRec : TClilocItemRec;
var j,Count : Integer;
begin
    Count:=0;  
    UnEquip(RHandLayer); 
    Wait(600);      
    FindType(SpellBook, BackPack);
    Count:= FindCount;
    for i:=0 to Count do
        begin
            BookRec := GetToolTipRec(FindItem);
			for j := 0 to (Length(BookRec.Items)-1) do
				begin
			        BookItemRec := BookRec.Items[j]; 
                    //AddToSystemJournal(GetClilocByID(BookItemRec.ClilocID)); 
                    //AddToSystemJournal(IntToStr(pos('scrapper',LowerCase(GetClilocByID(BookItemRec.ClilocID)))));
					if (Scrappers=0) and (pos('scrapper',LowerCase(GetClilocByID(BookItemRec.ClilocID))) <> 0) then begin Scrappers:=FindItem; break; end;
                    if (RepondSlayer=0) and (LowerCase('Repond Slayer') = LowerCase(GetClilocByID(BookItemRec.ClilocID))) then begin RepondSlayer:=FindItem; break; end;
                    if (DragonSlayer=0) and (LowerCase('Dragon Slayer') = LowerCase(GetClilocByID(BookItemRec.ClilocID))) then begin DragonSlayer:=FindItem; break; end;
                    if (UndeadSlayer=0) and (LowerCase('Undead Slayer') = LowerCase(GetClilocByID(BookItemRec.ClilocID))) then begin UndeadSlayer:=FindItem; break; end;
                    if (DemonSlayer=0) and (LowerCase('Demon Slayer') = LowerCase(GetClilocByID(BookItemRec.ClilocID))) then begin DemonSlayer:=FindItem; break; end;                  
                    if (SpiderSlayer=0) and (LowerCase('Spider Slayer') = LowerCase(GetClilocByID(BookItemRec.ClilocID))) then begin SpiderSlayer:=FindItem; break; end;
                end;
            Ignore(FindItem);
            FindType(SpellBook, BackPack)                
        end;
    IgnoreReset();
    Equip(RHandLayer, Scrappers);
    Wait(600);
end;

procedure Heal(Pers:Cardinal);
begin          
if GetHP(Pers) < GetMaxHP(Pers)-2 then   
    begin
        IsCasting:=True;    
        if IsPoisoned(Pers) then 
            begin
                CancelTarget;
                CancelWaitTarget;
                Cast('Cure');
                WaitForTarget(500);
                if targetpresent then
                begin
                    TargetToObject(Pers);
                    IsCasting:=False;
                end;        
            end
        else
            begin
                CancelTarget;
                CancelWaitTarget;
                cast ('Heal');
                WaitForTarget(350);
                if targetpresent then
                    begin
                        TargetToObject(Pers); 
                        IsCasting:=False;
                    end;
            end;        
    end;
end;  

procedure DropTrash;
var 
i,j:Integer;
TrashBarrel:Cardinal;
ClilocRec : TClilocRec;
ClilocItemRec : TClilocItemRec;
begin
    FindDistance:=2;
    TrashBarrel:=FindType(TrashBarrelType, Ground); 
    DropDelay:=600;
    for i:=0 to Length(Trash)-1 do
        begin
            FindType(Trash[i], BackPack);
            while (FindCount > 0) do
                begin
                    if TrashBarrel<>0 then
                        begin
                           MoveItem(FindItem, FindCount, TrashBarrel,0,0,0);
                           Wait(600);
                        end
                    else
                        begin  
                            Drop(FindItem,FindCount,1,0,0);
                            Wait(600);
                        end;
                    FindType(Trash[i], BackPack);
                end;
            FindType(PowerScrollType, BackPack);
            while (FindCount > 0) do
                begin
                    ClilocRec := GetToolTipRec(FindItem);  
                    for j := 0 to (Length(ClilocRec.Items)-1) do
				        begin
			                ClilocItemRec := ClilocRec.Items[j];  
                            if (pos('wondrous',LowerCase(GetClilocByID(ClilocItemRec.ClilocID))) <> 0) then
                                begin 
                                    if TrashBarrel<>0 then
                                        begin
                                            MoveItem(FindItem, FindCount, TrashBarrel,0,0,0);
                                            Wait(600);
                                        end
                                    else
                                        begin
                                            Drop(FindItem,FindCount,1,0,0);
                                            Wait(600);                                            
                                        end;
                                    FindType(PowerScrollType, BackPack);
                                end
                            else
                                begin
                                    Ignore(FindItem);
                                end;
                            end;
                    FindType(PowerScrollType, BackPack);
                end;
        end;
        
    IgnoreReset();
    for i:=0 to Length(Friends)-1 do 
    begin
        Ignore(Friends[i]);
    end;
end;   

procedure DropLoot;
var 
i,j:Integer;
ClilocRec : TClilocRec;
ClilocItemRec : TClilocItemRec;
begin
    FindDistance:=2;
    DropDelay:=600;
    for i:=0 to Length(Loot)-1 do
        begin
            FindType(Loot[i], BackPack);
            while (FindCount > 0) do
                begin          
                    Drop(FindItem,FindCount,1,0,0);
                    Wait(600);
                    FindType(Loot[i], BackPack);
                end;
            FindType(PowerScrollType, BackPack);
            while (FindCount > 0) do
                begin
                    ClilocRec := GetToolTipRec(FindItem);  
                    for j := 0 to (Length(ClilocRec.Items)-1) do
				        begin
			                ClilocItemRec := ClilocRec.Items[j];  
                            if (pos('exalted',LowerCase(GetClilocByID(ClilocItemRec.ClilocID))) <> 0) or (pos('mythical',LowerCase(GetClilocByID(ClilocItemRec.ClilocID))) <> 0) or (pos('legendary',LowerCase(GetClilocByID(ClilocItemRec.ClilocID))) <> 0) then
                                begin
                                    Drop(FindItem,FindCount,1,0,0);
                                    Wait(600);                                            
                                    FindType(PowerScrollType, BackPack);
                                end
                            else
                                begin
                                    Ignore(FindItem);
                                end;
                            end;
                    FindType(PowerScrollType, BackPack);
                end;
        end;
        
    IgnoreReset();
    for i:=0 to Length(Friends)-1 do 
    begin
        Ignore(Friends[i]);
    end;
end;   

procedure CheckParty;
begin
    if (not InParty) and (InJournal('You see: '+CharToFollowName+'  : You are invited to join the party') <> -1) then
        begin
            PartyAcceptInvite;
            PartyCanLootMe(True);
            ClearJournal;  
        end;               
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: enter gate') <> -1) then
        begin
            for i:=0 to GetGumpsCount-1 do
                begin
                    if GetGumpID(i) = $DD8B146A then  
                        begin
                            NumGumpButton(i,1);
                        end;
                end;
            ClearJournal;  
        end;   
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: gate spirit') <> -1) then
        begin
            for i:=0 to GetGumpsCount-1 do
                begin
                    if GetGumpID(i) = $B8110C96 then  
                        begin  
                            NumGumpRadioButton(i, 106, 1);
                            NumGumpButton(i,1);
                        end;
                end;
            ClearJournal;  
        end; 
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: gate valor') <> -1) then
        begin
            for i:=0 to GetGumpsCount-1 do
                begin
                    if GetGumpID(i) = $B8110C96 then  
                        begin
                            NumGumpRadioButton(i, 107, 1);
                            NumGumpButton(i,1);
                        end;
                end;
            ClearJournal;  
        end;
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: gate port') <> -1) then
        begin
            for i:=0 to GetGumpsCount-1 do
                begin
                    if GetGumpID(i) = $B8110C96 then  
                        begin
                            NumGumpRadioButton(i, 500, 1);
                            NumGumpButton(i,1);
                        end;
                end;
            ClearJournal;  
        end; 
        if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: enter doom') <> -1) then
        begin
            for i:=0 to GetGumpsCount-1 do
                begin
                    if GetGumpID(i) = $40317BA4 then  
                        begin
                            //NumGumpRadioButton(i, 2, 1);
                            //NumGumpCheckBox(i,2,1);
                            NumGumpButton(i,1);
                        end;
                end;
            ClearJournal;  
        end;        
        if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: exit doom') <> -1) then
        begin
            for i:=0 to GetGumpsCount-1 do
                begin
                    if GetGumpID(i) = $52cc0e56 then  
                        begin
                            NumGumpButton(i,1);
                        end;
                end;
            ClearJournal;  
        end;  
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: enter peerless') <> -1) then
        begin
            for i:=0 to GetGumpsCount-1 do
                begin
                    if GetGumpID(i) = $D6A4F9E4 then  
                        begin
                            //NumGumpRadioButton(i, 2, 1);
                            //NumGumpCheckBox(i,2,1);
                            NumGumpButton(i,2);
                        end;
                end;
            ClearJournal;  
        end; 
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: exit peerless') <> -1) then
        begin
            for i:=0 to GetGumpsCount-1 do
                begin
                    if GetGumpID(i) = $361B782A then  
                        begin
                            //NumGumpRadioButton(i, 500, 1)
                            NumGumpButton(i,2);
                        end;
                end;
            ClearJournal;  
        end;            
//    if (InParty) and (InJournal('Nefrid Damodred: PartyChatMsg: enter travesty') <> -1) then
//        begin
//            UseObject(TravestyEntryCrate); 
//            ClearJournal; 
//        end;
//    if (InParty) and (InJournal('Nefrid Damodred: PartyChatMsg: enter travDoorOne') <> -1) then
//        begin
//            UseObject(TravestyDoorOne); 
//            ClearJournal; 
//        end;  
if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: enter stygian') <> -1) then
        begin
            UseObject(StygianEntryGate); 
            ClearJournal; 
        end;

//    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: group 2 stay') <> -1) then
//        begin
//            if (self=Dissector) or (self=WooWoo) then
//                begin
//                    Following:=False;
//                end;
//            ClearJournal; 
//        end;
//    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: group 2 come') <> -1) then
//        begin
//            if (self=Dissector) or (self=WooWoo) then
//                begin
//                    Following:=True;
//                end;
//            ClearJournal; 
//        end;
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: step east') <> -1) then
        begin
            Step(2,True);
            ClearJournal; 
        end;
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: step west') <> -1) then
        begin
            Step(6,True);
            ClearJournal; 
        end;
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: step south') <> -1) then
        begin
            Step(4,True);
            ClearJournal; 
        end;  
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: step north') <> -1) then
        begin
            Step(0,True);
            ClearJournal; 
        end;
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: cbol') <> -1) then
        begin
            ClearBadObjectList;
            ClearBadLocationList;
            ClearJournal; 
        end;
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: drop trash') <> -1) then
        begin
            DropTrash;
            ClearJournal; 
        end; 
    if (InParty) and (InJournal(CharToFollowName+': PartyChatMsg: drop loot') <> -1) then
        begin
            DropLoot;
            ClearJournal; 
        end;                              
end;

procedure CheckDress;
begin
    if (ObjAtLayer(NeckLayer) = 0) then//(not IsDressing) and 
        
        begin
            DressSpeed:=600;
            if (EquipDressSet() = True) then
                begin
                    //IsDressing:=False;
                end;
        end;
end;

procedure FindSomeOneToHeal;
var MinCharHP, CharDistance:Integer;
begin
    CharDistance:=-1;
    if (self = CharIDOne) or (self = CharIDTwo) then
        begin
            MinCharHP:=23;
        end
    else
        begin 
            if (self = CharIDThree) then 
                begin
                    MinCharHP:=20;    
                end
            else              
                begin
                    MinCharHP:=15;
                end;            
        end;
    for i:=0 to Length(Friends)-1 do begin
        if (Friends[i]=self) then 
            begin
                 if (GetHP(self)/(GetMaxHP(self)/25) < MinCharHP) then
                      begin
                        MinCharHP:=GetHP(Friends[i]);
                        //AddToSystemJournal('MinHP=' + IntToStr(MinCharHP)
                        //                    +' Pers:'+GetName(Friends[i]));         
                        CharToHealIndex:=i;
                      end;
            end
        else
            begin
                CharDistance:=GetDistance(Friends[i]);
                if (CharDistance > -1) and (CharDistance < 10) and
                (GetHP(Friends[i])>0) and (GetHP(Friends[i]) < MinCharHP) then  
                    begin
                        MinCharHP:=GetHP(Friends[i]);
                        //AddToSystemJournal('MinHP=' + IntToStr(MinCharHP)
                        //                    +' Pers:'+GetName(Friends[i])
                        //                    +' index:'+IntToStr(i)
                        //                    +' distance:'+IntToStr(GetDistance(Friends[i])));         
                        CharToHealIndex:=i;
                    end; 
            end;
    end;
end;

procedure SummonFamiliar;
begin
    for i:= 0 to GetGumpsCount-1 do 
        begin
            if IsGumpCanBeClosed(i) then
                CloseSimpleGump(i);
        end;
    WaitGump('2')
    Cast ('Summon Familiar');
end;

procedure CastFireball;
 begin
      if (not IsCasting) and (OneEnemy<>-1) then
           begin
                CancelTarget;
                CancelWaitTarget;  
                IsCasting:=True;                                 
                Cast('Fireball'); 
                WaitForTarget(500);
                if targetpresent then
                    begin
                        TargetToObject(OneEnemy);
                    end; 
                IsCasting:=False;  
           end;                        
 end; 
 
 procedure CastWordOfDeath;  
 begin
      if (not IsCasting) and (OneEnemy<>-1) then
           begin
                CancelTarget;
                CancelWaitTarget;  
                IsCasting:=True;                                 
                Cast('Word of Death'); 
                WaitForTarget(3500);
                if targetpresent then
                    begin
                        TargetToObject(OneEnemy);
                    end; 
                IsCasting:=False;  
           end;                        
 end;   
 
 procedure CastFlameStrike;
 begin
      if (not IsCasting) and (OneEnemy<>-1) then
           begin
                CancelTarget;
                CancelWaitTarget;  
                IsCasting:=True;                                 
                Cast('Flame Strike'); 
                WaitForTarget(3000);
                if targetpresent then
                    begin
                        TargetToObject(OneEnemy);
                    end; 
                IsCasting:=False;  
           end;                        
 end; 
 
 procedure CastHarm;
 begin
      if (not IsCasting) and (OneEnemy<>-1) then
           begin
                CancelTarget;
                CancelWaitTarget;  
                IsCasting:=True;                                 
                Cast('Harm'); 
                WaitForTarget(350);
                if targetpresent then
                    begin
                        TargetToObject(OneEnemy);
                    end; 
                IsCasting:=False;  
           end;                        
 end;      
     
procedure CastLightning;
 begin
      if (not IsCasting) and (OneEnemy<>-1) then
           begin
                CancelTarget;
                CancelWaitTarget;  
                IsCasting:=True;                                 
                Cast('Lightning'); 
                WaitForTarget(800);
                if targetpresent then
                    begin
                        TargetToObject(OneEnemy);
                    end; 
                IsCasting:=False;  
           end;                        
 end;  
 
procedure CastPoisonStrike;
 begin
      if (not IsCasting) and (OneEnemy<>-1) then
           begin
                CancelTarget;
                CancelWaitTarget;  
                IsCasting:=True;                                 
                Cast('Poison Strike'); 
                WaitForTarget(2000);
                if targetpresent then
                    begin
                        TargetToObject(OneEnemy);
                    end; 
                IsCasting:=False;  
           end;                        
 end;

procedure FindOneEnemy;
begin
    OneEnemy:=-1;
	//human female
    if (FindType($0191, Ground) <> 0) then
		begin
                     // if (GetName(Finditem)='NitroS') then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastFireball; exit; end;
            
			if (GetName(Finditem)='Neira') then begin if (RepondSlayer<>0) and (ObjAtLayer(RHandLayer)<>RepondSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, RepondSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;
			if (GetName(Finditem)='Cora') then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastHarm; exit; end;  
            
		end;
	//human male
	if (FindType($0190, Ground) <> 0) then
        begin 
            if (GetName(Finditem)='Barracoon') then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500);  Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastFireball; exit; end; 
            if (GetName(Finditem)='Adrian') then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastHarm; exit; end;
            if (GetName(Finditem)='Andros') then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastHarm; exit; end;           
        end;	
    if ((FindType($00AD, Ground) <> 0) and (GetName(Finditem)='Mephitis')) then begin if (SpiderSlayer<>0) and (ObjAtLayer(RHandLayer)<>SpiderSlayer) then begin Unequip(RHandLayer); Wait(500);  Equip(RHandLayer, SpiderSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end; 
    if ((FindType($00AC, Ground) <> 0) and (GetName(Finditem)='Rikktor')) then begin if (DragonSlayer<>0) and (ObjAtLayer(RHandLayer)<>DragonSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, DragonSlayer); end; OneEnemy:=Finditem; CastHarm; exit; end;
    if ((FindType($00AF, Ground) <> 0) and (GetName(Finditem)='Lord Oaks')) then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastFireball; exit; end;
    if ((FindType($00AE, Ground) <> 0) and (GetName(Finditem)='Semidar')) then begin if (DemonSlayer<>0) and (ObjAtLayer(RHandLayer)<>DemonSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, DemonSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;  
    if ((FindType($00F9, Ground) <> 0) and (GetName(Finditem)='Serado')) then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers);  end; OneEnemy:=Finditem; CastFireball; exit; end;
    
    if ((FindType($004C, Ground) <> 0) and (GetName(Finditem)='Corgul the Soulbinder')) then begin if (RepondSlayer<>0) and (ObjAtLayer(RHandLayer)<>RepondSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, RepondSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;
    if ((FindType($0092, Ground) <> 0) and (GetName(Finditem)='the harrower')) then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500);  Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastPoisonStrike; exit; end;                                                                                                                                          
    if ((FindType($030C, Ground) <> 0) and (GetName(Finditem)='the true harrower')) then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500);  Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastPoisonStrike; exit; end; 

    //peerless
    //Medusa
    if ((FindType($02D8, Ground) <> 0) and (GetName(Finditem)='Medusa')) then 
        begin 
            if (RepondSlayer<>0) and (ObjAtLayer(RHandLayer)<>RepondSlayer) then 
                begin 
                    Unequip(RHandLayer); Wait(500);  Equip(RHandLayer, RepondSlayer); 
                end; 
            OneEnemy:=Finditem; 
            if PetsCurrent <= 3 then
                begin
                    Cast('Summon Fey');
                    Wait(1500); 
                    CancelTarget;
                    CancelWaitTarget;
//                    if PetsCurrent > 4 then        
//                        begin
                            UoSay('All Kill');
                            WaitForTarget(1500); 
                            CheckLag(1000);
                            TargetToObject(OneEnemy);
//                        end;
                end
            else
                begin
                    if (GetHP(OneEnemy) > 5) or (Mana < 50) then begin CastFireball; end
                    else begin CastWordOfDeath; end;
                end;                            
            exit; 
        end; 
    if ((FindType($0101, Ground) <> 0) and (GetName(Finditem)='a Dread Horn')) then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastFireball; exit; end;
    if ((FindType($02DF, Ground) <> 0) and (GetName(Finditem)='Navrey Night-Eyes')) then begin if (SpiderSlayer<>0) and (ObjAtLayer(RHandLayer)<>SpiderSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, SpiderSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;
           
    //Stygian Abyss
    //The Slasher of Veils
    if (FindType($02E5, Ground) <> 0) then begin if (DemonSlayer<>0) and (ObjAtLayer(RHandLayer)<>DemonSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, DemonSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end; 
    //stygian dragon
    if (FindType($033A, Ground) <> 0) then begin if (DragonSlayer<>0) and (ObjAtLayer(RHandLayer)<>DragonSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, DragonSlayer); end; OneEnemy:=Finditem; CastLightning; exit; end; 
    //primeval lich
    if (FindType($033E, Ground) <> 0) then begin if (UndeadSlayer<>0) and (ObjAtLayer(RHandLayer)<>UndeadSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, UndeadSlayer); end; OneEnemy:=Finditem; CastHarm; exit; end;
    //minichamp
    if ((FindType($0080, Ground) <> 0) and (GetName(Finditem)='a pixie')) then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastPoisonStrike; exit; end;   
    //Tikitavi
    if ((FindType($002A, Ground) <> 0) and (GetName(Finditem)='Tikitavi')) then begin if (RepondSlayer<>0) and (ObjAtLayer(RHandLayer)<>RepondSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, RepondSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;
    //Vitavi (Lightning)
    if ((FindType($008F, Ground) <> 0) and (GetName(Finditem)='Vitavi')) then begin if (RepondSlayer<>0) and (ObjAtLayer(RHandLayer)<>RepondSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, RepondSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;  
    //ancient lich
    if ((FindType($004E, Ground) <> 0) and (GetName(Finditem)='ancient lich')) then begin if (UndeadSlayer<>0) and (ObjAtLayer(RHandLayer)<>UndeadSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, UndeadSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;
    //Wyvern
    if (FindType($003E, Ground) <> 0) then begin if (DragonSlayer<>0) and (ObjAtLayer(RHandLayer)<>DragonSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, DragonSlayer); end; OneEnemy:=Finditem; CastLightning; exit; end;     
    //devourer of souls
    if (FindType($012F, Ground) <> 0) then begin if (DemonSlayer<>0) and (ObjAtLayer(RHandLayer)<>DemonSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, DemonSlayer); end; OneEnemy:=Finditem; CastHarm; exit; end; 
            
    //Doom
    if ((FindType($0134, Ground) <> 0) and (GetName(Finditem)='a bone demon')) then begin if (DemonSlayer<>0) and (ObjAtLayer(RHandLayer)<>DemonSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, DemonSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;
    //dark father
    if (FindType($013E, Ground) <> 0) then begin if (DemonSlayer<>0) and (ObjAtLayer(RHandLayer)<>DemonSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, DemonSlayer); end; OneEnemy:=Finditem; CastFlameStrike; exit; end;
    //first room Darknight Creeper Fire & Physical
    if (FindType($0139, Ground) <> 0) then begin if (UndeadSlayer<>0) and (ObjAtLayer(RHandLayer)<>UndeadSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, UndeadSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;
//second room Fleshrenderer Cold & Fire
    if (FindType($013B, Ground) <> 0) then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastFireball; exit; end;   
    //third room Impaler Demon Fire & Poison
    if (FindType($0132, Ground) <> 0) then begin if (DemonSlayer<>0) and (ObjAtLayer(RHandLayer)<>DemonSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, DemonSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;   
   //fourth room Shadow Knight	 Undead	 Energy & Fire
   if (FindType($0137, Ground) <> 0) then begin if (UndeadSlayer<>0) and (ObjAtLayer(RHandLayer)<>UndeadSlayer) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, UndeadSlayer); end; OneEnemy:=Finditem; CastFireball; exit; end;  
   //fifth room Abyssmal Horror	 Demon	 Physical	 Fire & Energy
   if (FindType($0138, Ground) <> 0) then begin if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(Scrappers); Wait(500); Equip(RHandLayer, Scrappers); end; OneEnemy:=Finditem; CastHarm; exit; end;	
end;
 
 
procedure KillMobs;
begin
    FindDistance:=MobsFindDistance;
    for i:=0 to Length(Enemies)-1 do 
        begin
            FindType(Enemies[i], Ground);  
//            FindNotoriety(Enemies[i], 3);
//            enemiesCount:=enemiesCount+FindCount();  
//            FindNotoriety(Enemies[i], 6);  
            enemiesCount:=enemiesCount+FindCount();
        end;      
//	AddToSystemJournal('Enemies found:' + IntToStr(enemiesCount));
    
    if enemiesCount>1 then 
        begin       
            //AddToSystemJournal(IntToStr(enemiesCount));
            if (Scrappers<>0) and (ObjAtLayer(RHandLayer)<>Scrappers) then begin Unequip(RHandLayer); Wait(500); Equip(RHandLayer, Scrappers); end;
            Cast('Wither');
        end
    else
        if enemiesCount = 1 then
            begin
                FindOneEnemy;                               
            end;
end;

procedure AcceptResurrection;
begin
    for i:=0 to GetGumpsCount-1 do
        begin
            if GetGumpID(i) = ResurrectionGumpID then  
                begin
                    NumGumpButton(i,1);
                end;
        end;
end;

procedure CheckWraith;
begin
    if (GetType(self) <> $02EC) and (GetType(self) <> $02EB) and (Mana > 20) then
        begin
            Cast('Wraith Form');
            Wait(1500);
        end;
end;

begin

Friends:=[
Nefrid,
IamMaestro,
DiesIrae,
Elminster,
Egoiste,
Helin,
Disturbed,
Flexfixxit
//Marazm,
//Sunrise,
//JECTb
];

Enemies:=[
$0190, // human male

//Neira
$0191,  // human female
//$001A,  // spectre & wraith
$009A,  // mummy
$0099,  // bogle
$0039,  // bone knight
$0093,  // skeletal knight
$0094,  // skeletal & bone mage
$0018,  // lich  
$004F,  // lich lord
$0003,  // zombie
$009B,  // rotting corpse

$00AE,  //Semidar
//$004A,  // imp
$0027,  // greater mongbat
$001E,  // harpy
$0004,  // gargoyle
$0043,  // stone gargoyle
$0082,  // searing & burning gargoyle
$0009,  // demon
$0095,  // succubus

$00AC, //Rikktor
$0024,  // lizardman
$0034,  // snake
$00CE,  // lava lizard
$0055,  // ophidian justicar
$003D,  // drake
$003C,  // drake 2
$003E,  // wywern
$003B,  // dragon red
$000C,  // dragon gray
$0056,  // ophidian enforcer & warrior

$00AF,   //Lord Oaks
//$00A5,  // shadow wisp
//$0080,  // pixie
$003A,  // wisp
$0065,  // centaur 
$0067,  // serpentine dragon
$007B,  // ethereal
$0084,  // kirin
$007A,  // unicorn

//Barraccoon
$0033,  // slime
$00D7,  // giant rat
$0017,  // dire wolf
$002A,  // ratman
$0062,  // hell hound
$008F,  // ratman mage
$005C,  // silver serpent
$008E,   // ratman archer

$00AD,  //Mephitis
$0030,  // scorpion
$001C,  // giant spider
$0046,  // terathan warrior
$0047,  // terathan drone
$0048,  // terathan matriarch
$000B,  // dread spider
$0098,  // terathan avenger
$00A2,  // poison elemental

$00F9,  //Serado the Awakened
$00F2,  // deathwatch beetle & deathwatch beetle hatchling
$00F0,  // kappa
$00F3,  // lesser hiryu & hiryu
$00FB,  // revenant lion
$00F1,  // oni

$033e, //Primeval Lich
$02E4, //dream wraith
$0131, //gore fiend
$0136, //wight
$013D, //vampire bat
$0068, //skeletal drake
$0130, //flash golem

$004e, //ancient lich
$012f, //devourer of souls

$004C,  //Corgul the Soulbinder
$007C,  // corgul mage

$0092,  //the harrower
$030C,  //True Harrower

$02D8,  //Medusa
$0053,  //ogre lord
$02D2,  //undead guardian

$0026, //forgotten servant (lord of the abyss)

$033A, //stygian dragon

$0101,  //Dread Horn
//changeling
//$02EB,   //wraith female
$009D,   //Lady Lissith & Sabrix

$02DF, //Navrey Night-Eyes

$02E5, //The Slasher of Veils

//Doom
$0134, //bone daemon
$013E, //dark father
$0139, //1st room
$013B, //2nd room
$0132, //3rd room
$0137, //4th room
$0138 //5th room
];

Trash:=[
//$0E76 Color: $0AA1 //daily reward bag 
$12EE, //lava
$320D, //swamp
$346E, //water
$03AE, //pier
$3BB5, //ankh pendant

$2B0E, //gorget of honesty
$2B08, //breastplate of justice
$2B0C, //gauntlets of valor
$2B13, //sollerets of sacrifice
$2B06, //legs of honor
$2B10, //helm of spirituality
$2B0A, //arms of compassion

$1BC3, //lord blackthorn's exemplar
$1BC4, //sentinel's guard
$13F8, //jaana's staff
$13F4, //katrina's crook
$0F61, //dragon's end
$224E, //demon skull
$224F, //demon skull
$1F1F, //wind spirit [replica]
$2250, //demon skull
$20DA, //crocodile statue
$3BB6, //a map of the known world
$14EF, //scroll of transcendence
$2db6, //medusa blood
$40bc  //medusa statue
]; 

Loot:=[
$1AE1, //skull
$2684, //death shroud
$1401, //kryss (fang of ractus)
$0f52, //dagger (oblivion's needle)
$171b, //tricorne hat
$143e, //halberd
$1f03, //robe
$1f09, //ring
$13ff, //katana
$1541, //body sash
$170b, //boots
$0EC4, //skinning knife
$1086, //bracelet
$108a, //ring
$4213, //gargish earrings
$457e, //gargish wings
$2f5b, //Y-talisman
$26c2 //composite bow
];
Following:=True;
SetDress;
SetSpellBooks;
AddGumpIgnoreByID(IgnoredGumpID);
for i:=0 to Length(Friends)-1 do 
    begin
        Ignore(Friends[i]);
    end;
while Connected do
    begin
        //CheckLag(1000);
        enemiesCount:=0; 
        CharToHealIndex:=-1; 
        MoveThroughNPC:=0;  
        MoveOpenDoor:=True;
        CheckParty;
        if (Following) and (GetDistance(CharToFollow) > FollowDistance) and ((Stam > 5) or Dead) then
            begin
                newmovexy(GetX(CharToFollow),GetY(CharToFollow),true,1,true);
            end
        else 
            begin
                if not Dead then
                    begin 
                        CheckDress; 
                        CheckWraith;
                        FindSomeOneToHeal;
                        if CharToHealIndex<>-1 then
                            begin 
                                Heal(Friends[CharToHealIndex]);
                            end
                        else 
                            begin
                                if (Mana <= 20) and (PetsCurrent=0) then 
                                    begin
									//summons wisp, not relevant for most shards
									//feel free to comment SummonFamiliar func
									//especially if you have plenty of LMC
                                        SummonFamiliar; 
                                    end
                                else   
                                    begin
                                        KillMobs;
                                    end;
                            end;
                    end
                else
                    begin
                        AcceptResurrection;
                    end;
                Wait(100); 
            end; 
    end;
end.
Last edited by Nefrid on 03.04.2015 18:07, edited 1 time in total.
Image
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: Auto Champion Killer - for crowd of chars [Inceptum]

Post by drabadan »

хорош!

А разве гетнейм работает хорошо? Мб лучше там тултип парсить? А проверки на айди командира нету, а то вдруг чо?
MaskedPerson
Neophyte
Neophyte
Posts: 31
Joined: 14.03.2015 12:39

Re: Auto Champion Killer - for crowd of chars [Inceptum]

Post by MaskedPerson »

Лол, поехавшие люди (в хорошем смысле) :mrgreen: Молодец, отличный скрипт, ща сяду смотреть, что к чему.
Nefrid
Posts: 4
Joined: 01.07.2014 0:32

Re: Auto Champion Killer - for crowd of chars [Inceptum]

Post by Nefrid »

drabadan wrote: А разве гетнейм работает хорошо? Мб лучше там тултип парсить?
Помню-помню наши с тобой беседы на эту тему. :) Мб и лучше, но это - работало. Хз, насколько хорошо, замеров не проводил. :)
drabadan wrote:А проверки на айди командира нету, а то вдруг чо?
В патичате ник проверяется.
Image
Post Reply