[REQUEST] Professions role - event when checking mail

Post Reply
zombiejoe
Basic Botter
Basic Botter
Posts: 9
Joined: Sat Jul 14, 2018 4:47 pm

[REQUEST] Professions role - event when checking mail

Post by zombiejoe » Mon Sep 17, 2018 3:28 pm

Jarod,

First of all thank you! I really appreciate the feed back you give on this forum and that you're active in monitoring it.

I spent some time thinking over what I originally asked and realized the only thing I was missing here was a way to call a plugin function when the mail is being checked. The professions role works really well for everything I need except I want to add the ability to move items to more than just my main character.

Would it be possible to have an event handler added to call plugin functions while the mailbox is opened for transferring items for storage? I've tried doing this in the AfterConnectionEvent and BeforeCheckCompletedTasksEvent but I think it would look a little suspicious to have each of my characters potentially opening the mailbox multiple times every time they log in. It also doesn't seem very efficient.

I guess this would also require an option be added to force the task that sends mail to always be called (if storage is enabled) so I realize the changes I'm requesting aren't trivial but if it's possible, I think this would be a really great feature add for anyone writing their own plugins.

Thank you again for putting up with all my weird questions and for all the help you provide the community!

Orion33
Contributor
Contributor
Posts: 620
Joined: Sat Jan 07, 2017 4:00 pm

Re: [REQUEST] Professions role - event when checking mail

Post by Orion33 » Fri Sep 28, 2018 8:25 am

You can try to use other events. These logs can help you to choise.
Spoiler: [+]
Professions are disabled, invoke only:

Code: Select all

[13-48-5 LOG][13:48] *** seem to need to invoke...
[13-48-5 LOG][13:48] Change character, go to character selection ...
[13-48-20 LOG][13:48] Enter in world with ***...
[13-48-29 LOG][13:48] <<< API_AfterConnectionEvent >>>
[13-48-29 LOG][13:48] <<< API_BeforeInvocationEvent >>>
[13-48-36 LOG][13:48] Check reward boxes...
[13-48-36 LOG][13:48] Discard 'Божественное благословение' ...
[13-48-39 LOG][13:48] Unstock astral diamonds...
[13-48-39 LOG][13:48] <<< API_BeforeCheckTasksToStartEvent >>>
[13-48-39 LOG][13:48] Pause between two characters...
Professions are enabled, all slots are filled and working:

Code: Select all

[13-40-42 LOG][13:40] *** seem to need to invoke...
[13-40-42 LOG][13:40] Change character, go to character selection ...
[13-40-49 LOG][13:40] Enter in world with ***...
[13-40-58 LOG][13:40] Use level 25 task list
[13-40-58 LOG][13:40] <<< API_AfterConnectionEvent >>>
[13-40-58 LOG][13:40] Refresh game tasks list...
[13-41-1 LOG][13:41] <<< API_BeforeCheckCompletedTasksEvent >>>
[13-41-1 LOG][13:41] Check completed tasks...
[13-41-1 LOG][13:41] <<< API_BeforeInvocationEvent >>>
[13-41-9 LOG][13:41] Check reward boxes...
[13-41-9 LOG][13:41] Discard 'Божественное благословение' ...
[13-41-12 LOG][13:41] Unstock astral diamonds...
[13-41-12 LOG][13:41] <<< API_BeforeCheckTasksToStartEvent >>>
[13-41-12 LOG][13:41] Pause between two characters...
Professions enabled, tasks are empty and filling:

Code: Select all

[12-27-53 LOG][12:27] *** have at least one slot to complete...
[12-27-53 LOG][12:27] Change character, go to character selection ...
[12-28-0 LOG][12:28] Enter in world with ***...
[12-28-10 LOG][12:28] Use level 25 task list
[12-28-10 LOG][12:28] <<< API_AfterConnectionEvent >>>
[12-28-10 LOG][12:28] Refresh game tasks list...
[12-28-14 LOG][12:28] <<< API_BeforeCheckCompletedTasksEvent >>>
[12-28-14 LOG][12:28] Check completed tasks...
[12-28-14 LOG][12:28] <<< API_BeforeInvocationEvent >>>
[12-28-22 LOG][12:28] Check reward boxes...
[12-28-22 LOG][12:28] Discard 'Божественное благословение' ...
[12-28-25 LOG][12:28] Stock astral diamonds...
[12-28-25 LOG][12:28] Total AD : 0 (character) + 0 (account) = 0
[12-28-25 LOG][12:28] <<< API_BeforeCheckTasksToStartEvent >>>
[12-28-25 LOG][12:28] Use slot 5
[12-28-29 LOG][12:28] Unable to found Ящики драгоценностей task, skip...
[12-28-29 LOG][12:28] Use slot 5
[12-28-34 LOG][12:28] Unable to found Ящики простых драгоценностей task, skip...
[12-28-34 LOG][12:28] Use slot 5
[12-28-38 LOG][12:28] Unable to found Ящики ценных самоцветов task, skip...
[12-28-38 LOG][12:28] Use slot 5
[12-28-41 LOG][12:28] Сбор в глухой чаще task found !
[12-28-41 LOG][12:28] <<< API_BeforeStartATaskEvent >>>
[12-28-41 LOG][12:28] Start task using 1 assets
[12-28-41 LOG][12:28] 1.Ювелир-магистр
[12-28-44 LOG][12:28] Use slot 6
[12-28-45 LOG][12:28] Сбор в глухой чаще task found !
[12-28-45 LOG][12:28] <<< API_BeforeStartATaskEvent >>>
[12-28-45 LOG][12:28] Start task using 1 assets
[12-28-45 LOG][12:28] 1.Ювелир-магистр
[12-28-49 LOG][12:28] Use slot 7
[12-28-51 LOG][12:28] Сбор в глухой чаще task found !
[12-28-51 LOG][12:28] <<< API_BeforeStartATaskEvent >>>
[12-28-51 LOG][12:28] Start task using 1 assets
[12-28-51 LOG][12:28] 1.Ювелир-магистр
[12-28-54 LOG][12:28] Use slot 8
[12-28-58 LOG][12:28] Unable to found Ящики драгоценностей task, skip...
[12-28-58 LOG][12:28] Use slot 8
[12-29-1 LOG][12:29] Unable to found Ящики простых драгоценностей task, skip...
[12-29-1 LOG][12:29] Use slot 8
[12-29-5 LOG][12:29] Unable to found Ящики ценных самоцветов task, skip...
[12-29-5 LOG][12:29] Use slot 8
[12-29-7 LOG][12:29] Сбор в глухой чаще task found !
[12-29-7 LOG][12:29] <<< API_BeforeStartATaskEvent >>>
[12-29-7 LOG][12:29] Start task using 1 assets
[12-29-7 LOG][12:29] 1.Ювелир-магистр
[12-29-11 LOG][12:29] Pause between two characters...
Professions enabled, tasks are completed and changing:

