Clickable CLI links ?

How can I pull the information from a get_property, and then display it in a print("");?

IE:
else if (get_property("_spacegateTurnsLeft") >= 20)
{ print ("your space gate is open, and you have " + spacegateTurnsLeft + " turns left"); }

Assign it to a variable. For example,

Code:
    int turns;
    turns = to_int(get_property("_spacegateTurnsLeft"));
    if (turns >= 20)
            {    
              print ("your space gate is open, and you have " + turns +" turns left.");
        }
 
What is the down side of not using the .to_int()? :confused:

Umm ...

In ash, comparisons between number and string "upgrade" to string. So "10" < 2 because "10" < "2". But "10".to_int() > 2, because 10 > 2. If you are comparing numbers, make sure you compare *numbers*.
 
They "coerce" to strings. I don't think any of us think of that as an "upgrade", per se, but it is intentional behavior.
 
Assign it to a variable.

Or not. get_property() returns a string. print() accepts strings. So many options. Yay!

Code:
print ("your space gate is open, and you have " + get_property("_spacegateTurnsLeft") +" turns left.");
 
Ha, I came here all excited to link to CLI Links, but saw that Bale had already made the error I was about to make.

Interestingly, this:

PHP:
> ashq print_html("<a href='clilinks.ash?cli=print hello'>clickity</a>")

works to execute the command, but still opens up a browser window, which displays the confirmation message.

Maybe as a workaround, make all the links point to a page that does nothing but close its own window?
 
Last edited:
Ha, I came here all excited to link to CLI Links, but saw that Bale had already made the error I was about to make.

Interestingly, this:

PHP:
> ashq print_html("<a href='clilinks.ash?cli=print hello'>clickity</a>")

works to execute the command, but still opens up a browser window, which displays the confirmation message.

Maybe as a workaround, make all the links point to a page that does nothing but close its own window?

I tried this, and it doesn't open a window until I click on it. Maybe my settings are different, so the window doesn't open automatically?

EDIT: Or am I just an idiot, and this isn't what you want?
 
Last edited:
My scripts for managing the dailyDeedsOptions & scriptList props are so developed at this point that I am almost always able to do everything I want with a click or two. At this point, I probably wouldn't even use this method, even if it were possible. I can more or less play an entire ascension in the gCLI (and do my favorite aftercore things) without ever having to type commands. (I wasn't able to ditch the browser altogether because I am still addicted to Ezandora's Guide. But, otherwise, at this point I'm only using the browser when I want to see new artwork.)
 
My scripts for managing the dailyDeedsOptions & scriptList props are so developed at this point that I am almost always able to do everything I want with a click or two. At this point, I probably wouldn't even use this method, even if it were possible. I can more or less play an entire ascension in the gCLI (and do my favorite aftercore things) without ever having to type commands. (I wasn't able to ditch the browser altogether because I am still addicted to Ezandora's Guide. But, otherwise, at this point I'm only using the browser when I want to see new artwork.)

So you don't use this now?

I'm working on a script that checks (pretty much everything) that can be tracked on a daily basis. I'm sure I've missed a thing or two, which is fine until I roll it out.

I have an idea about how I want the script to run, and I want to set preferences so the user can change what the script does as they see fit. Right now I'm running into the problem of figuring out how to get "set_set_property( string, string )" to do what it's supposed to do. I've looked at other scripts that have custom preferences, but I need to look deeper to figure it out. When I get completely stuck, I'll eventually ask for help. :)
 
Back
Top