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

[Plugin] LocationChecker Alert

emc

New Member
Joined
Jun 15, 2012
Messages
190
Reaction score
3
What does this do?
Plays a sound alert if the player has not moved R distance within X seconds.

Setup
Extract to your plugins folder.

Configuration
Edit the ./Plugins/LocationChecker/config.txt file to configure:
Line1: TimeSpan (if the player hasn't moved within this timespan, in seconds, alert)
Line2: MinRadius (minimum distance within which the player is considered to have not moved yet)
Line3: SoundFile (path to your epic sound file)

* Comes with default sound file and config.

[table="width: 500, class: grid, align: left"]
[tr]
[td]File[/td]
[td]Version[/td]
[/tr]
[tr]
[td]View attachment LocationChecker.zip[/td]
[td]1.0[/td]View attachment LocationChecker-1.0.1.2.zip
[/tr]
[tr]
[td]View attachment LocationChecker-1.0.1.2.zip[/td]
[td]1.0.1.2[/td]
[/tr]
[/table]


The plugin was in request to:

This works like the Unstucker. It checks if the character has moved 40 yards in 60 seconds. If it has not moved 60 seconds, then:

Unstucker version - Restarts the Quest

My Request - Alert with some sorts of sounds




I prefer alerting instead of restart because sometimes restart will screw up while alerting allows the user to come and fix the problem.

Thanks.
 
Last edited:
Hi,

I assume you check position at time0 and then check back again at time60? But if it's this way, sometimes the short Sarkoth runs may repeat the same location within that time period, so it will detect that it is the same location? Would it be possible to track for movements instead of coordinates?

Thanks.
 
Hi,

I assume you check position at time0 and then check back again at time60? But if it's this way, sometimes the short Sarkoth runs may repeat the same location within that time period, so it will detect that it is the same location? Would it be possible to track for movements instead of coordinates?

Thanks.

I have never run a Sarkoth run, since I am quite new around here. :D Anyways, but I think I have made the necessary changes that you are asking for, checkout v1.0.1.2. Let me know if there is anything else.

The next update, I will implement the ability to move randomly anywhere within Z radius if it is at the same location for the timespan, so just maybe the profile can resume by itself ? What do you think? Overkill?
 
Last edited:
Thanks will test it out!

As for the extra features, would be really helpful for some people facing those problems. We'll see how popular this Plugin get.
 
Hi again, in version 2, the wav file doesn't play for me. Weird.

Edit: Could be my problem. I'm changing the wav file. Let me test more.

Edit2: Yeah, working now. I just had to restart DB.
 
Last edited:
mayb you can add a notifo notification like buddyprowl for honorbuddy :)
I use something like this for my own Unstucker
more info about notifo can be found here Mobile Notifications for Everything - Notifo

Exmaple on how to use:
Code:
private Notifo Informer;

public void OnInitialize()
{
       Informer = new Notifo("username", "API key");
}

private void NotifoPusher(string msg, string title, string label)
{
        if (UseNotifo)
        {
                Log("Notifo: Push -> [" + label + "] " + title + ": " + msg, LogLevel.Diagnostic);
                Informer.SendNotification(msg, title, label);
        }
}

Notifo
Code:
/*
 *	This code comes from buddyprowl for honorbuddy
 *  http://www.thebuddyforum.com/honorbuddy-forum/plugins/monitoring/24554-plugin-monitoring-buddyprowl-4-a.html
 */

using System;
using System.Text;
using System.Collections.Generic;
using System.Net;
using System.Threading;
using System.IO;

namespace UnstuckMe
{
    public class Notifo
    {
        public Queue<PushMessage> PushList = new Queue<PushMessage>();

        const string BaseUrl = "https://api.notifo.com/v1/";
        const string SendNotificationUrl = BaseUrl + "send_notification";
        private string _authorizationHeaderValue;

        public Notifo(string username, string secret)
        {
            _authorizationHeaderValue = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(username + ":" + secret));
        }

        public void Reload(string username, string secret)
        {
            _authorizationHeaderValue = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(username + ":" + secret));
        }

        public string SendNotification(string msg, string title, string label)
        {
            var request = PrepareRequest(SendNotificationUrl);

            var fields = new Dictionary<string, string>()
                {
                    { "msg", msg },
                    { "title", title },
                    { "label", label },
                };

            WriteValues(request, fields);

            return request.GetResponse().ToString();
        }

        HttpWebRequest PrepareRequest(string url)
        {
            var request = (HttpWebRequest)WebRequest.Create(url);
            request.Method = "POST";
            request.Headers.Add("Authorization", _authorizationHeaderValue);
            request.ContentType = "application/x-www-form-urlencoded";
            request.Accept = "application/json, text/json";
            request.Timeout = Timeout.Infinite;
            return request;
        }

        void WriteValues(WebRequest request, IDictionary<string, string> values)
        {
            using (var requestStream = request.GetRequestStream())
            using (var writer = new StreamWriter(requestStream))
            {
                foreach (var v in values)
                {
                    if (string.IsNullOrEmpty(v.Value))
                        continue;

                    writer.Write(v.Key);
                    writer.Write("=");
                    writer.Write(Uri.EscapeDataString(v.Value));
                    writer.Write("&");
                }
            }
        }

        public struct PushMessage
        {
            public string PushEvent, PushDescription, PushLabel;

            public PushMessage(string Event, string Description, string Label)
            {
                this.PushEvent = Event;
                this.PushDescription = Description;
                this.PushLabel = Label;
            }
        }
    }
}
 
Awesome that would cool thanks, ill implement it.
 
Back
Top