Code: Select all

[16-4-12 LOG][16:04] *** have at least one slot to complete...
[16-4-12 LOG][16:04] Select *** character.
[16-4-12 LOG][16:04] Change character, go to character selection ...
[16-4-20 LOG][16:04] Enter in world with ***...
[16-4-27 LOG][16:04] 6 tiles loaded from cache !
[16-4-29 LOG][16:04] Use level 25 task list
[16-4-29 LOG][16:04] <<< API_AfterConnectionEvent >>>
[16-4-29 LOG][16:04] Refresh game tasks list...
[16-4-33 LOG][16:04] <<< API_BeforeCheckCompletedTasksEvent >>>
[16-4-33 LOG][16:04] Check completed tasks...
[16-4-40 LOG][16:04] Pause after collecting tasks...
[16-4-46 LOG][16:04] Check reward boxes...
[16-4-48 LOG][16:04] Stock astral diamonds...
[16-4-48 LOG][16:04] Total AD : 0 (character) + 0 (account) = 0
[16-4-48 LOG][16:04] <<< API_BeforeCheckTasksToStartEvent >>>
[16-4-48 LOG][16:04] Use slot 0
[16-4-49 LOG][16:04] Ящики драгоценностей task found !
[16-4-49 LOG][16:04] <<< API_BeforeStartATaskEvent >>>
[16-4-49 LOG][16:04] Start task using 5 assets
[16-4-49 LOG][16:04] 1.Ювелир-магистр
[16-4-49 LOG][16:04] 2.Мифриловый давчик
[16-4-49 LOG][16:04] 3.Горнило для выплавки мифрила
[16-4-49 LOG][16:04] 4.Горнило для выплавки мифрила
[16-4-49 LOG][16:04] 5.Горнило для выплавки мифрила
[16-4-53 LOG][16:04] Use slot 1
[16-4-54 LOG][16:04] Ящики простых драгоценностей task found !
[16-4-54 LOG][16:04] <<< API_BeforeStartATaskEvent >>>
[16-4-54 LOG][16:04] Start task using 5 assets
[16-4-54 LOG][16:04] 1.Ювелир-магистр
[16-4-54 LOG][16:04] 2.Мифриловый давчик
[16-4-54 LOG][16:04] 3.Горнило для выплавки мифрила
[16-4-54 LOG][16:04] 4.Горнило для выплавки мифрила
[16-4-54 LOG][16:04] 5.Горнило для выплавки мифрила
[16-4-58 LOG][16:04] Use slot 2
[16-4-59 LOG][16:04] Ящики ценных самоцветов task found !
[16-4-59 LOG][16:04] <<< API_BeforeStartATaskEvent >>>
[16-4-59 LOG][16:04] Start task using 5 assets
[16-4-59 LOG][16:04] 1.Ювелир-магистр
[16-4-59 LOG][16:04] 2.Мифриловый давчик
[16-4-59 LOG][16:04] 3.Горнило для выплавки мифрила
[16-4-59 LOG][16:04] 4.Горнило для выплавки мифрила
[16-4-59 LOG][16:04] 5.Горнило для выплавки мифрила
[16-5-20 LOG][16:05] Skip to next character...
[16-5-20 LOG][16:05] Pause between two characters...
[16-5-25 LOG][16:05] Pause while can't find a character...

zombiejoe
Basic Botter
Basic Botter
Posts: 9
Joined: Sat Jul 14, 2018 4:47 pm

Re: [REQUEST] Professions role - event when checking mail

Post by zombiejoe » Sun Oct 07, 2018 5:59 pm

Thank you, this is along the lines of what I ended up doing. I built a function to open the mailbox and grab all mail items in the AfterConnectionEvent event, do "stuff" with the items during BeforeInvocationEvent, and then let the normal item storage function of Astral move any unprocessed items on to the next character.

As a side note, I let Astral delete the empty emails after I grabbed my items since I kept running into errors and was feeling too lazy to properly parse the mail list myself. Just throwing that out there in case anyone else tries doing the same thing. :P

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests