Relay script

Pazleysox

Member
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:
buffer gash( buffer 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.
	write( nstower( visit_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.
 

xKiv

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

Pazleysox

Member
Also, shouldn't that be "replace_string(source" instead of "replace_string(string"?
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.

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?
 

theo1001

Member
In your case, it is
PHP:
visit_url().gash().write();
simply because that is how you named the function you created
PHP:
buffer gash( buffer 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.
 

Pazleysox

Member
Now if you want it to run at nstower then you have to name the file as place.nstower.ash.

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:
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( )
{
	write( color_planes( visit_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/[COLOR="#FF0000"]nstower[/COLOR]/gash.gif'
 
Last edited:
Top