Play sound when a rainbow goblin is near/on screen? menu

User Tag List

Results 1 to 8 of 8
  1. #1
    wreck1's Avatar Member
    Reputation
    1
    Join Date
    Jan 2018
    Posts
    4
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Play sound when a rainbow goblin is near/on screen?

    Hey fam,

    I know it's possible to create sound notifications to play for pretty much any circumstance, however I am new-ish to C# and lack the necessary talent to write a code I'd very much be interested in. Basically, I'd just like a sound notification to play whenever a rainbow goblin is close enough to deem "near" the player (however that is interpreted by the HUD). I remember the later .xml versions of THUD had this feature and it would make my life dramatically easier while I farm for those cosmic wings.

    Thanks for your attention and for whatever help you can give!


    *Edit*
    So far I've thrown together a little something that probably needs a lot of tweaking, borrowed from: [v7.6] [INTERNATIONAL] [Resu] ChannelingPlugin for the sound notification work am using the SNO for a rainbow goblin (at least I believe I am).

    using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Globalization;
    using SharpDX;
    using SharpDX.Direct2D1;

    using Turbo.Plugins.Default;
    namespace Turbo.Plugins.User

    {
    public class RainbowGobAlert : BasePlugin, IInGameTopPainter, IAfterCollectHandler , INewAreaHandler
    {

    public bool RainbowNotification { get; set; }

    var highSound = Hud.Sound.LoadSoundPlayer("Resource-Full-By-Resu.wav");
    if (405624.IsOnScreen)
    { ThreadPool.QueueUserWorkItem(state =>
    {
    highSound.PlaySync();
    });
    }
    }
    }
    I don't think it will take too much time to get something like this to work but I'm sure I'm still a little while from getting to the point of this working as intended.
    Last edited by wreck1; 01-20-2018 at 05:37 AM.

    Play sound when a rainbow goblin is near/on screen?
  2. #2
    JarJarD3's Avatar Contributor
    Reputation
    106
    Join Date
    Oct 2017
    Posts
    395
    Thanks G/R
    41/101
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    It seems that GoblinPlugin (default plugin) has EnableSpeak that is by default false;
    If you set EnableSpeak to true that should do the trick for you.
    Code:
     var goblins = Hud.Game.AliveMonsters.Where(x => x.SnoMonster.Priority == MonsterPriority.goblin);
     foreach (var goblin in goblins)
     {
         if (EnableSpeak && (goblin.LastSpeak == null) && Hud.Sound.LastSpeak.TimerTest(5000))
         {
             Hud.Sound.Speak(goblin.SnoMonster.NameLocalized);
             goblin.LastSpeak = Hud.Time.CreateAndStartWatch();
         }
         ...
    But the goblins make sounds far away so it is hard to get by them without hearing theirs sounds, right?

  3. #3
    wreck1's Avatar Member
    Reputation
    1
    Join Date
    Jan 2018
    Posts
    4
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JarJarD3 View Post
    It seems that GoblinPlugin (default plugin) has EnableSpeak that is by default false;
    If you set EnableSpeak to true that should do the trick for you.
    Code:
     var goblins = Hud.Game.AliveMonsters.Where(x => x.SnoMonster.Priority == MonsterPriority.goblin);
     foreach (var goblin in goblins)
     {
         if (EnableSpeak && (goblin.LastSpeak == null) && Hud.Sound.LastSpeak.TimerTest(5000))
         {
             Hud.Sound.Speak(goblin.SnoMonster.NameLocalized);
             goblin.LastSpeak = Hud.Time.CreateAndStartWatch();
         }
         ...
    But the goblins make sounds far away so it is hard to get by them without hearing theirs sounds, right?
    I thought I replied to this earlier but I guess I forgot to submit it. I play the game without sound on (too much going on at once), so having THUD shout it out is extremely helpful. I want to thank you for bringing this to my attention. I've spent the last afternoon working on dialing this down to just RGobs. I took this plugin, through it into users, and trimmed it down to only RGobs and portals. However, I do not know how to isolate the loop function to yell out only rainbow goblins so it's still useless for my needs. Do you know what variables need to be placed in the:
    (x => x.SnoMonster.Priority == MonsterPriority.goblin) in order to isolate it to rainbow goblins? I've tried replacing SnoMonster with the Sno of the rainbow goblin (405186) but it's not as easy as I thought it'd be.

    Can anyone help me or touch up the code below to work for explicitly rainbow goblins?
    RainbowGobAlert

    I'm not sure if public DefaultGoblinDecorator needs to be defined if the loop is isolated to include just rainbow gobs, but currently it throws an exception because the loop calls for it.

    Appreciate the help!

  4. #4
    JarJarD3's Avatar Contributor
    Reputation
    106
    Join Date
    Oct 2017
    Posts
    395
    Thanks G/R
    41/101
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Code:
    public void PaintWorld(WorldLayer layer)
    {
        var portals = Hud.Game.Actors.Where(x => x.SnoActor.Sno == 410460);
        foreach (var actor in portals)
        {
            PortalDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
        }
    
        var goblins = Hud.Game.AliveMonsters.Where(x => x.SnoActor.Sno == 405186); // RainbowGoblin
        foreach (var goblin in goblins)
        {
            if (EnableSpeak && (goblin.LastSpeak == null) && Hud.Sound.LastSpeak.TimerTest(5000))
            {
                Hud.Sound.Speak(goblin.SnoMonster.NameLocalized);
                goblin.LastSpeak = Hud.Time.CreateAndStartWatch();
            }
            RainbowGoblinDecorator.Paint(layer, goblin, goblin.FloorCoordinate, goblin.SnoMonster.NameLocalized);
        }
    }

  5. Thanks wreck1, jaeheung09 (2 members gave Thanks to JarJarD3 for this useful post)
  6. #5
    wreck1's Avatar Member
    Reputation
    1
    Join Date
    Jan 2018
    Posts
    4
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JarJarD3 View Post
    Code:
    public void PaintWorld(WorldLayer layer)
    {
        var portals = Hud.Game.Actors.Where(x => x.SnoActor.Sno == 410460);
        foreach (var actor in portals)
        {
            PortalDecorator.Paint(layer, actor, actor.FloorCoordinate, null);
        }
    
        var goblins = Hud.Game.AliveMonsters.Where(x => x.SnoActor.Sno == 405186); // RainbowGoblin
        foreach (var goblin in goblins)
        {
            if (EnableSpeak && (goblin.LastSpeak == null) && Hud.Sound.LastSpeak.TimerTest(5000))
            {
                Hud.Sound.Speak(goblin.SnoMonster.NameLocalized);
                goblin.LastSpeak = Hud.Time.CreateAndStartWatch();
            }
            RainbowGoblinDecorator.Paint(layer, goblin, goblin.FloorCoordinate, goblin.SnoMonster.NameLocalized);
        }
    }
    You are a gentleman and a scholar. I salute you sir!

  7. #6
    jaeheung09's Avatar Active Member
    Reputation
    23
    Join Date
    Nov 2017
    Posts
    109
    Thanks G/R
    8/21
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would you mind showing me the full detail source which makes it work in game?
    I did it myself adding this and that from other sources but failed making a lot of exception errors.

  8. #7
    JarJarD3's Avatar Contributor
    Reputation
    106
    Join Date
    Oct 2017
    Posts
    395
    Thanks G/R
    41/101
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Originally Posted by jaeheung09 View Post
    Would you mind showing me the full detail source which makes it work in game?
    I did it myself adding this and that from other sources but failed making a lot of exception errors.
    Code:
    using System.Linq;
    using Turbo.Plugins.Default;
    
    namespace Turbo.Plugins.JarJar
    {
        /// <summary>
        /// Speaks given goblin's name when first time encountered (seen in minimap).
        /// </summary>
        /// <remarks>
        /// This file must be copied into following folder: plugins\JarJar\RainbowGoblinSpeak.cs
        /// </remarks>
        public class RainbowGoblinSpeak : BasePlugin, IInGameWorldPainter
        {
            /// <summary>
            /// See plugins\Default\Monsters\GoblinPlugin.cs for other goblin numbers.
            /// </summary>
            public uint GoblinNumber { get; set; }
    
            public RainbowGoblinSpeak()
            {
                Enabled = true;
                GoblinNumber = 405186;
            }
    
            public void PaintWorld(WorldLayer layer)
            {
                foreach (var goblin in Hud.Game.AliveMonsters.Where(x => x.SnoActor.Sno == GoblinNumber))
                {
                    if (goblin.LastSpeak == null && Hud.Sound.LastSpeak.TimerTest(5000))
                    {
                        Hud.Sound.Speak(goblin.SnoMonster.NameEnglish);
                        goblin.LastSpeak = Hud.Time.CreateAndStartWatch();
                        break;  // Can not speak more than one goblin within 5 sec.
                    }
                }
            }
        }
    }
    I put it in "my" namespace folder "JarJar" instead of "User" because it is the way to do it
    This has been running on my machine for two days but no luck with RainbowGoblin - so to say this has not been tested yet.

  9. #8
    jaeheung09's Avatar Active Member
    Reputation
    23
    Join Date
    Nov 2017
    Posts
    109
    Thanks G/R
    8/21
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your kind reply.
    Hope to have many chances to test this plugin sooner or later.

Similar Threads

  1. PQR: cast spell when target is near. [question]
    By Fantersam123 in forum WoW Bot Maps And Profiles
    Replies: 10
    Last Post: 06-12-2013, 11:05 AM
  2. [Bot] Priest Bg Bot: attacks when enemy is near
    By Foxibilis in forum World of Warcraft Bots and Programs
    Replies: 8
    Last Post: 12-29-2010, 09:28 AM
  3. [Release] paswtian - play a sound when there is a node (autoit source)
    By mnbvc in forum World of Warcraft Bots and Programs
    Replies: 19
    Last Post: 08-04-2010, 06:26 AM
  4. How To Play sounds to all players of the server! read it here !
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 17
    Last Post: 11-30-2007, 03:33 AM
  5. 30 days FREE play time when gliding up an alt acct.
    By Newbs_r_us in forum World of Warcraft Guides
    Replies: 14
    Last Post: 04-08-2007, 12:14 AM
All times are GMT -5. The time now is 10:07 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search