Back to "snippet" tags

tranq's aspect switcher by tranq

Description: This is a script to automatically switch to the aspect you want with the press of a button/hotkey.

STEP 1: Get the main script

Copy the main script that I posted in the message after this one called AspectSwitcher and add it to your scripts. You can call it whatever you want, just remember the name and use that instead of AspectSwitcher in Step 2.

STEP 2: Create macro buttons for each aspect and slot

For each of the aspects you want to switch to, create an additional script that looks like the following:

;============ Script start

// set aspect category, 0 = weapon, 1 = spellbook, 2 = armor

setvar _aspectCategory 0

// set aspect type, see AspectSwitcher script at the top for list

setvar _aspectType 0

script AspectSwitcher

;============ Script end

Great, now give the script a name! For example, this one would switch to Air Weapon, so let's call it AirWeapon

Remember to change the name of AspectSwitcher to whatever you named the script when you copied it!

STEP 3: Create a macro button in CUO

So you set up a script for each aspect you want to switch to? Great! Now if you want to use a hotkey, you can assign one to each of the scripts created in step 2 directly. But if you want a macro button, go to Options -> Macros and create a new macro, give it the name you want to see on the button, select "say" and add in ">script NameOfYourScript". Do this for each one and you'll have a macro button for each, yay!

LIMITATIONS

Yes, there's one small caveat. The script can't tell the difference between weapon and spellbook text, so if you use spellbooks make sure to swap the weapon slot into an aspect you don't use and vice versa if you use a weapon. Otherwise it will find the matching text of the spellbook and will think it found it in weapon.

Enjoy!

// CATEGORIES (set as _aspectCategory) // 0 = weapon // 1 = spellbook // 2 = armor // ASPECT IDs (set as _aspectType) // 0 = air // 1 = artisan // 2 = blood // 3 = command // 4 = death // 5 = discipline // 6 = earth // 7 = eldritch // 8 = fire // 9 = fortune // 10 = holy // 11 = lyric // 12 = poison // 13 = shadow // 14 = void // 15 = water if not varexist _aspectCategory sysmsg "No aspect category set! Stopping." 56 stop endif if not varexist _aspectType sysmsg "No aspect type set! Stopping." 56 stop endif say "[aspect" waitforgump 2424293173 if _aspectCategory = 0 setvar! nextButton 5 setvar! activationButton 8 elseif _aspectCategory = 1 setvar! nextButton 10 setvar! activationButton 13 elseif _aspectCategory = 2 setvar! nextButton 15 setvar! activationButton 17 endif @setvar! found 0 if _aspectCategory < 2 while not dead if ingump "Whirlwind" 2424293173 and _aspectType = 0 and found = 0 setvar! found 1 elseif ingump "Fortify" 2424293173 and _aspectType = 1 and found = 0 setvar! found 1 elseif ingump "Ravage" 2424293173 and _aspectType = 2 and found = 0 setvar! found 1 elseif ingump "Inspiration" 2424293173 and _aspectType = 3 and found = 0 setvar! found 1 elseif ingump "Decay" 2424293173 and _aspectType = 4 and found = 0 setvar! found 1 elseif ingump "Iron Will" 2424293173 and _aspectType = 5 and found = 0 setvar! found 1 elseif ingump "Earth Hands" 2424293173 and _aspectType = 6 and found = 0 setvar! found 1 elseif ingump "Energy Surge" 2424293173 and _aspectType = 7 and found = 0 setvar! found 1 elseif ingump "Fire Nova" 2424293173 and _aspectType = 8 and found = 0 setvar! found 1 elseif ingump "Windfall" 2424293173 and _aspectType = 9 and found = 0 setvar! found 1 elseif ingump "Judgement" 2424293173 and _aspectType = 10 and found = 0 setvar! found 1 elseif ingump "Cacophony" 2424293173 and _aspectType = 11 and found = 0 setvar! found 1 elseif ingump "Toxicity" 2424293173 and _aspectType = 12 and found = 0 setvar! found 1 elseif ingump "Vanish" 2424293173 and _aspectType = 13 and found = 0 setvar! found 1 elseif ingump "Doom Dragon" 2424293173 and _aspectType = 14 and found = 0 setvar! found 1 elseif ingump "Ice Storm" 2424293173 and _aspectType = 15 and found = 0 setvar! found 1 endif if found = 1 overhead "Correct aspect found!" waitforgump 2424293173 gumpresponse activationButton 2424293173 waitforgump 2424293173 gumpresponse activationButton 2424293173 waitforgump 2424293173 gumpresponse activationButton 2424293173 waitforgump 2424293173 gumpclose 2424293173 stop endif gumpresponse nextButton 2424293173 waitforgump 2424293173 endwhile else while not dead if ingump "Chance to Avoid Movement Effects" 2424293173 and _aspectType = 0 and found = 0 setvar! found 1 elseif ingump "Exceptional Crafting Chance Bonus" 2424293173 and _aspectType = 1 and found = 0 setvar! found 1 elseif ingump "All Stats Increase" 2424293173 and _aspectType = 2 and found = 0 setvar! found 1 elseif ingump "Follower Exp Gain" 2424293173 and _aspectType = 3 and found = 0 setvar! found 1 elseif ingump "Gain Unholy Symbol" 2424293173 and _aspectType = 4 and found = 0 setvar! found 1 elseif ingump "10 Sec After Using Mana" 2424293173 and _aspectType = 5 and found = 0 setvar! found 1 elseif ingump "Damage Resistance While Stationary" 2424293173 and _aspectType = 6 and found = 0 setvar! found 1 elseif ingump "Effective Spirit Speak" 2424293173 and _aspectType = 7 and found = 0 setvar! found 1 elseif ingump "Field Damage Resistance" 2424293173 and _aspectType = 8 and found = 0 setvar! found 1 elseif ingump "Harvesting Skill Bonus" 2424293173 and _aspectType = 9 and found = 0 setvar! found 1 elseif ingump "Resist Per Symbol Spent" 2424293173 and _aspectType = 10 and found = 0 setvar! found 1 elseif ingump "Effective Barding Skill Bonus" 2424293173 and _aspectType = 11 and found = 0 setvar! found 1 elseif ingump "Effective Poisoning" 2424293173 and _aspectType = 12 and found = 0 setvar! found 1 elseif ingump "Bonus Stealth Steps" 2424293173 and _aspectType = 13 and found = 0 setvar! found 1 elseif ingump "Effective Parrying" 2424293173 and _aspectType = 14 and found = 0 setvar! found 1 elseif ingump "Effective Alchemy" 2424293173 and _aspectType = 15 and found = 0 setvar! found 1 endif if found = 1 overhead "Correct aspect found!" waitforgump 2424293173 gumpresponse activationButton 2424293173 waitforgump 2424293173 gumpresponse activationButton 2424293173 waitforgump 2424293173 gumpresponse activationButton 2424293173 waitforgump 2424293173 gumpclose 2424293173 stop endif gumpresponse nextButton 2424293173 waitforgump 2424293173 endwhile endif