Advertisement
Guest User

FFXIV-Gathering - Calc

a guest
Sep 28th, 2013
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5.  
  6. pChainBonus0 := 0
  7. pChainBonus1 := 5
  8. pChainBonus2 := 10
  9. pChainBonus3 := 20
  10. pChainsCount = 0
  11. pHQBonus = 200
  12. iGatherTimes = 4
  13. iNormalItem = 0
  14. iHQItem = 0
  15. iTimesFailed = 0
  16. iExpTotal = 0
  17. iChainBonus = 0
  18.  
  19. IniRead, SuccessChance, ffxiv.ini, ahk, iSuccessChance, 90
  20. IniRead, HQChance, ffxiv.ini, ahk, iHQChance, 15
  21. IniRead, BaseExp, ffxiv.ini, ahk, iBaseExp, 300
  22. IniRead, Iteration, ffxiv.ini, ahk, iIteration, 10000
  23.  
  24. Gui, Add, Text,, Success Chance (`%):
  25. Gui, Add, Edit, Number vSuccessChance, %SuccessChance%
  26. Gui, Add, Text,, HQ Chance (`%):
  27. Gui, Add, Edit, Number vHQChance, %HQChance%
  28. Gui, Add, Text,, Base Experience:
  29. Gui, Add, Edit, Number vBaseExp, %BaseExp%
  30. Gui, Add, Text,, Iteration:
  31. Gui, Add, Edit, Number vIteration, %Iteration%
  32. Gui, Add, Button, Default, Calculate
  33. Gui, Show,, Gathering Calculator
  34. return
  35.  
  36. GuiClose:
  37. ButtonCalculate:
  38. Gui, Submit
  39. Loop %Iteration% {
  40.     pChainsCount = 0
  41.     Loop %iGatherTimes% {
  42.         Random, iRand, 1, 100
  43.         if (iRand > SuccessChance) { ;Fail
  44.             iTimesFailed++
  45.             pChainsCount = 0
  46.         } else { ;Succeed
  47.             Random, iRand, 1, 100
  48.             if (iRand > HQChance) { ;Normal Item
  49.                 iNormalItem++
  50.                 iExpTotal += BaseExp * (pChainBonus%pChainsCount% + 100) / 100
  51.                 iChainBonus += BaseExp * (pChainBonus%pChainsCount%) / 100
  52.             } else { ;HQ Item
  53.                 iHQItem++
  54.                 iExpTotal += BaseExp * ((pChainBonus%pChainsCount% + 100) + pHQBonus) / 100
  55.                 iChainBonus += BaseExp * (pChainBonus%pChainsCount%) / 100
  56.             }
  57.             pChainsCount++
  58.         }
  59.     }
  60. }
  61. SetFormat, float, 4.0
  62. iAvgExpPerNode := iExpTotal / Iteration
  63. iAvgExpPerHour := iAvgExpPerNode * 120
  64. iExpTotal += 0
  65. iChainBonus += 0
  66. IniWrite, %SuccessChance%, ffxiv.ini, ahk, iSuccessChance
  67. IniWrite, %HQChance%, ffxiv.ini, ahk, iHQChance
  68. IniWrite, %BaseExp%, ffxiv.ini, ahk, iBaseExp
  69. IniWrite, %Iteration%, ffxiv.ini, ahk, iIteration
  70. MsgBox %iNormalItem%`tnormal items`r`n%iHQItem%`tHQ items`r`n%iTimesFailed%`tfails`r`n%iChainBonus%`tchain bonus`r`n%iExpTotal%`texperience`r`n%iAvgExpPerNode%`texp per node`r`n%iAvgExpPerHour%`texp per hour.
  71. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement