NTSL Scripts

A place to record your ideas for the game.
Post Reply
kosmos
Joined: Tue Apr 22, 2014 2:59 pm
Byond Username: Kingofkosmos

NTSL Scripts

Post by kosmos » #4678

A while back I saw a discussion about NTSL scripts and people were talking about how some of the wiki's scripts don't work anymore and such. I'd like to update them.
So someone said they would do a thread where they would go through which scripts work... but I've not seen the thread. Is it somewhere?

If no, maybe this could be the thread where everyone dumps their awesome scripts for helping out when being an AI / killing your target / goofing around / fucking up the round and other foolery.
User avatar
Stickymayhem
Joined: Mon Apr 28, 2014 6:13 pm
Byond Username: Stickymayhem

Re: NTSL Scripts

Post by Stickymayhem » #4681

I was part of this discussion. I wasn't going to post the thread until I'd had an oppurtunity to go through every known NTSL script on the wiki and the dump thread back on NTstation to see which still worked, along with the errors they gave back.

For now I can say that the advanced job script on the wiki doesn't work, and neither do the mutes. I'll keep working on it and post here when I'm done.
Image
Image
Boris wrote:Sticky is a jackass who has worms where his brain should be, but he also gets exactly what SS13 should be
Super Aggro Crag wrote: Wed Oct 13, 2021 6:17 pm Dont engage with sticky he's a subhuman
kosmos
Joined: Tue Apr 22, 2014 2:59 pm
Byond Username: Kingofkosmos

Re: NTSL Scripts

Post by kosmos » #4755

Stickymayhem wrote:For now I can say that the advanced job script on the wiki doesn't work, and neither do the mutes. I'll keep working on it and post here when I'm done.
Thanks, they are removed. Maybe I'll try to learn how these things work and test them out as well.
AseaHeru
Rarely plays
Joined: Mon Apr 21, 2014 12:26 pm

Re: NTSL Scripts

Post by AseaHeru » #4771

Did you atleast save an archived version? Some servers still use the old system as a secret...
I am located here, lurking in your posts, leaving piles of transparent wordings and being confused. Oh, I also try to map...

This, this is an example of what I leave for you.
Also, these days I mostly play Ursit McStation, mostly because I like roleplay.
kosmos
Joined: Tue Apr 22, 2014 2:59 pm
Byond Username: Kingofkosmos

Re: NTSL Scripts

Post by kosmos » #4781

AseaHeru wrote:Did you atleast save an archived version? Some servers still use the old system as a secret...
They are always available through View History on the NTSL Scipts -page. But sure, I can make an additional archive.
Gun Hog
Joined: Sat Apr 19, 2014 5:19 am
Byond Username: Gun Hog

Re: NTSL Scripts

Post by Gun Hog » #4979

The scripts do not work because of the 'function inside a parameter' error.
Example:

Code: Select all

broadcast ( replace ( "I AM ROGUE", "ROGUE" , "HELP" ) );
This would throw an error, as the replace() function is inside broadcast(). To fix it, simply set the output of the functions to a variable, then use it instead.
Example:

Code: Select all

$holder = replace ( "AI ROGUE", "ROGUE", "HELP" );
broadcast ( $holder );
You do not need to simply purge the current scripts; Fix them instead!
User avatar
Cavoglave
Joined: Sun Apr 20, 2014 12:39 pm
Byond Username: Cavoglave

Re: NTSL Scripts

Post by Cavoglave » #5250

Gun Hog wrote:The scripts do not work because of the 'function inside a parameter' error.
Example:

Code: Select all

broadcast ( replace ( "I AM ROGUE", "ROGUE" , "HELP" ) );
This would throw an error, as the replace() function is inside broadcast(). To fix it, simply set the output of the functions to a variable, then use it instead.
Example:

Code: Select all

$holder = replace ( "AI ROGUE", "ROGUE", "HELP" );
broadcast ( $holder );
You do not need to simply purge the current scripts; Fix them instead!
I don't understand why that's considered an error.
Why was it ever changed? What purpose does preventing function calls in arguments serve aside from slowing down development?
What's next, recursive functions being erroneous?
Gun Hog
Joined: Sat Apr 19, 2014 5:19 am
Byond Username: Gun Hog

Re: NTSL Scripts

