LUA addons code: DAR and Rare Rate

Greetings all, quick question:
  1. Does anyone know how to grab the value of the current party DAR and Rare Rate?
  2. While I'm asking, I was also curious if anyone knew how to grab the name of the currently active quest...?
(I'm assuming I need to know what the memory address for these might be?)

I'm definitely no Lua programmer lol, just been tinkering with various addons I've downloaded, and tweaking/making new features---thanks to google and based on the code I've been examining from all of these [far-better-written] addons.

Any help is appreciated ;)
 
1. That stuff only reaches the client in form of text, you'd have to examine the buffer where that appears (I think is the message to the side of the screen no?) just like the other rank stuff addon.
2. You'd have to find a pointer to the quest data and read it's name from there.
 
I wrote a function for the Kill Counter addon that accesses the quest data to get the quest number. That should get you to the right place in memory.
https://github.com/StephenCWills/psobb-kill-counter/blob/master/Kill Counter/init.lua#L742

This webpage defines the data structure for the quest data.
http://sharnoth.com/psodevwiki/doku.php?id=format:bin

Based on that, the offset for the quest name should be 0x18, as opposed to the 0x10 I used for the quest number.

This should be more than enough info for you to get the quest name. Good luck!
 
Thanks for the replies, definitely gives me place to start looking. I'd have to say that this all might be over my head lol -- I primarily work with PHP/basic web development, so this stuff isn't really my forte...

For example: I see this snippet:

Code:
local function get_banner_text()
    local addr = pso.read_u32(0x00a46c78)
    
    if addr ~= 0 then
        local text = pso.read_wstr(addr + 0x1c, 0x0400)
        return text
    end
    
    return ""
end

which is taken from Esc's HBR Score reader. Based on what Soly said, I imagine I would need to go a similar route to grab text from the DAR and Rare messages that appear on "/partyinfo" for example. Perhaps, same process but different address for pso.read_32()? But I have absolutely no idea where Esc would have acquired the number 0x00a46c78, and then, I have no idea how/why he added read_wstr(addr + 0x1c, 0x0400) to get the text (this might be simple to you all, but that's the level of noob you're dealing with :oops:). I looked at the wiki link Staphen posted, but not sure how to use that info...

So, if there's any more insight you all have, many thanks for it, although the appropriate answer might be "don't bother, dude :cool:".
 
But I have absolutely no idea where Esc would have acquired the number 0x00a46c78, and then, I have no idea how/why he added read_wstr(addr + 0x1c, 0x0400) to get the text

I used Cheat Engine to search for the banner strings and found the location of the pointer to the banner data (0x00a46c78). Then I used the memory viewer in CE to observe that 0x1c is the offset from the beginning of the banner data block to the actual banner text, and 0x0400 is the maximum size of the banner text.
 
Cheat Engine
Gootcha, yes that'd be immensely helpful lol. Although, the game crashes whenever CE is open (potentially on purpose?).

EDIT: Would I need to install my own Tethealla server on local machine in order to use CE?
 
Last edited:
0x0400 is the maximum size of the banner text
If I am not mistaken, the argument to read_wstr is number of characters, if so, you should be reading 0x200 and not 0x400.
0x200 is the max length (including null terminator), unless Soda changed that to be longer.
 
  • Like
Reactions: Esc
I looked at the wiki link Staphen posted, but not sure how to use that info...
I really only posted the wiki link because it shows what the quest data structure looks like, defined in C. You can see the same thing if you inspect the psobb.exe memory space, but that's easier said than done so I provided the link. But it's really more informational than helpful since I gave you the relevant information in the sentence that comes right after it. So there's no real need for you to understand the data structure.
 
So I was able to get a tethealla server running on my local machine. At least I can now tinker basic game mechanics with CE.

It is on purpose.
Makes sense, figured as much.

I really only posted the wiki link because it shows what the quest data structure looks like, defined in C. You can see the same thing if you inspect the psobb.exe memory space, but that's easier said than done so I provided the link. But it's really more informational than helpful since I gave you the relevant information in the sentence that comes right after it. So there's no real need for you to understand the data structure.
Yes, when I first tried the numbers, no dice. After tinkering with CE on Tethealla install, I could see exactly what you meant. I am now able to grab the Quest Name successfully, thanks for that!

1. That stuff only reaches the client in form of text, you'd have to examine the buffer where that appears (I think is the message to the side of the screen no?) just like the other rank stuff addon.
I'm getting closer to understanding how to grab this info.. although offline, with CE, I can't trigger such "side of the screen" messages at will. I've been able to find some of them in memory when leveling up, for example, but not quite there yet (and too tired right now :D) EDIT: I have since found the list of GM commands and will commence testing :)

I appreciate the help; I'm sure this is child's play to many of you, so thanks for your patience ;)
 
Last edited:
Whew.... thanks everyone for their input. Crash course in reading from memory (very new to me), but I got it working :D

Made some modifications to @Seth 's [awesome] drop chart addon (I hope that's ok? :oops:). I extracted the dar and rare %'s for the items from the drop rate strings. Thanks to the help here, I was able to extract the party's DAR and Rare from memory, and now the drop chart can show you accurate %'s and ratios for any item, factoring in party's DAR and rare rates (I think my math is right LOL). UPDATE: now it automatically pulls all info (difficulty, sectionId, party DAR and rare bonuses, and automatically opens the correct Episode by default) when entering a room (or refreshing with /partyinfo if needed)

I'm sure this code is horrendous (more of an experiment with Lua, and it taught me a lot about memory addresses, etc), but it was fun. Thanks!

upload_2017-8-30_0-13-26.png
 
Last edited:
This looks awesome. I'll have to try it out sometime today.
 
Amazing, look forward to any finished product + download etc. Saves me having to use math (which I have no clue).
 
Hi guys,

I just merged @HighTheMemory's changes for the drop charts addon. You can download the latest version by clicking here and read about the changes in this version here. If there's any issues feel free to let us know.

@HighTheMemory Thanks for implementing this new functionality ; it's awesome ! :D
 
Back
Top