Auto Splitter v2.1 Made by @abianche on Discord (Artemis) Description Automatically splits stackable items into multiple smaller stacks and distributes them into chosen containers (anti-theft). Splits: Reagents, Recall Scrolls, Potions,…
BardOrganizing
Artemis Auto Splitter.razor
1# This is an automated backup - check out https://outlands.uorazorscripts.com/script/26785aa0-b051-419b-a52a-f204af185556 for latest2# Automation by Jaseowns3## Script: Artemis Auto Splitter4## Created by: abianche#05#############################################6 7# ------------------------------------------------------------8# Auto Splitter v2.19# Made by @abianche on Discord (Artemis)10#11# Description12# Automatically splits stackable items into multiple smaller stacks13# and distributes them into chosen containers (anti-theft).14#15# Splits: Reagents, Recall Scrolls, Potions, Bandages, Vet Supplies,16# Rope, Traps, Crystals, Arrows, Bolts17#18# Features19# - Each item group (reagents, potions, misc, ammo) can be switched on/off20# - Bags are auto-selected or manually picked, separately for21# reagents, potions, misc and quiver22# - Auto-select priority: satchel > pouch > backpack bag > rounded bag23# > main backpack, and each bag type can be allowed/skipped24# - The character's main backpack is excluded when searching for25# "backpack bag" containers26# - All items are data-driven: to add one, add a block to the27# ITEM DATA section (id, hue, drop Y, amount profile, target bag)28#29# Changelog30# v2.1 Bag-type toggles for auto-select, main backpack excluded31# from the bag search32# v2.0 Single data-driven loop for all items, split toggles,33# overhead messages built from the item label34# v1.2 Added crystals35# v1.1 Added traps36# v1.0 Initial implementation37#38# ------------------------------------------------------------39 40# =========================41# USER SETTINGS42# =========================43 44# Reagents bag. 1 = auto select, 0 = manual select.45@setvar! autoSelectRegBag 146 47# Potions bag. 1 = auto select, 0 = manual select.48@setvar! autoSelectPotionBag 149 50# Misc bag. 1 = auto select, 0 = manual select.51@setvar! autoSelectMiscBag 152 53# Quiver bag. 1 = auto select (quiver if found), 0 = manual select.54@setvar! autoSelectQuiverBag 155 56#� Split items. 1 = split, 0 = do not split.57@setvar! splitReagents 158@setvar! splitPotions 159@setvar! splitMisc 160@setvar! splitAmmo 161 62# Bag types auto-select may use. 1 = allowed, 0 = skip.63# Priority stays: satchel > pouch > backpack bag > rounded bag > main backpack64@setvar! useSatchel 165@setvar! usePouch 166@setvar! useBackpackBag 167@setvar! useRoundedBag 168 69# =========================70# DO NOT EDIT BELOW UNLESS YOU KNOW THE SCRIPT71# =========================72 73clearignore74 75@setvar! maxwaittimeinms 65076 77#********** Bags **********#78# slot 0 = reagents, 1 = potions, 2 = misc, 3 = quiver79 80for 481 82 # per-slot settings83 if index = 084 @setvar! autoOn autoSelectRegBag85 @setvar! prefType 3076586 elseif index = 187 @setvar! autoOn autoSelectPotionBag88 @setvar! prefType 3126289 elseif index = 290 @setvar! autoOn autoSelectMiscBag91 @setvar! prefType 092 else93 @setvar! autoOn autoSelectQuiverBag94 @setvar! prefType 1221595 endif96 97 @setvar! thisBag 098 99 if autoOn = 1100 if index = 3101 # Quiver: real quiver if found, otherwise the misc bag102 @setvar! thisBag myMiscBag103 if findtype prefType self as q104 @setvar! thisBag q105 endif106 else107 @ignore backpack108 109 if useSatchel = 1110 if prefType > 0111 if findtype prefType self as b112 @setvar! thisBag b113 endif114 endif115 endif116 117 if thisBag = 0 and usePouch = 1118 if findtype 3705 self as b119 @setvar! thisBag b120 endif121 endif122 123 if thisBag = 0 and useBackpackBag = 1124 if findtype 3701 self as b125 @setvar! thisBag b126 endif127 endif128 129 if thisBag = 0 and useRoundedBag = 1130 if findtype 3702 self as b131 @setvar! thisBag b132 endif133 endif134 135 @unignore backpack136 137 if thisBag = 0138 @setvar! thisBag backpack139 endif140 endif141 else142 clearsysmsg143 if index = 0144 overhead "Select Reagent bag:" 68145 elseif index = 1146 overhead "Select Potion bag:" 68147 elseif index = 2148 overhead "Select Misc bag:" 68149 else150 overhead "Select Quiver bag:" 68151 endif152 @setvar! thisBag153 wait 200154 while not targetexists and not insysmsg "Select"155 @setvar! thisBag156 endwhile157 158 if find thisBag self159 getlabel thisBag bagLabel160 161 if "satchel" in bagLabel or "pouch" in bagLabel or "bag" in bagLabel or "backpack" in bagLabel or "quiver" in bagLabel162 sysmsg "new bag set" 55163 else164 overhead "That is not a bag" 34165 sysmsg "That is not a bag" 34166 stop167 endif168 else169 overhead "No bag found!" 34170 stop171 endif172 endif173 174 if index = 0175 @setvar! myRegBag thisBag176 elseif index = 1177 @setvar! myPotionBag thisBag178 elseif index = 2179 @setvar! myMiscBag thisBag180 else181 @setvar! myQuiverBag thisBag182 endif183 184endfor185 186overhead "Auto Splitter started..." 55187 188#********** Drop X positions **********#189# Column used for the 1st, 2nd, 3rd... stack. Stacks past the190# end of the list reuse the last column (142 / 125 / 55).191 192if not listexists 'x_pack'193 createlist 'x_pack'194endif195if not listexists 'x_misc'196 createlist 'x_misc'197endif198if not listexists 'x_ammo'199 createlist 'x_ammo'200endif201clearlist 'x_pack'202clearlist 'x_misc'203clearlist 'x_ammo'204 205# Reagent + potion bags206pushlist 'x_pack' 44 back207pushlist 'x_pack' 68 back208pushlist 'x_pack' 96 back209pushlist 'x_pack' 121 back210pushlist 'x_pack' 142 back211 212# Misc bag213pushlist 'x_misc' 45 back214pushlist 'x_misc' 65 back215pushlist 'x_misc' 85 back216pushlist 'x_misc' 105 back217pushlist 'x_misc' 125 back218 219# Quiver220pushlist 'x_ammo' 35 back221pushlist 'x_ammo' 40 back222pushlist 'x_ammo' 45 back223pushlist 'x_ammo' 50 back224pushlist 'x_ammo' 55 back225 226#********** ITEM DATA **********#227# item_ids : item graphic id228# item_hue : overhead hue229# item_y : drop Y position inside the bag230# item_amt : amount profile 1 = standard, 2 = recall scroll,231# 3 = greater agility, 4 = greater magic resist232# item_bag : target bag 1 = reagents, 2 = potions, 3 = misc, 4 = quiver233 234if not listexists 'item_ids'235 createlist 'item_ids'236endif237if not listexists 'item_hue'238 createlist 'item_hue'239endif240if not listexists 'item_y'241 createlist 'item_y'242endif243if not listexists 'item_amt'244 createlist 'item_amt'245endif246if not listexists 'item_bag'247 createlist 'item_bag'248endif249clearlist 'item_ids'250clearlist 'item_hue'251clearlist 'item_y'252clearlist 'item_amt'253clearlist 'item_bag'254 255# ----- Reagents + Recall -----256 257if splitReagents = 1258 259 # Spider Silk260 pushlist 'item_ids' 3981 back261 pushlist 'item_hue' 0 back262 pushlist 'item_y' 65 back263 pushlist 'item_amt' 1 back264 pushlist 'item_bag' 1 back265 266 # Black Pearl267 pushlist 'item_ids' 3962 back268 pushlist 'item_hue' 11 back269 pushlist 'item_y' 75 back270 pushlist 'item_amt' 1 back271 pushlist 'item_bag' 1 back272 273 # Nightshade274 pushlist 'item_ids' 3976 back275 pushlist 'item_hue' 66 back276 pushlist 'item_y' 85 back277 pushlist 'item_amt' 1 back278 pushlist 'item_bag' 1 back279 280 # Mandrake Root281 pushlist 'item_ids' 3974 back282 pushlist 'item_hue' 439 back283 pushlist 'item_y' 95 back284 pushlist 'item_amt' 1 back285 pushlist 'item_bag' 1 back286 287 # Sulfurous Ash288 pushlist 'item_ids' 3980 back289 pushlist 'item_hue' 56 back290 pushlist 'item_y' 105 back291 pushlist 'item_amt' 1 back292 pushlist 'item_bag' 1 back293 294 # Ginseng295 pushlist 'item_ids' 3973 back296 pushlist 'item_hue' 149 back297 pushlist 'item_y' 115 back298 pushlist 'item_amt' 1 back299 pushlist 'item_bag' 1 back300 301 # Blood Moss302 pushlist 'item_ids' 3963 back303 pushlist 'item_hue' 35 back304 pushlist 'item_y' 125 back305 pushlist 'item_amt' 1 back306 pushlist 'item_bag' 1 back307 308 # Garlic309 pushlist 'item_ids' 3972 back310 pushlist 'item_hue' 910 back311 pushlist 'item_y' 135 back312 pushlist 'item_amt' 1 back313 pushlist 'item_bag' 1 back314 315 # Recall Scroll316 pushlist 'item_ids' 8012 back317 pushlist 'item_hue' 0 back318 pushlist 'item_y' 145 back319 pushlist 'item_amt' 2 back320 pushlist 'item_bag' 1 back321 322endif323 324# ----- Potions -----325 326if splitPotions = 1327 328 # Greater Heal329 pushlist 'item_ids' 3852 back330 pushlist 'item_hue' 48 back331 pushlist 'item_y' 65 back332 pushlist 'item_amt' 1 back333 pushlist 'item_bag' 2 back334 335 # Greater Cure336 pushlist 'item_ids' 3847 back337 pushlist 'item_hue' 44 back338 pushlist 'item_y' 75 back339 pushlist 'item_amt' 1 back340 pushlist 'item_bag' 2 back341 342 # Greater Agility343 pushlist 'item_ids' 3848 back344 pushlist 'item_hue' 93 back345 pushlist 'item_y' 85 back346 pushlist 'item_amt' 3 back347 pushlist 'item_bag' 2 back348 349 # Total Refresh350 pushlist 'item_ids' 3851 back351 pushlist 'item_hue' 38 back352 pushlist 'item_y' 95 back353 pushlist 'item_amt' 1 back354 pushlist 'item_bag' 2 back355 356 # Greater Magic Resist357 pushlist 'item_ids' 3846 back358 pushlist 'item_hue' 897 back359 pushlist 'item_y' 105 back360 pushlist 'item_amt' 4 back361 pushlist 'item_bag' 2 back362 363 # Greater Strength364 pushlist 'item_ids' 3849 back365 pushlist 'item_hue' 2041 back366 pushlist 'item_y' 115 back367 pushlist 'item_amt' 1 back368 pushlist 'item_bag' 2 back369 370 # Greater Explode371 pushlist 'item_ids' 3853 back372 pushlist 'item_hue' 1275 back373 pushlist 'item_y' 125 back374 pushlist 'item_amt' 1 back375 pushlist 'item_bag' 2 back376 377 # Lethal Poison378 pushlist 'item_ids' 3850 back379 pushlist 'item_hue' 1267 back380 pushlist 'item_y' 135 back381 pushlist 'item_amt' 1 back382 pushlist 'item_bag' 2 back383 384endif385 386# ----- Misc (Bandages + Vet Supplies + Rope + Traps + Crystals) -----387 388if splitMisc = 1389 390 # Bandages391 pushlist 'item_ids' 3617 back392 pushlist 'item_hue' 0 back393 pushlist 'item_y' 45 back394 pushlist 'item_amt' 1 back395 pushlist 'item_bag' 3 back396 397 # Vet Supplies398 pushlist 'item_ids' 25750 back399 pushlist 'item_hue' 15 back400 pushlist 'item_y' 70 back401 pushlist 'item_amt' 1 back402 pushlist 'item_bag' 3 back403 404 # Rope405 pushlist 'item_ids' 5370 back406 pushlist 'item_hue' 360 back407 pushlist 'item_y' 105 back408 pushlist 'item_amt' 1 back409 pushlist 'item_bag' 3 back410 411 # Traps412 pushlist 'item_ids' 19821 back413 pushlist 'item_hue' 897 back414 pushlist 'item_y' 125 back415 pushlist 'item_amt' 1 back416 pushlist 'item_bag' 3 back417 418 # Crystals419 pushlist 'item_ids' 20309 back420 pushlist 'item_hue' 999 back421 pushlist 'item_y' 125 back422 pushlist 'item_amt' 1 back423 pushlist 'item_bag' 3 back424 425endif426 427# ----- Ammo -----428 429if splitAmmo = 1430 431 # Arrows432 pushlist 'item_ids' 3903 back433 pushlist 'item_hue' 38 back434 pushlist 'item_y' 45 back435 pushlist 'item_amt' 1 back436 pushlist 'item_bag' 4 back437 438 # Bolts439 pushlist 'item_ids' 7163 back440 pushlist 'item_hue' 93 back441 pushlist 'item_y' 65 back442 pushlist 'item_amt' 1 back443 pushlist 'item_bag' 4 back444 445endif446 447#********** MAIN LOOP **********#448 449while list 'item_ids' > 0450 451 if poplist 'item_ids' front as tmpVal452 @setvar! itemID tmpVal453 else454 overhead "Item list error" 34455 stop456 endif457 458 if poplist 'item_hue' front as tmpVal459 @setvar! itemHue tmpVal460 endif461 462 if poplist 'item_y' front as tmpVal463 @setvar! dropY tmpVal464 endif465 466 if poplist 'item_amt' front as tmpVal467 @setvar! amtProfile tmpVal468 endif469 470 if poplist 'item_bag' front as tmpVal471 @setvar! bagKind tmpVal472 endif473 474 # ---- target bag ----475 if bagKind = 1476 @setvar! targetBag myRegBag477 elseif bagKind = 2478 @setvar! targetBag myPotionBag479 elseif bagKind = 3480 @setvar! targetBag myMiscBag481 else482 @setvar! targetBag myQuiverBag483 endif484 485 # ---- count stacks ----486 @setvar! myCounter 0487 488 while findtype itemID self as r489 @setvar! myCounter index490 @ignore r491 endwhile492 @clearignore493 494 # ---- amount per split ----495 if amtProfile = 2496 # Recall scroll profile497 if counttype itemID self <= 5498 @setvar! amount 1499 elseif counttype itemID self <= 10500 @setvar! amount 2501 elseif counttype itemID self <= 20502 @setvar! amount 4503 elseif counttype itemID self <= 40504 @setvar! amount 8505 else506 @setvar! amount 15507 endif508 509 elseif amtProfile = 3510 # Greater Agility profile511 if counttype itemID self <= 10512 @setvar! amount 1513 elseif counttype itemID self <= 20514 @setvar! amount 2515 elseif counttype itemID self <= 50516 @setvar! amount 4517 elseif counttype itemID self <= 100518 @setvar! amount 10519 elseif counttype itemID self <= 150520 @setvar! amount 20521 elseif counttype itemID self <= 200522 @setvar! amount 30523 else524 @setvar! amount 40525 endif526 527 elseif amtProfile = 4528 # Greater Magic Resist profile529 if counttype itemID self <= 10530 @setvar! amount 1531 elseif counttype itemID self <= 20532 @setvar! amount 2533 elseif counttype itemID self <= 50534 @setvar! amount 5535 elseif counttype itemID self <= 100536 @setvar! amount 10537 elseif counttype itemID self <= 150538 @setvar! amount 20539 elseif counttype itemID self <= 200540 @setvar! amount 30541 else542 @setvar! amount 40543 endif544 545 else546 # Standard profile547 if counttype itemID self <= 10548 @setvar! amount 2549 elseif counttype itemID self <= 20550 @setvar! amount 4551 elseif counttype itemID self <= 50552 @setvar! amount 10553 elseif counttype itemID self <= 100554 @setvar! amount 20555 elseif counttype itemID self <= 150556 @setvar! amount 30557 elseif counttype itemID self <= 200558 @setvar! amount 40559 else560 @setvar! amount 50561 endif562 endif563 564 # ---- split and move ----565 while findtype itemID self as thisStack566 567 # drop column for this stack568 if bagKind = 3569 @setvar! dropX 125570 if atlist 'x_misc' index as tmpVal571 @setvar! dropX tmpVal572 endif573 elseif bagKind = 4574 @setvar! dropX 55575 if atlist 'x_ammo' index as tmpVal576 @setvar! dropX tmpVal577 endif578 else579 @setvar! dropX 142580 if atlist 'x_pack' index as tmpVal581 @setvar! dropX tmpVal582 endif583 endif584 585 @setvar! moveIt 0586 587 if myCounter = 0588 @setvar! moveIt 1589 elseif not find thisStack targetBag590 @setvar! moveIt 1591 endif592 593 if moveIt = 1594 # sysmsg "id {{itemID}} stack {{thisStack}} idx {{index}}" 90595 getlabel thisStack stackLabel596 overhead "{{stackLabel}}..." itemHue597 lift thisStack amount598 drop targetBag dropX dropY 0599 endif600 601 @ignore thisStack602 603 if moveIt = 1604 wait maxwaittimeinms605 endif606 607 endwhile608 609endwhile610 611overhead "Splitter completed!" 55