Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1.  
  2. ;Make it add up to 100
  3. (defrule
  4. (goal g-dynamic-gathering yes)
  5. (timer-triggered t-dynamic-gather)
  6. =>
  7. (up-modify-goal g-math-1 g:= g-saved-food-percent)
  8. (up-modify-goal g-math-1 g:+ g-saved-wood-percent)
  9. (up-modify-goal g-math-1 g:+ g-saved-stone-percent)
  10. (up-modify-goal g-math-1 g:+ g-saved-gold-percent)
  11.  
  12. (up-modify-goal g-saved-food-percent c:* 100)
  13. (up-modify-goal g-saved-wood-percent c:* 100)
  14. (up-modify-goal g-saved-stone-percent c:* 100)
  15. (up-modify-goal g-saved-gold-percent c:* 100)
  16.  
  17. (up-modify-goal g-saved-food-percent g:/ g-math-1)
  18. (up-modify-goal g-saved-wood-percent g:/ g-math-1)
  19. (up-modify-goal g-saved-stone-percent g:/ g-math-1)
  20. (up-modify-goal g-saved-gold-percent g:/ g-math-1))
  21.  
  22. ;Overwrites earlier gathering percentages with dynamic ones
  23. (defrule
  24. (goal g-dynamic-gathering yes)
  25. =>
  26. (up-modify-sn sn-food-gatherer-percentage g:= g-saved-food-percent)
  27. (up-modify-sn sn-wood-gatherer-percentage g:= g-saved-wood-percent)
  28. (up-modify-sn sn-stone-gatherer-percentage g:= g-saved-stone-percent)
  29. (up-modify-sn sn-gold-gatherer-percentage g:= g-saved-stone-percent))
  30.  
  31. ;So we can safely switch dynamic gathering on and off
  32. (defrule
  33. (goal g-dynamic-gathering no)
  34. =>
  35. (set-goal g-saved-food-percent -1))
  36.  
  37. ;Reset the timer
  38. (defrule
  39. (timer-triggered t-dynamic-gather)
  40. (goal g-dynamic-gathering yes)
  41. =>
  42. (up-chat-data-to-self "Dynamic food %: %d" s: sn-food-gatherer-percentage)
  43. (up-chat-data-to-self "Dynamic wood %: %d" s: sn-wood-gatherer-percentage)
  44. (up-chat-data-to-self "Dynamic stone %: %d" s: sn-stone-gatherer-percentage)
  45. (up-chat-data-to-self "Dynamic gold %: %d" s: sn-gold-gatherer-percentage)
  46. (enable-timer t-dynamic-gather 180))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement