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

Need help to modify this CB.

Megser

Well-Known Member
Joined
Apr 17, 2010
Messages
1,389
Reaction score
73
Okay, I've seen a thread for this quest before, The Great Bank Heist - http://www.thebuddyforum.com/honorbuddy-forum/developer-forum/24629-great-bank-heist.html

I was thinking of something similiar if like you know it says "Use your blabla" it will press vehicle button 3 etc.

Vlad's WaitForChatEvent kinda does this but it doesn't execute any action when the string is confirmed. Could you add like an AttackButton option? Could this be a CB? Or would it have to be a plugin? I would really, really want some help with this I'd be so frickin' happy. I've made a thread asking about where I begin as a plugin/cb creator too if someone could direct me.

Thanks in advance.
 
Last edited:
WaitForChatEvent will not help you on this one. It's purpose it to wait for a certain chat string.

this is how it's done in my plugin:


Code:
if (onstart)
			{
				Lua.Events.AttachEvent("CHAT_MSG_RAID_BOSS_WHISPER", HandleRBW);
				onstart = false;
			}
Code:
private void HandleRBW(object sender, LuaEventArgs args)
{
if (!Me.Dead && Me.QuestLog.GetQuestById(14122) != null && !Me.QuestLog.GetQuestById(14122).IsCompleted)
			{
				
				if (args.Args[0].ToString().Contains("Amazing G-Ray"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(121, 'target', 'LeftButton')");
				}
				if (args.Args[0].ToString().Contains("Blast*****ers"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(122, 'target', 'LeftButton')");
				}
				if (args.Args[0].ToString().Contains("Ear-O-Scope"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(123, 'target', 'LeftButton')");
				}
				if (args.Args[0].ToString().Contains("Infinifold Lockpick"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(124, 'target', 'LeftButton')");
				}
				if (args.Args[0].ToString().Contains("mite Drill"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(125, 'target', 'LeftButton')");
				}
			}
}

doesn't really matter if it's a plugin or a CB. but if C# is not your best friend, this might not be very easy to understand and compose to either.
 
First, thanks for taking time to help :). I understand the code you've posted perfectly here. Could I put this into a CB? If, could you give me some directions? Or a plugin.
 
As I said, I understand how the code you posted functions, but I do not know what to put before it and possibly after it to make it work. Looks like this:

PHP:
using System;
using System.Collections.Generic;
using System.IO;
using System.Drawing;
using Levelbot.Actions.Combat;
using Styx;
using Styx.Helpers;
using Styx.Plugins.PluginClass;
using Styx.WoWInternals.WoWObjects;
using Styx.WoWInternals;
using Styx.Logic;
using Styx.Logic.Combat;
using Styx.Logic.Profiles;
using Styx.Logic.BehaviorTree;
using Styx.Logic.Pathing;
using Styx.Logic.Questing;
using Styx.Logic.POI;
using System.Threading;
using System.Diagnostics;
using System.Linq;

namespace TheGreatBankHeist
{
    public class TheGreatBankHeist : HBPlugin, IDisposable
    {
		#region uselessbutnecessaryshit
		public override string Name { get { return "The Great Bank Heist"; } }
        public override string Author { get { return "Test"; } }
        public override Version Version { get { return new Version(1, 0, 0); } }
		#endregion
		private static LocalPlayer Me { get { return ObjectManager.Me; } }
		public int counter = 0;
		private bool Dothis = true;
		private bool onstart = true;
					}
				}
if (onstart)
			{
				Lua.Events.AttachEvent("CHAT_MSG_RAID_BOSS_WHISPER", HandleRBW);
				onstart = false;
			}
private void HandleRBW(object sender, LuaEventArgs args)
{
if (!Me.Dead && Me.QuestLog.GetQuestById(14122) != null && !Me.QuestLog.GetQuestById(14122).IsCompleted)
			{
				
				if (args.Args[0].ToString().Contains("Amazing G-Ray"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(121, 'target', 'LeftButton')");
				}
				if (args.Args[0].ToString().Contains("Blast*****ers"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(122, 'target', 'LeftButton')");
				}
				if (args.Args[0].ToString().Contains("Ear-O-Scope"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(123, 'target', 'LeftButton')");
				}
				if (args.Args[0].ToString().Contains("Infinifold Lockpick"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(124, 'target', 'LeftButton')");
				}
				if (args.Args[0].ToString().Contains("mite Drill"))
				{
					Thread.Sleep(1000);
					Lua.DoString("UseAction(125, 'target', 'LeftButton')");
				}
			}
}
 
what i do for it to work is,
Code:
#region Quest 14122
            if (!Me.Dead && Me.QuestLog.GetQuestById(14122) != null && !Me.QuestLog.GetQuestById(14122).IsCompleted && Me.QuestLog.GetQuestById(14121).IsCompleted && Me.QuestLog.GetQuestById(14123) != null && Me.QuestLog.GetQuestById(14121) != null)
            {
                WoWPoint q14122 = new WoWPoint(-8361.689, 1726.248, 39.94792);
                while (Me.Location.Distance(q14122) > 5)
                {
                    Navigator.MoveTo(q14122);
                }
                while (!Me.HasAura("Vault *****ing Toolset"))
                { q14122bank[0].Interact(); }
                Thread.Sleep(1000);
                if (!IsAttached)
                {
                    Lua.Events.AttachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122_msg);
                    IsAttached = true;
                }
            }
            if (Me.QuestLog.GetQuestById(14122) != null && Me.QuestLog.GetQuestById(14122).IsCompleted && IsAttached)
            {
                Lua.DoString("VehicleExit()");
                if (IsAttached)
                {
                    Lua.Events.DetachEvent("CHAT_MSG_RAID_BOSS_WHISPER", q14122_msg);
                    IsAttached = false;
                }
            }
            #endregion
where i have a boolean value for IsAttached (instead of your OnStart)
this is all within the pulse() method
then i have another Method outside of the pulse with the lua event handling:
Code:
public void q14122_msg(object sender, LuaEventArgs arg)
        {
            if (arg.Args[0].ToString().Contains("Infinifold Lockpick"))
            {
                Lua.DoString("CastPetAction(4)");
            }
            if (arg.Args[0].ToString().Contains("Amazing G-Ray"))
            {
                Lua.DoString("CastPetAction(1)");
            }
            if (arg.Args[0].ToString().Contains("Kaja'mite Drill"))
            {
                Lua.DoString("CastPetAction(5)");
            }
            if (arg.Args[0].ToString().Contains("Ear-O-Scope"))
            {
                Lua.DoString("CastPetAction(3)");
            }
            if (arg.Args[0].ToString().Contains("Blast*****ers"))
            {
                Lua.DoString("CastPetAction(2)");
            }
        }
dunno if that helped you...
 
Hey Megser

Just wrote it as a CB for ya aswell, been testing it 3 times, and shouldn't be anything wrong with it.
simply use it in a profile like this:
HTML:
<CustomBehavior File="14122" QuestId="14122" />

- Shak
 

Attachments

Hey Megser

Just wrote it as a CB for ya aswell, been testing it 3 times, and shouldn't be anything wrong with it.
simply use it in a profile like this:
HTML:
<CustomBehavior File="14122" QuestId="14122" />

- Shak

Omfg Shakazara, are you kidding me? So f*ing nice of you man. Remember the 1-60 we were working on? Well Munta bailed, tried to talk to him but he never responds. Thanks so much mate. So kind.
 
This could be used to make a QB for the questt "please the crowd" in Mt Hyjal.
 
Not only, but it could be made to a standard listen => response CB by adding multiple quest ids in the same CB. the problem is that it has to fit more then one language, for example german, russian and so on.
 
Omfg Shakazara, are you kidding me? So f*ing nice of you man. Remember the 1-60 we were working on? Well Munta bailed, tried to talk to him but he never responds. Thanks so much mate. So kind.

I know Munta bailed, was quite a shame...
but doesn't mean we can't continue it... come on chat room, or add my msn ([email protected]) and we can figure something out...
 
Not only, but it could be made to a standard listen => response CB by adding multiple quest ids in the same CB. the problem is that it has to fit more then one language, for example german, russian and so on.

Nah not really, you could make it so YOU'D specify, like, if text TargetLine="Habengutten rapptapp" is spoken then VehicleButton1 etc. Would support any language.
 
Back
Top