Вернуться   CoderX :: Forums > Lineage II > L2PacketHack > Скриптинг
Войти через OpenID

Скриптинг Форум посвещенный созданию скриптов для L2PacketHack

Чат (Новых сообщений с момента вашего последнего визита нет)
Загрузка...
Задавайте ваши вопросы на форуме. Чат предназначен для небольших разговоров.
 
Ответ
 
Опции темы Опции просмотра
Старый 24.07.2008, 12:12   #461
Пользователь
 
Аватар для metalFan
 
Регистрация: 26.10.2007
Сообщений: 43
Сказал Спасибо: 8
Имеет 21 спасибок в 8 сообщенях
metalFan
По умолчанию

воть это мой третий скрипт по счету, который висит окошкоми показывает статы, можно добавить все что угодно пишитеа еще лучше, кто подправит ошибку при выключении - пирожокinvalid pointer operation а так все путем
delphi Код:
//монитор, показывает хп\мп\вес\имя :) //мспользуется в процессах когда нужно nofreeondisconect //ну или когда вам захочется//тестировался на l2c6 alpha //v0.1b - первая версия //v0.2b - изменет алгоритм принудительного обновления //(c)metalFan const name = 'metalFan' ; //Warning! Не поставишь имя - вылетишь из игры! xD var frm: TForm; m: TMemo; Button: TButton; MaxHP,CurHP,MaxMP,CurMP,CurLoad,MaxLoad,i: integer; CharName: string; procedure Init; begin //формочка frm := TForm.Create(nil); frm.Caption := 'Info by metalFan v0.2b'; frm.BorderStyle := bsDialog; frm.Position := poScreenCenter; frm.Width:=250;frm.Height:=125; frm.OnClose := @FormClose; m:=TMemo.Create(frm); m.parent:=frm; m.align:=alClient; m.ReadOnly:=true; m.ScrollBars:=ssBoth; Button := TButton.Create(frm); Button.Parent := frm; Button.Caption := 'Refresh'; Button.Left := 125; Button.Top := 15; Button.onClick := @ForceUpdate; frm.show; end;   //закрываем формочку procedure free; begin m.free; Button.Free; frm.free; end; //принудительное обновление procedure ForceUpdate; begin buf:=Hstr('45 01 00 00 00 00 00 00 00 00'); SendToServerEx(name); delay(50); buf:=Hstr('45 01 00 00 00 00 00 00 00 00'); SendToServerEx(name); end;   //(c)NLObP скажи нет случайному закрытию формы procedure FormClose(Sender: TObject; var Action: TCloseAction); begin Action:=caNone; end; procedure OnDisconnect(WithClient: Boolean); //Вызывается при установке соединения begin NoFreeOnClientDisconnect; NoFreeOnServerDisconnect; end; //думалка begin if FromServer and (ConnectName=name) and (pck[1]=#$04) then begin i:=22; CharName:=ReadS(i); i:=i+48; MaxHP:=ReadD(i); CurHP:=ReadD(i); MaxMP:=ReadD(i); CurMP:=ReadD(i); i:=i+4; CurLoad:=ReadD(i); MaxLoad:=ReadD(i); //выводим на экран это дело m.lines.add('Name ' + CharName); m.lines.add('Health ' + inttostr(CurHP) +'\' + inttostr(MaxHP)); m.lines.add('Mana ' + inttostr(CurMP)+'\' + inttostr(MaxMP)); m.lines.add('Load ' + inttostr(CurLoad)+'\' + inttostr(MaxLoad)); end; end.

Добавлено через 6 минут
кстати как код вставлять а не цитату?

Последний раз редактировалось NLObP, 24.07.2008 в 13:47. Причина: Добавлено сообщение
metalFan вне форума   Ответить с цитированием
За это сообщение metalFan нажился спасибкой от:
Старый 24.07.2008, 13:39   #462
Рыцарь
 
Аватар для NLObP
 
Регистрация: 25.02.2008
Адрес: г.Волгоград
Сообщений: 2,009
Сказал Спасибо: 1,285
Имеет 1,458 спасибок в 793 сообщенях
NLObP пока неопределено
По умолчанию

Цитата:
Сообщение от metalFan Посмотреть сообщение
//закрываем формочку
procedure free;
begin m.free;
frm.free;
Button.Free;
end;
Неправильный порядок вызова процедур.
Уничтожение формы, последнее что должно быть в нашем случае. Мне так кажеться, что frm.free достаточно одной. Сделай так:
delphi Код:
procedure free; begin   m.free;   Button.Free;   frm.free; end;

Добавлено через 2 минуты
Цитата:
Сообщение от metalFan Посмотреть сообщение
кстати как код вставлять а не цитату?
Самая правая решётка. Пишишь туда - delphi, и будет такое обрамление кода [ HIGHLIGHT = " delphi " ][ / HIGHLIGHT ]

Последний раз редактировалось NLObP, 24.07.2008 в 13:40. Причина: Добавлено сообщение
NLObP вне форума   Ответить с цитированием
За это сообщение NLObP нажился спасибкой от:
Старый 24.07.2008, 15:34   #463
Пользователь
 
Аватар для metalFan
 
Регистрация: 26.10.2007
Сообщений: 43
Сказал Спасибо: 8
Имеет 21 спасибок в 8 сообщенях
metalFan
По умолчанию

delphi Код:
//монитор, показывает хп\мп\вес\имя //мспользуется в процессах когда нужно nofreeondisconect //ну или когда вам захочется//тестировался на l2c6 alpha //v0.1b - первая версия //v0.2b - изменет алгоритм принудительного обновления //v0.3b - исправлена ошибка закрытия хандлера //(c)metalFan const name=('metalFan'); //Warning! Не поставишь имя - вылетишь из игры! xD var frm: TForm; m: TMemo; Button: TButton; MaxHP,CurHP,MaxMP,CurMP,CurLoad,MaxLoad,i: integer; CharName: string; procedure Init; begin //формочка frm := TForm.Create(nil); frm.Caption := 'Info by metalFan v0.3b'; frm.BorderStyle := bsDialog; frm.Position := poScreenCenter; frm.Width:=250;frm.Height:=125; frm.OnClose := @FormClose; m:=TMemo.Create(frm); m.parent:=frm; m.align:=alClient; m.ReadOnly:=true; m.ScrollBars:=ssBoth; Button := TButton.Create(frm); Button.Parent := frm; Button.Caption := 'Refresh'; Button.Left := 125; Button.Top := 15; Button.onClick := @ForceUpdate; frm.show; end; //закрываем формочку procedure free; begin m.free; Button.Free; frm.free; end; //принудительное обновление procedure ForceUpdate; begin buf:=Hstr('45 01 00 00 00 00 00 00 00 00'); SendToServerEx(name); delay(50); buf:=Hstr('45 01 00 00 00 00 00 00 00 00'); SendToServerEx(name); end; //(c)NLObP скажи нет случайному закрытию формы procedure FormClose(Sender: TObject; var Action: TCloseAction); begin Action:=caNone; end; procedure OnDisconnect(WithClient: Boolean); //Вызывается при установке соединения begin NoFreeOnClientDisconnect; NoFreeOnServerDisconnect; end; //думалка begin if FromServer and (ConnectName=name) and (pck[1]=#$04) then begin i:=22; CharName:=ReadS(i); i:=i+48; MaxHP:=ReadD(i); CurHP:=ReadD(i); MaxMP:=ReadD(i); CurMP:=ReadD(i); i:=i+4; CurLoad:=ReadD(i); MaxLoad:=ReadD(i); //выводим на экран это дело m.lines.add('Name ' + CharName); m.lines.add('Health ' + inttostr(CurHP) +'\' + inttostr(MaxHP)); m.lines.add('Mana ' + inttostr(CurMP)+'\' + inttostr(MaxMP)); m.lines.add('Load ' + inttostr(CurLoad)+'\' + inttostr(MaxLoad)); end; end.
так определенно лучше
metalFan вне форума   Ответить с цитированием
За это сообщение metalFan нажился спасибкой от:
Старый 25.07.2008, 07:21   #464
Пользователь
 
Аватар для charly911
 
Регистрация: 20.05.2008
Адрес: Arg.
Сообщений: 35
Сказал Спасибо: 2
Имеет 3 спасибок в 2 сообщенях
charly911 пока неопределено
По умолчанию

Hello

Цитата:
Сообщение от QaK Посмотреть сообщение
charly911, if you use Script by Voron ("Бот кач локомотив") there is o lot of errrs in this script,because olny Voron (as I known) use and test this script, so if something did'nt work correct - try to fix by yourself.
Put there a code of the function to calculate distance, and example, where and how do you use it?
Here is the code i tried to use to calculate the nearest Mob in the area:

delphi Код:
--------------------------------------------------------------------- const PJname='UlTrApLeX'; var r,i,j,jMax,Listo,KNpcID,MoveID,MoveX,MoveY,MoveZ,PJID,PJY,PJX,PJZ,PJlvl,PJMaxHP,PJCurHP,PJMaxMP,PJCurMP,IDTemp:integer; NpcNameStr,PJNames:string; frm:TForm; m:TMemo; penel:TPanel; button:TButton; Label1:TLabel; NpcID:    array[1..100] of integer; NpcName:  array[1..100] of string; NpcX:     array[1..100] of integer; NpcY:     array[1..100] of integer; NpcZ:     array[1..100] of integer; DisNpc:   array[1..100] of integer; {MoveX:    array[1..100] of integer; MoveY:    array[1..100] of integer; MoveZ:    array[1..100] of integer;} procedure Init; //Вызывается при включении скрипта begin frm := TForm.Create(nil); frm.Caption := 'NPC Info - '+PJName+' - by ..::Charly::..'; frm.BorderStyle := bsSizeable; frm.Position := poScreenCenter; frm.Width:=360; frm.Height:=900; m:=TMemo.Create(frm); m.parent:=frm; m.align:=alClient; m.ReadOnly:=true; m.ScrollBars:=ssBoth; penel:=TPanel.Create(frm); penel.parent:=frm; penel.align:=alBottom; penel.Width:=150; penel.height:=30; button:=tbutton.Create(penel); button.parent:=penel; button.align:=alLeft; button.Width:=45; button.caption:='Buscar'; button.onClick:=@buscar; button.hint:='busca el bicho mas cercano.'; Label1:=TLabel.Create(penel); Label1.parent:=penel; Label1.align:=alRight; Label1.Width:=50; Label1.Caption:=' 0 '; i:=1; j:=1; jMax:=1; Listo:=0; frm.Show; for i:=1 to 100 do begin      NpcID[i]:=0;      NpcName[i]:='';      NpcX[i]:=0;      NpcY[i]:=0;      NpcZ[i]:=0; end; end; procedure Free; begin  frm.Free; end; procedure buscar; begin      IDTemp:=999999999;      for i:=1 to 100 do          begin          if (DisNpc[i] > 0) and (DisNpc[i] < IDTemp) then                begin                     IDTemp:=i;                end;          end;          if (DisNpc[IDTemp]>0) and (DisNpc[IDTemp]<>999999999) then              begin                     buf:=#$01;                     WriteD(NpcX[i]);                     WriteD(NpcY[i]);                     WriteD(NpcZ[i]);                     WriteD(PJX);                     WriteD(PJY);                     WriteD(PJZ);                     SendToServerEx(PJName);                     m.Lines.Add('@%@% El bicho mas cercanos es: '+inttostr(IDTemp));                     Label1.Caption:=' '+inttostr(i);              end; end; begin if FromServer and (ConnectName=PJName) and (pck[1]=#$04) then begin      PJX:=ReadD(2);      PJY:=ReadD(6);      PJZ:=ReadD(10);      PJID:=ReadD(18);      PJNames:=ReadS(22);      PJlvl:=ReadD(54);      PJMaxHP:=ReadD(86);      PJCurHP:=ReadD(90);      PJMaxMP:=ReadD(94);      PJCurMP:=ReadD(98);      m.Lines.Add('Nombre:'+(PJNames)+'.');      m.Lines.Add('->Coordenadas: X:'+inttostr(PJX)+' - Y:'+inttostr(PJY)+' - Z:'+inttostr(PJZ)+'.');      m.Lines.Add('->ID:'+inttostr(PJID)+'.');      m.Lines.Add('->lvl:'+inttostr(PJlvl)+'.');      m.Lines.Add('->MaxHP:'+inttostr(PJMaxHP)+'.');      m.Lines.Add('->CurHP'+inttostr(PJCurHP)+'.');      m.Lines.Add('->MaxMP'+inttostr(PJMaxMP)+'.');      m.Lines.Add('->CurMP'+inttostr(PJCurMP)+'.'); end; //******************** -Pck-16-  -NPC Info-*********************** if FromServer and (ConnectName=PJName) and (pck[1]=#$16) then    begin    listo:=0;    i:=1;         Repeat               i:=i+1;                   if (NpcID[i]=0)and (Listo=0) then                      begin                           NpcID[i]:=ReadD(2);                           NpcX[i]:=ReadD(14);                           NpcY[i]:=ReadD(18);                           NpcZ[i]:=ReadD(22);                           DisNpc[i]:=((PJX-NpcX[i])*(PJX-NpcX[i]));                           Listo:=1;                           m.Lines.Add('-->NpcID: '+inttostr(NpcID[i]));                           m.Lines.Add('-->NpcX: '+inttostr(NpcX[i])+' - NpcY: '+inttostr(NpcY[i])+' - NpcZ: '+inttostr(NpcZ[i]));                           m.Lines.Add('-->Posicion: '+inttostr(i));                           m.Lines.Add('-->Distancia del PJ: '+inttostr(DisNpc[i]));                           m.Lines.Add('');                      end;               if i=100 then Listo:=1;         until Listo=1;    end; //********************************************************** //********************* -Pck-12- -NPC Delete-*************** if FromServer and (ConnectName=PJName) and (pck[1]=#$12) then    begin         KNpcID:=ReadD(2);         listo:=0;         i:=0;         Repeat               i:=i+1;                   if (NpcID[i]=KNpcID)and (Listo=0) then                      begin                           NpcID[i]:=0;                           NpcX[i]:=0;                           NpcY[i]:=0;                           NpcZ[i]:=0;                           DisNpc[i]:=0;                           Listo:=1;                           m.Lines.Add('-----> Posicion '+inttostr(i)+' liberada.');                           m.Lines.Add('');                      end;                   if i=100 then Listo:=1;         until Listo=1;    end; //******************************************************* //******************** -Pck-01- -NPC Move- ************** if FromServer and (ConnectName=PJName) and (pck[1]=#$01) then    begin         MoveID:=ReadD(2);         MoveX:=ReadD(18);         MoveY:=ReadD(22);         MoveZ:=ReadD(26);         listo:=0;         i:=0;         if MoveID<>PJID then         begin         Repeat               i:=i+1;                   if (MoveID<>0) and (NpcID[i]=MoveID)and (Listo=0) then                      begin                           NpcX[i]:=MoveX;                           NpcY[i]:=MoveY;                           NpcZ[i]:=MoveZ;                           DisNpc[i]:=((PJX-NpcX[i])*(PJX-NpcX[i]));                           Listo:=1;                           m.Lines.Add('> NPC '+inttostr(NpcID[i])+' actualizado.');                           m.Lines.Add('> X:'+inttostr(NpcX[i])+' - Y:'+inttostr(NpcY[i])+' - Z:'+inttostr(NpcZ[i])+'.');                           m.Lines.Add('> Posicion:'+inttostr(i)+'.');                      end;                   if i=100 then Listo:=1;         until Listo=1;         end;    end; if FromServer and (ConnectName=PJName) and (pck[1]=#$01) then    begin         MoveID:=ReadD(2);         MoveX:=ReadD(18);         MoveY:=ReadD(22);         MoveZ:=ReadD(26);         if MoveID=PJID then         begin              PJX:=MoveX;              PJY:=MoveY;              PJZ:=MoveZ;              m.Lines.Add('## Mi pos actualizada.')         end;    end; end. --------------------------------------------------------------------------

