Pages: 1 2
Post: #1 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Hello,

I am looking for a python script which a user "xibalba" requested and which was graciously provided by the users of I think the first iteration of bboard. The script is referenced in post #416 in this thread (posts per page set at 50, your page-view will vary):
https://gamefaqs.gamespot.com/boards/198537-saga-frontier/77194324?page=8#416

Use the python script that opens a single file and splits that file into it's 10 subfiles.

It's the last one on the first page of this link, in a post by "funkyass":
http://helmet.kafuka.org/byuubackup/viewtopic.php@f=10&t=2421.html

I think it's used as:
python arc_split.py M*.arc

There could be some issues if the version of Python isn't correct, post them and I'll help you troubleshoot them. Asking on a Python forum would help too, though I'm not sure what exactly to ask off the top of my head.


The script was used to split M???.ARC files for Saga Frontier into their subfiles.

If it can't be recovered and no one has it saved anywhere, I can pick up python in a week or two (I am very lazy) and recreate it, so no worries if it's lost forever. Just thought I would try the simple, obvious solution before I rouse myself.

Thanks,
MysticLord
Posted on 20-08-01, 23:29 in Looking for a python script in the now defunct archives (revision 1)
Post: #2 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Thank you.

edit

Link for posterity
https://pastebin.com/qqe5Cvdx
Post: #3 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Sorry for the double-post, feel free to merge it once someone notices me.

Could you find another script that xibalba e-begged off you all, which IIRC was something that would write concatenated text in a CSV to a file?

I think there were multiple versions posted, for C and Python (not sure which version of Python either). I'll take all of them, if possible.

Thank you once again.
Post: #4 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Posted by wertigon
Would probably solve this with a one-liner bash script to be honest:


cat test.csv | cut -f3,4 -d, | sed s/,//g > output.txt


Works like this:

