Openkore.com

OpenKore Forums
It is currently 11 Dec 2019, 10:56

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: runFromTarget support in autoSwitch
PostPosted: 08 Apr 2008, 15:40 
Offline
Noob
Noob
User avatar

Joined: 06 Apr 2008, 09:01
Posts: 7
Location: near respawn at Prontera
I wrote a quick patch to add runFromTarget and runFromTarget_dist to the autoSwitch options. It's still experimental, but seems to work OK so far on SVN version.

Dunno if this is the right place to post it, or if there is forms to fulfil - feel free to move/correct me if I am doing anything wrong.

I have 2 situations where this is useful:
- an Auto Spell sage killing geographers (distant cast only, no auto spell :P damn those DEX plants)
- an Exorcist on Pyramids and maps with Drainliars, Familiars and the like - I'd rather use a stunner to kill them than use a Phen accessory (where I play, there is no Phen card drop - only thru ROPs; too expensive to let it get caught on a bot)

There are probably more situations where it could be useful, but those are my motives for patching :)

Enough talk, here is the snippet of code, added in AI.pm.

on function "sub attack", right after the "useWeapon' check in autoSwitches:

Code:
                                if ($config{"autoSwitch_$i"."_useWeapon"} ne "") {
                                        $ai_v{'attackUseWeapon'} = $config{'attackUseWeapon'};
                                        $config{'attackUseWeapon'} = $config{"autoSwitch_$i"."_useWeapon"};
                                        message TF("Change Attack useWeapon to : %s\n", $config{'attackUseWeapon'}), "equip";
                                }
                                # Patch starts here
                                if ($config{"autoSwitch_$i"."_runFromTarget"} ne "") {
                                        $ai_v{'runFromTarget'} = $config{'runFromTarget'};
                                        $config{'runFromTarget'} = $config{"autoSwitch_$i"."_runFromTarget"};
                                        message TF("Change runFromTarget to : %s\n", $config{'runFromTarget'}), "equip";
                                }
                                if ($config{"autoSwitch_$i"."_runFromTarget_dist"} ne "") {
                                        $ai_v{'runFromTarget_dist'} = $config{'runFromTarget_dist'};
                                        $config{'runFromTarget_dist'} = $config{"autoSwitch_$i"."_runFromTarget_dist"};
                                        message TF("Change runFromTarget_dist to : %s\n", $config{'runFromTarget_dist'}), "equip";
                                }
                                # Patch ends here
                                last AUTOEQUIP;


A little bit further down, there is the ai_v "restore" code. Again, right after the useWeapon check:

Code:
                if ($ai_v{'attackUseWeapon'} ne "" && $config{'attackUseWeapon'} != $ai_v{'attackUseWeapon'}) {
                        $config{'attackUseWeapon'} = $ai_v{'attackUseWeapon'};
                        message TF("Change Attack useWeapon to default : %s\n", $config{'attackUseWeapon'}), "equip";
                }
                # Patch starts here
                if ($ai_v{'runFromTarget'} ne "" && $config{'runFromTarget'} != $ai_v{'runFromTarget'}) {
                        $config{'runFromTarget'} = $ai_v{'runFromTarget'};
                        message TF("Change runFromTarget to default : %s\n", $config{'runFromTarget'}), "equip";
                }
                if ($ai_v{'runFromTarget_dist'} ne "" && $config{'runFromTarget_dist'} != $ai_v{'runFromTarget_dist'}) {
                        $config{'runFromTarget_dist'} = $ai_v{'runFromTarget_dist'};
                        message TF("Change runFromTarget_dist to default : %s\n", $config{'runFromTarget_dist'}), "equip";
                }
                # Patch ends here
        } #END OF BLOCK AUTOEQUIP


And now the configuration example:

Code:
autoSwitch Geographer,Flora {
        useWeapon 0         
        runFromTarget 1
        runFromTarget_dist 6
}


I would appreciate your thoughts on this.

_________________
Image


Top
 Profile  
 
 Post subject: Re: runFromTarget support in autoSwitch
PostPosted: 08 Apr 2008, 17:50 
Offline
Noob
Noob
User avatar

Joined: 08 Apr 2008, 01:03
Posts: 8
Location: PH
i like this idea ^^

_________________
Im A Darkmoon Fan ^_^


Top
 Profile  
 
 Post subject: Re: runFromTarget support in autoSwitch
PostPosted: 09 Apr 2008, 04:40 
Offline
Perl Monk
Perl Monk

Joined: 04 Apr 2008, 03:08
Posts: 416
you might want to post a diff file and test it in every possible way.
we'll commit it if we think its usefull and working properly


Top
 Profile  
 
 Post subject: Re: runFromTarget support in autoSwitch
PostPosted: 24 Mar 2009, 22:33 
Offline
OpenKore Monk
OpenKore Monk

Joined: 04 Apr 2008, 10:10
Posts: 474
Post a diff, I'll move it to the commit queue.

Time to wake up :P

_________________
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.


Top
 Profile  
 
 Post subject: Re: runFromTarget support in autoSwitch
PostPosted: 24 Mar 2009, 23:42 
Offline
Noob
Noob

Joined: 22 Feb 2009, 08:23
Posts: 6
Nice implementation :) I look forward at this.


Top
 Profile  
 
 Post subject: Re: runFromTarget support in autoSwitch
PostPosted: 27 May 2011, 13:51 
Offline
Testers Team
Testers Team

Joined: 04 Apr 2008, 21:53
Posts: 106
Location: Asia
AI.pm already changes

_________________
Image
Image


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