This is just a test i made, its all a mess :P
What i wanted to do was to create a data base of Mobs position, determine the nearest, and when i pressed the button, the PJ (Player) run to that location. Result: only some times worked, why? i don't know. :'(
I have to re-write it, but i have not enought time as i am working and i have to study.
Maybe this weekend i'll do it, with the corresponding explanation.
I made this script to add it into another, that worked. This is the main working script:

delphi Код:
-------------------------------------------------------------------------- {This is very stupid bot, that works fine :D The way it search mobs is very simple. He moves to one of four secific points, and all the time uses /targetnext When he finaly targets a mob, he atacks, until mod is dead. Then he try to target another, and if no mob is targeted he goes to another position. If his HP goes less than 55%, he drinks a greater Healing Pot, and if it is lower than 10% he dispears (not log off, but mobs cant atack)  until his HP goes more than 1/2. He also try to use skills every time he can. To select the four positions, the only thing that must be made, is to clic one button (Pos1/2/3/4), an then clic on the place you want to set it. } const PJName='UlTrApLeX'; var act,PotID1,PotID2,PotID3,PotID4:integer; me1:char; me2:char; me3:char; me4:char; nm:integer; t1:char; t2:char; t3:char; t4:char; nt:integer; shade:integer; mz:integer; pz:integer; tz:integer; hz:integer; MaxHP,CurHP,MaxMP,Shadow,CurMP,MaxCP,CurCP,ATT,TS,MyCorX,MyCorY,MyCorZ,CoordPpalX,CoordPpalY,CoordPpalZ,Contador,Posicion,Coord,Activo,Activo2,CoordX,CoordY,CoordZ,i: integer; CoordX1,CoordX2,CoordX3,CoordY1,CoordY2,CoordY3,CoordZ1,CoordZ2,CoordZ3,CoordX4,CoordY4,CoordZ4,Espera,Esperando,AutoSelect,AutoSelect2,PJInfoAct,PJInfoAct2,p,RaceID,SexID,ClassID,MoveOK,MoveOK2,UsandoPot:integer; m,m2,m3:TMemo; frm,frm2,frm3:TForm; Message,NombreDelPJ,Name,Sex,Race, Class: string; button: tbutton; etext3: TEdit; IDdelPJ,VerificarID,Accuracy,Vicio,ShadowEterno,BichosMuertos:integer; timer1,timer2,timer3: TTimer; MiID,IDObtenida,IDTemporal,IDActualizable,NeedLoc,Comienzo:integer; UltimaX,UltimaY,UltimaZ,UltimaXa,UltimaYa,UltimaZa,Memorizar,LocX1,LocX2,LocX3,LocX4,LocY1,LocY2,LocY3,LocY4,LocZ1,LocZ2,LocZ3,LocZ4:integer; penel,penel2,penel3:TPanel; ProgressBar1: TProgressBar; Label1: TLabel; penel4,penel0: TPanel; statusBar: TStatusbar; // //000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 // procedure Init; begin frm := TForm.Create(nil); frm.Caption := 'Movimiento'; frm.BorderStyle := bsSizeable; frm.Position := poScreenCenter; frm.Width:=210; frm.Height:=900; m:=TMemo.Create(frm); m.parent:=frm; m.align:=alClient; m.ReadOnly:=true; m.ScrollBars:=ssBoth; penel:=TPanel.Create(frm); penel.parent:=frm; penel.align:=alBottom; penel.Width:=150; penel.height:=30; penel2:=TPanel.Create(frm); penel2.parent:=frm; penel2.align:=alBottom; penel2.Width:=150; penel2.height:=30; penel3:=TPanel.Create(frm); penel3.parent:=frm; penel3.align:=alBottom; penel3.Width:=150; penel3.height:=30; penel4:=TPanel.Create(frm); penel4.parent:=frm; penel4.align:=alBottom; penel4.Width:=150; penel4.height:=17; {penel0:=TPanel.Create(frm); penel0.parent:=frm; penel0.align:=alBottom; penel0.Width:=150; penel0.height:=30; StatusBar:=TStatusBar.Create(penel0); StatusBar.parent:=penel0; StatusBar.Width:=200; } button:=tbutton.Create(penel); button.parent:=penel; button.align:=alLeft; button.Width:=25; button.caption:='ID'; button.onClick:=@VerifID; button.hint:='Verifica ID del PJ.'; button:=tbutton.Create(penel); button.parent:=penel; button.align:=alLeft; button.Width:=30; button.caption:='1'; button.onClick:=@Memo1; button.hint:='Memoriza ubicacion 1.'; button:=tbutton.Create(penel); button.parent:=penel; button.align:=alLeft; button.Width:=30; button.caption:='2'; button.onClick:=@Memo2; button.hint:='Memoriza ubicacion 2.'; button:=tbutton.Create(penel); button.parent:=penel; button.align:=alLeft; button.Width:=30; button.caption:='3'; button.onClick:=@Memo3; button.hint:='Memoriza ubicacion 3.'; button:=tbutton.Create(penel); button.parent:=penel; button.align:=alLeft; button.Width:=30; button.caption:='4'; button.onClick:=@Memo4; button.hint:='Memoriza ubicacion 4.'; button:=tbutton.Create(penel); button.parent:=penel; button.align:=alLeft; button.Width:=55; button.caption:='Contador'; button.onClick:=@ContBichos; button.hint:='Verifica ID del PJ.'; button:=tbutton.Create(penel2); button.parent:=penel2; button.align:=alLeft; button.Width:=50; button.caption:='Ir a 1'; button.onClick:=@IrMemo1; button.hint:='Ir a ubicacion 1.'; button:=tbutton.Create(penel2); button.parent:=penel2; button.align:=alLeft; button.Width:=50; button.caption:='Ir a 2'; button.onClick:=@IrMemo2; button.hint:='Ir a ubicacion 2.'; button:=tbutton.Create(penel2); button.parent:=penel2; button.align:=alLeft; button.Width:=50; button.caption:='Ir a 3'; button.onClick:=@IrMemo3; button.hint:='Ir a ubicacion 3.'; button:=tbutton.Create(penel2); button.parent:=penel2; button.align:=alLeft; button.Width:=50; button.caption:='Ir a 4'; button.onClick:=@IrMemo4; button.hint:='Ir a ubicacion 4.'; button:=tbutton.Create(penel3); button.parent:=penel3; button.align:=alLeft; button.Width:=50; button.caption:='On / Off'; button.onClick:=@ActDes; button.hint:='Activa / Desactiva el BOT.'; button:=tbutton.Create(penel3); button.parent:=penel3; button.align:=alLeft; button.Width:=70; button.caption:='Auto Target'; button.onClick:=@AutoSel; button.hint:='Auto Target On/Off.'; button:=tbutton.Create(penel3); button.parent:=penel3; button.align:=alLeft; button.Width:=60; button.caption:='Movimiento'; button.onClick:=@PMoveOK; button.hint:='Movimiento automatico.'; button:=tbutton.Create(penel3); button.parent:=penel3; button.align:=alLeft; button.Width:=20;                         //////////////////////////////////// button.caption:='R'; button.onClick:=@Reset; button.hint:='Resetea contador de Bichos matados.'; Label1:=TLabel.Create(penel4); Label1.parent:=penel4; Label1.align:=alLeft; Label1.Width:=20; Label1.Caption:=' HP: '; Progressbar1:= tprogressbar.create(penel4); Progressbar1.parent:=penel4; Progressbar1.align:=alLeft; Progressbar1.Width:=175; Progressbar1.Height:=20; Progressbar1.Step:=1; Progressbar1.Max:=100; Progressbar1.Min:=0; //ProgressBar1.PbColor:=Red; frm.Show;   // Initialice Variables MiID:=0; Activo:=0; Activo2:=1; PjinfoAct:=0; PJInfoAct2:=1; AutoSelect:=0; AutoSelect2:=1; MoveOK:=0; MoveOK2:=1; ShadowEterno:=1; UsandoPot:=0; BichosMuertos:=0; Progressbar1.Position:=0; //****************** timer1:=TTimer.Create(nil); timer1.OnTimer:=@OnTimer1; timer1.enabled:=true; timer1.interval:=500; //***************** timer2:=TTimer.Create(nil); timer2.OnTimer:=@OnTimer2; timer2.enabled:=true; timer2.interval:=500; //****************** timer3:=TTimer.Create(nil); timer3.OnTimer:=@OnTimer3; timer3.enabled:=true; timer3.interval:=1000; //****************** end; procedure Free; begin m.Free; frm.Free; timer1.Free; timer2.Free; timer3.Free; end; procedure VerifID; // verify if i got my player ID begin      if (IDObtenida=1) and (MiID<>0) then m.Lines.Add('ID obtenida correctamente. ID: '+inttostr(MiID)); end; procedure Memo1; begin Memorizar:=1; NeedLoc:=1; end; procedure Memo2; begin Memorizar:=2; NeedLoc:=1; end; procedure Memo3; begin Memorizar:=3; NeedLoc:=1; end; procedure Memo4; begin Memorizar:=4; NeedLoc:=1; end; procedure IrMemo1; // move to memory location 1 begin buf:=#$01; WriteD(LocX1); WriteD(LocY1); WriteD(LocZ1); WriteD(UltimaXa); WriteD(UltimaYa); WriteD(UltimaZa); SendToServerEx(PJName); m.Lines.Add('Ir Loc 1.'); end; procedure IrMemo4; // move to memory location 4 begin buf:=#$01; WriteD(LocX4); WriteD(LocY4); WriteD(LocZ4); WriteD(UltimaXa); WriteD(UltimaYa); WriteD(UltimaZa); SendToServerEx(PJName); m.Lines.Add('Ir Loc 4.'); end; procedure IrMemo2; // move to memory location 2 begin buf:=#$01; WriteD(LocX2); WriteD(LocY2); WriteD(LocZ2); WriteD(UltimaXa); WriteD(UltimaYa); WriteD(UltimaZa); SendToServerEx(PJName); m.Lines.Add('Ir Loc 2.'); end; procedure IrMemo3; // move to memory location 3 begin buf:=#$01; WriteD(LocX3); WriteD(LocY3); WriteD(LocZ3); WriteD(UltimaXa); WriteD(UltimaYa); WriteD(UltimaZa); SendToServerEx(PJName); m.Lines.Add('Ir Loc 3.'); end; procedure ActDes; // Bot On/Off begin      if Activo=1 then         begin              Activo:=0;              Activo2:=0;              Message:='Bot desactivado';              m.Lines.Add(Message);         end;      if (Activo=0) and (Activo2=1) then         begin              Activo:=1;              Message:='Bot activado';              m.Lines.Add(Message);         end;      Activo2:=1; end; procedure Reset; //not use :P begin end; procedure PMoveOK; // Automatic movement On/Off           begin                if MoveOK=1 then                   begin                        MoveOK:=0;                        MoveOK2:=0;                        Message:='Movimiento automatico desactivado.';                        m.Lines.Add(Message);                   end;                if (MoveOK=0) and (MoveOK2=1) then                    begin                         MoveOK:=1;                         Message:='Movomiento automatico activado.';                         m.Lines.Add(Message);                    end;                MoveOK2:=1;           end; procedure AutoSel; // Auto Target On/Off           begin                if AutoSelect=1 then                   begin                        AutoSelect:=0;                        AutoSelect2:=0;                        Message:='Auto Select desactivado';                        m.Lines.Add(Message);                   end;                if (AutoSelect=0) and (AutoSelect2=1) then                    begin                         AutoSelect:=1;                         Message:='Auto Select activado';                         m.Lines.Add(Message);                    end;                AutoSelect2:=1;           end; //********************************************************************** //                      SKILL // procedure OnTimer1(Sender: TObject); // Skill use           begin                if (TS=1) and (ATT=1) then                    begin                         {buf:=Hstr('2F 10 00 00 00 00 00 00 00 00 ');                         SendToServer;                         buf:=Hstr('45 02 00 00 00');                         SendToServer;}                         buf:=Hstr('2F 07 01 00 00 00 00 00 00 00');                         SendToServerEx(PJName);                         buf:=Hstr('45 02 00 00 00');                         SendToServerEx(PJName);                    end;           end; //************************************************* //                   AUTO SELECT // procedure OnTimer2(Sender: TObject); // Targetnext           begin                if (TS=0) and (AutoSelect=1) {and (Espera=0)} then                    begin                         buf:=Hstr('45 04 00 00 00'); // Selecciona.                         SendToServerEx(PJName);                    end;           end; //************************************************* //                ATACAR!!! // procedure OnTimer3(Sender: TObject); // Atackkk           begin                if (Ts=1) then                    begin                         buf:=Hstr('45 02 00 00 00'); // Ataca.                         SendToServerEx(PJName);                         ATT:=1;                    end;           end; //********************************************* procedure ContBichos; // Shows number of killed mobs begin      m.lines.Add('.........................');      m.lines.Add('Total de Bichos matados: '+inttostr(BichosMuertos));      m.lines.Add('.........................'); end; // //000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 // begin // Obtener ID del PJ - Obtain Players ID if FromServer and (ConnectName=PJName) and (pck[1]=#$04) then    begin         MiID:=ReadD(18);         IDObtenida:=1;    end; // ***************************************************************************** if FromServer and (ConnectName=PJName) and (pck[1]=#$01) then // Update Pos    begin         IDTemporal:=ReadD(2);         if IDTemporal=MiID then            begin                 UltimaXa:=ReadD(6);                 UltimaYa:=ReadD(10);                 UltimaZa:=ReadD(14);                 UltimaX:=ReadD(18);                 UltimaY:=ReadD(22);                 UltimaZ:=ReadD(26);                 {m.Lines.Add('Recibido correctamente...');                 m.Lines.Add('Coordenadas:');                 m.Lines.Add('      Xa:'+inttostr(UltimaXa));                 m.Lines.Add('      Ya:'+inttostr(UltimaYa));                 m.Lines.Add('      Za:'+inttostr(UltimaZa));                 m.Lines.Add('      X:'+inttostr(UltimaX));                 m.Lines.Add('      Y:'+inttostr(UltimaY));                 m.Lines.Add('      Z:'+inttostr(UltimaZ));}                 IDActualizable:=1;                 if NeedLoc=1 then                    begin                         if Memorizar=1 then // Updates memory Loc1                            begin                                 LocX1:=UltimaXa;                                 LocY1:=UltimaYa;                                 LocZ1:=UltimaZa;                                 Memorizar:=0;                                 m.Lines.Add('Memoria 1 actualizada.');                            end;                         if Memorizar=2 then // Updates memory Loc2                            begin                                 LocX2:=UltimaXa;                                 LocY2:=UltimaYa;                                 LocZ2:=UltimaZa;                                 Memorizar:=0;                                 m.Lines.Add('Memoria 2 actualizada.');                            end;                         if Memorizar=3 then // Updates memory Loc3                            begin                                 LocX3:=UltimaXa;                                 LocY3:=UltimaYa;                                 LocZ3:=UltimaZa;                                 Memorizar:=0;                                 m.Lines.Add('Memoria 3 actualizada.');                            end;                         if Memorizar=4 then // Updates memory Loc4                            begin                                 LocX4:=UltimaXa;                                 LocY4:=UltimaYa;                                 LocZ4:=UltimaZa;                                 Memorizar:=0;                                 m.Lines.Add('Memoria 4 actualizada.');                            end;                    end;            end;    end; //****************************************************************************** if Activo=1 then     begin //                Guarda valores de HP y MP - Update HP and MP Values //              ----------------------------- if FromServer and (ConnectName=PJName) and (pck[1]+pck[6]=#$0E#$04) then    begin         CurHP:=ReadD(14);         MaxHP:=ReadD(22);         CurCP:=ReadD(30);         MaxCP:=ReadD(38);              if (CurHP<MaxHP/8) then  // Me queda muy poca HP - If very little HP, Disapear!!                  begin                       Shadow:=1;                  end;              if (CurHP<MaxHP/1.8) and (UsandoPot=0) and (Shadow<>10) then // Little HP, Drink Pot                    begin                         buf:=Hstr('14 54 D6 13 40 00 00 00 00')// Poco HP ---- CAMBIAR CAMBIAR CAMBIAR CAMBIAR CAMBIAR                         SendToServerEx(PJName);                         //Message:='Menos de 66% de HP, tomo Pot';                         m.Lines.Add('Tengo '+inttostr(CurHP)+'HP, tomo pot..');                         UsandoPot:=1;                    end;                if (CurHP=MaxHP) then      // Tengo todo el HP - Full HP :D                    begin                         Message:='HP al 100%';                         m.Lines.Add(Message);                    end;                if (CurCP<MaxCP/2) then    // Me quieren PKear - Player ataks me, Desapear!!                  begin                       Shadow:=3;                  end;         Progressbar1.Position:=trunc((CurHP/MaxHp)*100); end; //**************************************************** //******************************************************************** //                            Muy poca vida //                       ----------------------- if Shadow=1 then // Disapear!!    begin         buf:=Hstr('14 54 D6 13 40 00 00 00 00')// Poco HP ---- CAMBIAR CAMBIAR CAMBIAR CAMBIAR CAMBIAR         SendToServerEx(PJName);         shade:=1;         buf:=#$48#$00#$00#$FE#$FF#$7F#$AB#$03#$00#$E9#$F1#$FF#$FF#$88#$D4#$00#$00#$00#$00#$00#$00;         SendToServerEx(PJName);         Message:='Menos del 10% de HP, desaparezco!';         m.Lines.Add(Message);         TS:=0;         ATT:=0;         Shadow:=10;    end; //------------------------------------------------------------ if Shadow=10 then // Return    begin         if (CurHP>MaxHP/2) then Shadow:=2;    end; //************************************************************************* //                             Volver de Shadowmelt //                         -------------------------- if Shadow=2 then // Return    begin         shade:=0;         buf:=#$30#$00#$00;         SendToServerEx(PJName);         Message:='REcupere HP, volvi!';         m.Lines.Add(Message);         Shadow:=0;         Shadoweterno:=1;    end; //**************************************************************************** //                                 Me PKean //                               ------------ if Shadow=3 then  // Player atackss    begin         buf:=#$38;         WriteS('Chau PT!!!');         WriteD(0);         SendToServerEx(PJName);         shade:=1;         buf:=#$48#$00#$00#$FE#$FF#$7F#$AB#$03#$00#$E9#$F1#$FF#$FF#$88#$D4#$00#$00#$00#$00#$00#$00;         SendToServerEx(PJName);         Message:='Me ataco otro PJ y desapareci.';         m.Lines.Add(Message);         TS:=0;         ATT:=0;         delay (10000);         Shadow:=10;    end; //************************************************************************** //******************************************************************* //                               Muerte //                          ---------------- if FromServer and (ConnectName=PJName) and (pck[1]=#$06) then  // Mob died    begin         ATT:=0; // No ataca         TS:=0// No tiene nada seleccionado         buf:=Hstr('45 05 00 00 00'); //  Levantar drop         SendToServerEx(PJName);         m.Lines.Add('------------ Bicho muerto.........');         BichosMuertos:=BichosMuertos+1;    end; //*********************************************************************** //                            Selecciono????? //                        ---------------------- if FromServer and (ConnectName=PJName) and (pck[1]=#$A6) then // Target selected    begin         TS:=1;    end; //********************************************************************* //                            Unselected??? //                           ---------------- if FromServer and (ConnectName=PJName) and (pck[1]=#$A2) then  //Target not selected, Select!!    begin         TS:=0;         ATT:=0;         buf:=Hstr('45 04 00 00 00'); // selecciona. (Target Next)         SendToServerEx(PJName);    end; if TS=0 then    begin         buf:=Hstr('45 04 00 00 00'); // selecciona. (Target Next)         SendToServerEx(PJName);         buf:=Hstr('45 05 00 00 00'); //  Levantar drop         SendToServerEx(PJName);    end; if MoveOK=1 then    begin         if (Contador=1) and (TS=0) then IrMemo1;  // Move to locations...         if (Contador=100) and (TS=0) then IrMemo2;         if (Contador=200) and (TS=0) then IrMemo3;         if (Contador=300) and (TS=0) then IrMemo4;    end; Contador:=Contador+1; IF Contador>400 then Contador:=0; if shade = 1 then begin if FromClient and (pck[1]=#$30) then pck:=''; end; //if FromServer and (pck[1]+pck[2]+pck[3]=#$7f#$00#$00) then UsandoPot:=0; if FromServer and (ConnectName=PJName) and (pck[1]+pck[2]+pck[3]+pck[4]+pck[5]+pck[6]+pck[7]+pck[8]+pck[9]+pck[10]+pck[11]+pck[12]+pck[13]+pck[14]+pck[15]+pck[16]+pck[17]+pck[18]+pck[19]+pck[20]+pck[21]=Hstr('64 5C 00 00 00 01 00 00 00 04 00 00 00 F5 07 00 00 01 00 00 00')) then UsandoPot:=0; if FromServer and (ConnectName=PJname)and (pck[1]=#$27) and (pck[12]=#$03) and (pck[13]=#$06)then    begin         PotID1:=ReadC(6);         PotID2:=ReadC(7);         PotID3:=ReadC(8);         PotID4:=ReadC(9);         m.Lines.Add('Greater Healing Potion');         m.Lines.Add('ObjectID='+inttostr(PotID1)+inttostr(PotID2)+inttostr(PotID3)+inttostr(PotID4));    end; end; end. --------------------------------------------------------------------------

I know it is a dissaster but it finished like that because it started as a little simple script, but then i added some lines, then other and other and other... I have to re-write it also, but it requires time, that i don't have...
Maybe some parts are useful to some body, that is why i posted it...
If some one have some question about the scripts, just ask

Charly.

P.S.: i entered the code using CODE between [], and at the end /CODE, also between [], but the reserved words as "procedure" didn't appeared highlighted, am i doing it well???

--> Edited, now it's ok
--> New edit, i added some explanations of the code....

Последний раз редактировалось charly911, 25.08.2008 в 02:20.
charly911 вне форума   Ответить с цитированием
За это сообщение charly911 нажился спасибкой от:
Старый 25.07.2008, 09:09   #465
Рыцарь
 
Аватар для QaK
 
Регистрация: 28.09.2007
Сообщений: 1,558
Сказал Спасибо: 71
Имеет 351 спасибок в 244 сообщенях
QaK пока неопределено
По умолчанию

Цитата:
Сообщение от charly911 Посмотреть сообщение
P.S.: i entered the code using CODE between [], and at the end /CODE, also between [], but the reserved words as "procedure" didn't appeared highlighted, am i doing it well???
Use tags [ HIGHLIGHT = "delphi" ] [ / HIGHLIGHT ]
QaK вне форума   Ответить с цитированием
Старый 18.08.2008, 23:02   #466
Новичок
 
Аватар для raid
 
Регистрация: 01.07.2008
Адрес: Пермь
Сообщений: 21
Сказал Спасибо: 0
Имеет 37 спасибок в 10 сообщенях
raid пока неопределено
По умолчанию

Как обычно: Только опытным скриптописателям
Есть интересные задумки не всё рабочее, в основном для пвп-сервера.
Почитайте, иногда интересно)
Вложения
Тип файла: rar Scripts.rar (14.7 Кб, 202 просмотров)
__________________
Emo-chan style.
raid вне форума   Ответить с цитированием
За это сообщение raid нажился 3 спасибками от:
Старый 22.08.2008, 02:06   #467
Местный
 
