Атака монстра)
Posted: 30.07.2008 10:54
Поделитесь простеньким скриптиком)) что бы чар просто стоял на месте и атачил монстра с определенным типом)
Code: Select all
Program killer;
var
monster : cardinal;
const
Monstr := $0000; // Тип монстра
Begin
repeat
begin
FindType(Monstr,ground);
If FindCount > 0 then
begin
monster := FindItem;
AddToSystemJournal('-= Монстр найден, атакую =-');
Attack(monster);
wait(5000);
end
Else
begin
AddToSystemJournal('-= Монстр не найден =-');
wait(5000);
end;
end;
until Dead;
End.
Code: Select all
procedure CowBojs;
var ic,ox,oy,o,w : integer;
CowBull: array [1..4] of word;
Corpse,Piles,Meat,Resourse,Dagger,Scission,trup,p : Word;
Weapon,Shield : word;
aTime : TDateTime;
begin // 0
CowBull[1]:=$00D8;// 216 cow black 8
CowBull[2]:=$00E7;// 231 cow brown
CowBull[3]:=$00E8;// 232 bull black 10*4(5)kg
CowBull[4]:=$00E9;// 233 bull brown
Corpse:=$2006;// 8198 Corpse cow or bull
Piles:=$1079;// 4217 Pile of Hides
Resourse:=$1081;// 4225 Cut Leather
Dagger:=$0F52; // cliloc# 0x6962 = What do you want to use this item on? 1010018
Scission:=$0F9F; // Scission 3999
Weapon:=$26BC; // Scepter 9916
Shield:=$1BC4; // Shield 7108
Meat:=$09F1; // Cut Raw Ribs 2545
if isWarMode(Self) = true Then SetWarMode(false);
addtosystemjournal('cowbojs');
CheckSave;
UseObject(BackPack);
wait(2000);
ignorereset;
Addtosystemjournal('Weapon '+IntToStr(GetType(ObjAtLayer(RhandLayer))));
Addtosystemjournal('Shield '+IntToStr(GetType(ObjAtLayer(LhandLayer))));
While GetType(ObjAtLayer(RhandLayer)) <> Weapon Do
begin
unequip(RhandLayer);
CheckSave;
wait(500);
if GetType(ObjAtLayer(RhandLayer)) = 0 then
begin
equipt(RhandLayer,Weapon);
CheckSave;
end;
end;
While GetType(ObjAtLayer(LhandLayer)) <> Shield Do
begin
unequip(LhandLayer);
CheckSave;
wait(500);
if GetType(ObjAtLayer(LhandLayer)) = 0 then
begin
equipt(LhandLayer,Shield);
CheckSave;
end;
end;
FindDistance := 10;
For ic:=1 To 4 Do
begin
FindType(CowBull[ic],ground);
Addtosystemjournal(IntToStr(FindCount));
ox := 0;
oy := 0;
While (FindCount > 0) Do
begin // 1
Addtosystemjournal('Где же Мясо??? '+IntToStr(FindCount));
FindDistance := 1;
While (FindDistance <= 10) do
begin // 2
FindType(CowBull[ic],ground);
If (FindCount > 0) Then Addtosystemjournal('Мияссо '+IntToStr(FindCount));
wait(100);
o := FindItem;
CheckSave;
If o > 0 Then
begin // 3
w := Weight;
wait(1000);
Addtosystemjournal('Мияссо 1 '+IntToStr(o)+' | x '+IntToStr(ox)+' | y '+IntToStr(oy)+' | d '+IntToStr(GetDistance(o)));
// Addtosystemjournal('Овца 1 type '+IntToStr(GetType(o)));
While (GetDistance(o) >= 0) and (w = Weight) Do
begin // 4
ox := GetX(o);
oy := GetY(o);
GotoXY2(ox,oy,1,true);
wait(500);
If (GetDistance(o) <= 2) Then
begin // 5
CheckSave;
repeat
If TargetPresent Then CancelTarget;
Addtosystemjournal('o '+IntToStr(o));
Addtosystemjournal('ot '+IntToStr(GetType(o)));
Attack(o);
wait(500);
Addtosystemjournal('oo '+IntToStr(o));
Addtosystemjournal('oot '+IntToStr(GetType(o)));
until (GetType(o) = 0) or (GetDistance(o) > 2);
ignore(o);
CheckSave;
repeat
FindDistance := 2;
trup:=FindType(Corpse,Ground);
Addtosystemjournal('trup '+IntToStr(trup));
If TargetPresent Then CancelTarget;
UseObject(FindType(Dagger,BackPack));
// UseType(Dagger,$FFFF);
Addtosystemjournal('dagger '+IntToStr(FindType(Dagger,BackPack)));
Addtosystemjournal('daggert '+IntToStr(GetType(FindType(Dagger,BackPack))));
WaitForTarget(3000);
If TargetPresent Then
begin
TargetToObject(FindType(Corpse,Ground));
Addtosystemjournal('fi '+IntToStr(FindType(Corpse,Ground)));
Addtosystemjournal('fit '+IntToStr(GetType(FindType(Corpse,Ground))));
end;
UseObject(FindItem);
wait(1500);
// UOSay('.opencorpse');
FindTypeEx(Piles,$FFFF,p,True);
Addtosystemjournal('p '+IntToStr(FindItem));
Addtosystemjournal('pt '+IntToStr(GetType(FindItem)));
// Addtosystemjournal('Piles '+IntToStr(Piles));
Grab(FindItem,0);
until (w < Weight) or (trup <= 0) or (GetType(FindItem) = 0);
wait(1000);
w := Weight;
wait(1000);
CheckSave;
repeat
wait(1000);
FindTypeEx(Meat,$FFFF,p,True);
Grab(FindItem,0);
until (w < Weight) or (trup <= 0) or (GetType(FindItem) = 0);
ignore(trup);
CheckSave;
While (Weight >= 310) Do
begin
UseObject(BackPack);
wait(1500);
If TargetPresent Then CancelTarget;
UseObject(FindType(Scission,BackPack));
WaitTargetType(Piles);
wait(500);
end;
end; // 5
end; // 4
FindDistance := 0;
o := 0;
end; // 3
FindDistance := FindDistance + 1;
wait(500);
end; // 2
wait(1000);
FindType(CowBull[ic],ground);
end; // 1
end; // For
CheckSave;
While (count(Piles) > 0) Do
begin
UseObject(BackPack);
wait(1500);
If TargetPresent Then CancelTarget;
UseObject(FindType(Scission,BackPack));
WaitTargetType(Piles);
wait(1000);
if isWarMode(Self) = true Then SetWarMode(false);
end;
end; // 0
Вызов ходилки в процедуре есть, так что ходить долженproZak wrote:много непонятного в процедуре мнебы скриптик какоито де ета процедура задействована яб проанализировал шо к чему - а то допустим как он будет бегать без (без ходилки) и тд.
-=JoKeR=- wrote:Пора бы уже такие скрипты самому(самой) писать...но вообще описанных тобою условий не хватает для написания нормального скрипта, ведь нужно же атаковать до определённого момента(условия)...Code: Select all
Program killer; var monster : cardinal; const Monstr := $0000; // Тип монстра Begin repeat begin FindType(Monstr,ground); If FindCount > 0 then begin monster := FindItem; AddToSystemJournal('-= Монстр найден, атакую =-'); Attack(monster); wait(5000); end Else begin AddToSystemJournal('-= Монстр не найден =-'); wait(5000); end; end; until Dead; End.
Если то... Если это...
Code: Select all
Program killer;
const
Monstr = $0000; // Тип монстра
Begin
repeat
begin
FindType(Monstr,ground);
If FindCount > 0 then
begin
monster := FindItem;
AddToSystemJournal('-= Монстр найден, атакую =-');
Attack(monster);
wait(5000);
end
Else
begin
AddToSystemJournal('-= Монстр не найден =-');
wait(5000);
end;
end;
until Dead;
End.
Code: Select all
Program killer;
var monster : Cardinal;
const
Monstr = $0000; // Тип монстра
Begin
repeat
begin
FindType(Monstr,ground);
If FindCount > 0 then
begin
monster := FindItem;
AddToSystemJournal('-= Монстр найден, атакую =-');
Attack(monster);
wait(5000);
end
Else
begin
AddToSystemJournal('-= Монстр не найден =-');
wait(5000);
end;
end;
until Dead;
End.