PDA

View Full Version : Atlas



Jymamon
12-31-2016, 11:22 AM
Current version: v2017.01.12.02

I had vacation to blow over the holidays and promised myself I'd do a non-work project. Atlas.lic, now on the repo, is the result. Slightly more than an alpha version, but maybe not quite yet beta, it is a work in progress far enough along to gather feedback.

How do you use it?

;repos download atlas.lic
;repos download atlas_data.db3
;trust atlas
;atlas


What is it?

A hunting area setting GUI - It is a GUI front end to atlas_data.db3 that lists (most of) the creatures in the game and has a bunch of pre-set hunting areas. Click on "Activate", and it'll set the appropriate variables to have bigshot hunt the specified creatues in the given area. This is probably the most interesting bit in the current release.

An editor for the above - This still needs a bunch of work. Creature editing is present, but delete is currently disabled. Area editing still needs to be enabled.

A data source for other scripts to use to automate the above - This is really where it started out. I was tired of manually managing hunting areas between characters and there's a few old threads around sbounty and wanting shared hunting area definitions. I need to make this a little more usable in the next release, but for the programmer's out there....


File.file?("#{$script_dir}/atlas.lic") to get it loaded.

Then you can use the Areas and Creatures modules to find huntable goo. As an example, my routine that autosets my hunting based on the current bounty looks like


# region and creature were regex'ed out of the bounty text. Omitted here
def self.sethunt(region, creature)
respond "Looking for creature '#{creature.name}' in region '#{region}'\n" if $debug

areas = Areas.find_by_region(region)
distances = Hash.new

area = areas.select{|area|
area.region == region && area.creatures.any?{|critter| critter.id==creature.id}
}.each{|area|
previous, shortest_distances = Room.current.dijkstra(area.start)
distances[area.start] = shortest_distances[area.start]
}.sort{|area1, area2|
distances[area1.start] <=> distances[area2.start]
}.first

if (area.nil?)
echo "#{name}: Ack! I can't find anywhere to hunt '#{creature.name}'"
return
end

UserVars.op['hunting_room_id'] = "#{area.start}"
UserVars.op['hunting_boundaries'] = "#{area.boundaries.join(",")}"
# I hunt just the bounty creature, you might want to include all of them.
UserVars.op['targets'] = creature.name

# For funsies, let's flee from anything more than 3 levels over our current level.
flee_from = Array.new
area.creatures.each{|c|
if ( c.level > (Char.level + 3) )
flee_from.push(c.name) unless (c.name == creature.name)
end
}

UserVars.op['always_flee_from'] = "#{flee_from.join(",")}"
UserVars.save();
end



What isn't it?

It is not a hunting script. It is a supplement to bigshot or other custom hunting scripts.
It is not all inclusive. I have about 138 areas defined that are mostly around the Landing, Solhaven, Icemule, and Ta'Illistim
Super user friendly. The backing data has existed for a while, but I use it entirely programmatically. Hence, my hunting areas, for example, how no name. There's just and ID starting at 1 and going to the last one. Great for me. Pretty sucky in the dropdown where someone is looking for a particular area.


Anyhow, posting here to see if folks like it, hate it, or even use it. If folks find it useful, I'll flesh it out more and add features. If not, then I won't take the time since GUI work is about the bottom of the barrel in "fun" for me.

Soulance
12-31-2016, 03:37 PM
This looks interesting. I'm game to try it out! Thanks for the work on this.

Stavman
01-05-2017, 11:35 AM
seems it wont download the data.db3 file????

Jymamon
01-05-2017, 12:29 PM
seems it wont download the data.db3 file????
What exactly did you type and exactly what error did it give you? Looking at the repository stats, the file has been downloaded successfully a number of times.

Stavman
01-08-2017, 11:02 AM
this is the error I get trying to download the db3 file from repo

--- Lich: repository active.
[repository: downloading atlas_data.db3 in 3 seconds... (;k repository to cancel)]
>
--- Lich: error: Permission denied - (C:/Users/Windows 7/Desktop/lich-old2/temp/87365232, C:/Users/Windows 7/Desktop/lich-old2/temp/5395254.repo)
repository:889:in `rename'
repository:889:in `block in _script'
--- Lich: repository has exited.

Jymamon
01-08-2017, 11:40 AM
That looks like a perms issue on your machine and not directly related to the script. What happens if you manually try to rename the first file from the error to the second? (ren "C:\Users\Windows 7\Desktop\lich-old2\temp\87365232"
"C:\Users\Windows 7\Desktop\lich-old2\temp\5395254.repo" from a command prompt).

Stavman
01-08-2017, 12:32 PM
I renamed... deleted.. and no dice

