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

Meditation (DRW)

тут можно задать вопрос по скриптингу
Post Reply
Maruk
Neophyte
Neophyte
Posts: 19
Joined: 05.11.2009 2:24

Meditation (DRW)

Post by Maruk »

Искал долго, но не нашел нормально работающего.
Что нужно от скрипта: одел курсу инта упала, снял курсу и медетирует.
Заранее спасибо!
Last edited by Maruk on 13.11.2009 19:55, edited 1 time in total.
WladL
Apprentice
Apprentice
Posts: 240
Joined: 27.07.2009 17:21
Location: DRW
Contact:

Post by WladL »

Code: Select all

program Meditation;
{$Include 'all.inc'}

//===========================
//	Crafted by WladL version 1.2 
//---------------------------
{
Прокачка медитации и хилинга на курсе
Есть возможность прокачивать отдельно медитацию и отдельно хилинг.
Время ожидания в курсе регулируется:
1)При включенной медитации  переменной  ManaDown.
2)При выключенной медитации и включенном хилинге переменной HPDown.
3)При включенных обоих скиллах переменной ManaDown.  
}
type Rec_clothes = Record 
	clothes_L : Byte;		// ID слоя (Не трогать!)
	clothes_T : Cardinal;		// Тип Вашей шмотки 
end;

var 
i,MyInt,MyHp,EquipDelay,ManaDown,HpDown:Integer;
clothes_A : array [0..12] of Rec_clothes;
DoHealing,DoMeditation:Boolean;
Rnd:Integer;

procedure Healing;
var
Water:Cardinal;
begin 
 if Count($0E21)=0 then begin 
	AddToSystemJournal('No bandages, Healing set OFF...');
	DoHealing:=false;
	exit;
 end;
 AddToSystemJournal('Healing...');
 while (HP<MaxHP) and (Count($0E21)>0)do begin 
	WaitTargetSelf;
	UseObject(FindType($0E21,backpack));
	wait(1000); 
	WaitJournalLine(now,'bloody|barely|healing or',70000);
 end;
 Water:=FindType($1008,backpack);
 if (Water=0) then exit;
 while (FindType($0E20,backpack)>0) do begin 
	TargetToObject(Water);
	UseObject(FindItem);
	CheckSave;
	wait(1000);
 end;
 DoHealing:=Count($0E21)>0;
end;

begin
//init vars
DoHealing:=true;		//если поставить false, то хиляться не будет.
DoMeditation:=true;		//если поставить false, то медитировать не будет.
EquipDelay:=700;		//Задержка между одеванием\сниманием кусовых предметов
ManaDown:=20;			//На сколько опускать ману перед началом медитации 
HPDown:=20;			//На сколько опускать жизни перед началом хилинга(работает только при выключенной медитации) 

Rnd:=0;
AddToSystemJournal('Starting Meditation script at  : '+DateTimeToStr(Now)); 
  
//disconnect events
if not GetARStatus then SetARStatus(true);
// !!! Для стелса версия у которого ниже чем (v-1.0.9  build-20 от 05.09.2009) следующая команда работать не будет. Строку удалить или закомментить.
if not GetPauseScriptOnDisconnectStatus then SetPauseScriptOnDisconnectStatus(true);

	//Fill array
	AddToSystemJournal('Fill curse array...');
	clothes_A[0].clothes_L := RhandLayer; 
	clothes_A[0].clothes_T := $0E85;    //если предмет не используется в clothes_T поставить 0, иначе вписать тип своего предмета
	clothes_A[1].clothes_L := ShoesLayer;
	clothes_A[1].clothes_T := $170B; 
	clothes_A[2].clothes_L := PantsLayer; 
	clothes_A[2].clothes_T := $1539; 
	clothes_A[3].clothes_L := ShirtLayer;
	clothes_A[3].clothes_T := $1EFD; 
	clothes_A[4].clothes_L := HatLayer; 
	clothes_A[4].clothes_T := $171C; 
	clothes_A[5].clothes_L := GlovesLayer;
	clothes_A[5].clothes_T := $13C6; 
	clothes_A[6].clothes_L := NeckLayer; 
	clothes_A[6].clothes_T := $13C7; 
	clothes_A[7].clothes_L := WaistLayer;
	clothes_A[7].clothes_T := $153B; 
	clothes_A[8].clothes_L := TorsoLayer;
	clothes_A[8].clothes_T := $13CC; 
	clothes_A[9].clothes_L := TorsoHLayer; 
	clothes_A[9].clothes_T := $1541; 
	clothes_A[10].clothes_L := ArmsLayer;
	clothes_A[10].clothes_T := $13C5; 
	clothes_A[11].clothes_L := CloakLayer;
	clothes_A[11].clothes_T := $1515; 
	clothes_A[12].clothes_L := RobeLayer;
	clothes_A[12].clothes_T := $1F03;

