Скрипт выбивающий инжект после 3-его раза

General Injection issues

Moderators: Murderator+, Murderator

Post Reply
Beyonder
Expert!
Posts: 388
Joined: 2005-04-23 10:19:43
Contact:

Скрипт выбивающий инжект после 3-его раза

Post by Beyonder »

Писал я скриптик на своеобразное чтение из файла. Как-бы и написал, но при запуске происходит так:
Пуск 1: Unhandled exception
Пуск 2: Unhandled exception
Пуск 3: Все работает как должно
Пуск 4: Unhandled exception + Краш инжи.

Не могу понять как исправить чтобы такого небыло:

Code: Select all

Sub ScanFile(NeedNames,NeedTypFr,NeedTypTo,NeedColOf,NeedColFr,NeedColTo,Results)
## Results[0]=LastTyp
## Results[1]=LastCol
  var LastTyp=0,LastCol=0,LastStartCol=0
  var f_type,f_word
  var f

  f=file("c:\autoloot.dat")
  f.open()
  f_type=safe call f.ReadString()   
  while (not f.eof())
    LastStartCol=LastCol
     NeedColOf[LastTyp]=LastStartCol;
     #### Reading name
    if (f_type=="Name=") then
      NeedNames[LastTyp]=safe call f.ReadString()
      f_type=safe call f.ReadString()   
      UO.TextPrint("Name: "+NeedNames[LastTyp])
    else
    #### Reading type
    if (f_type=="Type=") then
      f_word=safe call f.ReadString()   
      while (f_word<>"Name=" && f_word<>"Type=" && f_word<>"Colr=" && f_word<>"" && not f.eof())
        if (len(f_word)==6 or len(f_word)==13) then
          NeedTypFr[LastTyp]=Left(f_word,6)
          NeedTypTo[LastTyp]=Right(f_word,6)
          NeedColOf[LastTyp]=LastStartCol
          LastTyp=LastTyp+1
          UO.TextPrint("Type: "+NeedTypFr[LastTyp-1]+"-"+NeedTypTo[LastTyp-1])
        end if
        f_word=safe call f.ReadString()
      wend
      f_type=f_word
    else
   
    if (f_type=="Colr=") then
      f_word=safe call f.ReadString()   
      while (f_word<>"Name=" && f_word<>"Type=" && f_word<>"Colr=" && f_word<>"" && not f.eof())
        if (len(f_word)==6 or len(f_word)==13) then
          NeedColFr[LastCol]=Left(f_word,6)
          NeedColTo[LastCol]=Right(f_word,6)
          LastCol=LastCol+1
          UO.TextPrint("Color: "+NeedColFr[LastCol-1]+"-"+NeedColTo[LastCol-1])
        end if
        f_word=safe call f.ReadString()
      wend
      f_type=f_word
    end if
    end if
    end if
    ####
  wend
  f.close()
  Results[0]=LastTyp
  Results[1]=LastCol
end sub

sub TestScan()
UO.TextOpen()
dim NeedNames[5]
dim NeedTypFr[5]
dim NeedTypTo[5]
dim NeedColOf[5]
dim NeedColFr[20]
dim NeedColTo[20]
dim Results[5]
ScanFile(NeedNames,NeedTypFr,NeedTypTo,NeedColOf,NeedColFr,NeedColTo,Results)
UO.Print(str(Results[0]))
UO.Print(str(Results[1]))
end sub
Beyonder
Expert!
Posts: 388
Joined: 2005-04-23 10:19:43
Contact:

Post by Beyonder »

Забыл приложить файл c:\autoloot.dat

Code: Select all

Name= Jems
Type= 0x0000-0x0010 0x0F00
Colr= 1x1100-1x1f00 1x22ff 0x1223
Name= Scrolls
Type= 0x0F00-0x0FF0 0x0100
Colr= 1x0010 0x1122 0x1111-0x1211
Name= Book
Type= 0x0001-0x0001 0x0F00
Colr= 1x0010


Да и кстати, 1 ошибку я подправил уже, скрипт не выбивает инжект, но работает каждый 3-ий раз...
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Хех, вот ща ИфЕС допишу :roll:
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
Post Reply