WatchNon-threaded

Forums » The Lounge » Read Message

A place to sit back, hang out, and talk about anything you'd like.

CYSBOT: CYS Backup Or Transpile

27 days ago

So, I've decided I do want to be a programmer when I grow up, after all. As such, I need some portfolio projects. And I'd very much like to enable CYS users to get their games off this site.. and into a different format, if they so choose.

And thus, the CYSBOT project is born. My goal is to create a bot that you can add as a coauthor to a story, then PM it a command that has it make a backup, recreate a storygame from a backup, or transpile a storygame to ChoiceScript or Twine.

This is assuming that A) anyone is interested, and B) the mods don't nix it.

So! Anyone interested? And if you are, are you more interested in backup/recreate, ChoiceScript, or Twine?

@BerkaZerka @EndMaster ...hiii mods. It'll be a very well-behaved bot, I promise. Still, I figured I should ask permission rather than forgiveness. I'd hate to spend a lot of time on this and then have my bot banned.

CYSBOT: CYS Backup Or Transpile

27 days ago

Morgan, this clearly goes against the Site Policy. Bots can't consent to Co-Authorship unless coerced by programming/MIND CONTROL.

CYSBOT: CYS Backup Or Transpile

27 days ago

Hi Sent! How ya been?

There's nothing in site policy against mind control. There is this:

While using the Web site you may not:
• ( I ) post or transmit any message under a false name;

Soooo, pretty much everyone here is violating the ToS every time they post. Myself excepted, since my name actually is Morgan. XD

CYSBOT: CYS Backup Or Transpile

27 days ago

I've been positively excellent, as far as I know.

Well, yeah, but it's also against the De-Facto rules to co-author someone without their consent, and those are ten times as important as the Terms of Service. Also, I'm pretty sure everyone commits murder fairly regularly even though it's technically illegal. Does that mean we should be allowed to rob banks!? Of course not, that would be madness!

CYSBOT: CYS Backup Or Transpile

27 days ago

I'm very glad to hear it. ^_^

I will definitely take measures to ensure that my bot doesn't rob any banks. But if someone co-authors it without its consent, well... who is breaking the rules? Not the bot, surely!

CYSBOT: CYS Backup Or Transpile

27 days ago

This must have been your plan all along! Forcing everyone into alternative game engines by creating a bot that gets everyone banned for co-authoring it without its permission! IT'S A TRAP! AND IT DOESN'T EVEN HAVE ANIME EYES OR A PENIS!

CYSBOT: CYS Backup Or Transpile

27 days ago

...are you sure?

I mean, if you are, that raises certain questions... XD

CYSBOT: CYS Backup Or Transpile

27 days ago

I mean, not really, but I hope I'm right. Like, if the French are allowed to assume that a guillotine has a vagina without checking to make sure, I'm allowed to assume you didn't attach sex parts and anime eyes to a Secret Death Robot.

CYSBOT: CYS Backup Or Transpile

27 days ago

...okay, you got me. My bot is entirely lacking in sex parts. And eyes, anime or otherwise. But, also lacking in nefarious plans and/or murderous intentions!

CYSBOT: CYS Backup Or Transpile

27 days ago
>ChoiceScript or Twine

*laughtrack*

Joking aside, what language, protocols, etc? It basically would have to be open source because it has to follow CYS ToS and not store others' creative work itself. What will you run it from? What kind of security do the servers you have in mind have, or will it run from a personal computer? I never thought of you as much of a developer. What kind of experience do you have? (genuinely just curious on that part)

Choicescript and twine are useless formats you should learn to be really good at something else like playing with yo-yo's or weaving baskets in sub-unique aquatic settings.

CYSBOT: CYS Backup Or Transpile

27 days ago