Аватар для Breadfan
 
Регистрация: 29.04.2008
Сообщений: 830
Сказал Спасибо: 80
Имеет 230 спасибок в 169 сообщенях
Breadfan пока неопределено
По умолчанию

А вот полезная мелочь)) тупо пересылает пмы:
delphi Код:
const name='';      //ник командира var i:integer; msg:string; procedure SendMsg(msg:string); begin   buf:=#$4A;   WriteD(0);   WriteD(10);   WriteS('');   WriteS(msg);   SendToClientEx(Name); end; begin   if fromserver and (pck[1]=#$4a) and (pck[6]=#$02) and (connectname<>name)then            begin             i:=10;             msg:=('Incoming Message: From: '+ReadS(i)+' To: '+connectname+' >> '+ReadS(i));             sendmsg(msg);            end;     end.
Хроники: Камаель
Правда сообщения дублируются )
Кстати, я не ошибаюсь что функция StrtoHex теперь вшита в пакетхак? (в версиях 3.3.х)

Глянул аттач Raid (кстати спс за скрипт), жжоте))
delphi Код:
if (PartyNick='Corey')or(PartyNick='SaKpa') then begin  buf:=#$38;  WriteS('Ignored you)');

Последний раз редактировалось Breadfan, 22.08.2008 в 02:49.
Breadfan вне форума   Ответить с цитированием
Старый 22.08.2008, 02:57   #468
Рыцарь
 
