Yoko
http://forum.yoko.com.ua/

[Help]this script cause lag why
http://forum.yoko.com.ua/viewtopic.php?f=3&t=13139
Page 1 of 1

Author:  khitans [ 2008-01-27 22:06:38 ]
Post subject:  [Help]this script cause lag why

I would like to know how get this script does not cause lag

Code:
sub hpoison()
     while NOT UO.Dead()
   repeat
            if UO.Poisoned()==1 then
                  wait(700)
                  uo.exec("cast 'Cure' self")
            end if
            if uo.poisoned()==0 then
                  if UO.Life < UO.str then
                        UO.bandageself()
                        wait(4000)
                  endif
      until UO.Life == UO.str
if UO.Life <= 30 then
uo.usetype('0x0E24')
wend
end sub

Author:  Nmy [ 2008-01-27 22:12:05 ]
Post subject: 

Well firstly you should use code/code when you post a script.

You need to use wait somewhere, because it can madly cycle without delay's and do nothing.

Author:  Destruction [ 2008-01-27 22:33:42 ]
Post subject: 

Your script is clumsy.

For example, unexpected "until UO.Life == UO.str", expected "endif" and unexpected "wend", expected "endif"..

Two unclosed operators.. :)

And as Mr Nmy wrote, u must use some pause in cycles (for, while, repeat).

PS: Correct version:
Code:
sub hpoison()
   while NOT UO.Dead()
      repeat
         if UO.Poisoned()==1 then
            wait(700)
            uo.exec("cast 'Cure' self")
         end if
         if uo.poisoned()==0 then
            if UO.Life < UO.str then
               UO.bandageself()
               wait(4000)
            endif
         endif ; !!! NEW LINE !!!
         wait( 100 ) ; !!! NEW LINE !!!
      until UO.Life == UO.str
      if UO.Life <= 30 then
         uo.usetype('0x0E24')
      endif ; !!! NEW LINE !!!
   wend
end sub


I was add comment to new lines in script. Don't forget to close IF in next times ;)

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/