AddToSystemJournal('Unequip any items...');
for i := 0 to 12 do begin 
	if (ObjAtLayer(clothes_A[i].clothes_L) > 0) then begin
		unequip(clothes_A[i].clothes_L);
		wait(700);
		Checksave;
	end;
end;
MyInt:=Int;
MyHP:=Str;
while (not dead) and (GetSkillValue('Meditation')<100) do begin
	if (not doMeditation) AND (not DoHealing) then begin
		AddToSystemJournal('Healing And Meditation is Turned Off, exit...');
		break;
	end;
		//Check_Hungry;
		inc(Rnd);
		AddToSystemJournal('Equip curse...( '+IntToStr(Rnd)+' )');
		for i := 0 to 12 do begin 
			if (clothes_A[i].clothes_T > 0) then begin
				UseObject(Findtype(clothes_A[i].clothes_T,backpack));
				wait(EquipDelay);
				Checksave;
				if (i=0) then CancelTarget;
			end;
		end;

		if (DoMeditation) then begin 
			AddToSystemJournal('Wait mana down to '+IntToSTR(MyInt-ManaDown));
			while (Mana > MyInt-ManaDown) do wait(1000);
		end else if (DoHealing) then begin
			AddToSystemJournal('Wait life down to '+IntToSTR(MyHP-HPDown));
			while (HP > MyHP-HPDown) do wait(1000);
		end;
		
		AddToSystemJournal('Unequip curse...');
		for i := 0 to 12 do begin
			if (clothes_A[i].clothes_T > 0) then begin
				unequip(clothes_A[i].clothes_L);
				wait(EquipDelay);
				Checksave;
			end;
		end;
		//**** DoMeditation ****
		if (DoMeditation) then begin
			AddToSystemJournal('Meditation...');
			repeat
				UseSkill('Meditation');
				Wait(2000);Checksave;
			until (Mana >= INT) ;
			wait(500);
		end;
		//**** DoHealing ****
		if (Life<MaxLife) And DoHealing then healing;
		if (MyInt<>Int) then MyInt:=Int;
		if (MyHP<>STR) then MyHP:=STR;
end;
end.
Last edited by WladL on 30.12.2009 0:02, edited 11 times in total.
"Как хочешь ты трудись;
Но приобресть не льстись
Ни благодарности, ни славы,
Коль нет в твоих трудах ни пользы, ни забавы. (с) С.Крылов."
Maruk
Neophyte
Neophyte
Posts: 19
Joined: 05.11.2009 2:24

Post by Maruk »

большое спасибо, щас буду тестить
Maruk
Neophyte
Neophyte
Posts: 19
Joined: 05.11.2009 2:24

Post by Maruk »

Code: Select all

type Rec_clothes = Record
   clothes_L : Byte;      // ID слоя
   clothes_T : Cardinal;      // Тип шмотки 
Не понимаю как переменные вбить, ID слоя это ID курсы?
Alexej
Novice
Novice
Posts: 79
Joined: 06.06.2008 11:55
Contact:

Post by Alexej »

в хелпе посмотри , есть список слоев чара, выбери тот, на который одеваешь шмотку...
Maruk
Neophyte
Neophyte
Posts: 19
Joined: 05.11.2009 2:24

Post by Maruk »

Code: Select all

function EggsLayer: Byte; // 0x17 - Юбка, килт - Legs (outer) (skirt/kilt)
Мне нужно вписать 0x17 или EggsLayer: Byte ?
А вот насчет clothes_T : Cardinal; я так и не понял что и как...
WladL
Apprentice
Apprentice
Posts: 240
Joined: 27.07.2009 17:21
Location: DRW
Contact:

Post by WladL »

Code: Select all

   clothes_A[3].clothes_L := ShirtLayer; 
   clothes_A[3].clothes_T := $1EFD;
function ShirtLayer: Byte; // 0x05 - Рубашка - Shirt

