PDA

View Full Version : Updated AutoBar (My Modded Version)



JASlaughter
12-14-2004, 12:11 PM
I hope you don't mind, I took some liberties with AutoBar that I think others may find useful.

http://bellsouthpwp.net/j/a/jaslaughter

The link to my interface is there, but you can delete everything you don't want. For the updated AutoBar, you'll need the AutoBar directory and the JASuite directory.

Here's a breakdown of what's changed:

First off, the bar is now vertical, and smaller. It binds to the right-side of your main chat window. To the right of each icon, a count (if you have more than one) is shown. You can see that in the screenshot.

/jasuite - Help message
/jasuite clear - clears current toon's autobar settings
/jasuite clearall - clears all toons' autobar settings

/autobar# - clears current toon's autobar number #
/autobar# <items> - sets autobar tracking for autobar number #.

Example usage:

/autobar5 Light Shot, Crafted Light Shot, Heavy Shot

will set the 5th slot (hearthstone by default) to track heavy shot, then crafted light shot, then light shot, in that order. The order you type them in is in order of least preferable to most preferable. I'll fix this some day.

/autobar4 Flash Powder

will set the 4th slot to only track flash powder.

/autobar3

will reset the 3rd slot to default settings.

All changes take place immediately.

I tried to make it so you can use the shift-click, but I couldn't figure out how to just get text. It seems there's extra info sent to the variable when you do that and it's not as simple as trimming the [] off of it. But the good news is:

You only have to do this once, per character. Your selections are saved per character and automatically reloaded on login. New characters are automatically created. If Blizzard ever gives us the option to find the server name, that'll be done too...

Note that the item names have to be capitalized correctly. However, you -can- just type /autobar4 Linen and it'll track Bolt of Linen Cloth and then Linen Cloth. That's standard AutoBar functionality. Also, all key-bindings should work, though I haven't tested it since I modified the code.

I'll try to keep up with this forum now if you have any questions, since I normally just browse the Blizzard UI board. Keep in mind, however, that the core functionality is the same AutoBar code. I just needed a way to utilize those slots for other things for different classes, in-game.

Hope you all find it useful.
- Jason

---------------------

As a side note, this modification of this fine mod is my first foray into LUA programming. My code may not be the most optimized although I did try. If you have the time and notice something stupid I did, that could be done better, please state that if you don't mind :) I'm always learning.

Alador
12-14-2004, 01:36 PM
Um, wow.

Very nice.

How did you fix the item counting? I was boggled by the problem and spent hours trying to figure out what was causing it. I see you fixed the problem!

edit: Hmm, looks like you took direct control of the counting situation yourself. Interesting. I still don't see what the original problem was.

edit2: Ahh, a my first real reason to use WinMerge. Was that OBO bug the entire reason the original autobar didn't count properly? Testing..

edit3: Nope, that wasn't it. I tried merging the count changes over but it throws errors at the getglobal(button:GetName().."Label"):SetText("") lines :(

edit4: Sigh, I give up. Can't figure out how the problem with the Label thing.

JASlaughter
12-14-2004, 02:24 PM
To be honest, I don't really remember.

The very first thing I did (since I use CTMod's right hotbar) was move it and add the label. What -seems- to be happening is that the last occurance of the item in the bag would have a count associated with it and would automatically take over the AutoBar's count...so I made my own counter.

If you'll notice, line 162 is:

getglobal(button:GetName().."Label"):SetText("2nd!");

and I've -never- seen '2nd!' as a count label, so it would seem that

if (button.count and itemCount) then

never tests out as true, so you never really have a chance to do this:

button.count = button.count+itemCount;

That's about all I could find out, so I did my mod to the code and went about my business. I actually wanted to do all the modifications in the AutoBar files, but couldn't figure it out without screwing something up. I guess I work better when the code is separated that way.

If you use CTMod, you'll also notice I added a button in the CT Mod interface to turn the autobar display on / off. The changes are CT_ModRegister.lua.

Catharsys
12-14-2004, 02:58 PM
I noticed that your AutoBar doesn't like to track items with - in them. Ex: Strong Anti-Venom. Besides that very nice, added that and your scaled down itembuff to the UI addons I use.

JASlaughter
12-14-2004, 03:25 PM
Huh, never tried that. I'm looking at that now. I thought maybe it was my trim function but even without that it's not working.

I'll update ASAP.

JASlaughter
12-14-2004, 03:44 PM
I downloaded the original again, and tried Anti-Venom, and it doesn't show up. I'm not sure what the problem is, but I'll look into it so maybe everyone can benefit.

In the meantime, you can just use Venom and it'll track it.

JASlaughter
12-14-2004, 04:43 PM
Okay here's the deal:

In AutoBar.lua starting with line 218, you'll see the lines that actually do the search and compare:

string.find(itemName,item)

By default, LUA does a pattern matching type search here (regular expressions type of patterns) and it takes a '-' as a pattern tool character. I changed all of these lines to:

string.find(itemName,item,1,true)

which basically does the same thing, except without pattern matching. It now accepts Anti-Venom as intended. I was curious, and tried an apostrophe item too (Thieves' Tools) and it worked. So use the same link above, and grab the latest!

Also, if you want the buttons docked to the left of the chat window, grab:

http://bellsouthpwp.net/j/a/jaslaughter/AutoBar.xml (Right-Click...Save As)

I'm not going to spend any more time customizing the position above and beyond that, as I want to find a way to make the bar moveable in-game.

Renton
12-14-2004, 05:21 PM
That's pretty kick arse. I'd use it if i knew how to get quest minion into that. Can anyone tell me the files i have to have in interface to make it work? Thanks.

Terant
12-14-2004, 08:35 PM
Crap saw it and work and emailed link to myself, and now bandwidth is exceeded hehe... just my luck.

Firecrak
12-15-2004, 04:05 AM
Hmm I am trying to get the CT_Tick mod to work with cosmos (I have your autobar and its great thx :P). Can you suggest how I go about installing/activating it? I copied it to the add on folder, but can't seem to find the right switch to get it to activate. Much thanks in advance.

JASlaughter
12-15-2004, 04:35 AM
I'm not sure, to be honest, as I don't use Cosmos. There is a CT icon next to your minimap though, which brings up the CT Mod control panel and it'll enable/disable the tick mod. This is assuming you're using the CT_Mastermod folder as well.

On a side-note, I've completely redone the AutoBar mod. It's now all in the AutoBar directory. Also, I noticed a bug in AutoBar... items aren't tracked correctly if you only have one bag (bag 0). I did manage to fix it, and it was one additional line that took me ages and ages to figure out. Working late at night has drawbacks I suppose :P

The new version of the 'Jason Presents' AutoBar is up on that bellsouth site, but I'm also looking into some kind of hosting for it. It's only 5k but man I'm really scared to open up my DSL at home to thousands of potential connections. Get it while you can...

Firecrak
12-15-2004, 06:46 AM
Hmm no I am using Cosmos, and thus can't exactly run Cosmos AND CT...that would sort of pointless. I was under the impression that addons to the interface where translatable between the diffrent ui's....guess i was wrong :(

1 other thing, is there a way to customise how big the icons are? having them very tiny is great for space considerations, but sometimes a little hard to distinguish in the middle of a fight :P Thx

a67rhf7823jn8747==