Yoko

All sides of Injection
It is currently 2025-12-26 01:47:36

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2005-05-15 12:17:08 
Offline
Expert!
User avatar

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

Не могу понять как исправить чтобы такого небыло:
Code:
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


Top
   
 Post subject:
PostPosted: 2005-05-15 12:21:53 
Offline
Expert!
User avatar

Joined: 2005-04-23 10:19:43
Posts: 388
Забыл приложить файл c:\autoloot.dat

Code:
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-ий раз...


Top
   
 Post subject:
PostPosted: 2005-05-15 12:24:06 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Хех, вот ща ИфЕС допишу :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.
Skype: d119060


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited