Page 3 of 3 FirstFirst 1 2 3
Results 21 to 29 of 29

Thread: Clickable CLI links ?

  1. #21
    Senior Member
    Join Date
    Sep 2006
    Posts
    329

    Post

    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"); }
    Originally Posted by Pazleysox View Post
    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.");
            }

  2. #22
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,722

    Default

    What is the down side of not using the .to_int()?
    Originally Posted by Pazleysox View Post
    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*.

  3. #23
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,131

    Default

    They "coerce" to strings. I don't think any of us think of that as an "upgrade", per se, but it is intentional behavior.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  4. #24
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    744

    Default

    Assign it to a variable.
    Originally Posted by Ethelred View Post
    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.");

  5. #25
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,481

    Default

    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 Code:
    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 by zarqon; 08-07-2017 at 10:22 AM.
    Sig by JakAtk
    My scripts: Prefref Plus | One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  6. #26
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    256

    Default

    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 Code:
    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?
    Originally Posted by zarqon View Post
    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 by Pazleysox; 08-07-2017 at 08:31 PM.

  7. #27
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    705

    Default

    it doesn't open a window until I click on it.
    Originally Posted by Pazleysox View Post
    The idea is to be able to click it without opening any window...just execute the command.

  8. #28
    Senior Member AlbinoRhino's Avatar
    Join Date
    May 2008
    Posts
    705

    Default

    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.)

  9. #29
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    256

    Default

    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.)
    Originally Posted by AlbinoRhino View Post
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •