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

Thread: CLI Links -- easily add CLI power to your relay script

  1. #21
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,490

    Default

    HTML is not ASH. HTML is understood by your browser, and ASH is understood by KoLmafia. You cannot freely mix the two. A relay script is written in ASH, and outputs HTML to your browser via the write() and writeln() commands.

    Code:
    <ash commands>
    write("<html>");
    write("<head>head stuff, such as scripts included</head>");
    write("<body>page content, such as CLI-ified links</body>");
    write("</html>");
    <more ash commands>
    If you try to include HTML in your ASH script without it being in quotes, it will definitely generate errors.
    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!

  2. #22
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    260

    Default

    HTML is not ASH. HTML is understood by your browser, and ASH is understood by KoLmafia. You cannot freely mix the two. A relay script is written in ASH, and outputs HTML to your browser via the write() and writeln() commands.

    Code:
    <ash commands>
    write("<html>");
    write("<head>head stuff, such as scripts included</head>");
    write("<body>page content, such as CLI-ified links</body>");
    write("</html>");
    <more ash commands>
    If you try to include HTML in your ASH script without it being in quotes, it will definitely generate errors.
    Originally Posted by zarqon View Post
    PHP Code:
    void main()
    {
    write("<html>");
    write("<head><script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>");
    write("<script src="clilinks.js"></script></head>");

        if((
    get_property("stenchAirportAlways") == "true" || get_property("_stenchAirportToday") == "true") && item_amount($item[bag of park garbage]) > && get_property("_dinseyGarbageDisposed") == "false")
        {
        
    write("You can still <font color=FF0000>Dispose Dinsey Garbage</font>");
        
    write("<a href=place.php?whichplace=airport_stench&action=airport3_tunnels</a>>\n<a href=choice.php?pwd&whichchoice=1067&option=6 + class="clilink through">Dinsey Garbage</a>");
        }
    write("</html>"); 
    getting this error:
    Expected ), found write (00TEST.ash, line 5)

    Regardless what I have after line 5, it continues to give the error... Not sure what I'm doing wrong here, but I'm sure it's simple

  3. #23

    Default

    When you have a string contained in "", you need use " to include " in the string.

  4. #24
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    260

    Default

    When you have a string contained in "", you need use " to include " in the string.
    Originally Posted by lostcalpolydude View Post
    DUH! I knew it was something simple. I actually thought of this at one point but pushed it out, thinking there's no way.

    PHP Code:
    void main()
    {
    write("<html>");
    write("<head><script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"></script>");
    write("<script src=\"clilinks.js\"></script></head>");

    //    if((get_property("stenchAirportAlways") == "true" || get_property("_stenchAirportToday") == "true") && item_amount($item[bag of park garbage]) > 0 && get_property("_dinseyGarbageDisposed") == "false")
        
    {
        
    print_html("You can still <font color=FF0000>Dispose Dinsey Garbage</font>");
        
    print_html ("<body><a href=place.php?whichplace=airport_stench&action=airport3_tunnels>\n<a href=choice.php?pwd&whichchoice=1067&option=6 + class=\"clilink through\">Dinsey Garbage</a></body>");
        }
    write("</html>"); 
    This works. The "Dinsey Garbage" link comes up, but it opens a new browser window. I thought doing this was supposed to prevent the browser window from opening?

Similar Threads

  1. KoLMafia will not open links to anything including Relay Browser
    By AggiePunbot in forum Community Support
    Replies: 5
    Last Post: 07-29-2015, 07:08 AM
  2. Feature - Implemented Relay links for the untinkerer
    By Erich in forum Bug Reports
    Replies: 1
    Last Post: 01-16-2013, 04:27 AM
  3. Bug - Fixed Links broken in relay browser after Louvre automation
    By Idran in forum Bug Reports
    Replies: 10
    Last Post: 02-29-2012, 05:33 AM
  4. Replies: 1
    Last Post: 07-24-2010, 10:17 PM
  5. A request for additional topmenu links in Relay Browser
    By Cams in forum Community Support
    Replies: 5
    Last Post: 07-04-2009, 12:05 PM

Posting Permissions

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