Changing Gender Between Ascensions

Lxndr

Member
I want a relay script to automagically switch my gender from my current one to the other gender when in Valhalla.

Any idea how to code this?
 

Theraze

Active member
Since you no longer have a gender once you hit Valhalla? You'd need to have your preascension script write your current gender to a property, and your Valhalla relay script read that property to set your new gender.
 

Lxndr

Member
Valhalla defaults to the gender you had before entering it. So I'd want it to "switch from the default."
 

Bale

Minion
That makes it simple to know which one you want. I would like to see the relay override when you're done. since I was thinking about doing something like that, along with making hardcore a default choice.
 

caphector

Member
I threw together a relay script that attempts to do this. Unfortunately, I can't test it until I next ascend and from my single tester it doesn't seem to be working. This is somewhat cargo cult programming - I tried following the code in shopwtf.ash, but I appear to be missing several somethings. The page that needs to be modified is afterlife.php?place=reincarnate

I'm attempting to do three things:
1. Trigger the full page, showing all the blurbs with HC selected on page load.
2. Have the menu show hardcore selected
3. Swap genders

I'm attempting to do the first by replacing <body> with a <script> and using a body onload. I'm also doing a replace to swap the menu values for gender and hardcore. Unfortunately, none of the above seems to be working and I'm not sure what I'm missing.

Code:
buffer NewAfterlife(buffer page)
{
        page.replace_string('<body>', '<script>function ascend() {     document.ascform.asctype.value==3; hidediv('casualblurb'); hidediv('softcoreblurb'); showdiv('hardcoreblurb'); showdiv('classgender'); showdiv('moonsigns'); showdiv('path'); showdiv('submission'); }</script><body>');

        page.replace_string("<option value=0 >-select a type-</option>", "<option value=3 >Hardcore</option>");

        page.replace_string("<option selected value=1>Male</option>", "<option value=1>Male</option>");
        page.replace_string("<option value=1>Male</option>", "<option selected value=1>Male</option>");

        page.replace_string("<option value=2>Female</option>", "<option selected value=2>Female</option>");
        page.replace_string("<option selected value=1>Female</option>", "<option value=1>Male</option>");

        return page;

}

void main() {
        buffer page;
        page.append(visit_url());
        page = NewAfterlife(page);
        write(page);
}
 
Last edited:

caphector

Member
Did a bit more work on this; here's a script that will set the player to Hardcore automatically but does not change gender. I think a gender-swap is possible because the page has this code:

Code:
<option value="1" selected="">Male</option>
<option value="2">Female</option>

In theory some replace_strings could swap that out or a JavaScript could be called to change which item is selected.

Anyway, this will select Hardcore and allow a valid ascent:

Code:
// Afterlife.ash - defaults to perma-hardcore and may do gender swapping
// By CapHector
buffer NewAfterlife(buffer page)
{
        page.replace_string('<body>', '<script>function ascend() {document.ascform.asctype.value==3; hidediv(\'casualblurb\'); hidediv(\'softcoreblurb\'); showdiv(\'hardcoreblurb\'); showdiv(\'classgender\'); showdiv(\'moo$

        page.replace_string("<option value=0 >-select a type-</option>", "<option value=3 >Hardcore</option>");

 //     page.replace_string('value="1">Male', 'value="1" selected="">Male');
 //     page.replace_string('value="1" selected="">Male', 'value=1>Male');

 //     page.replace_string('value="2" selected="">Female', 'value="2">Female');
 //     page.replace_string('value="2">Female', 'value="2" selected="">Female');

        return page;

}

void main() {
        buffer page;
        page.append(visit_url());
        page = NewAfterlife(page);
        write(page);
}

Same script attached here: View attachment afterlife.ash
 

Lxndr

Member
That one isn't setting my test account to Hardcore.

ETA: Nevermind. Copy/paste error.
 
Last edited:
Top