* move csv file to stdin (cat)
* Select the fields that are desired, and use comma as delimeter (cut)
* Remove any commas and other unnecessary characters (sed s///g)
* Optional: use > to save output to a text file

Alas, it's for skrub windoze lusers. He used spreadsheets to edit data, concatenated all the hex strings together, and put them in a file intended to be exported as a CSV and written to whatever game files are needed with the Python script. I think there's a command-line tool that lets you import and export entire directories and wildcarded files into a disc image, so it should be possible to edit monster data in SaGa Frontier this way.

Format of the CSV was IIRC:
[code]
filename,address,text-string-representing-hex-bytes
file.bin,0,BEEFCAFEB00B1E55
[code]

Doesn't matter if you can't find the python script, I can whip it up in a day or two.

Post: #5 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
While I appreciate your thoughtfulness and effort, my time is better spent picking up a little Python than beating my testicles with a hammer learning esoteric Windows command line tools.
Posted on 20-08-28, 08:16 in Mozilla, *sigh*
Post: #6 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
tomman, what are your thoughts on Pale Moon? Is it a worthwhile replacement for Firefox? Is it relatively secure and fast, in your opinion?

I use it and I like it. It's not slow, the plug-ins work, I haven't had any security issues at all, and it's updated once every month or two.
Posted on 20-08-28, 08:41 in Mozilla, *sigh* (revision 2)
Post: #7 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
I find this funny, because he actually answered this question in his last post.

I never claimed I was smart.

edit

BTW Pale Moon can run PDFs just fine with one of the PDF.js add-ons. Getting Windows to recognize Pale Moon as a PDF reader is a different story.

If we kept people with bizarre beliefs/opinions/sexual-fetishes away from the internet, it would stop functioning within minutes. Sorry tomman, the internet only exists because RMS cares too much about freedom and software to learn that eating your foot flakes in public or advocating for necrophilia is not socially acceptable.

I'm not being ironic, without these glorious madmen we wouldn't have an internet.
Posted on 20-08-28, 09:03 in Misc. software
Post: #8 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
All Windows 10 software because I am a skrub.

Bulk Crap Uninstaller for Windows. Does everything except remove Windows Edge. Has only slightly broken my system. FOSS.

Cheat Engine, now open source and available for OSx and Linux.

Homebank, FOSS personal finance software.

LazPaint, FOSS alternative to Paint, lightweight, easy to use, all the features amateurs need.

Scenarist by Kit, FOSS writing and screenwriting software. Lots of useful features. USE THIS IF YOU ARE WRITING ANYTHING.
Post: #9 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
https://python-forum.io/Thread-How-do-I-write-a-single-8-bit-byte-to-a-file

Python 3 is apparently far less useful than Python 2 for writing a single byte to a file. Looks like I'm going back to Java.
Posted on 20-09-03, 12:37 in Looking for a python script in the now defunct archives (revision 2)
Post: #10 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
It turns out that I'm a moron.

Posted by 'bowlofred'

Those aren't ints. You describe the bit at the end as "concatenated 8-bit bytes", but I'm guessing they're actually hexadecimal strings, so each character represents a 4-bit value.

You can create a byte object directly from a hex string like this:


>>> nmbr = bytes.fromhex("0102030405")
>>> nmbr
b'\x01\x02\x03\x04\x05'
>>> len(nmbr)
5


Since you've opened the file as binary and you have a bytes object, you can write it directly. There's no encoding necessary here.


Final code. Tested, works great. Tested on files padded with 0x00 and 0xFF to ensure that nothing is getting zero padded.
import sys,io

csvName = sys.argv[1]
with open(csvName, "r") as f:
line = f.readline()
while line != '':
lineList = line.split(',')
with open(lineList[0],"r+b") as writeFile:
writeFile.seek(int(lineList[1]))
writeFile.write(bytes.fromhex(lineList[2]))
line = f.readline()


I looked at the CSV package but it seems like overkill given that I'm only using readline() twice and split() once. It's not like it's a complicated or script CSV after all.

This is my second screw up with bytes objects, I really need to do my research before I herp a derp in the future.
Posted on 20-09-27, 14:06 in Looking for a python script in the now defunct archives (revision 2)
Post: #11 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
If this should be moved to a new thread in a different board, I encourage the mods to do so and to give it a witty title.

Python 3 is a truly awful programming language. It's a struggle to do things that I could do in minutes in Java, but unfortunately my users are living caricatures of technological illiteracy when it comes to reading the fucking documentation and following clearly written instructions - and generally dysfunctional in a fractal manner - so I'm stuck with Python.

I'm trying to dump the spark talents data for Saga Frontier in a format that can be easily copied and pasted into a spreadsheet. It needs to be done because my users to too dumb/lazy/entitled/insane to simply provide the spreadsheets and production documents (assuming they made any to start with lol) they used to make their mods, and I need to make scripts that allow one to extract their changes from their mods so one can understand what changes they made and make informed decisions such as:
1. Do I want to play this?
2. How do I play this?
3. Was he just mashing the keyboard at random when he made these changes?

The table is currently organized in a 16x16 table of bytes, where each row is the talent listing (0 - 15) and each column is a set of bit that represents 8 sparkable (or not) skills.

FB 2C D2 93 40 00 00 00 00 00 00 00 EA C8 61 00 //talent listing 1
F9 AA F0 D7 C0 00 00 00 00 00 00 00 FD 28 CA 00 //talent listing 2
E2 49 B4 8B 50 00 00 00 00 00 00 00 F2 4B CE 00 //...
E8 99 A4 4B B0 00 00 00 00 00 00 00 E1 37 D7 00
82 0E 00 C3 40 00 00 00 00 00 00 00 DE 89 19 00
F5 F1 FB 1F F0 00 00 00 00 00 00 00 E3 FE E6 00
FA E7 D2 DF D0 00 00 00 00 00 00 00 F5 EC F5 00
FF F9 FF 1F F0 00 00 00 00 00 00 00 F4 BD 79 00
FB C6 92 D3 20 00 00 00 00 00 00 00 FF FA FE 00
FB C9 54 03 D0 00 00 00 00 00 00 00 FF 13 0A 00
C9 96 92 CB B0 00 00 00 00 00 00 00 C5 1E BD 00
FB EE D2 C3 77 00 00 00 00 00 07 FC EA E9 F9 00
FD F9 FD 57 E0 00 00 00 00 00 00 00 F7 7D 7D 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 //talent listing 16


I want to turn it into a 128x16 list, where each column is the talent listing (0 - 15) and each row is a set of sixteen 1 or 0 representing talented or not talented, for all 128 skills.


1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 //Slash
0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0 //StunSlash
1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0 //DoubleSlash

Note that the above isn't actually correct or exactly how I want it formatted (I don't want commas), but it's close enough for our work and I can easily change the formatting later once it works.

