Openkore.com

OpenKore Forums
It is currently 21 May 2013, 01:33

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: The "time" functin in AI.pm
PostPosted: 28 Feb 2011, 23:33 
Offline
Developers
Developers

Joined: 24 Nov 2010, 03:08
Posts: 192
The codes that calling the "time" functin, such as :
statement in sub ai_SkillUse
Code:
sub ai_skillUse {
   return if ($char->{muted});
   my %args = (
      skillHandle => shift,
      lv => shift,
      maxCastTime => { time => time, timeout => shift },
      minCastTime => { time => time, timeout => shift },
      target => shift,
      y => shift,
      tag => shift,
      ret => shift,
      waitBeforeUse => { time => time, timeout => shift },
      prefix => shift
   );
   $args{giveup}{time} = time;
   $args{giveup}{timeout} = $timeout{ai_skill_use_giveup}{timeout};

   if ($args{y} ne "") {
      $args{x} = $args{target};
      delete $args{target};
   }
   AI::queue("skill_use", \%args);
}

The lines:
maxCastTime => { time => time, timeout => shift },
minCastTime => { time => time, timeout => shift },
waitBeforeUse => { time => time, timeout => shift },
$args{giveup}{time} = time;

They will get incorrect time value, the decimal is truncated.
And then, the "timeOut" will get wrong result from these time values.

So, the AI.pm should add a line "use Time::HiRes qw(time);" after "use strict;", such as :
Code:
......
# moved into this package.

package AI;

use strict;
use Time::HiRes qw(time);
use Globals;
use Utils qw(binFind);
........


After adding the "use Time::HiRes qw(time);" line.
I make my Monk bot has most 90% ComboSkill, even more high !


Top
 Profile  
 
 Post subject: Re: The "time" functin in AI.pm
PostPosted: 01 Mar 2011, 16:21 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1254
Nice!
Approved.
somebody Commit it please.

P.S.:
Would you like to Join our Dev Team?

_________________
Join our Team. Click here.
Image


Image


Top
 Profile  
 
 Post subject: Re: The "time" functin in AI.pm
PostPosted: 01 Mar 2011, 20:39 
Offline
Developers
Developers

Joined: 05 Dec 2008, 05:42
Posts: 1857
In r7674.
We need to check other modules for this issue too.


Top
 Profile  
 
 Post subject: Re: The "time" functin in AI.pm
PostPosted: 01 Mar 2011, 20:44 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1254
BTW. I think that 'time' should be used only once per block.
Everything else, is copies of the first one.

_________________
Join our Team. Click here.
Image


Image


Top
 Profile  
 
 Post subject: Re: The "time" functin in AI.pm
PostPosted: 03 Mar 2011, 00:50 
Offline
Developers
Developers

Joined: 24 Nov 2010, 03:08
Posts: 192
kLabMouse wrote:
Nice!
Approved.
somebody Commit it please.

P.S.:
Would you like to Join our Dev Team?

I would like to join OpenKore Dev Team.....
But, I have no much time.
I play and modify openkore off work.

What is the duty, to be a Dev Team member ?
The "Join our Team" seems to be locked up !!
I already reply to Love Openkore? Join the team!.


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

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 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 © 2000, 2002, 2005, 2007 phpBB Group
[ Time : 0.056s | 14 Queries | GZIP : On ]