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

Stealth 4.0.

Tiger89
Novice
Novice
Posts: 131
Joined: 28.11.2008 17:32

Re: Stealth 4.0.

Post by Tiger89 »

А в лодку идет в случае перевеса?
pecnepago
Neophyte
Neophyte
Posts: 14
Joined: 30.06.2011 14:18
Contact:

Re: Stealth 4.0.

Post by pecnepago »

На этот вопрос ответить не могу, т.к. пришлось запустить старую версию стелса чтобы не простаивал чар
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Stealth 4.0.

Post by Vizit0r »

ну так запусти временно новую и проверь.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Tomers
Novice
Novice
Posts: 99
Joined: 06.08.2009 11:51

Re: Stealth 4.0.

Post by Tomers »

Code: Select all

a:=GetGumpsCount;
    addtosystemjournal('before '+inttostr(GetGumpsCount));
    addtosystemjournal('1');
    UseObject(qwester_npc);
    addtosystemjournal('2');
    for timer_1:=0 to 20 do begin
      if GetGumpsCount>a then break;
      wait(150);
      addtosystemjournal('wait'+inttostr(timer_1));
    end;
    addtosystemjournal('After '+inttostr(GetGumpsCount));         
    if (GetGumpsCount>0) then begin
    addtosystemjournal('3');
      b:=TStringList.Create;
      addtosystemjournal('4');
      if GetGumpID(GetGumpsCount-1)=0 then continue;
      addtosystemjournal('Вычитываю');
      GetGumpTextLines(GetGumpsCount-1,b);
      addtosystemjournal('Вычитал - '+inttostr(b.count));
      for i:=1 to 10 do addtosystemjournal(b.strings[i]);
12:44:36:453 [Gabriel]: before 0
12:44:36:453 [Gabriel]: 1
12:44:36:453 [Gabriel]: 2
12:44:36:609 [Gabriel]: wait0
12:44:36:609 [Gabriel]: After 1
12:44:36:609 [Gabriel]: 3
12:44:36:609 [Gabriel]: 4
12:44:36:609 [Gabriel]: Вычитываю
12:44:36:609 [Gabriel]: Вычитал - 0 <---- TStringList пустой
12:44:36:625 [Gabriel]: Exception: List index out of bounds (1) at 0.2544
12:44:36:625 [Gabriel]: Script QUEST.sc stopped successfuly

Не записываются данные в StringList. Либо изменен принцип работы TStringList
Забыл добавить. Версия 4.0.2
CFA
Developer
Developer
Posts: 492
Joined: 20.04.2006 6:03
Contact:

Re: Stealth 4.0.

Post by CFA »

попробуй GetGumpFullLines, может в этом гампе нет текста.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Stealth 4.0.

Post by Vizit0r »

обновил статью про GUI в Вики, про VFDesigner. Не успел доделать его до конца чтобы получать на выходе готовый стелсо-скриптовый код, но и так 90% работы делает за вас.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Tomers
Novice
Novice
Posts: 99
Joined: 06.08.2009 11:51

Re: Stealth 4.0.

Post by Tomers »

CFA wrote:попробуй GetGumpFullLines, может в этом гампе нет текста.
Это гамп, который выдается квестером, там сплошной текст. На версии 3,9,8 и 3,9,9 работало нормально.

Попробовал с Фуллайнс. Вот результат:
13:41:45:155 [Gabriel]: before 0
13:41:45:155 [Gabriel]: 1
13:41:45:155 [Gabriel]: 2
13:41:45:311 [Gabriel]: wait0
13:41:45:311 [Gabriel]: After 1
13:41:45:311 [Gabriel]: 3
13:41:45:311 [Gabriel]: 4
13:41:45:311 [Gabriel]: Вычитываю
13:41:45:311 [Gabriel]: Вычитал - 40
13:41:45:311 [Gabriel]: GumpID: 88BC0B07
13:41:45:311 [Gabriel]: X: 004B
13:41:45:311 [Gabriel]: Y: 004B
13:41:45:311 [Gabriel]: Pages: 1
13:41:45:311 [Gabriel]: Gump Options: NoClose NoResize
13:41:45:311 [Gabriel]:
13:41:45:311 [Gabriel]: GumpPicTiled: X Y Width Height Gump_ID ElemNum
13:41:45:311 [Gabriel]: GumpPicTiled: 50 20 400 400 5124 3
13:41:45:311 [Gabriel]: GumpPicTiled: 50 29 30 390 10460 4
13:41:45:311 [Gabriel]: GumpPicTiled: 34 140 17 279 9263 5

