// aliasing native functions var foeGetCnt = foe.GetCount var getCld = item.GetCooldown var canAct = item.CanActivate var itmGetCnt = item.GetCount var strIdxOf = string.IndexOf var strSub = string.Sub var strSplit = string.Split var strFormat = string.Format var sumGetId = summon.GetId var sumGetVar = summon.GetVar var intPrs = int.Parse // consts var cnstDashMinDist = 11 var cnstDashMaxDist = 17 // caching values var foe_ var FoeStr = func() return foe_ var foeDist = 9999 var FoeDist = func() return foeDist var foeHP var FoeHP = func() return foeHP var foeArm var FoeArm = func() return foeArm var debuffs_ var Debuffs = func() return debuffs_ var debuffsCnt var DebuffsCnt = func() return debuffsCnt var debuffsStr var DebuffsStr = func() return debuffsStr var buffs_ var Buffs = func() return buffs_ var buffStr var BuffStr = func() return buffStr var time_ var TimeSinceLoop = func() return time_ var itmL var ItmL = func() return itmL var itmLState var itmR var ItmR = func() return itmR var itmRState var itmPot var ItmPot = func() return itmPot var hp_ var PHp = func() return hp_ var maxhp_ var MaxPHp = func() return maxhp_ var armor_ var PArmor = func() return armor_ var pickup_ var PickupStr = func() return pickup_ var pickupDist var PickupDist = func() return pickupDist var harvest_ var HarvestStr = func() return harvest_ var harvestDist var HarvestDist = func() return harvestDist var scrI var ScrI = func() return scrI var scrTransStart = false var ScrTransStart = func() return scrTransStart var scrTransEnd = false var ScrTransEnd = func() return scrTransEnd var scrTrans = false var ScrTrans = func() return scrTrans var aiIdle var lstScrI = 0 func updateScrTransStart() ?lstScrI ! scrI lstScrI = scrI scrTransStart = true : scrTransStart = false var scrTrnsTimer = -1 func updateScrTrans() ?scrTrnsTimer ! -1 ?time_ - scrTrnsTimer >= 18 scrTrnsTimer = -1 scrTrans = false scrTransEnd = true :?scrTransStart scrTrnsTimer = time_ scrTrans = true :?scrTransEnd scrTransEnd = false func cacheVars() foe_ = foe foeDist = foe.distance foeHP = foe.hp foeArm = foe.armor debuffs_ = debuffs debuffsCnt = debuffs.count debuffsStr = debuffs.string buffs_ = buffs buffStr = buffs.string time_ = time itmL = item.left itmLState = item.left.state itmR = item.right itmRState = item.right.state itmPot = item.potion hp_ = hp maxhp_ = maxhp armor_ = armor pickup_ = pickup pickupDist = pickup.distance harvest_ = harvest harvestDist = harvest.distance aiIdle = ai.idle scrI = screen.i updateScrTransStart() updateScrTrans() // helpers func mathWithin(min, max, val) return min <= val & val <= max var pStr pStr = "" func pStrAdd(str) ?str = null str = "null" pStr = pStr + str func pStrAddN(str) pStrAdd(str) pStrAdd("\n") func pStrPrint() >@pStr@ // returned value [name, count, length] func getBf(str, bf) var ret = ["", 0, 0] var i = strIdxOf(str, bf) ?i ! -1 var curBf = strSplit(strSub(str, i), ":") ret[0] = curBf[0] ret[1] = intPrs(curBf[1]) ret[2] = intPrs(curBf[2]) return ret func getBfLen(str, bf) return getBf(str, bf)[2] func getBfCnt(str, bf) return getBf(str, bf)[1] func p(str, cnd) ?cnd >@str@ var cTimer = -1 func StartCTimer() cTimer = time_ return cTimer func StopCTimer() cTimer = -1 func GetCTimer() return time_ - cTimer func CurrentlyCasting() return cTimer ! -1 // generic dash func genericDash(name) var cnd = func(itmNm) var cMin = cnstDashMinDist var cMax = cnstDashMaxDist return !scrTrans & ^ mathWithin(cMin, cMax, foeDist) & ^ getCld(itmNm) <= 0 ?cnd(name) equipR @name@ return true return false func bashShield() return genericDash("bash") func dashShield() return genericDash("dash") var stdDashArr = [ "bash", "dash" ] func anyDash(arr) for e : arr var res = genericDash(e) ?res return res return false func mindStone(msRng) var msCnd = func(minRng) return getCld("mind") <= 0 & ^foeDist <= minRng ?msCnd(msRng) equipL @"mind_stone"@ return true : return false func fireTalisman() var ftCnd = func() return getCld("fire_talisman") <= 0 & ^sumGetId() = null ?ftCnd() equipL @"fire_talisman"@ ?canAct("fire_talisman") activate L : return sumGetId() ! "cinderwisp" func cinderwisp(ignitionStacks) var cwCnd = func(stxReq) return sumGetId() = "cinderwisp" & ^sumGetVar("ignition") >= stxReg ?cwCnd(ignitionStacks) activate R return false func cultistMask() var cmCnd = func() return !scrTrans & ^ foe_ = "boss" & ^ foeDist <= 30 & ^ foe_ ! "Nagaraja" & ^ getCld("mask") <= 0 ?cmCnd() equipR @"mask"@ ?canAct("mask") activate R return false return true return false func bladeOfGod(foeMinimum) var bgCnd = func(cnt) return !scrTrans & ^ cnt <= foeGetCnt(46) & ^ foe_ ! "Pallas" & ^ getCld("blade") <= 0 ?bgCnd(foeMinimum) equip @"blade"@ ?canAct("blade") activate R return false return true return false var genMelRunning = false func genericMeleeItem( ^itmNam, cldNam, rng, cRng, tgtCnd, dshArr) var rangeToExecute = rng var rangeToCharge = cRng var genericCnd = func(range, itemName) return !scrTrans & ^ getCld(itemName) <= 0 & ^ foeDist <= range ?genMelRunning ?itmRState = 2 return true :?itmRState = 3 genMelRunning = false return false :?genericCnd(rangeToCharge, cldNam) ?tgtCnd equip @itmNam@ ?foeDist <= rangeToExecute ?canAct(cldNam) activate R genMelRunning = true : anyDash(dshArr) return true return false return false func heavyHammer(rng, cRng) var tgtCnd = func() var arm = 100 var foeAmt = 5 return ^ ( ^ (arm <= foeArm | foe_ = boss) & ^ foe_ ! "immune_to_physical" ^ ) | ^ foeAmt <= foeGetCnt(foeAmt) return genericMeleeItem( ^"heavy hammer", "hammer", ^rng, cRng, tgtCnd(), stdDashArr) func bardiche(rng, cRng, minHp) var tgtCnd = func(hpReq) return ^ ( ^ ((foeHP + foeArm) >= hpReq | foe_ = boss) & ^ foe_ ! "immune_to_physical" ^ ) return genericMeleeItem( ^"bardiche", "bardiche", ^rng, cRng, tgtCnd(minHp), stdDashArr) var saLevel = -1 var ppStxMax = 100 func updateSALevel() equip @"skeleton_arm"@ ?itmR = "skeleton_arm" saLevel = intPrs(strSplit(itmR, "*")[1]) ppStxMax = saLevel - 4 return false return true func skeletonArm(steal, stack) var stl = steal var stk = stack var activateDist = 5 var itmNam = "skeleton_arm" var cnd = func() return !scrTrans & ^ foe_ ! "pallas" & ^ foe_ ! "immune_to_physical" ?cnd() var ppStx = getBfCnt("pick_pocket") ?stack ?ppStx ! ppStxMax equip @itmNam@ return true ?steal ?getCld(itmNam) <= 0 & ppStx = ppStxMax equip @itmNam@ ?foeDist <= activateDist ?canAct(itmNam) activate R return false :?anyDash(stdDashArr) return true return false // loadout stuff func harvestTool(harvestable) var h = harvestable ?h = "tree" return "hatchet" :?h = "boulder" return "shovel" : return null func noFoeLoadout() var noFoeDist = 25 var hvstSwapDist = 8 var pickupSwapDist= 10 var armThrs = 5 var shieldToUse = "socketed_shield *max" ?foeGetCnt(noFoeDist) = 0 ?harvestDist <= hvstSwapDist var tool = harvestTool(harvest_) ?tool equip @tool@ ?canAct(tool) & harvestDist <= 5 activate R return true return false :?pickupDist <= pickupSwapDist var l = "star_stone" var r = shieldToUse ?armor_ > armThrs r = "trisk" :?hp_ ! maxhp_ r = "ouroborus" equipR @r@ equipL @l@ return true :?hp_ ! maxhp_ | armor < armThrs // regen equipL @"ouroboros"@ equipR @shieldToUse@ return true : equipL @"trisk"@ equipR @shieldToUse@ return true return false func cndLo(cnd, lItm, rItm) ?cnd equipL @" equipR @" return true return false func vigorImmunityLoadout() return cndLo( ^ foe_ = "immune_to_vigor", ^ "fire wand dF", "crossbow *max") func aetherImmunityLoadout() return cndLo( ^ foe_ = "immune_to_aether", ^ "fire wand dF", "vigor wand dL") func fireImmunityLoadout() return cndLo( ^ foe_ = "immune_to_fire", ^ "crossbow *max", "vigor wand dL") func iceImmunityLoadout() return cndLo( ^ foe_ = "immune_to_ice", ^ "fire wand dF", "vigor wand dL") func poisonImmunityLoadout() return cndLo( ^ foe_ = "immune_to_poison", ^ "fire wand dF", "vigor wand dL") func meleeImmunityLoadout() return cndLo( ^ foe_ = "immune_to_melee", ^ "fire wand dF", "vigor wand dL") func rangedImmunityLoadout() ?foe_ = "immune_to_ranged" equip @"heavy hammer"@ ?foeDist >= cnstDashMinDist dashShield() return true return false func longRangeLoadout(lngRngSwapDist) ?foeDist > lngRngSwapDist & ^ foe_ ! "immune_to_ranged" equip @"repeating_crossbow"@ return true return false //implement immunity loadouts func loadoutSwap() var lngRngSwpDist = 20 ?noFoeLoadout() return false :?longRangeLoadout(lngRngSwpDist) return false // immunities :?vigorImmunityLoadout() return false :?aetherImmunityLoadout() return false :?fireImmunityLoadout() return false :?iceImmunityLoadout() return false :?poisonImmunityLoadout() return false :?meleeImmunityLoadout() return false :?rangedImmunityLoadout() return false : equipL @"vigor wand dL"@ equipR @"fire wand dF"@ return false // potion use func potion(hpThreshold) ?hp_ <= hpThreshold activate potion return false func cleansingPotion(debuffThreshold) ?itmPot = "cleansing" & ^debuffsCnt >= debuffThreshold activate potion return false // runs and saves any ability returning // true (thereby denoting the ability // needs to run next frame) var cAb func impLoopSet(a) var res = a() ?res cAb = a : cAb = null return res func ImperativeLoopRun() // variables and functions var r = impLoopSet // if an ability has requested next frame // run it ?cAb ?r(cAb) return // fix some variables for abilities // that need it var potionF = func() return potion(15) var bardicheF = func() return bardiche(10, 23, 300) var heavyHammerF = func() return heavyHammer(10, 23) var bladeOfGodF = func() return bladeOfGod(10) // start of execution ?r(potionF) return :?r(fireTalisman) return :?r(bladeOfGodF) return :?r(bardicheF) return :?r(heavyHammerF) return :?r(cultistMask) return :?r(loadoutSwap) return return func ImperativeLoopInit() ?updateSALevel() return false : return true // wrappers // runs imperative loop and returns // itself. Meaning it will run indefinitely func run() ImperativeLoopRun() return runThis var runThis = run func init() var init_ = ImperativeLoopInit ?!init_() return initThis : return run() var initThis = init // entry point cacheVars() // var CurrentF = init CurrentF = CurrentF()