OpenKore / openkore

A free/open source client and automation tool for Ragnarok Online
http://openkore.com
Other
1.28k stars 1.04k forks source link

Rodex Get Mail ID #1258

Closed iamtonysoft closed 7 years ago

iamtonysoft commented 7 years ago

Hi. is there a function for rodex to get mail id's and pass it into a loop

i want to read the mail and open it by doing a loop but no available function yet to get mail id at wiki documentation or will there be a seperate function by just reading the mail by index number instead of mail id

only function i found. rodex read <mail id>

Yakov-Chernogor commented 7 years ago

Try rodex list Do you want to do it by a macros?

alisonrag commented 7 years ago

this sub are working:

you can use in macro, eventmacro and plugin:

sub checkRodexID {
    my $id;
    foreach my $mail_id (keys %{$rodexList->{mails}}) { my $mail = $rodexList->{mails}{$mail_id}; next if ($mail->{page} != 0 || $mail->{page_index} != 0); $id = $mail_id; last; }
    if (defined $id) {
        message "Your wanted mail id is $id.\n";
        return $id;
    } else {
        message "You have no mails.\n";
        return 0;
    }
}

credits to: @Henrybk and @ ReedemBR

iamtonysoft commented 7 years ago

@alisonrag

Thank you that is what I am looking for.