Python + Scrapy so far. Not sure exactly what else I'll need, but the Python ecosystem seems to be pretty damn expansive at this point. And yes, it will be open source, since "portfolio" in this case means "projects accessible on GitHub." I'll run it from my own computer during development, and eventually deploy to PythonAnywhere. (Probably. I liked them when I tried them out a couple years back, and from what I've read people still like them, so that's the tentative plan.)

As for my background... I started programming when I was in my early teens. Made some little games in Visual Basic, and later on a bot for a game called Furcadia. I thought I wanted to be a programmer when I grew up. I got about halfway through  CompSci degree before switching focus to computer animation. My eventual work in that field was still fairly technical, and included software development. I wrote a domain-specific scripting language for one of our products... which was complete overkill, in retrospect, but it was a learning experience.

So, yes, this is a reasonably ambitious project, but I'm not starting from "Hello World."

CYSBOT: CYS Backup Or Transpile

27 days ago
So, I've written bots in python for a few years now and your idea is absolutely doable. I absolutely don't think it's worth the time and effort that will be required. However, that being said, in hopes that you make it anyways just because it's satisfying to make things - import requests, bs4, urllib, subprocess, and if you want to go easy on yourself I'd say use selenium. actionchains, keys, and alert are going to be absolute musts if you go with selenium though and it may work slower. The bulk of your program is not going to be the functions which gather data, but formatting that data. You'll have to come up with an efficient and decent way of formatting all the information that the bot will parse because it's not been done before so there's no stackoverflow for this. Disclaimer: I'm not familiar enough with scrapy to vouch for it in any way. I tried it once and it didn't work and so I moved on to using other things to parse and scrape.