Аватар для NLObP
 
Регистрация: 25.02.2008
Адрес: г.Волгоград
Сообщений: 2,009
Сказал Спасибо: 1,285
Имеет 1,458 спасибок в 793 сообщенях
NLObP пока неопределено
По умолчанию

Цитата:
Сообщение от Breadfan Посмотреть сообщение
Кстати, я не ошибаюсь что функция StrtoHex теперь вшита в пакетхак? (в версиях 3.3.х)
По ctl+shift показывает функции, которые можно применить (экспортируются из пакетхака).

Код:
function StrToHex(StrToHex: string): string;
обратная ей
Код:
function HStr(hex: string): string;
__________________
| Для самых ленивый | Телепаты в отпуске |Мы работаем над этим |
Не умеешь - учись, не хочешь учиться - плати © Суровый Закон Жизни



Последний раз редактировалось NLObP, 22.08.2008 в 03:01.
NLObP вне форума   Ответить с цитированием
За это сообщение NLObP нажился спасибкой от:
Старый 28.08.2008, 07:44   #469
Рыцарь
 
Аватар для VORON
 
Регистрация: 06.08.2007
Сообщений: 209
Сказал Спасибо: 6
Имеет 67 спасибок в 34 сообщенях
VORON пока неопределено
По умолчанию