вот этот гамп в клиенте:
Image
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Stealth 4.0.

Post by Vizit0r »

а GetGumpFullLines ты принципиально не хочешь показывать?
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Tomers
Novice
Novice
Posts: 99
Joined: 06.08.2009 11:51

Re: Stealth 4.0.

Post by Tomers »

Vizit0r wrote:а GetGumpFullLines ты принципиально не хочешь показывать?
Попробовал с Фуллайнс. Вот результат:
13:41:45:155 [Gabriel]: before 0
13:41:45:155 [Gabriel]: 1
13:41:45:155 [Gabriel]: 2
13:41:45:311 [Gabriel]: wait0
13:41:45:311 [Gabriel]: After 1
13:41:45:311 [Gabriel]: 3
13:41:45:311 [Gabriel]: 4
13:41:45:311 [Gabriel]: Вычитываю
13:41:45:311 [Gabriel]: Вычитал - 40
13:41:45:311 [Gabriel]: GumpID: 88BC0B07
13:41:45:311 [Gabriel]: X: 004B
13:41:45:311 [Gabriel]: Y: 004B
13:41:45:311 [Gabriel]: Pages: 1
13:41:45:311 [Gabriel]: Gump Options: NoClose NoResize
13:41:45:311 [Gabriel]:
13:41:45:311 [Gabriel]: GumpPicTiled: X Y Width Height Gump_ID ElemNum
13:41:45:311 [Gabriel]: GumpPicTiled: 50 20 400 400 5124 3
13:41:45:311 [Gabriel]: GumpPicTiled: 50 29 30 390 10460 4
13:41:45:311 [Gabriel]: GumpPicTiled: 34 140 17 279 9263 5

Это именно то, что показывает

Code: Select all

GetGumpFullLines(GetGumpsCount-1,b);
Инфогамп тем не менее выдает с текстом:

Code: Select all

Serial: 17EF5
GumpID: 88BC0B07
X: 004B
Y: 004B
Pages: 1
Gump Options: NoClose NoResize

GumpPicTiled: X Y   Width   Height   Gump_ID   ElemNum
GumpPicTiled: 50  20  400  400  5124  3
GumpPicTiled: 50  29  30  390  10460  4
GumpPicTiled: 34  140  17  279  9263  5
GumpPicTiled: 83  15  350  15  10250  10
GumpPicTiled: 51  419  392  17  10101  13
GumpPicTiled: 415  29  44  390  2605  14
GumpPicTiled: 415  29  30  390  10460  15
GumpPicTiled: 130  65  175  1  9101  20

GumpPics: X  Y  ID  Hue  Page  ElemNum
GumpPic: 48  135  10411  0  0  6
GumpPic: -16  285  10402  0  0  7
GumpPic: 0  10  10421  0  0  8
GumpPic: 25  0  10420  0  0  9
GumpPic: 34  419  10306  0  0  11
GumpPic: 442  419  10304  0  0  12
GumpPic: 370  50  1417  0  0  16
GumpPic: 379  60  5545  0  0  17
GumpPic: 425  0  10441  0  0  18
GumpPic: 90  33  9005  0  0  19

XmfHTMLGumpColor: X   Y   Width   Height   ClilocID   Background   scrollbar   Hue   ElemNum   ClilocText
0   XmfHTMLGumpColor: 130  45  270  16  1049010  0  0  16777215  21  Quest Offer
1   XmfHTMLGumpColor: 160  108  250  16  1073876  0  0  10000  22  Lethal Darts
2   XmfHTMLGumpColor: 98  140  312  16  1072202  0  0  10000  23  Description
3   XmfHTMLGumpColor: 98  156  312  180  1074066  0  1  24464  24  We elves are no strangers to archery but I would be interested in learning whether there is anything to learn from the human approach. I would gladly trade you something I have if you could teach me of the deadly crossbow bolt.  

GumpButtons: X   Y   Released_ID  Pressed_ID   Quit   Page_ID   Return_value   Page   ElemNum
0   GumpButton: 95  395  12000  12002  1  0  4  0  25
1   GumpButton: 313  395  12018  12020  1  0  2  0  26
2   GumpButton: 275  370  12009  12011  1  0  7  0  27
Тут правда другой текс из самого гампа, так как там рандомные квесты дает. Но само окно у всех идентичное.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Stealth 4.0.

Post by Vizit0r »

и где здесь текстовые строки?
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
murderinc
Neophyte
Neophyte
Posts: 17
Joined: 12.09.2011 15:46

Re: Stealth 4.0.

Post by murderinc »

Проблема с получением гампа. На стелсе 3.9.6 все работало.

Code: Select all