I recommend joining the CYS discord [https://discord.gg/7e5sDWy] and going into the dev channel. Presuming you don't appreciate any other channels, the dev channel is the only channel with any merit towards this goal of yours because me and BD are the only ones who talk in it (generally) and we pretty much know the site down to the last runtime error (like the back of our hands) by now. Pibot is my discord bot written in python that already parses the site correctly - I don't mind sharing code and tips there. Larimar is BD's bot written in JS and also parses the site and does some other mysterious things so he can definitely help too. Chanbot is going to be my project CYS-site bot and I'm currently moving his old python bones to C# (and unfortunately Lisp for other functions as he's not intended for just CYS).

We're there if you need a jump-start. We're there if you don't. Good luck with link scripts.

CYSBOT: CYS Backup Or Transpile

27 days ago

Awesome. And yeah, given the small userbase here, and the even smaller percentage that would have any interest, it's definitely not worth the time/effort from that angle. But: it's educational, and I need projects, aaaand I wanna see if I can do it. I do think it's possible that there's some 'gotcha' in the differences in functionality between CYS and ChoiceScript and/or Twine, such that I won't be able to get a transpiler working. But it'll certainly be interesting to find out.

I'll definitely join you on Discord, thanks for the invite! Hopefully I won't end up badgering you too much. XD

What are you doing with Lisp? I took a class in Scheme back in college, and one of the "real" devs from my former workplace told me I should look into Clojure. Which I've started to, but... yeah. Easily distracted, especially when I'm not yet clear on why something is cool.

CYSBOT: CYS Backup Or Transpile

27 days ago
As a programmer (ok, former), I'll say, "Good luck." No, I really mean it. But at the same time, I can't see a practical way for this to work.

I guess the idea of a back up nice, but I'm not sure what purpose it would have other than I could write a story, then back it up, then write a bunch of other stuff and change my mind and restore. Then again, maybe others have good ideas for that.

As for the export to other formats, this is where I don't see a reality. The main reason is variables and scripts. There might be a way to export scripts, but oh my, that is really going to be difficult. You're going to have to write a parser that figures out what the script commands here do and then convert them into the commands that the other languages use. It can be done, but it will be difficult, and it will be hard to get to 100% accuracy on that one. I'm not saying I wouldn't super-love to have a way to import and export from something like Twine, I just know how incredibly complex that will be. And you've got to realize that you've got page scripts AND global scripts AND link scripts. I have no idea how you'll access all that information.

On the other hand, it might be much, much simpler and more possible to write something that does the opposite -- converts from Twine into CYS. That's because you wouldn't have to worry about the script conversions (as I understand it). I suppose if you had a story here that had zero scripts, that might be possible to convert into something else, but I haven't really looked at that. And that's without even considering how items are implemented on this site.

I don't want to discourage you, I'd really like to see some projects like this succeed. At the same time, I'm aware of how this site works and how incredibly customized this site is as compared to things like HTML and other open source projects. It will take a substantial amount of work to create any sort of automation to make these stories move to anything else, I think.

CYSBOT: CYS Backup Or Transpile

27 days ago
BD made that for page scripts already.

You're right in that scripts would be the worst part. I've already thought extensively on this and in particular link scripts are going to be the main hurdle. Transferring writing is child's play - a simple html parser with a list of links set to go to link@storygame_title and just store all the data is easy as fuck and absolutely doable. The formatting will be the most tedious part. Incorporating working link scripts will be hell unless you go cheapo on it and just have the bot paste scripts below page text - but then you have globl link scripts and global page scripts to parse as well.

In summary: 7/10 difficulty. My solution would be to just spend a weekend with a C language and make a program that people can install and it backs up storygames in an acceptable way locally - then there's no need for a bot and it's more consistent across the board for people who want backup capability. Halogen Studio servers are really great though - they have, like all servers ever, excessive storage capable of many many more years of site content given that 90% of the site is plaintext and HTML it takes up essentially negligible space compared to several TB of disk space that servers have.

The next problem to be faced is real-time backup and the bandwidth problems that come with that. I want to get into it here but I don't think anyone is interested in "reading about a retro-encabulator" so-to-speak.

CYSBOT: CYS Backup Or Transpile

27 days ago

bradin.pw/cysfiddle for the... er, curious.

CYSBOT: CYS Backup Or Transpile

27 days ago

This is really neat! What does CYSugar looks like? And do you have on-page variables working yet? (I may be using the wrong terminology here, it's been awhile.... I mean something like %%VAR%% in the HTML. I tried it and it's displaying 0, even though the variables dropdown shows the value I set in the script.)

CYSBOT: CYS Backup Or Transpile

27 days ago

It looks a lot like plain CYS Script, but CYSugar is made slightly more brief with a few additional features. Stuff like compound operators (e.g. "+="), increment and decrement operators (e.g. "%FOO++"), headless dice notation (e.g. "D20" instead of "1D20"), and non-conditional on-page coding in strings (e.g. "Your score is %%SCORE%%").

By default, on-page coding is done before the page script, since that's how it works on CYS. I'm assuming that's why you're getting a zero instead of the intended value, but fortunately you can shift that processing to the end by enabling the "on-page post-processing" option.

CYSBOT: CYS Backup Or Transpile

27 days ago

Nice!

And yeah, that makes sense... I grabbed the display code from a random page from an old project, and then backtracked to get code to set it. It's been long enough that I don't remember the syntax myself... or details like evaluation order, apparently. XD

 

CYSBOT: CYS Backup Or Transpile

27 days ago

Err... what? How would switching to a C language help? How would making it local help? It would still need to scrape the site, what difference does it make if it's scraping from a server or from someone's machine? I can't imagine bandwidth being a problem... we're talking about text. What am I missing?
 

CYSBOT: CYS Backup Or Transpile

27 days ago

Parsing the scripts, and turning them into different scripts, is what makes it a transpiler. Since more than half the point of this project is to have something cool to put on my resume/GitHub, that functionality is definitely something I want to try to get working. But yeah, it's definitely not a simple task.

Twine > CYS or ChoiceScript > CYS is... less viable. Consider that both of those let you set a variable to a string. And Twine lets you put links anywhere in the text.

CYSBOT: CYS Backup Or Transpile

26 days ago
Well hey, if this gets off the ground and you want someone to test it, I'm pretty good at breaking things and explaining how I broke them! :)

CYSBOT: CYS Backup Or Transpile

26 days ago

Thanks for the offer! I may well take you up on that.

Currently eying the stuff Zikara's done with embedded JavaScript... it's going to make my life harder, but it might actually allow for Twine-style inline links. And I feel like it might be possible to hack together a solution for string variables, minus actual user input. Still, CYS > backup is definitely the first step.

 

CYSBOT: CYS Backup Or Transpile

27 days ago

Ooooo. A thingamabob. Coding. Programming and such. Choicescript and Twine also.

Yes.

I know these things.

CYSBOT: CYS Backup Or Transpile

27 days ago

Hello! ^_^

I'm glad you approve of thingamabobs! Which kind is your favorite?

CYSBOT: CYS Backup Or Transpile

27 days ago

... Uh... The red one.

CYSBOT: CYS Backup Or Transpile

27 days ago

And how deep does the rabbit hole go? XD

CYSBOT: CYS Backup Or Transpile

26 days ago

... I'm actually really happy you got what I was trying to do there.

Okay, so maybe I don't know these things, but apparently Twine is better than Choicescript, so I choose that one.

CYSBOT: CYS Backup Or Transpile

26 days ago

^_^

Cool. Looks like people are preferring Twine so far. I do intend to do both, but since I'll have to pick one to do first, it'll be helpful if there's a consensus.

CYSBOT: CYS Backup Or Transpile

27 days ago

Although I don't have much knowledge in things pertaining to programming and code, it is good to see you back online and (hopefully) fully operational, Morgan! :^)

CYSBOT: CYS Backup Or Transpile

27 days ago

Thanks! My brain is braining okay right now. Having some insomnia, which is a definite red flag for the start of an upward spiral... buuuuut it's intermittent, when it happens I still do get some sleep, and I do actually feel tired. It's when I don't sleep and feel awesome that things really go off the rails. >_<

CYSBOT: CYS Backup Or Transpile

26 days ago

Twine. Choice script is for the birds

CYSBOT: CYS Backup Or Transpile

26 days ago

Hey Malk! How goes?

I actually do prefer ChoiceScript, so... you're right! XD

But thanks for voting. I do think Twine is very cool, and I'd be happy to start with it, if that's the general consensus.

CYSBOT: CYS Backup Or Transpile

26 days ago

I've always disliked ChoiceScript, mainly because the layout reminds me uncomfortably of those proficiency questionnaires that companies give you on job interviews. Given a choice, I would certainly prefer Twine.

CYSBOT: CYS Backup Or Transpile

26 days ago

Visual appeal is definitely not their strong suit! Thanks for voting. ^_^

CYSBOT: CYS Backup Or Transpile

26 days ago
I possibly misread the topic as Transphile and...that's a much better title for your project. You should change it. You're welcome.

CYSBOT: CYS Backup Or Transpile

26 days ago

...gonna go with nope to the nope, thanks anyway. :P

CYSBOT: CYS Backup Or Transpile

26 days ago

As far as I know as long as it isn’t spamming ads/posts, harming the site or something similar I don’t think there’s a problem with this though I imagine JJJ or Alex would probably be the people to directly ask if this is allowable, but who knows when they’ll be around again.

CYSBOT: CYS Backup Or Transpile

26 days ago

Awesome, thanks.

CYSBOT: CYS Backup Or Transpile

21 days ago

I'm pleased to report that CYSBOT can now crawl a Classic Editor based storygame, and generate a playable Twine HTML file. Now, this is not actually that useful on either end, since A) most storygames here are made in the Advanced Editor, and B) the generated Twine files don't have positional data for the nodes. Still, it's a start!

CYSBOT: CYS Backup Or Transpile

21 days ago

Oooooh.

Progress.