Цитата:
Сообщение от PsyR Посмотреть сообщение
Ребят, надеюсь тут появились хорошие люди со вреени моего последнего визита. Есть 2 прозьбы. Вылоджите пожалуйста скрипт на рыбалку желательно что бы сам в ВХ клал адаптированый под шоки и так же скрипт на ТТ рец, тоже с диалогами адаптированными под шок. В своё время я тоже как то выложил абсолютно бескорыстно скрипт на ТТ рец. Щас времени нет заниматься этим :\
Благодарю за внимание.
улыбатор.. рука не поднимается щас удалять.. пускай другие почитают-)
потом вместе с етим постом в корзину-))

Добавлено через 26 минут
Цитата:
Сообщение от charly911 Посмотреть сообщение
Hello ppl, im new in the forum. Sry i dont know Russian... im from Argentina (South America).
First of all i would like to tell u that i love this forum and l2phx best botting tool ever
I know little programming, but i could write some scripts that worked excelent.
I have a problem with one script posted in this thread, i cant understand this:
delphi Код:
--------------------------------------------------------------------- for i:= 1 to 100 do  begin   if MobID[i] <> '' then    begin    tempX1:=ord(MobX[i][3])*256*256  + ord(MobX[i][2]) * 256 + ord(MobX[i][1]);    tempY1:=ord(MobY[i][3])*256*256  + ord(MobY[i][2]) * 256 + ord(MobY[i][1]);    if (MobX[i][4] = #$FF) then tempX1:=16777215-tempX1;    if (MobY[i][4] = #$FF) then tempY1:=16777215-tempY1;    tempLenght:= sqrt((MyCoordXex-tempx1)*(MyCoordXex-tempx1) + (MyCoordYex-tempy1)*(MyCoordYex-tempy1));     if (tempLenght<MinPutLenght) then     begin      MinPutLenght:=tempLenght;      MinPutID:=i;     end;   end;  end; ------------------------------------------------------------------
Can someone tell me what does it do???? what is "ord" for??? Why is MobID,MobX, etc string and not integer??? o.O

Thnx, Charly.
i`m author of this script.. i tell all that it is thery simple, but it work corectly.. it is calculate the mob , the distance to mob with the minimum distance.. that is apply when we are select the target to attack. we are know ID of MOB from here.. MobID,MobX in string becorse we must apply it in future code.. and all variables we must convert to string to send server in a packet.. so i do it.. we are read from incoming packet in string format and send in string format.. so all calculations we do with this format, it isnot so hard, you see..
but, of course, the programmer can apply the REAd and WRITE procedure to work this integer format.. but the ERROR is take place when we work with the coordination system.. becourse the sign "-" is present.. to make different calculations with sign "-" we must remember values in "EXTENDED" format.. so it can`t apply in "WRITE" procedure (only integer) so i do the string and work with it..

Цитата:
Сообщение от QaK Посмотреть сообщение
Ой блиин, ппц парниша попал =)
НЛО спасибо =)
you is ZLODEY!!