Here's the Python 3 code I've written so far:
import io,sys,pdb,copy

#with open("SCUS_942.30", 'rb') as scus:
#scus.seek(58364)
with open("sparks.bin", 'rb') as scus:
scus.seek(0)
tblList1 = []
cntr = 0
while cntr < 16:
tblList1.insert(cntr, bytearray(scus.read(16)))
cntr += 1
tblList2 = copy.deepcopy(tblList1)

for i in range(len(tblList1)):
for j in range(len(tblList1[0])):
tblList2[j][i] = tblList1[i][j]

tblList3 = []
for row in range(128):
tmpRow = []
for column in range(16):
tmpRow.append((row * 16) + column)
tblList3.append(tmpRow)

ecntr = 0
fcntr = 0

while ecntr < 16:
while fcntr < 16:
#something's wrong in your column/row calculations
#need to multiply something somewhere, it seems.
#still doesn't work. double check earlier stuff prints correctly
#then walk through this code once and make sure
if tblList2[ecntr][fcntr] & 128 == 128:
tblList3[(ecntr * 8) + 0][fcntr] = 128
else:
tblList3[(ecntr * 8) + 0][fcntr] = 0
if tblList2[ecntr][fcntr] & 64 == 64:
tblList3[(ecntr * 8) + 1][fcntr] = 64
else:
tblList3[(ecntr * 8) + 1][fcntr] = 0
if tblList2[ecntr][fcntr] & 32 == 32:
tblList3[(ecntr * 8) + 2][fcntr] = 32
else:
tblList3[(ecntr * 8) + 2][fcntr] = 0
if tblList2[ecntr][fcntr] & 16 == 16:
tblList3[(ecntr * 8) + 3][fcntr] = 16
else:
tblList3[(ecntr * 8) + 3][fcntr] = 0
if tblList2[ecntr][fcntr] & 8 == 8:
tblList3[(ecntr * 8) + 4][fcntr] = 8
else:
tblList3[(ecntr * 8) + 4][fcntr] = 0
if tblList2[ecntr][fcntr] & 4 == 4:
tblList3[(ecntr * 8) + 5][fcntr] = 4
else:
tblList3[(ecntr * 8) + 5][fcntr] = 0
if tblList2[ecntr][fcntr] & 2 == 2:
tblList3[(ecntr * 8) + 6][fcntr] = 2
else:
tblList3[(ecntr * 8) + 6][fcntr] = 0
if tblList2[ecntr][fcntr] & 1 == 1:
tblList3[(ecntr * 8) + 7][fcntr] = 1
else:
tblList3[(ecntr * 8) + 7][fcntr] = 0
fcntr = fcntr + 1
ecntr = ecntr + 1

for g in tblList3:
print(g)


It reads from SCUS_942.30, which is the Saga Frontier main compiled executable file, but I also ripped the data and commented out the SCUS-reader code at the first few lines of code. It now uses a dummy file that is just the spark talents table, which is here:
https://ufile.io/tizyn3fx

If you don't have or don't want to download Saga Frontier, use the dummy file above; though any file that is at least 256 bytes long, named sparks.bin (or whatever you change that line of code to), and contains easily identified patterns will do.

Here's the output:
https://pastebin.com/zATnhKbw

Note that I'm using bit flags on each line to ensure I'm not mixing things up that shouldn't be mixed. Those will be replaced with 1s and 0s once I'm sure everything else is working correctly.

The first 8 lines print correctly, but every line after that just prints the value I stored when I initialized the array. I wasn't sure if the array initialization was working correctly (it wasn't earlier until I used copy.deepcopy(...)), so i initialized the 2D array I'm storing it in with the effective/human-understandable index of each element within said 2D array.

I have no idea why it's only working on one line instead of all lines, and the incredibly helpful people over at the Python.org forums tell me things I've already figured out and which are totally irrelevant to the (previous) issues I have. I could have written this a hundred times over in Java, but Java isn't an option.

Note that 8 lines of printed stuff in the output is equivalent to 1 byte of talent data for all 16 spark talent listings.

