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

sakuraouji

New Member
Joined
Jun 29, 2015
Messages
81
Reaction score
1
i want to write my own mulligan but i dont understand because custom deck thread is close

1.how i can write alway keep card like

i want to keep

GVG_058

2. how i can write a logic like this

on hearthbuddy

var gotRedemption = false;
var gotShielded = false;

foreach (Card c in Choices)
{
if (c.Name == "EX1_136") // Redemption
{
gotRedemption = true;
}
if (c.Name == "GVG_058") // Shielded Minibot
{
gotShielded = true;
}

if (gotShielded && gotRedemption)
{
BlackList.Remove("EX1_136");// Redemption
}
}
 

Attachments

Last edited:
Any dev can translate this profile to hearthbuddy ?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SmartBotUI;
using SmartBotUI.Settings;

namespace SmartBotUI.Mulligan
{
[Serializable]
public class bMulliganProfile : MulliganProfile
{
public bMulliganProfile() : base()
{

}

public override List<Card> HandleMulligan(List<Card> Choices, CClass opponentClass, CClass ownClass)
{
List<Card> CardsToKeep = new List<Card>();
List<string> WhiteList = new List<string>();
List<string> BlackList = new List<string>();
bool HasCoin = Choices.Count > 3;

/* Setup Keep List */
WhiteList.Add("GAME_005"); //Coin
WhiteList.Add("GVG_058"); //Shielded Minibot
WhiteList.Add("NEW1_019"); //Knife Juggler
WhiteList.Add("AT_079"); //Mysterious Challenger
WhiteList.Add("CS2_188"); //Abusive Sergeant
WhiteList.Add("EX1_029"); //Leper Gnome
WhiteList.Add("EX1_080"); //Secretkeeper
WhiteList.Add("FP1_002"); //Haunted Creeper

/* Setup Ignore List */
BlackList.Add("FP1_020"); //Avenge
BlackList.Add("AT_073"); //Competitive Spirit
BlackList.Add("EX1_130"); //Noble Sacrifice
BlackList.Add("EX1_136"); //Redemption
BlackList.Add("EX1_379"); //Repentance
BlackList.Add("GVG_096"); //Piloted Shredder

var gotRedemption = false;
var gotShielded = false;

foreach (Card c in Choices)
{
if (c.Name == "EX1_136") // Redemption
{
gotRedemption = true;
}
if (c.Name == "GVG_058") // Shielded Minibot
{
gotShielded = true;
}

if (gotShielded && gotRedemption)
{
BlackList.Remove("EX1_136");// Redemption
}
}

var gotKnife = false;
var gotNoble = false;

foreach (Card c in Choices)
{
if (c.Name == "NEW1_019") // Knife
{
gotKnife = true;
}
if (c.Name == "EX1_130") // Noble
{
gotNoble = true;
}

if (gotNoble && gotKnife)
{
BlackList.Remove("EX1_130"); // Noble
}
}

/* Setup Logic to Keep or Ignore Cards Depending on Situation */

/* ---Paladin Logic---
foreach (Card c in Choices)
{
if (c.Name == "FP1_004") //Mad Scientist
{
BlackList.Add("EX1_130"); //Noble Sacrifice
}
}*/

if(opponentClass == CClass.HUNTER)
{
WhiteList.Add("GVG_061"); //Muster for Battle
}

if(opponentClass == CClass.PRIEST)
{
WhiteList.Add("GVG_096"); //Piloted Shredder
}

if(opponentClass == CClass.PALADIN)
{
}

if(opponentClass == CClass.WARLOCK)
{
WhiteList.Add("GVG_061"); //Muster for Battle
}

if(opponentClass == CClass.WARRIOR)
{
WhiteList.Add("GVG_061"); //Muster for Battle
WhiteList.Add("GVG_096"); //Piloted Shredder
}

if(opponentClass == CClass.SHAMAN)
{
WhiteList.Add("GVG_061"); //Muster for Battle
WhiteList.Add("GVG_096"); //Piloted Shredder
}

if(opponentClass == CClass.DRUID)
{
WhiteList.Add("GVG_096"); //Piloted Shredder
WhiteList.Add("GVG_061"); //Muster for Battle
}

if(opponentClass == CClass.MAGE)
{
WhiteList.Add("GVG_061"); //Muster for Battle
}

if(opponentClass == CClass.ROGUE)
{
WhiteList.Add("GVG_096"); //Piloted Shredder
WhiteList.Add("GVG_061"); //Muster for Battle
}

/*--------------------------------------------------------------*/

foreach(Card s in Choices)
{
if(BlackList.Contains(s.Name))
continue;

bool KeptAlreadyOne = false;
bool AllowDoublon = false;


foreach(Card cc in CardsToKeep)
{
if(cc.Name == s.Name)
KeptAlreadyOne = true;
}

if(WhiteList.Contains(s.Name) && KeptAlreadyOne && AllowDoublon)
{
CardsToKeep.Add(s);
continue;
}
else if(WhiteList.Contains(s.Name) && !KeptAlreadyOne)
{
CardsToKeep.Add(s);
continue;
}

}

return CardsToKeep;
}

}
}
 
