mirror of https://github.com/velour/catbase.git
sisyphus: modify min/max times a little more
This commit is contained in:
parent
df956513c2
commit
7e1c4e1106
|
@ -105,7 +105,9 @@ type Config struct {
|
||||||
}
|
}
|
||||||
Sisyphus struct {
|
Sisyphus struct {
|
||||||
MinDecrement int
|
MinDecrement int
|
||||||
|
MaxDecrement int
|
||||||
MinPush int
|
MinPush int
|
||||||
|
MaxPush int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,8 @@ func (g *game) scheduleDecrement() {
|
||||||
g.timers[0].Stop()
|
g.timers[0].Stop()
|
||||||
}
|
}
|
||||||
minDec := g.bot.Config().Sisyphus.MinDecrement
|
minDec := g.bot.Config().Sisyphus.MinDecrement
|
||||||
g.nextDec = time.Now().Add(time.Duration((60 + rand.Intn(60*minDec))) * time.Minute)
|
maxDec := g.bot.Config().Sisyphus.MinDecrement
|
||||||
|
g.nextDec = time.Now().Add(time.Duration((minDec + rand.Intn(maxDec))) * time.Minute)
|
||||||
go func() {
|
go func() {
|
||||||
t := time.NewTimer(g.nextDec.Sub(time.Now()))
|
t := time.NewTimer(g.nextDec.Sub(time.Now()))
|
||||||
g.timers[0] = t
|
g.timers[0] = t
|
||||||
|
@ -76,7 +77,8 @@ func (g *game) schedulePush() {
|
||||||
g.timers[1].Stop()
|
g.timers[1].Stop()
|
||||||
}
|
}
|
||||||
minPush := g.bot.Config().Sisyphus.MinPush
|
minPush := g.bot.Config().Sisyphus.MinPush
|
||||||
g.nextPush = time.Now().Add(time.Duration(rand.Intn(60)+minPush) * time.Minute)
|
maxPush := g.bot.Config().Sisyphus.MaxPush
|
||||||
|
g.nextPush = time.Now().Add(time.Duration(rand.Intn(maxPush)+minPush) * time.Minute)
|
||||||
go func() {
|
go func() {
|
||||||
t := time.NewTimer(g.nextPush.Sub(time.Now()))
|
t := time.NewTimer(g.nextPush.Sub(time.Now()))
|
||||||
g.timers[1] = t
|
g.timers[1] = t
|
||||||
|
|
Loading…
Reference in New Issue