What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Suggestion] Enhanced Mobile Notification

screwedx

New Member
Joined
Feb 18, 2016
Messages
36
Reaction score
0
Mobile Notification in Trinity is a very good thing. I can't look every minute on my pc so i get there at least the items which are going to stash.

For me it would be nice to have also the following:
- Big problems (or same problem maybe four times one after one)
- summary of rift
- level up
- death (i had it a few times, that i didn't work out as intended and the bot died 10 times in a row... - there i want to look and/or go in manually)

Thank you.
 
Isn't that what the buddystats plugin does? https://www.thebuddyforum.com/demonbuddy-forum/plugins/buddystats/

Haven't tested it myself so unsure about the exact features.
No, not exactly... thats the point.
buddystats gives me an overview and overall summary, items are there, but not the exact items... he just says, that there was found a helmet, but not exactly which one...
and no overview for me on actual progress... on errors,...
and since mobile notifications are supported by trinity (and are used very reliable for items) why not implement actual status in trinity.

Just to be exact: i don't want to have a second buddystats (not necessary, i own one). i want to have something with push... and notification on my mobile phone.

sorry, i'm not a developer - i was long time ago, but now i'm on the other (the good ;-) ) side... i'm testing software. so i can just say what could need improvement and not code it myself. But if you need help with testing i'm your man... (i think i'm quite good at my job ;-) )
 
Last edited:
I see. If you want to try it out, here are a few starters from what I see in Trinity code (didn't test myself since I'm not using the mobile notifications)

The notification code for mobile notifications:

In the imports at the top of the .cs file you're editing, you have to add (if it's not there already)
Code:
using Trinity.Notifications;

Then to generate a notification (SendNotification will check that notifications are enabled and route it to the right one depending on your settings). I'm not sure how the priority part is handled by the mobile apps, but I assume it's to let you set up different alerts (like vibrate/ring for high but silently display it for Normal or something)

Code:
var newNotification =new ProwlNotification
{
    Description = "Description here",
    Event = "Title here",
    Priority = ProwlNotificationPriority.Normal  // or VeryLow/Moderate/High/Emergency
};
NotificationManager.SendNotification(newNotification);

For example, if you wanted chain death alerts, you could open Trinity\DbProvider\DeathHandler.cs and at line 36-46 you'll see:
Code:
if (isDead)
{                    
    _deathCounter = _deathTime.Subtract(DateTime.UtcNow).TotalSeconds > 60 ? 0 : _deathCounter +1;
    _deathNeedRepairCounter = _deathTime.Subtract(DateTime.UtcNow).TotalSeconds < 60 && EquipmentNeedsEmergencyRepair() ? _deathNeedRepairCounter + 1 : 0;
    _deathTime = DateTime.UtcNow;
    _resButtonsVisibleStart = DateTime.MinValue;
    _resurrectButtonsVisible = false;

    Logger.Log("[Death] You died lol! RecentDeaths={0} RecentDeathsNeedingRepair={1}", 
        _deathCounter, _deathNeedRepairCounter);
}

