Results 1 to 6 of 6

Thread: Relay script

  1. #1
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    255

    Default Relay script

    I'm new to relay scripts. Never written one before. I found a script that does what I want here, and figured I would bend it to my will (read modify it to my needs).

    I'm not having any luck figuring how what I'm doing wrong, and could really use some help.

    PHP Code:
    buffer gashbuffer source )
    {
        
    replace_string(string,'https://s3.amazonaws.com/images.kingdomofloathing.com/otherimages/kingprism1.gif','/images/relayimages/my_image.gif');
        return 
    source;
    }

    void main( )
    {
    //    visit_url().nstower().write();      //when the line below didn't work, I tried this instead.
        
    writenstowervisit_url( ) ) );

    Here's the image I'm trying to replace with my own. I named the file place.gash.ash.

    If someone could help me out, I would greatly appreciate it.

  2. #2

    Default

    Try doing "verify place.gash.ash" in the CLI. You'll get a nice message about nstower() not being defined.

  3. #3
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,720

    Default

    Also, shouldn't that be "replace_string(source" instead of "replace_string(string"?

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

    Default

    Also, shouldn't that be "replace_string(source" instead of "replace_string(string"?
    Originally Posted by xKiv View Post
    Thanks, I knew I had made an error with that, and just put something in for the time being. It's fixed now, but the script still doesn't do what I want.

    Try doing "verify place.gash.ash" in the CLI. You'll get a nice message about nstower() not being defined.
    Originally Posted by lostcalpolydude View Post
    Yep, found that. Tried a few different locations, but can't come up with the right one for this location. Is there a list somewhere?

  5. #5

    Default

    In your case, it is
    PHP Code:
    visit_url().gash().write(); 
    simply because that is how you named the function you created
    PHP Code:
    buffer gashbuffer source 
    .
    Now if you want it to run at nstower then you have to name the file as place.nstower.ash.

    If you mouse over the "Lair of the Naughty Sorcerer" in the relay browser, on the bottom left of the screen it will say
    Code:
    http://127.0.0.1:60080/place.php?whichplace=nstower
    which is how you get the name for the location.

    This page in the wiki may also help.

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

    Default

    Now if you want it to run at nstower then you have to name the file as place.nstower.ash.
    Originally Posted by theo1001 View Post
    I've tried this, to no avail. I've gotten the script to work in other locations, but it seems I can't change the image of anything on/around the tower...

    PHP Code:

    buffer color_planes
    buffer source )
    {
        
    replace_string(source,'https://s3.amazonaws.com/images.kingdomofloathing.com/otherimages/gash.gif','/images/relayimages/airport_color_planes/airport_plane_spooky.gif');
        return 
    source;
    }

    void main( )
    {
        
    writecolor_planesvisit_url( ) ) );

    here's the actual code. I've named it place.nstower.ash, and place.gash.ash, and place.nstower.gash.ash...

    I've also tried replacing the "gash.gif" with multiple locations of the tower itself.

    EDIT: I figured out my mistake...
    Code:
    https://s3.amazonaws.com/images.kingdomofloathing.com/otherimages/nstower/gash.gif'
    Last edited by Pazleysox; 09-17-2017 at 01:14 AM.

Posting Permissions

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