Post by Gun Hog » #5286

It was done to reduce lag or some such thing. Anyway, that is how you get around it.
kosmos
Joined: Tue Apr 22, 2014 2:59 pm
Byond Username: Kingofkosmos

Re: NTSL Scripts

Post by kosmos » #5360

Gun Hog wrote:You do not need to simply purge the current scripts; Fix them instead!
Shit. I tried, but can't figure out a situation like this in the Less Annoying Job Indicator script... Could you help out (or anyone who understands the code)? I cannot into code. The only ones reported not working thus far are "Less Annoying Job Indicator", "Selective Mute" and "Cleaner Selective Mute" scripts.
Gun Hog
Joined: Sat Apr 19, 2014 5:19 am
Byond Username: Gun Hog

Re: NTSL Scripts

Post by Gun Hog » #5367

I have repaired them for you. Here is the job one:

Code: Select all

def Initialize() {
$words = vector(
    "Assistant", "Assnt",
    "Captain", "Capt",
    "Head of Personnel", "HoP",
    "Bartender", "Bar",
    "Chef", "Chef",
    "Botanist", "Hydro",
    "Quartermaster", "QM",
    "Cargo Technician", "Cargo",
    "Shaft Miner", "Miner",
    "Clown", "Clown",
    "Mime", "Mime",
    "Janitor", "Jan-r",
    "Librarian", "Lib-n",
    "Lawyer", "Law",
    "Chaplain", "Chapl",
    "Chief Engineer", "CE",
    "Station Engineer", "Engi",
    "Atmospheric Technician", "Atmos",
    "Chief Medical Officer", "CMO",
    "Medical Doctor", "MD",
    "Chemist", "Chem",
    "Geneticist", "G-tic",
    "Virologist", "Viro",
    "Research Director", "RD",
    "Scientist", "Sci",
    "Roboticist", "Robo",
    "Head of Security", "HoS",
    "Warden", "Ward",
    "Detective", "D-tiv",
    "Security Officer", "Sec",
    "AI", "AI",
    "Cyborg", "Borg",
    "Personal AI", "pAI",
    );
    
    $index = 1;
  while($index <= length($words))
 {
	$key = at($words, $index);
	$value = at($words, $index+1);
  mem($key,$value);
  $index += 2;
 }
}

if(mem("initialized") != 1)
{
 Initialize();
 mem("initialized", 1);
}

$foo = "";

if(mem($job)) { $foo = mem($job); }
else { $foo = substr($job, 1, 6); }

if (!find($source, "Unknown") && $job != "No id" && !find($source, " (as ")) {
$source = $source + " (" + $foo + ")"; }
And here is the Cleaner Selective Mute one:

Code: Select all

//recursive implode function, takes a vector and
//combines each member into a string with a space to separate
//by perogi
def implode($vector)
{
	$str = at($vector, 1);
	remove($vector, $str);
	if(length($vector) > 0) 
	{
		$str += " ";
		$str += implode($vector);
	}
	return $str;
}
//mute and unmute function
//use: type /mute or /unmute then the name of the person exactly as it is spelled
//by perogi

$exp = explode($content, " ");

if($source == "YOUR NAME HERE") //only the name in this line can use script
{

	if(at($exp, 1) == "/mute")
	{
		remove($exp, "/mute");
		$name = implode($exp);
		$pass = 0;
		mem($name,$name);
	}
	
	if(at($exp,1) == "/unmute")
	{
		$pass = 0;
		remove($exp, "/unmute");
		$muteremove = implode($exp);
		mem($muteremove, 0);
	}
}
//checks if source is muted
//possible to get around mute by taking off ID and being unknown, hence why unknowns are all blocked
if($source == mem($source) || $source == "Unknown")
{
	$pass = 0;
}
I am not touching the Selective Mute one, as that thing is a beast, and we have a mute script already.
User avatar
paprika
Rarely plays
Joined: Fri Apr 18, 2014 10:20 pm
Byond Username: Paprka
Location: in down bad

Re: NTSL Scripts

Post by paprika » #7548

I wonder if there's a way to put that job one in there by default. It really shouldn't not be in NTSL every round.
Oldman Robustin wrote:It's an established meme that coders don't play this game.
Post Reply

Who is online

Users browsing this forum: No registered users