Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Help improving custom .json files
spyscouter
#1 Posted : Saturday, December 9, 2017 1:04:34 AM(UTC)

Rank: Advanced Member

Groups: Registered
Posts: 118

Thanks: 10 times
Was thanked: 29 time(s) in 17 post(s)
Hello friends, I want to start coding more, but I am running into problems. I have two questions to pose.

1. How do you make a condition for if the enemy has a secret? I have come up with this...

"condition":"opp_secret(count(), WHAT DO I PUT HERE?) > 0",

2. How do I make this logic?

If opponent is rogue/paladin/mage/hunter
If opponent has a secret in play...set high value to flare
else, do not play flare.
Else play flare as normal value
spyscouter
#2 Posted : Saturday, December 9, 2017 1:06:13 AM(UTC)

Rank: Advanced Member

Groups: Registered
Posts: 118

Thanks: 10 times
Was thanked: 29 time(s) in 17 post(s)
Also, what happens if you wanted to put two "BeforePlayCardBonus" strings in a row? Do you lump them together like this?

"BeforeCardPlayBonus":
{
"values":
[
{
"comment":"If hero is rogue, mage, paladin, or hunter, do not play unless secret is in place.",
"condition":"opp_hero(count(), hero_class=hunter | mage | paladin | rogue | hunter) > 0",
"value":"0",
}

"comment":"If enemy secret in play, give large bonus.",
"condition":"opp_secret(count(), DON'T KNOW WHAT TO PUT HERE > 0",
"value":"0",
}

],
},
kovacsati7
#3 Posted : Saturday, December 9, 2017 6:33:36 AM(UTC)

Rank: Advanced Member

Groups: Registered
Posts: 32

Thanks: 3 times
Was thanked: 4 time(s) in 4 post(s)
Hi, I don't think you need to apply a filter on heroes, only on secrets. If you play against a priest, and he steals a secret from you, you still want to play flare.
And you can use conditions like this, without any filter:
"condition":"opp_secret(count()) > 0"
spyscouter
#4 Posted : Saturday, December 9, 2017 11:37:00 AM(UTC)

Rank: Advanced Member

Groups: Registered
Posts: 118

Thanks: 10 times
Was thanked: 29 time(s) in 17 post(s)
Hey kovac thanks for your input. I️ just think cycling might be stronger, but I️ understand. Especially if against dragon priest who doesn’t run any steal cards. We can try both ways :) do you have experience making custom .json files? I’m hoping to start a collaboration with people instead of relying on only botwhat and Scott who both do awesome work but are busy.
spyscouter
#5 Posted : Saturday, December 9, 2017 12:10:18 PM(UTC)

Rank: Advanced Member

Groups: Registered
Posts: 118

Thanks: 10 times
Was thanked: 29 time(s) in 17 post(s)
Next problem I am facing is loading the custom config. I am getting error...

After parsing a value an unexpected character was encountered: ".Path 'BeforeCardPlayBonus.values[0]', line 15, position 3.

I can't seem to find the error.

https://ufile.io/v5jrt
JoyAdmin
#6 Posted : Saturday, December 9, 2017 1:51:47 PM(UTC)
Rank: Administration

Groups: Administrators
Posts: 4,845

Thanks: 805 times
Was thanked: 4538 time(s) in 1636 post(s)
correct syntax in json for array is:

"values":
[
{
"comment":"Only play if enemy minions are >1",
"condition":"opp_minions(count())>1",
"value":"15",
},

{

"comment":"If opponent is at 1 or 2 health, play explosive trap.",
"condition":"opp_hero(count(), health<3) > 0",
"value":"0",
}

],
1 user thanked JoyAdmin for this useful post.
spyscouter on 12/9/2017(UTC)
spyscouter
#7 Posted : Saturday, December 9, 2017 1:57:38 PM(UTC)

Rank: Advanced Member

Groups: Registered
Posts: 118

Thanks: 10 times
Was thanked: 29 time(s) in 17 post(s)
Thanks Joy! I’ll keep working on my files!
Nataniel88
#8 Posted : Wednesday, January 31, 2018 3:12:22 AM(UTC)

Rank: Advanced Member

Groups: Registered
Posts: 87

Thanks: 5 times
Was thanked: 27 time(s) in 13 post(s)
I've experimented with configs myself but I have few questions. Maybe someone with more experience will give me some advices.

1. What is a difference between "InHandBonus" and "BeforePlayCardBonus"? When I want bot to prevent playing something or make him play something which one should I use?
2. "InHandPlayPriority" has influence on order which cards are played? With high value card should be played first and with negative value last? What about hero powers? How to force bot to use e.g. Life Tap first before playing other cards? I tried to add .json file for CS2_056 (Life Tap) and added there "InHandPlayPriority" value to 100 but it doesn't work. Bot still plays cards first.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.076 seconds.