how to check the variable - Homunculus hunger

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

Message
Author
martilyo
Noob
Noob
Posts: 19
Joined: 01 Jan 2009, 12:30
Noob?: Yes

how to check the variable - Homunculus hunger

#1 Post by martilyo »

Hi,

My main question would be;

What is the variable used to store homunculus hunger ?

What I would like to do is to assign this value to variable ,x , to determine if it is below 24 . If it is below 24 then I will automatically do homun feed.

I am planning to use this as a work around via macro. However if still it may not be a solution, it will still be great as long as I can get this value and show it off. Or at least assign this value on a temporary variable in a macro.

Thanks,

Hammer (in English)

martilyo
Noob
Noob
Posts: 19
Joined: 01 Jan 2009, 12:30
Noob?: Yes

Re: how to check the variable - Homunculus hunger

#2 Post by martilyo »

I saw in commit queue ... http://forums.openkore.com/viewtopic.php?f=58&t=2400 ...

Code: Select all

*** 1808,1821 ****
        "--------------------------------------------------------\n" .
        "Atk: \@>>>    Matk:     \@>>>    Hunger:    \@>>>\n" .
        "Hit: \@>>>    Critical: \@>>>    Intimacy:  \@>>>\n" .
!       "Def: \@>>>    Mdef:     \@>>>    Accessory: \@>>>\n" .
!       "Flee:\@>>>    Aspd:     \@>>>\n" .
        "--------------------------------------------------------"),
        [$char->{'homunculus'}{'name'}, $hp_string, $sp_string,
        $char->{'homunculus'}{'level'}, $exp_string, $char->{'homunculus'}{'atk'}, $char->{'homunculus'}{'matk'}, $char->{'homunculus'}{'hunger'},
        $char->{'homunculus'}{'hit'}, $char->{'homunculus'}{'critical'}, $char->{'homunculus'}{'intimacy'},
!       $char->{'homunculus'}{'def'}, $char->{'homunculus'}{'mdef'}, $char->{'homunculus'}{'accessory'},
!       $char->{'homunculus'}{'flee'}, $char->{'homunculus'}{'aspdDisp'}]);
           
        message($msg, "info");
This one appears after you manually type, homun s . I though that it will be $char->{'homunculus'}{'hunger'} to be the variable. I tried to do a test by creating a macro:

Code: Select all

macro h_feed {
 $x = $char->{'homunculus'}{'hunger'}
 do c $x
}
However calling this macro displays 'x' only as shouted by the character. I was not able to get a number.

Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: how to check the variable - Homunculus hunger

#3 Post by Technology »

Why not configure it?
# Feed homunculus between MIN and MAX value (example: between 11 and 25)
homunculus_hungerMin 11
homunculus_hungerMax 24
Actually, you can't access kore's $char->{'homunculus'}{'hunger'} like this,
you should do it in an eval or add a keyword to the macro plugin that makes this variable accessible.
Automacro trigger is also an option.

Tho, i understand that you and many others are using macro's to emulate AI functionality.
The reason for this is that we are currently stuck with the 2.x legacy AI and dito configuration of it.
Instead of trying to add code to the doomed 2.x source, people are resorting to macro's.
Well, can't blame them. :P
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!

martilyo
Noob
Noob
Posts: 19
Joined: 01 Jan 2009, 12:30
Noob?: Yes

Re: how to check the variable - Homunculus hunger

#4 Post by martilyo »

Thanks Technology. However I tried to do the homunculus part in the config however still it does not feed my vanilmirth @ 24 hunger (seen via homun s in console)

seems it is no longer responding on to those lines.

However, will it be possible to ask on how to call this variable via eval ? I know its spoon feeding already but I am no longer able to resolve my own issue.

Code: Select all

# get hunger lvl of homunculus
$x = @eval (.$char->{'homunculus'}{'hunger'})

#display hunger level - testing purpose
do c x
Will this code work ? will it be possible to ask for the exact line ... please ... just this one ...

The result that I would like to get is the integer , hunger level of vanilmirth, so that automacro will decide to feed it or not.

Post Reply