can any support answer me ?

help to fix error please

[Mulligan] An exception occurred: System.MissingMemberException: 'type' object has no attribute 'ROUGE'
at IronPython.Runtime.Binding.MetaPythonType.FastGetBinderHelper.ErrorBinder.Target(CodeContext context, Object self, Object& result)
at IronPython.Runtime.Types.TypeGetBase.RunDelegatesNoOptimize(Object self, CodeContext context)
at IronPython.Runtime.Types.SystemTypeGet.Target(CallSite site, Object self, CodeContext context)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
at IronPython.Compiler.PythonCallTargets.OriginalCallTarget0(PythonFunction function)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at _Scripting_(Object[] )
at HREngine.Bots.DefaultRoutine.GetCondition(String expression, IEnumerable`1 variables) in c:\Users\Yalz\Downloads\Hearthbuddy 0.3.1004.177\Routines\DefaultRoutine\DefaultRoutine.cs:line 220
at HREngine.Bots.DefaultRoutine.<MulliganLogic>d__12.MoveNext() in c:\Users\Yalz\Downloads\Hearthbuddy 0.3.1004.177\Routines\DefaultRoutine\DefaultRoutine.cs:line 597.


-_- please
 
Last edited:
@obtkamer how i can write keep card

_mulliganRules.Add(new Tuple<string, string>("True", "card.Entity.Id != "EX1_029"));


this is true ?
 
This is one of the few serious threads......
So why is no dev answering ?????

How can we setup a Whitelist for Mulligan ?
 
@obtkamer how i can write keep card

_mulliganRules.Add(new Tuple<string, string>("True", "card.Entity.Id != "EX1_029"));


this is true ?

I may be wrong but I think with this rule you tell the bot to mulligan EVERY other card than EX1_029.

In order to hold a specific card I think you either have to add it to _mulliganRules.Add(new Tuple<string, string>("True", "card.Entity.Cost >= 4 and card.Entity.Id != "GVG_063"")); so in the end it has to look like:
_mulliganRules.Add(new Tuple<string, string>("True", "card.Entity.Cost >= 4 and card.Entity.Id != "GVG_063" and card.Entity.Id != "EX1_029"")); or you could try and create a new rule:
_mulliganRules.Add(new Tuple<string, string>("False", "card.Entity.Id == "EX1_029""));

but the DefaultRoutine could get pretty lengthy.
Dear Devs please make the _mulligan.txt happen.

EDIT: I just tested _mulliganRules.Add(new Tuple<string, string>("False", "card.Entity.Id == "EX1_029"")); and it doesn't work because the first item of the touple is meant for the user/enemy class.
 
Last edited:
Back
Top