Цитата:
Сообщение от charly911 Посмотреть сообщение
Hi, thanks QaK for your answer, but when i asked for and explanation i wanted to know in detail what does it do, because once i tried to do something different but it didn't worked... Here is some piece of code:

--------------------------------------------------------
NpcID: array[1..100] of integer; // <-- integer, NOT STRING!!!
NpcX: array[1..100] of integer;
NpcY: array[1..100] of integer;
NpcZ: array[1..100] of integer;

------//-----

NpcID[i]:=ReadD(2);
NpcX[i]:=ReadD(14);
NpcY[i]:=ReadD(18);
NpcZ[i]:=ReadD(22);

----------------------------------------------------

If i tried to do this using string array i got an "incompatibility error".... Only this way worked.
Also i wanted to calculate distance using Pythagoras (sqrt((x*x)+(y*y)), but sometimes i got erros (negative values, theoricaly impossible), thas why i wanted to understand it better.
----
"function ord is for conversion between string-type and integer-type variables. Read the syntax of Pascal and Delphi."

why don't you use StrToInt?????

Thanks, Charly.
YOU try to remember values with sign "-" in integer.. so you have error.. coordinates are often take negative values.. so try EXTENDED format.. but you wiln`t can apply it in WRITE procedure.. so after calculations with extended format you must convert it to "string" by self.. you must read values in STRING when sign "-" is take place.. when you must convert to EXTENDED for calculation.. and then convert to STRING to apply in POST PROCEDURES..
__________________
Цитата:
Сообщение от pybukon
прежде чета попросить я немнога раскажу чтоб вы понили как мне плоха
Цитата:
Сообщение от Byrger
А как сделать мой скрипт бесконечным?
Цитата:
Сообщение от XKOR
.. каждый день ионизированной ногой протирает больную)
Цитата:
Сообщение от PsyR
Вылоджите пожалуйста скрипт на рыбалку желательно что бы сам в ВХ клал адаптированый под шоки и так же скрипт на ТТ рец, тоже с диалогами

Последний раз редактировалось VORON, 28.08.2008 в 07:50. Причина: Добавлено сообщение
VORON вне форума   Ответить с цитированием
Старый 31.08.2008, 14:58   #470
Местный
 
Аватар для Breadfan
 
Регистрация: 29.04.2008
Сообщений: 830
Сказал Спасибо: 80
Имеет 230 спасибок в 169 сообщенях
Breadfan пока неопределено
По умолчанию

Хроники Камаель.
Вобщем, в очередной раз сунувшись в кх и обнаружив полное отсутствие свитков для ТП решил посадить там перса с вот таким скриптом
delphi Код:
//Включить автоскупку - Да, выключить - Нет const name=''; var OIDnpc:integer; MyX,MyY,Myz:integer; start:boolean; startsk,startcmd:ttimer; kolvocmd,i,j,jj,x,step,st,itemID,itemcount,count,IDlist:integer; Buy:array[1..15,1..2] of integer; //массив для хранения ID и количества итемов в Buy-листе CmdNpc:array[1..50] of string; findt,oldpck,cmd,itemIDstr,countstr:string; Ste:array[1..3] of integer; //в этом массиве содержится последовательность номеров нажимаемых кнопок в меню procedure Init; begin OIDnpc:=0//Ввести OID нпс кланхолла startcmd:=TTimer.Create(nil)//счетчик для отсылки команд startcmd.OnTimer:=@scmd; startcmd.enabled:=false; startcmd.interval:=1500; startsk:=TTimer.Create(nil)//счетчик для частоты пробы покупки startsk.OnTimer:=@skupka; startsk.enabled:=false; startsk.interval:=1000*60*1; Ste[1]:= 3; Ste[2]:= 4; ste[3]:= 1; step:=0; count:=0; end; procedure Free; begin startsk.free; end; procedure scmd; begin   sendmsg(cmd);   RequestByPassToServer(cmd);   startcmd.enabled:=false; end; procedure SendMsg(msg:string)begin   buf:=#$4A;   WriteD(0);   WriteD(10);   WriteS('');   WriteS(msg);   SendToClientEx(Name); end; procedure Skupka; begin target(OIDnpc); delay(800); target(OIDnpc); delay(800); end; procedure Target(Attacker: Integer); begin   buf:=#$1f;   WriteD(Attacker);   WriteD(MyX);   WriteD(MyY);   WriteD(MyZ);   WriteC(00);   SendToServerEx(Name); end; procedure CmdNpcParc; Begin kolvocmd:=0; for j:=1 to 50 do begin CmdNpc[j]:=''; end; for j:=1 to length(oldpck) do  begin     for x:=0 to 9 do begin         findt:=findt+oldpck[j+x];     end;     if findt='bypass -h ' then begin        for x:=10 to 25 do begin            CmdNpc[kolvocmd+1]:=CmdNpc[kolvocmd+1]+oldpck[j+x];        end;        kolvocmd:=kolvocmd+1;     end;     findt:=''; end; end; procedure RequestByPassToServer(cmd:string); begin   buf:=#$23;   WriteS(cmd);   SendToServerEx(Name); end; procedure RequestBuyItem; begin   buf:=#$40;   WriteD(IDlist);   WriteD(count);   for i:=1 to count do begin   WriteD(buy[i,1]);   WriteD(buy[i,2]);   end;   SendToServerEx(Name); end; //---------------------------------------------------------- begin if FromClient and (ConnectName=name) and (pck[1]=#$59)  then    begin         MyX:=ReadD(6);         MyY:=ReadD(10);         MyZ:=ReadD(14);         end; if FromClient and (ConnectName=name) and (pck[1]=#$34)  and (pck[2]=#$06) then startsk.enabled:=true; if FromClient and (ConnectName=name) and (pck[1]=#$34)  and (pck[2]=#$05) then startsk.enabled:=false; if fromserver and (ConnectName=name) and (pck[1]=#$19) then begin    oldpck:=ReadS(6);    CmdNpcParc;    if not startcmd.enabled then step:=step+1;    if step=4 then step:=1;    cmd:=CmdNpc[ste[step]];    startcmd.enabled:=true; end; if fromserver and (ConnectName=name) and (pck[1]=#$07) then begin    IDlist:=ReadD(6);    jj:=1;    for j:=1 to 15 do begin           //берем первые 15 итемов из buy-листа, мне более ненужно       i:=18+((j-1)*64);       itemID:=ReadD(i);       itemcount:=ReadD(i);       if (itemID=5858) or (itemid=1829) or (itemid=7134) or (itemid=7126) then begin  //здесь ID вещей которые хотелось бы купить       buy[jj,1]:=ItemID;       buy[jj,2]:=itemcount;       count:=count+1;       inc(jj,1);       end;    end; if count<>0 then begin    RequestBuyItem;    count:=0;    end; end; end.
Прошу вашей помощи в оптимизации скрипта, он как-то вышел кривобоко ппц
__________________
На фразы в аську типа "слух карочь 1)как точить 2)как раскачаться за 5 мин" - игнор. ИМХО идиотизм
Дай голодному рыбу - он будет один день сыт. Покажи ему, как удить рыбу - он пошлёт тебя и скажет, что у него есть более интересные занятия, чем забрасывать снасти в воду
David Kastrup @ de.comp.text.tex.
"Приобретенные навыки общения с маленькими детьми - сильно упрощают взаимопонимание на форумах..."

А вы знаете, что для качественной сварки - место шва нужно протереть спиртом?

Последний раз редактировалось Breadfan, 31.08.2008 в 15:19.
Breadfan вне форума   Ответить с цитированием
За это сообщение Breadfan нажился спасибкой от:
Ответ

  CoderX :: Forums > Lineage II > L2PacketHack > Скриптинг


Опции темы
Опции просмотра

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


Часовой пояс GMT +4, время: 22:16.

vBulletin style designed by MSC Team.
Powered by vBulletin® Version 3.6.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot
Locations of visitors to this page
Rambler's Top100

Вы хотите чувствовать себя в безопасности? чоп Белган обеспечит её!