I have no idea why the loop-in-a-loop starting with "while ecntr < 16:" isn't working, and frankly I'm ready to sharpen a pointy stick so I can hunt my users and consume their flesh for sustenance. Assistance will be greatly appreciated and I'm sure the peaceful emanations from my aura will be felt within a 5000 mile radius, calming the nation and preventing the Second American Civil War and the resulting World Wars III and IV. Though if you'd prefer a two-digit amount of US dollars, that works too.
Post: #12 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Posted by funkyass
Its because you are not resetting fcntr at the top of the outer loop.

its the reason why for x in range() is perfered for loops of a fixed number


for fcntr in range(0,15):


to fix your loops:

while ecntr < 16:
fcntr = 0

Ahhhh, I feel my sanity returning. Do you have a paypal, gofundme, patreon, or onlyfans (lol) I can donate money to? Or would you prefer I donate $10-$99 to some cause you support?
Posted on 20-11-12, 22:58 in Misc. software
Post: #13 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Posted by wertigon
Question; Why even involve yourself with github when gitlab or other free repository hosting sites also exist?

Their site, their right to be arseholes. Even when it's not right.

Do any source repo services use Mercurial? I hate git.

What's the current state of obscure web browsers? I use Pale Moon and while I adore them and their shenanigans (look up their self-inflicted drama with one of the BSD Unices) I'm curious what else is out there.
Posted on 20-11-12, 23:00 in U.S. 2020 Election
Post: #14 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
None of you have learned anything from 2020.

The only solution to voting shenanigans is to do it all over again.

Post: #15 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Posted by wertigon
Nice attempt, but knowing a thing or two about python, this should take you where you want to go:


infile = open("input.txt", "r")
outfile = open("output.txt", "w")

skills = ["one", "two", "three", "four",
"five", "six", "seven", "eight",
"nine", "ten", "eleven", "twelve",
"thirteen", "fourteen", "fifteen", "sixteen"]

for line in infile.readlines():
writeline = ""
for index, word in enumerate(line.split()):
try:
num = int(word[:2],16)
writeline += "1 " if (num & 128) else "0 "
writeline += "1 " if (num & 64) else "0 "
writeline += "1 " if (num & 32) else "0 "
writeline += "1 " if (num & 16) else "0 "
writeline += "1 " if (num & 8) else "0 "
writeline += "1 " if (num & 4) else "0 "
writeline += "1 " if (num & 2) else "0 "
writeline += "1 " if (num & 1) else "0 "
writeline += "//" + skills[index] + "\n"
except ValueError:
pass
outfile.write(writeline)


There is (almost) always a shorter solution. Anyway, you're welcome, a fun little 10 minute problem for me. :)

Recommend me a book?
Posted on 20-11-14, 00:46 in Misc. software
Post: #16 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Posted by tomman
Bitbucket. WTF, they killed it almost 5 months ago!?

Ah well, here are some of your options. Didn't knew SourceForge had Mercurial, but then, who uses SF these days? All the kool kids left that dumpster fire when the ads (and continuous ownership changes, each new owner being worse than the prior one) rotted its foundations :/

Seems like there are some license restrictions on some of those sites, but copying the WTFPL into a repo isn't an issue so that works. Thank you.

Posted by tomman
Seamonkey. Aside of PM, it's the last browser with a SANE, non-braindamaged UI still standing, and it's still straight Gecko under the hood.

There is Waterfox, if you can stand the Asstralis disaster and still want compatibility with XUL addons.
Lynx/Elinks are still kicking alive, it seems, same for Dillo, but forget about the perks of the modern web.

Unfortunately most modern webshit only caters to Chrome and its clones, so half the Internet will look broken on our "obscure" browsers :/
Case in point: GitHub, which despite being the host for many of those obscure browsers sources, don't care at all for anything that isn't Blink or recent Firefox :/

Is Seamonkey old Firefox and Friends, but maintained? It doesn't follow the new Firefox releases and rejigger some shit?

What about Waterfox?
Posted on 20-11-19, 07:43 in Mozilla, *sigh* (revision 1)
Post: #17 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Posted by tomman
Remember: they're trying to pull the same "PC vocabulary" BS on other larger projects, like the Linux kernel.

I guess SJWs have no influence in the Big Iron market, where master/slave terminology is deeply ingrained, and I've yet to hear about any of the large/mid-of-the-pack enterprise vendors to raise this non-problem.

On the consumer side, PATA drives were discontinued nearly a decade ago, which was the last well known application of those "nasty" words.

Any time you see someone going on about how arcane xyz minutiae is oppressive to whomever - and that person is not a member of the oppressed group they are supposedly defending - you can rest assured that they are pulling the wool over your eyes about something else.

Similar to how Wells Fargo and other giant financial corporations now funds LGBTQ+ right parades so now we can forget ever holding them accountable for any of their numerous crimes. I'm not sure which is worse, that they try it or that people fall for it. Funding a pride parade cost's what, $200,000 at most? And they make billions of dollars a year, to say nothing of their vast reserves of wealth.

There's a sort of fractal dysfunction here - not only do people fall for transparent red herrings and obvious bait, but they bait itself is pathetically minuscule. Imagine that you have pretty much the entire working and middle classes ready to go Pol Pot on bankers, and you refuse to cooperate with the other side of the aisle against the bigger threat because they give 1/10,000th of their wealth to purely performative affirmations of your lifestyle which in no way materially benefit you. It's much easier to deal with society not affirming your beliefs and lifestyles when you own a home, a vehicle, and have no debt; but noooo~, the banks say populism is the devil! Now donate to the DNC and Pokemon-Go to the polls so we can invade Iran and continue to plunder America for shit to sell to China.
Posted on 21-01-24, 19:48 in Hardware/Product Recommendations Thread
Post: #18 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
I'm looking for an ebook reader that meets the following criteria:
* Low power usage and long battery life, I assume through use of e-ink or whatever it's called.
* As large a screen as possible.
* Either the ability to read any PDF, Mobi, and Epub regardless of DRM/provenance; or modifiable so one can run custom firmware on it.
* Doesn't contain super bright lights.
* I'm not sure if I need one with a backlight, I'm depending on you guys to give me feedback on that. I prefer something that isn't bright as shit, but which lets me read the material. Controlling brightness would be really nice too.

I have several hundred pirated ebooks in my backlog, and staring at a white screen while sitting in bed doesn't help my eyes or recall of the material. According to some research I read (link below among others I can't find right now), it's easier to recall material from a dead tree book than from a screen, so maybe something like e-ink will provide better recall than a laptop or tablet.

https://eric.ed.gov/?id=EJ1250471
Posted on 21-01-25, 07:40 in Hardware/Product Recommendations Thread (revision 1)
Post: #19 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
Thanks for the feedback everyone, I'll go with Boox Nova 3. Doesn't seem too different from higher end models, and it has most everything I need without being half the cost of a low end used car.

Time to make use of those 5 GB of pirated ebooks I've hoarded all these years.
Posted on 21-01-25, 08:11 in Computer Hardware News
Post: #20 of 27
Since: 08-01-20

Last post: 1090 days
Last view: 990 days
I should make a "Mehmet, my son" meme to demonstrate just how much the American tech industry has been gutted by a desire for cheap slave labor that you force to work 60 hours a week and which you can deport as soon as they start to organize.



The ones that aren't openly slave labor are just ethnic rackets*, and even then there are ongoing caste discrimination lawsuits going on against several huge firms for refusing to hire/promote qualified people who are descended from Dalits.

At this point I almost hope that China conquers Taiwan and we go 5 years without any new hardware, just so I can see our glorious, unaccountable leaders in government, finance, and business scramble to find someone else to blame for their failures. We can't vote them out of power, and any riots or revolts which actually threaten corporate capital (ie, the ones that don't make Jeff Bezos tens of billions of dollars) just get us new domestic surveillance laws. We literally can't remove them from power in any way, and they refuse to govern (looting the nation != governing). LOL what are our options here? Pray for Martians to invade and go Independence Day on Washington DC? Throw a goat into a volcano with a prayer for the Yellowstone caldera to erupt wrapped around it's neck?

What do you do when your ruling elites see you as prey/food, and dumb prey at that?

The sooner our elites asinine decisions topple their fortunes, the better off we will all be.

*I mean, kudos to them for finding a way to screw over their exploiters, but turning around and screwing over someone else over arbitrary differences hardly makes you the good guy.
Pages: 1 2
    Main » MysticLord » List of posts
    This does not actually go there and I regret nothing.