Yoko

All sides of Injection
It is currently 2025-11-23 21:14:30

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2008-01-27 22:06:38 
Offline

Joined: 2007-11-25 22:31:17
Posts: 4
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


Top
   
 Post subject:
PostPosted: 2008-01-27 22:12:05 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
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.

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2008-01-27 22:33:42 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
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 ;)

_________________
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: Bing [Bot] 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:  
Powered by phpBB® Forum Software © phpBB Limited