Program New;
var 
	Tmp,FileList : TStringList; 
	M,N,gg : Integer;
	FindNo : Boolean;
 
 
 procedure WriteToFile(filepath: string;     data: string);
var 
  file: TFileStream;
begin
     try
     file := TFileStream.Create(filepath,fmOpenReadWrite);
           file.seek(0, soFromEnd);
   except
     file := TFileStream.Create(filepath,fmCreate);
   end;          
     file.WriteBuffer(data,Length(data));
     file.Free;
end;


begin
  UseObject($49254E13);
  wait(2000);
  FileList := TStringList.Create();
  Tmp := TStringList.Create();  
  GetGumpFullLines(GetGumpsCount - 1,FileList);

  m:=0;
  N:=0;
  FindNo := true;
  while (m < FileList.count-1)  and FindNo do 
    BEGIN 
    StrBreakApart(FileList.Strings[m], ' ', Tmp); 
    WriteToFile('C:\new.txt',Tmp.Strings[0] + #13#10);
    if (Tmp.Strings[0] = 'GumpButtons:') then      
       begin
       N:=m+2;
       FindNo := false;
       end;
       m:=m+1;
    END;  
    if N > 0 then
        begin
        WriteToFile('C:\new.txt',#13#10+ #13#10 + '___________________________'+ #13#10);
        StrBreakApart(FileList.Strings[N], ' ', Tmp);
        for gg:= 1 to 50 do begin
        WriteToFile('C:\new.txt',Tmp.Strings[gg] + #13#10);
        addToSystemJournal(Tmp.Strings[gg]);
        end;
        end
    else
        begin
        addToSystemJournal('не нашел');   
        end; 
    FileList.Free;
    Tmp.Free;
end.
Запустив скрипт на 3.9.6 получаем примерно такое:
GumpButton:
56
62
2118
2117
1
0
642 // гамп руны
1

Запустив скрипт на 4.0.2 получаем такое:
GumpButton:
320
8
2236
2236
0
2
0
1
27

более подробно тут http://rghost.ru/37661210
Tomers
Novice
Novice
Posts: 99
Joined: 06.08.2009 11:51

Re: Stealth 4.0.

Post by Tomers »

Vizit0r wrote:и где здесь текстовые строки?
Вот. Интересует именно вот этот кусок:

Code: Select all

3   XmfHTMLGumpColor: 98  156  312  180  1074066  0  1  24464  24  We elves are no strangers to archery but I would be interested in learning whether there is anything to learn from the human approach. I would gladly trade you something I have if you could teach me of the deadly crossbow bolt. 
Возможно я что-то путаю, но на версиях 3,9,8 и 3,9,9, TStringList заполнялся нормально через GetGumpTextLines. Почему и возник вопрос, так как похоже, что изменился метод работы, а в Вики нашел старые примеры, по которым у меня написано.
Не буду засорять тут топик, пойду в раздел Хелп с вопросами по переделке своего кода под новую версию. Может потрете мои посты в этом топике, чтоб небыло лишнего
Tomers
Novice
Novice
Posts: 99
Joined: 06.08.2009 11:51

Re: Stealth 4.0.

Post by Tomers »

Кстати еще заметил, что новая версия для Инклюдов требует полного пути.
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Stealth 4.0.

Post by Vizit0r »

Tomers
этот кусок - это клилок, вытащенный из параметра Cliloc_ID элемента XmfHTMLGumpColor
и он к обычным текстовым строкам не относится никак.
Более того, раньше этот текст не показывался, и уж тем более не мог попасть в текстовые строки.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: Stealth 4.0.

Post by Vizit0r »

Tomers wrote:Кстати еще заметил, что новая версия для Инклюдов требует полного пути.
не лазил туда сто лет.
вот где он ищет по умолчанию (FileName - входящее имя инклюда)

Code: Select all

  Path := ExtractFilePath(fScriptPath) + FileName;
  if FileExists(Path) then
    CorrectPath := Path;
  if (CorrectPath = '') and FileExists(Path + '.pas') then
    CorrectPath := Path + '.pas';
  if (CorrectPath = '') and FileExists(ExpandUNCFileName(StealthPath + '\Scripts\Uses\' + FileName)) then
    CorrectPath := ExpandUNCFileName(StealthPath + '\Scripts\Uses\' + FileName);
  if (CorrectPath = '') and FileExists(ExpandUNCFileName(StealthPath + '\Scripts\Uses\' + FileName + '.pas')) then
    CorrectPath := ExpandUNCFileName(StealthPath + '\Scripts\Uses\' + FileName + '.pas');
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Post Reply