Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- pChainBonus0 := 0
- pChainBonus1 := 5
- pChainBonus2 := 10
- pChainBonus3 := 20
- pChainsCount = 0
- pHQBonus = 200
- iGatherTimes = 4
- iNormalItem = 0
- iHQItem = 0
- iTimesFailed = 0
- iExpTotal = 0
- iChainBonus = 0
- IniRead, SuccessChance, ffxiv.ini, ahk, iSuccessChance, 90
- IniRead, HQChance, ffxiv.ini, ahk, iHQChance, 15
- IniRead, BaseExp, ffxiv.ini, ahk, iBaseExp, 300
- IniRead, Iteration, ffxiv.ini, ahk, iIteration, 10000
- Gui, Add, Text,, Success Chance (`%):
- Gui, Add, Edit, Number vSuccessChance, %SuccessChance%
- Gui, Add, Text,, HQ Chance (`%):
- Gui, Add, Edit, Number vHQChance, %HQChance%
- Gui, Add, Text,, Base Experience:
- Gui, Add, Edit, Number vBaseExp, %BaseExp%
- Gui, Add, Text,, Iteration:
- Gui, Add, Edit, Number vIteration, %Iteration%
- Gui, Add, Button, Default, Calculate
- Gui, Show,, Gathering Calculator
- return
- GuiClose:
- ButtonCalculate:
- Gui, Submit
- Loop %Iteration% {
- pChainsCount = 0
- Loop %iGatherTimes% {
- Random, iRand, 1, 100
- if (iRand > SuccessChance) { ;Fail
- iTimesFailed++
- pChainsCount = 0
- } else { ;Succeed
- Random, iRand, 1, 100
- if (iRand > HQChance) { ;Normal Item
- iNormalItem++
- iExpTotal += BaseExp * (pChainBonus%pChainsCount% + 100) / 100
- iChainBonus += BaseExp * (pChainBonus%pChainsCount%) / 100
- } else { ;HQ Item
- iHQItem++
- iExpTotal += BaseExp * ((pChainBonus%pChainsCount% + 100) + pHQBonus) / 100
- iChainBonus += BaseExp * (pChainBonus%pChainsCount%) / 100
- }
- pChainsCount++
- }
- }
- }
- SetFormat, float, 4.0
- iAvgExpPerNode := iExpTotal / Iteration
- iAvgExpPerHour := iAvgExpPerNode * 120
- iExpTotal += 0
- iChainBonus += 0
- IniWrite, %SuccessChance%, ffxiv.ini, ahk, iSuccessChance
- IniWrite, %HQChance%, ffxiv.ini, ahk, iHQChance
- IniWrite, %BaseExp%, ffxiv.ini, ahk, iBaseExp
- IniWrite, %Iteration%, ffxiv.ini, ahk, iIteration
- 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.
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement