Custom Auxbox Creations

Moderator: EUO Moderators

Post Reply
User avatar
Keighn
Stop posting already --;
Posts: 5366
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: Custom Auxbox Creations

Post by Keighn » Thu Jun 13, 2013 6:00 am

Each should have a screenshot of what they display. If you get time since they're your posts you should put the miniature box of what it does first just to give everyone an idea. Hate to put the extra workload on ya but you know me.. always thinking.

User avatar
CIAassassin
Tune in next time & see how they do it.
Posts: 598
Joined: Thu Oct 26, 2006 10:34 am

Re: Custom Auxbox Creations

Post by CIAassassin » Thu Jun 13, 2013 6:50 am

that isnt too bad actually. I can paste each element in individually and call it a day. Ill work on that for a bit. Im tired of the grind of the quest dialogs.
Photos added

actually took me about 30 minutes. Nice little break.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."

brentoboy
LAUGHING OUT LOUD LIKE A MORON
Posts: 73
Joined: Thu Jul 05, 2012 1:39 pm

Re: Custom Auxbox Creations

Post by brentoboy » Fri Jun 14, 2013 6:38 am

CIAassassin wrote: I still need to tinker around and get the codes for setting up an alt put on that thread. Just been busy, and trying to not do three things at once. Now that I look at it you have a different format than I've seen before. You call your functions outside of the auxbox() and I'm not sure about the bottom of that code.
The script for multiple alts is not designed to be "plugged in" like the other scripts have been.
ITs a complete change to the way we have been doing it up to this point.

The idea is, the auxbox script (the main file) has the current version of every "script" that has been contributed. Whether you want them or not.

And then, the config file for the alt, just lists the names of the scripts they want to see.

pulling out the "multiple alts" code and plugging it in to a cut and paste script will not work -- its a totally different paradigm. however, adding new scripts into the multiple alts script is totally doable.
PD: Duncan
Reg: Zen / Natasha

User avatar
CIAassassin
Tune in next time & see how they do it.
Posts: 598
Joined: Thu Oct 26, 2006 10:34 am

Re: Custom Auxbox Creations

Post by CIAassassin » Fri Jun 14, 2013 6:45 am

so in otherwords, you make a giant script with everything, and put a function to look for a character name, which runs the [charname].lua which has the, in essence. auxbox() function of what to run?
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."

Loughf
LAUGHING OUT LOUD LIKE A MORON
Posts: 63
Joined: Fri May 10, 2013 9:24 am

Re: Custom Auxbox Creations

Post by Loughf » Fri Jun 14, 2013 8:20 am

CIAassassin wrote:so in otherwords, you make a giant script with everything, and put a function to look for a character name, which runs the [charname].lua which has the, in essence. auxbox() function of what to run?

actually, that all makes sense.. and I think it's [charname].aux, not lua. I think the auzbox.lua is the only .lua file.

which therefore means it's pulling from auxbox.lua to get the info that particular char, that all makes sense now. thanks guys!

Loughf
LAUGHING OUT LOUD LIKE A MORON
Posts: 63
Joined: Fri May 10, 2013 9:24 am

Re: Custom Auxbox Creations

Post by Loughf » Fri Jun 14, 2013 9:22 am

soo, in related news. I copied brentoboys auxbox.lua and renamed it to .lua like he said, and I also downloaded Zen.aux to look at how it was set up. I made a new one and named it Loughf.aux, and added some of the things that Brentoboy had. Same auxbox.lua code, and it doesn't work. I also made a second one named Drought.aux for my second alt, still doesn't work.

help?

User avatar
CIAassassin
Tune in next time & see how they do it.
Posts: 598
Joined: Thu Oct 26, 2006 10:34 am

Re: Custom Auxbox Creations

Post by CIAassassin » Fri Jun 14, 2013 10:41 am

Loughf wrote:
CIAassassin wrote:so in otherwords, you make a giant script with everything, and put a function to look for a character name, which runs the [charname].lua which has the, in essence. auxbox() function of what to run?

actually, that all makes sense.. and I think it's [charname].aux, not lua. I think the auzbox.lua is the only .lua file.

which therefore means it's pulling from auxbox.lua to get the info that particular char, that all makes sense now. thanks guys!
That was probably not the correct laymen way to put it. It was a question.
Loughf wrote:soo, in related news. I copied brentoboys auxbox.lua and renamed it to .lua like he said, and I also downloaded Zen.aux to look at how it was set up. I made a new one and named it Loughf.aux, and added some of the things that Brentoboy had. Same auxbox.lua code, and it doesn't work. I also made a second one named Drought.aux for my second alt, still doesn't work.

help?
Honestly, I would have put them in unedited and then tinkered around with the code that was already in place, ie add one already in the function body. It's how Ive learned about all of the other codes that Ive played with.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."

Loughf
LAUGHING OUT LOUD LIKE A MORON
Posts: 63
Joined: Fri May 10, 2013 9:24 am

Re: Custom Auxbox Creations

Post by Loughf » Fri Jun 14, 2013 10:49 am

ah, okay. well, all I did was just copy and paste what Brentoboy had, and it's not working. as a matter of fact, I took the EXACT same files that Brentoboy posted, and renamed auxbox.txt to auxbox.lua, and renamed Zen.txt to Loughf.aux as instructed under the uploads. it's not working.

User avatar
CIAassassin
Tune in next time & see how they do it.
Posts: 598
Joined: Thu Oct 26, 2006 10:34 am

Re: Custom Auxbox Creations

Post by CIAassassin » Fri Jun 14, 2013 10:55 am

can't help you. That's what I woulda done.

Ok, got it figured out. Ill go through and write a tute on how to get it set up

Tute make it the large screen to see. Resolution is a little fuzzy.

Brent is going to tweak it a bit so that there wont need to be any fuss and the file will auto find itself.

also, Im going to edit your item codes, so that they are direct and wont multi-count as well as add more items to it. Ill post up the completed code in the other thread when Im done. I cant be bothered to try and get the code to work like it did in after we got the custom boxes set up. The dynamic works just fine anyway, and it works in the body of the custom box so Im not worried about it.

Brent, the only thing I can see adding right now is a function that when you have 0 of a particular item it doesnt display. this would allow more options to be selected at lower resolutions and it would be dynamic, so if they were mining/armour crafting they could put on all of the ore/ingot/hammer etc at once and only what they have in their inventory would show.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."

Loughf
LAUGHING OUT LOUD LIKE A MORON
Posts: 63
Joined: Fri May 10, 2013 9:24 am

Re: Custom Auxbox Creations

Post by Loughf » Sat Jun 15, 2013 4:21 am

question / next issue to tackle..

here's my C:\euo\clientscripts...

Code: Select all

auxbox.lua
Drought.aux
Loughf.aux
Flawk.aux
Drought and Loughf are Reg chars, and Flawk is a PD. Now, as that sits, everything is fine. Here's my issue.

I wanted to make a new char named Loughf for PD. I can't customize Loughf.aux because that'll mess up Reg, and I can't have 2 different ones for the same char name cross servers.

Here's the question to tackle...

can we make the auxbox.lua LOOK for the server? Can it detect PD, NG, Alpha, Reg, Weekly? if it CAN detect servers via auxbox, can we then have it set up to look for "Loughf[PD].aux" for my PD character, and leave the "Loughf.aux" for REG ONLY.

so then my C:\euo\clientscripts would look like:

Code: Select all

auxbox.lua
Drought.aux
Loughf.aux
Loughf[PD].aux
Flawk[PD].aux
This way I can have the same charcter name for both servers, and still have different auxbox setups.

brentoboy
LAUGHING OUT LOUD LIKE A MORON
Posts: 73
Joined: Thu Jul 05, 2012 1:39 pm

Re: Custom Auxbox Creations

Post by brentoboy » Sat Jun 15, 2013 4:38 am

@Loughf
sure, that's easy enough.
if it finds a server specific one, then it can use that, if not it will go with the file that is just the name.
CIAassassin wrote: Brent, the only thing I can see adding right now is a function that when you have 0 of a particular item it doesnt display. this would allow more options to be selected at lower resolutions and it would be dynamic, so if they were mining/armour crafting they could put on all of the ore/ingot/hammer etc at once and only what they have in their inventory would show.
Yeah, I agree, for a few reasons. At first, I felt like ... if its important enough to be in the list, you want to see that you are out. But I agree now that that is kind of pointless. If its something like Arrows, and you really need to know when you hit zero, you could have a special section that only shows up when it IS zero, and it can look "louder".

I agree that having it just display all the different health scrolls, each with its own line, and hide the ones where you have zero will actually serve more people more easily.

I think that most of those item includes can probably be grouped together into logical groups that people either want to see the set or not. So I'm on board.
PD: Duncan
Reg: Zen / Natasha

Loughf
LAUGHING OUT LOUD LIKE A MORON
Posts: 63
Joined: Fri May 10, 2013 9:24 am

Re: Custom Auxbox Creations

Post by Loughf » Sat Jun 15, 2013 12:32 pm

brentoboy wrote:@Loughf
sure, that's easy enough.
if it finds a server specific one, then it can use that, if not it will go with the file that is just the name.

how do you make it happen? I don't know how to make it look for a server. can you make it look for [PD], [NG], [WEEKLY], [ALPHA]?

brentoboy
LAUGHING OUT LOUD LIKE A MORON
Posts: 73
Joined: Thu Jul 05, 2012 1:39 pm

Re: Custom Auxbox Creations

Post by brentoboy » Sat Jun 15, 2013 1:01 pm

to get PD specific custom character config... modify the script I posted earlier by swapping out the following function

Code: Select all

function load_sections_to_display()
	local character_name = me.name
	
	-- trim out the clan name if its in there
	local bracket,x = string.find(character_name, "[", nil, true)
	if bracket then
		character_name = string.sub(character_name, 0, bracket - 1)
	end 
	
	local server_name = "Reg"
	if PERMADEATH then
		server_name = "PD"
	end
	
	local possible_config_file_locations = {
		string.format("c:/program files/euo/clientscripts/%s[%s].aux", character_name, server_name)
		, string.format("c:/program files (x86)/euo/clientscripts/%s[%s].aux", character_name, server_name)
		, string.format("c:/euo/clientscripts/%s[%s].aux", character_name, server_name)
		, string.format("c:/program files/euo/clientscripts/%s.aux", character_name)
		, string.format("c:/program files (x86)/euo/clientscripts/%s.aux", character_name)
		, string.format("c:/euo/clientscripts/%s.aux", character_name)
	}
	
	for i = 1, #possible_config_file_locations do
		local config_file = possible_config_file_locations[i]
		if file_exists(config_file) then
			local file = io.open(config_file, "r");
			local arr = {}
			for line in file:lines() do
				table.insert (arr, line);
			end
			io.close(file)
			return arr
		end	
	end
		
	return nil
end
this also fixes the problem with people having euo installed in various directories.
I search for C:\Program Files\EUO
C:\Program Files (x86)\EUO
and C:\EUO

if you are using something else, post your euo folder and I'll add it in.
PD: Duncan
Reg: Zen / Natasha

Loughf
LAUGHING OUT LOUD LIKE A MORON
Posts: 63
Joined: Fri May 10, 2013 9:24 am

Re: Custom Auxbox Creations

Post by Loughf » Sat Jun 15, 2013 1:04 pm

so does this find PD on it's own, or do we need to add "[PD]" at the end of our names?

brentoboy
LAUGHING OUT LOUD LIKE A MORON
Posts: 73
Joined: Thu Jul 05, 2012 1:39 pm

Re: Custom Auxbox Creations

Post by brentoboy » Sat Jun 15, 2013 1:29 pm

yes, but it only detects PD, I dont see any way to detect the other servers.

if you have a character on PD by the same name as one on reg... and you want different auxbox configs for each of them, you would name the two files following this pattern...

Zen.aux
Zen[PD].aux

if there is no Zen[PD].aux file, then it will just use the same file as the one for Reg.

for what its worth... this would also work...
Zen[Reg].aux
Zen.aux

or
Zen[Reg].aux
Zen[PD].aux
PD: Duncan
Reg: Zen / Natasha

User avatar
LordMortiferus
MACRO > me
Posts: 849
Joined: Tue Dec 01, 2009 10:23 pm

Re: Custom Auxbox Creations

Post by LordMortiferus » Sat Jun 15, 2013 3:27 pm

I think it would be overall easier to have one lua file containing auxbox(), auxbox_prop_line() and auxbox_blank_line(), while functions called in auxbox() can be located in other lua-files as long as they are in \clientscripts\.

Code: Select all

auxbox_next_line = 0

function auxbox()
  -- calling individual player scripts or function in general e.g.:
  auxbox_dps()
  lordmort()
end

function auxbox_prop_line(prop_name, prop_val)
  local filler = string.rep(" ", 25 - string.len(prop_name) - string.len(prop_val))
  auxbox_next_line = auxbox_next_line + 1
  d:auxbox_set_line(auxbox_next_line, string.format("%s %s %s", prop_name, filler, prop_val))
end

function auxbox_blank_line()
  auxbox_next_line = auxbox_next_line + 1
end
Save any individual script you want to use as its own lua file (or one huge file) in the clientscript folder (make sure to remove the auxbox(), auxbox_prop_line() and auxbox_blank_line() function from these files). If you want to use customized auxbox for different chars creat playername.lua, e.g. lordmort.lua files and define the function names in it that shall be called for auxbox, e.g.:

Code: Select all

function lordmort()
  if me.name = lordmort then -- see brents post how to do this correctly!
  auxbox_real_world_time()
  end
end
That way you do not have the hassle with the file path which varies from system to user.

Edit: maybe this doesnt work as good as planned or something is off on my side atm.

Loughf
LAUGHING OUT LOUD LIKE A MORON
Posts: 63
Joined: Fri May 10, 2013 9:24 am

Re: Custom Auxbox Creations

Post by Loughf » Sun Jun 16, 2013 6:50 am

the only .LUA file that should exist, LordMort, is the auxbox.LUA. your char name, for example, should be LordMortiferus.AUX.

there can be multiple .aux where there should be one .lua

User avatar
CIAassassin
Tune in next time & see how they do it.
Posts: 598
Joined: Thu Oct 26, 2006 10:34 am

Re: Custom Auxbox Creations

Post by CIAassassin » Sun Jun 16, 2013 8:28 am

brentoboy wrote:
...you could have a special section that only shows up when it IS zero, and it can look "louder".

I agree that having it just display all the different health scrolls, each with its own line, and hide the ones where you have zero will actually serve more people more easily.

I think that most of those item includes can probably be grouped together into logical groups that people either want to see the set or not. So I'm on board.
Im working on the item lists, have added ore/ingots. I cleaned up your potion lists a tad as well, so that it wont count all of the yellows/blues. I have all of the scrolls separate as well.

I was talking to Ched about having a code that looks for blackrock items of crafting and displays that code block that is associated with that item. So that when you put a blackrock quill in your inventory, or a mining pick, it will auto load up the items that are used with that item.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."

User avatar
LordMortiferus
MACRO > me
Posts: 849
Joined: Tue Dec 01, 2009 10:23 pm

Re: Custom Auxbox Creations

Post by LordMortiferus » Mon Jun 17, 2013 3:11 am

Loughf wrote:the only .LUA file that should exist, LordMort, is the auxbox.LUA. your char name, for example, should be LordMortiferus.AUX.

there can be multiple .aux where there should be one .lua
You can handle different scripts located in different files with the lua extension from auxbox() - as long all scripts are located in \clientscripts\. So maybe I was not clear enough in my previous post. The point of this approach is that you do NOT have to clutter your scripts in one file and you do NOT have to set any file path. But if you want to do it the hard way I am not going to stop you =]

User avatar
LordMortiferus
MACRO > me
Posts: 849
Joined: Tue Dec 01, 2009 10:23 pm

Re: Custom Auxbox Creations

Post by LordMortiferus » Wed Jun 19, 2013 4:04 am

last update 19.06.2013
Here is a function that shows the time until the last instance visited will reset.

Code: Select all

function auxbox_lm_instance_reset()

	if cmap:get_level() ~= me.map_level and cmap:get_level() >= 0 then
     lm_instance_exit = os.time()
     lm_instance_visited = 1
    end
	
	 local lm_instance_reset = 0
    if cmap:get_level()=me.map_level and lm_instance_visited ~= nil then
      lm_instance_reset = 600 - (os.time() - lm_instance_exit)
        if lm_instance_reset <= 0 then
	     lm_instance_visited = nil
        end
	end 
 
 local m = math.floor(lm_instance_reset / 60)
 local s = math.floor((lm_instance_reset / 60 - m) * 60)
 
 auxbox_prop_line("Instance Reset:", string.format("-%02.f:%02.f", m, s)) 
 
end
Last edited by LordMortiferus on Thu Jun 20, 2013 7:06 am, edited 1 time in total.

Post Reply