>;repos download atlas_data.db3
--- Lich: repository active.
[repository: downloading atlas_data.db3 in 3 seconds... (;k repository to cancel)]
>
You release 1 mana into the surrounding area.
>
--- Lich: error: Permission denied - (C:/Users/Windows 7/Desktop/lich-old2/temp/30383661, C:/Users/Windows 7/Desktop/lich-old2/temp/49180447.repo)
repository:889:in `rename'
repository:889:in `block in _script'
--- Lich: repository has exited.

Jymamon
01-08-2017, 01:25 PM
I'll have to verify I have the latest repository when I'm online next, but looking at the code, line 889 is in the block to download the mapdb which further confuses me why it would show up when you'd downloading the script. Do you get the same error if you just ";repos download-mapdb". I expect you will, but, again, I may not be up-to-date.

Jymamon
01-08-2017, 05:50 PM
Verified I'm up-to-date on repository.lic. Does this happen just for atlas_data.db3? Do you run lich elevated? I'm basically at a loss. There's nothing special about the file and I see nothing in the repository script that would cause it to behave differently for a *.db3 v. *.lic file. I've nuked my local copies and tried re-downloading and can't repro the error.

deadly
01-09-2017, 12:21 AM
Love this thing so far, one request make the database searchable by level?

Stavman
01-09-2017, 11:45 AM
I did a download with another character and it workd.. go figure....lol

Jymamon
01-09-2017, 12:37 PM
Love this thing so far, one request make the database searchable by level?

Absolutely something that would be useful. I've had some issues with the updating GTK combo boxes not working as I'd expect, but let me give it a shot.


I did a download with another character and it workd.. go figure....lol

Weird, but glad you were able to download it.

Jymamon
01-10-2017, 12:28 PM
v2017.10.01.01

Changes:

Added level based filtering (both creatures and areas page)
Added ability to delete defined areas
Fixed window title

Next:

Add ability to add/edit areas

deadly
01-10-2017, 10:56 PM
awesome looks good, now hopefully you can add critters from ta'vaalor, illistim?

Jymamon
01-11-2017, 03:12 PM
awesome looks good, now hopefully you can add critters from ta'vaalor, illistim?

Pretty much all the creatures in the game should be present already. If you mean hunting areas, I'm unlikely to ever to Ta'Vaalor as I never have characters that hunt there. Ta'Illistim I'd likely add next time I have someone hunting that area. That said, I'll post the update tonight that allows users to add/remove/edit hunting areas, so it isn't something that really requires me to add them =-D

If folks wanted to post areas to this thread as a way to get them into the version of the DB on the repo, I could do that as well.

Jymamon
01-11-2017, 09:37 PM
v2017.11.01.01

Changes:

Add ability to add/edit areas
Some code cleanup


Next:

Probably changing the widget used to display creatures in an area to be more usable than a combobox

Jymamon
01-13-2017, 12:02 AM
v2017.12.01.02

Changes:

Better display for creatures in an area


Next:

Code cleanup

Fortybox
01-17-2017, 10:13 PM
v2017.12.01.02

Changes:

Better display for creatures in an area


Next:

Code cleanup


This has been very useful. Thanks!

zephyrii
01-29-2019, 08:08 PM
Seems like something broke?

>;atlas
--- Lich: atlas active.
--- Lich: error: undefined method `include' for #<Scripting:0x18298020>
atlas:1104:in `script'

Jymamon
01-29-2019, 08:32 PM
Seems like something broke?

>;atlas
--- Lich: atlas active.
--- Lich: error: undefined method `include' for #<Scripting:0x18298020>
atlas:1104:in `script'

What version of lich.rbw do you have? I just checked with the 4.6.31 (where I forked off locally) and the 4.6.49 (latest from the repository) and this is working okay for me. Does it make any difference if you run ;atlas first thing (before any other script)?

If I get time tonight, I'll try a clean install in another directory to see if that makes any difference.

Jymamon
01-31-2019, 03:05 AM
If I get time tonight, I'll try a clean install in another directory to see if that makes any difference.

Testing with a fresh install, this error happens if you haven't trusted the script.

;trust atlas
and life should be good.

SoupyPoopy
05-20-2020, 03:14 PM
btw love atlas. it has saved me a ton of work looking this stuff up on my own. Question, is there a way to automatically populate sbounty to fill in locations?

aythius
05-31-2020, 01:10 AM
I love the idea of this script, and am hoping to get it to work, but I am getting this error after downloading atlas.lic and atlas_data.db3, using version 4.6.52 of lich.

--- Lich: atlas active.
--- Lich: error: no such table: areas
C:/Ruby4Lich/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.0.20190219-x86-mingw32/lib/sqlite3/database.rb:147:in `initialize'
C:/Ruby4Lich/lib/ruby/gems/2.5.0/gems/sqlite3-1.4.0.20190219-x86-mingw32/lib/sqlite3/database.rb:147:in `new'