I am using a week or so old SVN version of openkore. First, I found out that there is some pet support in openkore already, looks like this:
Code: Select all
Command usage: pet [capture|hatch|status|info|feed|performance|return|unequip|name <name>]
1)enable debug messages, in config.txt find "debug" and set it to "debug 1" but that spams your console with lots of unneeded stuff
2)change the source code, openkore\src\Network\Receive\ServerType0.pm on line around line 4620 you find this code:
Code: Select all
sub pet_info {
my ($self, $args) = @_;
$pet{name} = bytesToString($args->{name});
$pet{renameflag} = $args->{renameflag};
$pet{level} = $args->{level};
$pet{hungry} = $args->{hungry};
$pet{friendly} = $args->{friendly};
$pet{accessory} = $args->{accessory};
$pet{type} = $args->{type} if (exists $args->{type});
debug "Pet status: name=$pet{name} name_set=". ($pet{renameflag} ? 'yes' : 'no') ." level=$pet{level} hungry=$pet{hungry} intimacy=$pet{friendly} accessory=".itemNameSimple($pet{accessory})." type=".($pet{type}||"N/A")."\n", "pet";
}
You need to change the debug line to:
Code: Select all
message TF("Pet status: name=$pet{name} name_set=". ($pet{renameflag} ? 'yes' : 'no') ." level=$pet{level} hungry=$pet{hungry} intimacy=$pet{friendly} accessory=".itemNameSimple($pet{accessory})." type=".($pet{type}||"N/A")."\n"), "pet", 1;
So now how to autofeed your pet?
First, you need to find out if your pet is hungry or not. I used the "doCommand" option in config.txt
Code: Select all
doCommand pet info {
stopWhenHit 0
inLockOnly 0
notWhileSitting 0
notInTown 0
timeout 300
disabled 0
manualAI 0
}
Code: Select all
automacro feedPet {
console /hungry=(\d+) intimacy=/
call {
if ($.lastMatch1 >= 60) goto end
do pet feed
stop
:end
log No feeding needed atm!
}
#maybe not needed, just in case
timeout 100
}