Yoko

All sides of Injection
It is currently 2026-03-10 14:39:51

All times are UTC+02:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 2004-08-10 18:03:19 
Offline

Joined: 2004-07-20 00:14:10
Posts: 45
Why when i put 2 ifs, in the same script,
my uo starts to get slower? And when i load 3 scripts, all of them with 2 ifs, i cant play, because i have little crashs all the time...

E.G

sub Bandages()
while true
if uo.life <= 90 then
if uo.mana >= 50 then
uo.exec ("bandageself")
wait (2000)
else
wait (1500)
end if
end if
wend
end sub


Top
   
PostPosted: 2004-08-10 19:59:02 
Offline
Expert!

Joined: 2004-04-03 17:36:29
Posts: 2544
Location: Saint-Petersburg
paulinho4life wrote:
Why when i put 2 ifs, in the same script,
my uo starts to get slower? And when i load 3 scripts, all of them with 2 ifs, i cant play, because i have little crashs all the time...

E.G

sub Bandages()
while true
if uo.life <= 90 then
if uo.mana >= 50 then
uo.exec ("bandageself")
wait (2000)
else
wait (1500)
end if
end if
wend
end sub


You have empty cycle (no actions) if your health greater 90. Scripts with empty cycle is simple way to lags and full busy your processor. Insert wait(100) to end of your script (before 'wend') and enjoy ;)


Top
   
 Post subject:
PostPosted: 2004-08-11 15:35:34 
Offline

Joined: 2004-08-09 14:17:33
Posts: 4
another way you could do it is
Code:
sub Bandages() 
while true
if uo.life <= 90 AND uo.mana >= 50 then
uo.exec ("bandageself")
wait (2000)
else
wait (1500)
end if
wend
end sub

just a suggestion :)
or not use the while command and set a label(thats how I set my infinite loops)
Code:
sub Bandages() 
top:
if uo.life <= 90 then
if uo.mana >= 50 then
uo.exec ("bandageself")
wait (2000)
else
wait (1500)
end if
goto top
end sub

hrmm actually that'd still lag :P Edred has the right of it


Top
   
 Post subject:
PostPosted: 2004-08-11 16:19:20 
Offline
Expert!

Joined: 2004-04-25 11:11:07
Posts: 359
labels sux. Any real programmer will tell you this.

_________________
Без труда не выловишь и рыбку из пруда,
А без пруда не выловишь её и с трудом...


Top
   
 Post subject:
PostPosted: 2004-08-12 19:02:04 
Offline
User avatar

Joined: 2004-06-26 15:36:11
Posts: 46
Location: Praha
definitly


Top
   
 Post subject: ty
PostPosted: 2004-08-17 16:50:35 
Offline

Joined: 2004-07-20 00:14:10
Posts: 45
ty


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 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