If you wanted to send a notification when you get to 5+ deaths in a row, you could replace that part with (and don't forget to add the extra import at the top of the file)
Code:
if (isDead)
{                    
    _deathCounter = _deathTime.Subtract(DateTime.UtcNow).TotalSeconds > 60 ? 0 : _deathCounter +1;
    _deathNeedRepairCounter = _deathTime.Subtract(DateTime.UtcNow).TotalSeconds < 60 && EquipmentNeedsEmergencyRepair() ? _deathNeedRepairCounter + 1 : 0;
    _deathTime = DateTime.UtcNow;
    _resButtonsVisibleStart = DateTime.MinValue;
    _resurrectButtonsVisible = false;

    Logger.Log("[Death] You died lol! RecentDeaths={0} RecentDeathsNeedingRepair={1}", 
        _deathCounter, _deathNeedRepairCounter);

    if (_deathCounter >= 5)
    {
        var newNotification = new ProwlNotification
        {
            Description = "I died " + _deathCounter + " times in a row, I need an adult now!!",
            Event = "Death Warning!",
            Priority = ProwlNotificationPriority.High
        };
        NotificationManager.SendNotification(newNotification);
    }
}

And hoping that works!

- Inactivity (for big problems) would be in Trinity (in Trinity\Helpers\XpInactivity.cs)
- Level up should be somewhere in Trinity, not sure where
- Rift summary would have to be done in Adventurer (not sure if other plugins can call each other easily in DB? I think so but didn't try it myself)
 
thanks, i will give it a try

Update: I gave it a try (btw i'm editing and haven't it tested.)

But you have a mistake in your code.
Every line should be ended by a ";"
 
Last edited:
I would like new features very much.

For me most useful would be notifications about the following:
1. Diablo III.exe process monitoring. Send message if process is closed or not responding.
2. Send message if character is idle, too many navigation errors, inactivity has certain value, stash is full, etc.

Do you think it is possible?

Cheers
 
I would like new features very much.

For me most useful would be notifications about the following:
1. Diablo III.exe process monitoring. Send message if process is closed or not responding.
2. Send message if character is idle, too many navigation errors, inactivity has certain value, stash is full, etc.

Do you think it is possible?

Cheers
Hey,
everything is possible...
But for me and my suggestions i will try to enhance trinity for myself. See the instructions above.
You can do everything what you want. it's not too hard.
 
ok, i've changed some things...

i should get a notification for the following events:
- level up
- death
- stats of rift
- town run because of bags are full
- town run because of rift finished

i'm not able to test it because of NON-availability of D3... :mad::cool:
i hope it will work.
 
ok, i've changed some things...

i should get a notification for the following events:
- level up
- death
- stats of rift
- town run because of bags are full
- town run because of rift finished

i'm not able to test it because of NON-availability of D3... :mad::cool:
i hope it will work.

Looking forward to your results. In the meantime, can you be so kind and point me which files and which sections did you add/change?

Cheers
 
ok, i'm getting several errors... i have to check...

but i'm using another method.

Code:
NotificationManager.AddNotificationToQueue("You died... LOL!!! for the " + _deathCounter + "th time...",
                        "KILLED", ProwlNotificationPriority.Emergency);
 
ok, i've tried to disable almost all notifications, only left in townrun.cs, where it comes from...

and Errors...

Code:
2016-03-30 12:49:02,090 [1] DEBUG AssemblyLoader`1 (null) - Reloading AssemblyLoader<Zeta.Bot.IBot> - BotManager.Reload
2016-03-30 12:49:02,252 [1] DEBUG BotManager (null) - Bots were reloaded. New bot list:
2016-03-30 12:49:02,253 [1] DEBUG BotManager (null) - Combat Bot v1.1.3010.460
2016-03-30 12:49:02,254 [1] DEBUG BotManager (null) - Order Bot v1.1.3010.460
2016-03-30 12:49:02,253 [1] DEBUG BotManager (null) - Script Runner v1.1.3010.460
2016-03-30 12:49:03,537 [1] DEBUG AssemblyLoader`1 (null) - Reloading AssemblyLoader<Zeta.Common.Plugins.IPlugin> - Initializing plugins
2016-03-30 12:49:11,139 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Game\Exploration\ExplorationGrid.cs(75,24) : warning CS0628: 'ExplorationGrid.MarkNodesNearWall': new protected member declared in sealed class
2016-03-30 12:49:11,143 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Game\Exploration\IGrid.cs(20,14) : warning CS0108: 'IGrid<T>.Reset()' hides inherited member 'IGrid.Reset()'. Use the new keyword if hiding was intended.
2016-03-30 12:49:11,143 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Game\Exploration\NavigationGrid.cs(48,24) : warning CS0628: 'NavigationGrid.MarkNodesNearWall': new protected member declared in sealed class
2016-03-30 12:49:11,144 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Game\Grid\GridPoint.cs(5,19) : warning CS0660: 'GridPoint' defines operator == or operator != but does not override Object.Equals(object o)
2016-03-30 12:49:11,142 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Game\Exploration\GridPoint.cs(6,19) : warning CS0660: 'GridPoint' defines operator == or operator != but does not override Object.Equals(object o)
2016-03-30 12:49:11,139 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Game\Exploration\ExplorationGrid.cs(102,40) : warning CS0108: 'ExplorationGrid.GetRayLine(Vector3, Vector3)' hides inherited member 'Grid<ExplorationNode>.GetRayLine(Vector3, Vector3)'. Use the new keyword if hiding was intended.
2016-03-30 12:49:11,142 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Game\Exploration\GridPoint.cs(6,19) : warning CS0661: 'GridPoint' defines operator == or operator != but does not override Object.GetHashCode()
2016-03-30 12:49:11,145 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Coroutines\TownPortalCoroutine.cs(118,34) : warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
2016-03-30 12:49:11,146 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Coroutines\WaitCoroutine.cs(29,33) : warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
2016-03-30 12:49:11,146 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Coroutines\BountyCoroutines\Subroutines\MoveToScenePositionCoroutine.cs(106,34) : warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
2016-03-30 12:49:11,147 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Coroutines\BountyCoroutines\Subroutines\MoveToScenePositionCoroutine.cs(161,34) : warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
2016-03-30 12:49:11,145 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\IPluginCommunicator.cs(78,30) : warning CS0168: The variable 'ex' is declared but never used
2016-03-30 12:49:11,144 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\Game\Grid\GridPoint.cs(5,19) : warning CS0661: 'GridPoint' defines operator == or operator != but does not override Object.GetHashCode()
2016-03-30 12:49:11,145 [1] INFO  AssemblyLoader`1 (null) - Compiler Error: C:\Users\User\Documents\demonbuddy\Plugins\Adventurer\IPluginCommunicator.cs(115,34) : warning CS0168: The variable 'ex' is declared but never used
 
Unsure where those errors are coming from. I tried editing DeathHandler.cs with my previous post's changes for chain death warnings and it compiles fine with that one at least

Also from what I remember, the NotificationManager doesn't process the queue automatically so AddNotificationToQueue is just queue'ing notifications but they won't be sent until some code does it (the item notifications does it to send all notifications at once at the end of the townrun)
 

Attachments

Ok, i give it later a try. Maybe it's just me. I'm editing here on a mac and then transfers it to my win pc... maybe some encoding shit...
i will do it later directly on my win pc...

and thx for your explanations. i try to understand how it works...
 
ok, i've tried it. Maybe i've done too much.

Used your method in deathtrapper.cs and townrun.cs
i should have done it only in deathtrapper... usage in townrun has given me the similar errors as yesterday...

i will try it later again only with deathtrapper...

i also tried the paragon.cs in framework/utils yesterday for level up... (i would send a notification before spending paragon points - fastest way to find out we have a level up)

and adventurer: in game/stats/experiencetracker.cs i would also like to send a notification, but he doens't know the namespace trinity... maybe someone has got a hint for me...
 
ok, i've tried it. Maybe i've done too much.

Used your method in deathtrapper.cs and townrun.cs
i should have done it only in deathtrapper... usage in townrun has given me the similar errors as yesterday...

i will try it later again only with deathtrapper...

i also tried the paragon.cs in framework/utils yesterday for level up... (i would send a notification before spending paragon points - fastest way to find out we have a level up)

and adventurer: in game/stats/experiencetracker.cs i would also like to send a notification, but he doens't know the namespace trinity... maybe someone has got a hint for me...

i had some spelling errors... ok. it's working for trinity...

i've made the following:
- notfication on death (always, just with the total number of deaths) - if this notification comes ten times in a minute i know by myself there is something wrong
- notificaiton on town run with different messages:
- bags are full
- town run forced by routine (adventurer, on end of rift f.e.)
- notification on spending paragon points (this gives me a level up message).

what i not have:
possibility to use this in adventurer... there are more good opportunities for notifications...
- better town run notification
- experience tracker
 
ok, made some new experience...

for mats i took white and grey items... and pushed to me every time he think the bag is full... i was spammed with notifications...

ok. my preliminary result:

- Death notification
is working great. Perfect. I just get a notification, that my bot has died and the total number of deaths... i see, if this is happening more than three times in a row, i can look after it... this works perfectly for me...

- Town run:
This is a problem. i don't know how to catch the perfect moment. this is also dependant from settings. if i just run rifts for experience and only take some spare items (as configured: ancient for my build) than i can use the routine, that he is forced to do a town run... but this happens sometimes twice, sometimes very late... the event, that the bags are full, is not occuring...
if i use the event "bags are full" i get spammed. if i want to use this (because i take more things with me in the bags) i have to build in a timer that i only get one notification.
BUT: Why do i want to get noticed about the town run? I wanted the notification for two reasons:
1. to stop the bot in town (best thing). with the notification i have 30sec to do so in best case.
2. to get the stats after a rift​
Both things aren't working, since for point 1 the notification comes at the wrong time, the second point isn't working because i have no possibility at the moment to get these data (later more)

- level up:
is working in a simple way, but i'm searching for a better point to post it. at the moment i only can notify that a level up has happened. i have to find the variable, with which i can add the current (paragon) level - i have some clues, but not enough time to figure it out...

- Stats:
Most important for me is the notification after finishing a rift. An example for me is the logging of Adventurer after finishing a rift. This is what i would like to receive...
Since this is in adventurer and notification is handled in Trinity there is no easy way to tap the values and send them. For me it seems easier to build the ExperienceTracker class into Trinity than implementing notification into Adventurer (because notifications has to be configured).


QUESTION:

Has anyone experience where to initialise the new class in Trinity? and maybe how can i recognise in Trinity that the rift is over? Maybe environment change?
Or is there any connection between adventurer and Trinity which could use?


update: just corrected some spelling errors...
 
Last edited:
Back
Top