Yoko

All sides of Injection
It is currently 2025-11-09 23:47:09

All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 2007-09-27 16:31:23 
Offline

Joined: 2007-09-24 17:11:19
Posts: 20
незнаю в чём но есть проблема... когда запукаю скрипр, клиент начинает подлагивать ... в скрите ошибка чтоли ? :?


Code:
sub healingother()
repeat
while not uo.dead()
wait(200)
uo.UseType('0x0E21','0x0000')
uo.deletejournal()
uo.waittargetobject('0x00008E6E')
wait(1000)
repeat
until uo.injournal('put') or uo.injournal('fully')
wait(1000)
uo.print('3')
wait(1000)
uo.print('2')
wait(1000)
uo.print('1')
wait(1600)
wend
end if
end if
end sub


Top
   
 Post subject:
PostPosted: 2007-09-27 16:36:07 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
Code:
sub healingother() 

repeat

  while not uo.dead()
    wait(200)

    uo.UseType('0x0E21','0x0000')
    uo.deletejournal()
    uo.waittargetobject('0x00008E6E')
    wait(1000)
    repeat
 
    until uo.injournal('put') or uo.injournal('fully')

    wait(1000)
    uo.print('3') 
    wait(1000)
    uo.print('2')
    wait(1000)
    uo.print('1')
    wait(1600)

  wend

end if
end if
end sub


1. Для чего repeat и 2 ифа в конце?
2.

Code:
    uo.UseType('0x0E21','0x0000') 
    uo.deletejournal()
    uo.waittargetobject('0x00008E6E')


Ловушка на прицел ставится до действия.
Code:
    uo.deletejournal() 
    uo.waittargetobject('0x00008E6E')
    uo.UseType('0x0E21','0x0000')


3.
Code:
    repeat 
 
    until uo.injournal('put') or uo.injournal('fully')


Лагает из-за того что пока ждёт сообщений выполняет проверку на их наличие в журнале с минимально возможной задержкой что и приводит к таким лагам. wait(100) внутри цикла будет достаточно + используй динамическую задержку

Code:
    var k
    k=0
    repeat
      k=k+1
      wait(100)
    until uo.injournal('put') or uo.injournal('fully') || k>100


тогда в случае того что если сообщения и не появятся то как только k достигнет значения =100, он выйдет из цикла

4. Используй табуляцию и учись правильно программировать- это будет удобно и для тебя и для других. Отступы после условных операторов и циклов на 1-4 пробела от первой буквы оператора(if,repeat,while,for) и когда закрываешь (end if,until,wend,next) то возвращаешься на такое же кол-во пробелов чтоб скрипт был более читабельным

Пример:


Code:
repeat    
   If  Then
      If  Then
         If  Then
            If  Then

            Endif
         Endif
      Endif
   Endif
   If  Then
      If  Then

      Endif
      If  Then

      Endif
   Endif
until 


Top
   
 Post subject:
PostPosted: 2007-09-27 16:44:10 
Offline

Joined: 2007-09-24 17:11:19
Posts: 20
Scripts Writer ты просто бог скриптов :) спасиб тебе 8) :)


Top
   
 Post subject:
PostPosted: 2007-09-27 16:46:05 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
:oops: :wink:


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 3 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:  
cron
Powered by phpBB® Forum Software © phpBB Limited