clothes_A[3].clothes_L := ShirtLayer; это слой вещи с уже вписаным значением (не трогать)
clothes_A[3].clothes_T := $1EFD; если ты не используешь рубашку курсы поставь сюда 0, иначе впиши тип рубашки

и так со всеми слоями , можно менять !только! clothes_T
"Как хочешь ты трудись;
Но приобресть не льстись
Ни благодарности, ни славы,
Коль нет в твоих трудах ни пользы, ни забавы. (с) С.Крылов."
Maruk
Neophyte
Neophyte
Posts: 19
Joined: 05.11.2009 2:24

Post by Maruk »

Сделал так:

Code: Select all

type Rec_clothes = Record
clothes_A[3].clothes_L := ShirtLayer; 
clothes_A[3].clothes_T:= $1518;
end;
Ошибка
15:00:56 [myst]: Compiler: [Error] (Meditation.sc at 10:10): colon (':') expected
WladL
Apprentice
Apprentice
Posts: 240
Joined: 27.07.2009 17:21
Location: DRW
Contact:

Post by WladL »

:lol: Ладно, пойдем другим путем...
1) скопируй весь скрипт заново.
2)в разделе //Fill array (см ниже), подставь вместо 0 свои типы курсы в нужных слоях.

Code: Select all

//Fill array 
   AddToSystemJournal('Fill curse array...'); 
   clothes_A[0].clothes_L := RhandLayer; 
   clothes_A[0].clothes_T := 0;    //если предмет не используется в clothes_T поставить 0, иначе вписать тип своего предмета 
   clothes_A[1].clothes_L := ShoesLayer; 
   clothes_A[1].clothes_T := 0; 
   clothes_A[2].clothes_L := PantsLayer; 
   clothes_A[2].clothes_T := 0; 
   clothes_A[3].clothes_L := ShirtLayer; 
   clothes_A[3].clothes_T := 0; 
   clothes_A[4].clothes_L := HatLayer; 
   clothes_A[4].clothes_T := 0; 
   clothes_A[5].clothes_L := GlovesLayer; 
   clothes_A[5].clothes_T := 0; 
   clothes_A[6].clothes_L := NeckLayer; 
   clothes_A[6].clothes_T := 0; 
   clothes_A[7].clothes_L := WaistLayer; 
   clothes_A[7].clothes_T := 0; 
   clothes_A[8].clothes_L := TorsoLayer; 
   clothes_A[8].clothes_T := 0; 
   clothes_A[9].clothes_L := TorsoHLayer; 
   clothes_A[9].clothes_T := 0; 
   clothes_A[10].clothes_L := ArmsLayer; 
   clothes_A[10].clothes_T := 0; 
   clothes_A[11].clothes_L := CloakLayer; 
   clothes_A[11].clothes_T := 0; 
   clothes_A[12].clothes_L := RobeLayer; 
   clothes_A[12].clothes_T := 0;
и больше ничего не тогай !!!
"Как хочешь ты трудись;
Но приобресть не льстись
Ни благодарности, ни славы,
Коль нет в твоих трудах ни пользы, ни забавы. (с) С.Крылов."
Maruk
Neophyte
Neophyte
Posts: 19
Joined: 05.11.2009 2:24

Post by Maruk »

Все я понял где нужно было тип вписывать, просто меня смутили надписи в начале скрипта. Сейчас вроде сделал все правильно, но всеровно ошибка
19:48:56 [myst]: Compiling
19:48:56 [myst]: Compiler: [Error] (meditation.sc at 54:8 ): Unknown identifier 'GetPauseScriptOnDisconnectStatus'
19:48:56 [myst]: Compiling failed
WladL
Apprentice
Apprentice
Posts: 240
Joined: 27.07.2009 17:21
Location: DRW
Contact:

Post by WladL »

похоже у тебя версия стелса старовата ибо вот http://stealth.od.ua/forum/viewtopic.php?p=6253#6253 , ну удали эту строку и все
"Как хочешь ты трудись;
Но приобресть не льстись
Ни благодарности, ни славы,
Коль нет в твоих трудах ни пользы, ни забавы. (с) С.Крылов."
Maruk
Neophyte
Neophyte
Posts: 19
Joined: 05.11.2009 2:24

Post by Maruk »

Спасибо все работает :) билд у стелса 60, 20.08.2009.
Post Reply