Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Make it add up to 100
- (defrule
- (goal g-dynamic-gathering yes)
- (timer-triggered t-dynamic-gather)
- =>
- (up-modify-goal g-math-1 g:= g-saved-food-percent)
- (up-modify-goal g-math-1 g:+ g-saved-wood-percent)
- (up-modify-goal g-math-1 g:+ g-saved-stone-percent)
- (up-modify-goal g-math-1 g:+ g-saved-gold-percent)
- (up-modify-goal g-saved-food-percent c:* 100)
- (up-modify-goal g-saved-wood-percent c:* 100)
- (up-modify-goal g-saved-stone-percent c:* 100)
- (up-modify-goal g-saved-gold-percent c:* 100)
- (up-modify-goal g-saved-food-percent g:/ g-math-1)
- (up-modify-goal g-saved-wood-percent g:/ g-math-1)
- (up-modify-goal g-saved-stone-percent g:/ g-math-1)
- (up-modify-goal g-saved-gold-percent g:/ g-math-1))
- ;Overwrites earlier gathering percentages with dynamic ones
- (defrule
- (goal g-dynamic-gathering yes)
- =>
- (up-modify-sn sn-food-gatherer-percentage g:= g-saved-food-percent)
- (up-modify-sn sn-wood-gatherer-percentage g:= g-saved-wood-percent)
- (up-modify-sn sn-stone-gatherer-percentage g:= g-saved-stone-percent)
- (up-modify-sn sn-gold-gatherer-percentage g:= g-saved-stone-percent))
- ;So we can safely switch dynamic gathering on and off
- (defrule
- (goal g-dynamic-gathering no)
- =>
- (set-goal g-saved-food-percent -1))
- ;Reset the timer
- (defrule
- (timer-triggered t-dynamic-gather)
- (goal g-dynamic-gathering yes)
- =>
- (up-chat-data-to-self "Dynamic food %: %d" s: sn-food-gatherer-percentage)
- (up-chat-data-to-self "Dynamic wood %: %d" s: sn-wood-gatherer-percentage)
- (up-chat-data-to-self "Dynamic stone %: %d" s: sn-stone-gatherer-percentage)
- (up-chat-data-to-self "Dynamic gold %: %d" s: sn-gold-gatherer-percentage)
- (enable-timer t-dynamic-gather 180))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement