Openkore.com

OpenKore Forums
It is currently 22 Feb 2018, 02:45

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: AI 2008 Smart Event.
PostPosted: 03 Dec 2008, 07:11 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1299
I was planning to use this technology to make coding and performance better.
Technology itself is based on Utils::SmartCallbackList that is part of AI 2008 Project and used by AI::EnvironmentQueue

Technical Details:
System is based on Rules, callback function will run only when all the Rules will return 1;
Utils::SmartCallbackList->call function get a parameter: object
Object is a simple hash with no nested structures.

Example:
Adding new Callback with rules:
Code:
my $rules = [(object => "obj_name1", type => "eq", against=> "something"),
                 (object => "obj_name2", type => "==", against=> 1)];
$SmartCallbackList->add($self, $rules, \&some_func, undef);

my $rules2 = [(object => "obj_name1", type => "eq", against=> "something new"),
                 (object => "obj_name2", type => "==", against=> 1)];
$SmartCallbackList->add($self, $rules2, \&some_func2, undef);

Calling by rule:
Code:
my %check;
%check{obj_name1} = "something";
%check{obj_name2} = 1;
$SmartCallbackList->call($self, \%check);


The "call" function, will check whatever all rules match, and only then call our Callback.

All Questions and Suggestions are Welcome.

_________________
Join our Team. Click here.
Image


Image


Top
 Profile  
 
 Post subject: Re: AI 2008 Smart Event.
PostPosted: 04 Jan 2009, 09:18 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1299
Found some good Example and very good Implementation of such system inside CPAN.
System will update a bit, to handle more complex rules and structures.

_________________
Join our Team. Click here.
Image


Image


Top
 Profile  
 
 Post subject: Re: AI 2008 Smart Event.
PostPosted: 02 Feb 2009, 07:00 
Offline
Human
Human
User avatar

Joined: 23 Apr 2008, 10:11
Posts: 30
Location: Indonesia TANAH AIRKU
Well that's a GENIUS idea for me.(sorry if I'm a dumb)
I hope it gets implemented soon and i could learn sumthin new from it...


Top
 Profile  
 
 Post subject: Re: AI 2008 Smart Event.
PostPosted: 02 Feb 2009, 07:03 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1299
Chontrad wrote:
Well that's a GENIUS idea for me.(sorry if I'm a dumb)
I hope it gets implemented soon and i could learn sumthin new from it...


It's already Implemented in "AI 2008" Project.
But since it's not as perfect as it should be, it will be improved shortly.

_________________
Join our Team. Click here.
Image


Image


Top
 Profile  
 
 Post subject: Re: AI 2008 Smart Event.
PostPosted: 23 Mar 2009, 08:12 
Offline
Super Moderators
Super Moderators
User avatar

Joined: 06 May 2008, 12:47
Posts: 801
kLabMouse, could you read last paragraph of this post and answer my question?

_________________
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!


Top
 Profile  
 
 Post subject: Re: AI 2008 Smart Event.
PostPosted: 23 Mar 2009, 08:35 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1299
Technology wrote:
kLabMouse, could you read last paragraph of this post and answer my question?

MM.... may-be I've had too much vodka yesterday, But where is that question anyway?

_________________
Join our Team. Click here.
Image


Image


Top
 Profile  
 
 Post subject: Re: AI 2008 Smart Event.
PostPosted: 23 Mar 2009, 08:56 
Offline
Super Moderators
Super Moderators
User avatar

Joined: 06 May 2008, 12:47
Posts: 801
Na zdorovje :)
Technology wrote:
Criticism on the condition system
Quote:
if ($config{$prefix."_isGuildTitle"})
Kore should NOT have to check wether to use a condition or not every single time.
(wich it currently is, causing kore to hog extra resources)

It should be more like the macro plugin,
where hooks are only used when you actually want to use them in any of the automacro's.

An improvement on that would be: using a hook (or in skillblock, a condition) dependant on the skillblock options for each skillblock.
If i'm not mistaken, this is exactly what kLabMouse wants to do with smart events.
For example, we have a skill use block with some conditions.
We create a smart event for our bot to start a skill task,
in the smart event conditions checks we only put those condition checks that we want.
This way, kore simply knows wich condition checks to use,
compared to how it is now: kore needs to check wether to use a condition check first.
Less CPU overhead.

_________________
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!


Top
 Profile  
 
 Post subject: Re: AI 2008 Smart Event.
PostPosted: 23 Mar 2009, 08:59 
Offline
Administrator
Administrator
User avatar

Joined: 24 Apr 2008, 12:02
Posts: 1299
Technology wrote:
Technology wrote:
Criticism on the condition system
Quote:
if ($config{$prefix."_isGuildTitle"})
Kore should NOT have to check wether to use a condition or not every single time.
(wich it currently is, causing kore to hog extra resources)

It should be more like the macro plugin,
where hooks are only used when you actually want to use them in any of the automacro's.

An improvement on that would be: using a hook (or in skillblock, a condition) dependant on the skillblock options for each skillblock.
If i'm not mistaken, this is exactly what kLabMouse wants to do with smart events.
For example, we have a skill use block with some conditions.
We create a smart event for our bot to start a skill task,
in the smart event conditions checks we only put those condition checks that we want.
This way, kore simply knows wich condition checks to use,
compared to how it is now: kore needs to check wether to use a condition check first.
Less CPU overhead.


Yep. That's one of "Smart Events" use cases.

Edit:
Smart Events are more global thing. It's like Conditional hooks to Environment.

_________________
Join our Team. Click here.
Image


Image


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

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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