View Full Version : Alt-self-casting in Cosmos v0.39
EDIT:
Upgraded it to new Interface version. Might be non-working. Optionally dependent on Cosmos (options should work now).
Updated the code for the new Cosmos.
Updated the code into an AddOn.
Code works. Minor bug with not saving state currently known about and ignored. :)
Hiya!
Version 0.34 contains MAJOR additions to configurability (thanks to Mugendai for the suggestions and the implicit threats :) ). When it gets deloused, it should be better in every way, allowing you to specify more things (such as using Ctrl/Alt/Shift in any combination to self-cast spells... note that disabling all three means that ALL spells should be self-cast).
Latest stable version (http://www.fukt.bth.se/~k/wow/scripts/AltSelfCast/AltSelfCast_v0.32.zip).
I've tried to reimplement Telo's Alt-self-cast (http://www.worldofwarcraft.com/thread.aspx?FN=wow-interface-customization&T=3596) mod to work with Cosmos.
The modified files can be found here (http://www.fukt.bth.se/~k/wow/scripts/AltSelfCast/), with the latest (v0.32) zip file located here (http://www.fukt.bth.se/~k/wow/scripts/AltSelfCast/AltSelfCast_v0.32.zip).
Post any feedback here. Note that the modification is NOT enabled automatically, you'll have to do that in the Cosmos menu or manually by using the following code :/script AltSelfCast_Toggle_Enabled(1);
It defaults to using Alt as the self-cast key.
Sarf
---
"What happens if a big asteroid hits Earth? Judging from realistic simulations involving a sledge hammer and a common laboratory frog, we can assume it will be pretty bad." - Dave Barry
Consider this tested the next time I load up WoW.
Thanks, sarf!
karconn
09-07-2004, 02:14 PM
Is this the ability to use ALT and any one of the standard button bar actions to perform an action (presumably casting a spell) assuming you are the target?
I had some code from several months ago that someone came up with for the actionbutton.lua and if this is a substitute for that I'd be very interested in it :)
Yes, that is correct, karconn. Unfortunately, I haven't updated it for the latest distribution of Cosmos - I'll see what I can do tonight.
Sarf
---
I tried sniffing coke once, but the ice cubes got stuck in my nose.
karconn
09-07-2004, 02:50 PM
Excellent! I've been having to monkey around with making that actionbutton.lua a .prepatch and making them read-only so I can tell when you folks had updates to the files, so I could bring down the latest version, and then paste the old ALT functionality back in.
Does it reacquire your current target and put you back in combat mode (assuming the target is hostile and not friendly)? Or better yet, is it smart enough to know when it reacquires the target that you were in fact 'fighting' it before, regardless as to whether it is hostile or not, and enters combat mode? The version I have now (someone else wrote it) will re-engage with an enemy, but if you are fighting a 'yellow' it retargets, but you just stand there and have to hit 'T' to enter combat mode again. Would be nice to not do that anymore.
Really excited about this one, I will be 'monkey free' after this :D
Oh, I had an idea for another little script, where should I post that, 'general'?
If it is an idea, probably general. Might be suggestions if it is an improvement of Cosmos functionality.
Anyhow, the Alt-self-cast uses the SpellTarget functions and other stuff to avoid destroying your current target as far as is possible.
Sarf
---
CLARIONET, n. An instrument of torture operated by a person with cotton in his ears. There are two instruments that are worse than a clarionet -- two clarionets.
karconn
09-07-2004, 03:12 PM
I just tried this, and when I came in, all my buttons were gone. Including the little up and down arrow images to the right of the action bar. I removed the new xml and lua and I seem to be working again.
EDIT: forgot the IRC address
As I said, it is not compliant with the current version of Cosmos. :)
By the way, maybe you should join us on IRC - it's a bit easier to talk there! :)
IRC address:
irc://irc.datavertex.com/#cosmostesters
I'm not sure about the "#" before cosmostesters, but...
Sarf
---
Confucious says ... "Man who keep feet firmly on ground have trouble putting on pants."
karconn
09-07-2004, 03:54 PM
Wooops, sorry didn't read that, just ran off to test it :)
karconn
09-07-2004, 04:00 PM
IRC address:
irc://irc.datavertex.com/#cosmostesters
I'm not sure about the "#" before cosmostesters, but...
This didn't work :( Tried no punctuation, other random punctuation, it barked at me.
Err... you have to use an IRC client. I recommend X-Chat (http://www.xchat.org/) or mIRC (http://www.mirc.com/).
I don't think either of those are integrated with browsers.
Anyhow, use "irc.datavertex.com" as server, "cosmostesters" or "#cosmostesters" as the channel.
Sarf
---
"If you want to shoot yourself in the foot, Perl will give you ten bullets and a laser scope, then stand by and cheer you on." - Teodor Zlatanov
I've updated the code to the latest Cosmos code - it should work now.
Sarf
---
ALTAR, n. The place whereupon the priest formerly raveled out the small intestine of the sacrificial victim for purposes of divination and cooked its flesh for the gods. The word is now seldom used, except with reference to the sacrifice of their liberty and peace by a male and a female tool.
karconn
09-07-2004, 11:14 PM
I just tried it again, and I get the same problem. Having the new XML file in there makes the entire button bar not functional. There's no buttons on it at all. If I remove that file and put the other one back, it's ok again, but ALT+<button> doesn't do anything at that point.
I downloaded the 0.2 zip.
Try the new version.
Sarf
---
If you are sitting, just sit. If you are walking, just walk. Above all, don't wobble.
karconn
09-07-2004, 11:38 PM
The frame seems to be ok now, all my spells and buttons and what not are there. But it doesn't seem to be doing anything for me.
Just to be clear as to the expected result. I should be able to do ALT + <button bar number> and it will attempt to cast that on myself, assuming I'm a valid target, but selecting me first if I'm not already selecting, and then if I had a previous target, select that target...and if I was engaged in combat with that previous target, enter combat mode?
Or is that not what this does?
BTW - I'm 'only' using the 'main' bar. I don't use the side bars and the 2nd toolbar. I'm one of those odd people that don't have a problem with shift+1,2,3,4 and back and forth to flip spells around :) So...in the case where this was 'not' intended to work with the main button bar, I might not be the best tester for this :)
Well... it tries to cast the thing on yourself, true, hopefully wihtout destroying your target.
That's what it's supposed to do anyhow.
It's only made to work for the mainbar as of now.
Sarf
---
It is easier to fight for one's principles than to live up to them.
karconn
09-08-2004, 03:57 PM
My last test with this didn't work, the frame looked ok and was functional this time, but using the ALT key and a button bar number didn't do anything for me. It didn't seem to do anything.
Is there a newer version than .3 or did you freeze this for a bit?
Well, first of all you need to enable it.
Until I make this into a proper AddOn, it will not be shown in the Cosmos options, so until then, try :/script ActionButton_AltSelfCast_Enabled = true;
Unfortunately... there is currently no good way of hooking it into Cosmos as well as having it stand-alone. :/
UNLESS!
<IDEA>
Hmm... perhaps UseAction can be redefined? If so... bwahahahahahahaaa!
<cough>
Try using the script thingy above though, I want to see if it works before I put more effort into it.
Sarf
---
Cthulhu for President -- for when you're tired of choosing the lesser of the two evils.
karconn
09-08-2004, 05:16 PM
I'll go test it, but I thought all the things out here were going to eventually officially be 'in' Cosmos? Is that true? I'd sure like it all to just come down in the one patcher at some point and be configurable in Cosmos - I rather like Cosmos on the whole :)
Going to go retest .3 with the enable script command above. I think until it gets totally intergrated, I'll probably just use my old hacked actionbutton.lua though, so I don't have to run a script every time I start to remember to turn it on...plus I figured all these new things were going to show up in alpha at some point soon :p
I'll go test it, but I thought all the things out here were going to eventually officially be 'in' Cosmos? Is that true? I'd sure like it all to just come down in the one patcher at some point and be configurable in Cosmos - I rather like Cosmos on the whole :)
Well, hopefully, they will be possible to choose in ThottBots shiny new patcher someday. I prefer developing stuff until it's done (and relatively bug-free) and then integrating it with Cosmos.
Going to go retest .3 with the enable script command above. I think until it gets totally intergrated, I'll probably just use my old hacked actionbutton.lua though, so I don't have to run a script every time I start to remember to turn it on...plus I figured all these new things were going to show up in alpha at some point soon :p
Well, you could change the following line in ActionButton.lua:
ActionButton_AltSelfCast_Enabled = false;
into (yeah, you guessed it :) )
ActionButton_AltSelfCast_Enabled = true;
But then you wouldn't have so much fun toggling it, would you?
Yeah, I hope this patch makes it into Cosmos. However, I would strongly prefer to do an AddOn that can work with or without Cosmos.
Sarf
---
Join the Cthulhu Corps; it's not just a job, it's a higher position under an elder god.
karconn
09-08-2004, 06:07 PM
But in the case of files in FrameXML, like ActionButton.lua, yer all gonna 'have' to share at some point :)
Oh well...what'd be 'really' neat is in the new interface if they think of a clever way to allow you as a stand-alone modder to allow you to 'register' your app with their menu, so you get your own section of settings in the Cosmos option menu :)
Still need to go test :p
Getting side tracked with real work today, what's that all about? :roll:
karconn
09-08-2004, 06:30 PM
Ok, I just set it to default to 'true' in mine, since I 'always' want mine on.
And btw...this is PERFECT! It's a LOT cleaner than the one I was using, for several reasons:
No Target
Mine: Targets self (or 'last known target' if it can) and leaves that targeted
Yours: No new target or target change
Target friendly; not in combat
Mine: Targets friendly, does not enter combat
Yours: Targets friendly, does not enter combat
Target friendly; IN combat (by friendly I mean non-agressive, yellow)
Mine: Targets friend, does 'not' re-engage enemy
Yours: Targets friendly, re-enagages
Target Hostile; not in combat
Mine: Targets friendly, 'enters combat' (even though you weren't in combat before)
Yours: Targets friendly, does not enter combat
Target Hostile; IN combat
Mine: Targets friendly, re-enagages
Yours: Targets friendly, re-enagages
In the case of 'not' having a target, my old way would try to use the last target, or say you can't target it or just target myself, one of those combinations. Was just not as clean. Yours is really clean and works exactly like it used to before they removed it from that patch awhile back (still angry they removed it).
But this is one that you'll 'really' want to integrate with Cosmos or any other 'main' set of tools (CTMod or other big one) that has overwritten these files in FrameXML, because as far as I know, they 'both' can't co-exist? I'm assuming this code was integrated into the latest and greatest alpha versions of Cosmos files (hope so, I use Cosmos and they have lots of changes in theirs), and until this gets integrated (not sure what that process is), if the team makes a change between now and then, you'll have to somehow be aware of it and re-integrate and repackage these files...which really seems like a pain :(
But it works great and here's to hoping they pick it up! :D
But in the case of files in FrameXML, like ActionButton.lua, yer all gonna 'have' to share at some point :)
Perhaps. I've made a workaround that might actually work.
Oh well...what'd be 'really' neat is in the new interface if they think of a clever way to allow you as a stand-alone modder to allow you to 'register' your app with their menu, so you get your own section of settings in the Cosmos option menu :)
That is already present - what is happening is this :
Standalone but Cosmos compatible AddOn loads It's checks reveal that there is no Cosmos currently online. It deploys using its own methods. ...other things Cosmos loads and sets up its option and so on. Other standalone but Cosmos compatible AddOn loads and works beautifully with Cosmos My patch code detects that Cosmos has loaded and adds itself into its options, causing problems as Cosmos re-initializes the saved values.
Currently, there is no way of making sure that you load after Cosmos has loaded. OptionalDeps will hopefully provide that.
Still need to go test :p
Getting side tracked with real work today, what's that all about? :roll:Real work? I never heard about it... some kind of new food?
And btw...this is PERFECT! It's a LOT cleaner than the one I was using, for several reasons:
Actually, the credit should go to Telo for this mod - I've basically kept his code around and simply kept grafting it to new versions of Cosmos.
The new AddOn version of this patch is available here:
http://www.fukt.bth.se/~k/wow/scripts/AltSelfCast/
It is independent on the ActionButton.lua/xml (if it works) and provides toggle on/off functionality (hopefully the toggle will save too, but my track record in that department is... not good).
Sarf
---
"Money is like muck, not good except it be spread." - Francis Bacon, The Essays or Counsels
karconn
09-08-2004, 06:45 PM
Oh, so with this add-on I should set the XML and LUA files 'back' to the clean ones and then load this AddOn? Or does the add-on rely on the changes in the XML and LUA files still?
Oh, so with this add-on I should set the XML and LUA files 'back' to the clean ones and then load this AddOn? Or does the add-on rely on the changes in the XML and LUA files still?
Yes, just go back to the original files (available at the old Alt-Self-Cast url).
Sarf
---
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
karconn
09-08-2004, 06:50 PM
I was poking through the lua file, take a look at AltSelfCast_Register(), seems like there are some 'odd' registrations in there? Like /ldenable goes with the Loot Destroyer right? :) And what is /modname* in reference to?
Ok I'll just go fire this up and see if I can figure out how to turn it on :)
10 minutes to conference call :(
I was poking through the lua file, take a look at AltSelfCast_Register(), seems like there are some 'odd' registrations in there? Like /ldenable goes with the Loot Destroyer right? :) And what is /modname* in reference to?
Hehe... you caught me. :)
I am using a BaseMod (http://www.fukt.bth.se/~k/wow/scripts/BaseMod/) for all my new AddOns, which is based on LootDestroyer - if you want to take a gander at it, check it out here (http://www.fukt.bth.se/~k/wow/scripts/BaseMod/).
That's why modname was there, and why ldenable/disable was there too.
Sarf
---
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
karconn
09-08-2004, 06:58 PM
Well so much for my XML and LUA concerns...this works like a champ!
I deleted the XML and LUA and just let the alpha patcher give me new files. Plopped the add-on in, the Cosmos menu option was there but unchecked, so I picked it. Voila...operational!
Did all my friendly, no target, enemy, engage and not engaged tests...all working great!
But it does not save the setting like Unabridged, between sessions :(
Hehe, well, you can't say I didn't warn ya! :)
Anyhow, there might be a way around it, the only problem is that it is rather "clunky" and cumbersome, so it will probably have to wait until next time I have some free time (hopefully by Saturday afternoon... or even more hopefully before that).
Sarf
---
May we live long and die out. (http://www.vhemt.org/)
karconn
09-08-2004, 09:36 PM
I don't care about the saving, just wanted to fully report :D
I can hard code it like you recommended in the other thread.
I'll say it again though, these are all working awesome! Thx again!
vBulletin® v3.8.0 Beta 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.