How many pineapples does it take to change a taxidermist?

For script writing
Post Reply
User avatar
wyli romesco
Spy vs. Pie
Posts: 81
Joined: Wed May 07, 2014 6:39 am

How many pineapples does it take to change a taxidermist?

Post by wyli romesco » Tue Nov 25, 2014 12:17 am

Finally here it is, procedural humour for the masses. Should one woman really be allowed to wield such vast power?

"I am become hilarity, destroyer of worlds."

Code: Select all

void main ()
{
	boolean [string] chatPeeps = who_clan();
	foreach peepName in chatPeeps
		if (chatPeeps[peepName] == true)
		{
			cli_execute("throw warbear procedural hilarity drone at "+peepName);
			print (peepName+" has been sent some hilarity!","blue");
		}
}
Yeah, so it takes warbear drones from your inventory and throws them at clannies who are actively listening to clan chat. Thanks to Paffers for letting me throw drones at him until one actually hit :)

For Lolli, obvsly.

User avatar
lostcalpolydude
Forum Maestro
Posts: 2940
Joined: Wed Apr 23, 2008 6:54 pm

Re: How many pineapples does it take to change a taxidermist

Post by lostcalpolydude » Tue Nov 25, 2014 7:18 am

A small note, you don't actually need a main() function in scripts. It doesn't hurt anything and generally doesn't matter either way, it just uses a few more lines of code.
bmaher: Softcore character
lostcalpolydude: Hardcore character (abandoned)

littlelolligagged
Leader of Heck
Posts: 677
Joined: Tue Aug 23, 2011 10:42 am

Re: How many pineapples does it take to change a taxidermist

Post by littlelolligagged » Tue Nov 25, 2014 8:58 am

Thanks!

Question - can we make it grab the listeners in /clan, too?

User avatar
wyli romesco
Spy vs. Pie
Posts: 81
Joined: Wed May 07, 2014 6:39 am

Re: How many pineapples does it take to change a taxidermist

Post by wyli romesco » Tue Nov 25, 2014 9:45 am

littlelolligagged wrote:Thanks!

Question - can we make it grab the listeners in /clan, too?
Yep, that's actually simpler. The following version will grab everyone in channel /clan, both those actively participating and those just listening:

Code: Select all

void main ()
{
	boolean [string] chatPeeps = who_clan();
	foreach peepName in chatPeeps
	{
		cli_execute("throw warbear procedural hilarity drone at "+peepName);
		print (peepName+" has been sent some hilarity!","blue");
	}
}

littlelolligagged
Leader of Heck
Posts: 677
Joined: Tue Aug 23, 2011 10:42 am

Re: How many pineapples does it take to change a taxidermist

Post by littlelolligagged » Tue Nov 25, 2014 9:51 am

You're the best! Thanks again!

(and see, being unsubtle about stroking your fragile male ego is highly effective)

User avatar
Pantsless
Fie the Pie
Posts: 1011
Joined: Fri Aug 15, 2008 4:23 pm

Re: How many pineapples does it take to change a taxidermist

Post by Pantsless » Tue Nov 25, 2014 5:11 pm

Oooh, this script is close to being something I've wanted for a while, namely, a script to jawbruise (or wang, or other curse item) everyone in every chat channel (maybe I'd skip /newbie). If someone could help me solve the following potential problems I would really appreciate it:

1. Remove duplicate entries; I don't want to jawbruise someone 3 times just because they are in /games, /radio, and /hardcore.

2. Don't abort on failing to jawbruise someone just because they are in hardcore or ronin; simply move on to the next person on the list. (This might be a non-issue, actually).

EDIT:

3. [clan] BmAHer: mafia is designed to not let you interact with public chat channels

Okay, knowing that the last one will make this tricky, I will pay a bounty of 6 million meat for anyone who can make this script for me.

EDIT 2:

[clan] BmAHer: maybe you can cli_execute( "/who normal" ) and then parse the response, i guess that would work
[quote="Serra725"]What did you use for the structural part of the bear?[/quote]

littlelolligagged
Leader of Heck
Posts: 677
Joined: Tue Aug 23, 2011 10:42 am

Re: How many pineapples does it take to change a taxidermist

Post by littlelolligagged » Mon Dec 15, 2014 9:03 pm

So, wyli (or anyone else)

I'd like to make the script ignore the chatbots now that they have returned, and I'd also like to have it automatically whitelist to each of the clans to send hilarity. What needs to be added?

User avatar
wyli romesco
Spy vs. Pie
Posts: 81
Joined: Wed May 07, 2014 6:39 am

Re: How many pineapples does it take to change a taxidermist

Post by wyli romesco » Wed Dec 17, 2014 11:07 am

There you go. It takes you on a little tour of the clans, but you eventually end up back where you started.

Code: Select all

void drone_strike (string peepName)
{
	if (contains_text(peepName,"AFH") || contains_text(peepName,"devster") || peepName == "MonocleBot" || peepName == my_name ())
		return;
	cli_execute("throw warbear procedural hilarity drone at "+peepName);
	print (peepName+" has been sent some hilarity!","blue");
	return;
}

void main ()
{
	string startClan = get_clan_name();
	foreach clanName in $strings [hell,heck,hobopolis]
	{
		chat_macro ("/whitelist alliance from "+clanName);
		boolean [string] chatPeeps = who_clan();
		foreach peepName in chatPeeps
		{
			drone_strike (peepName);
		}
	}
	chat_macro ("/whitelist "+startClan);
}
Last edited by wyli romesco on Wed Dec 17, 2014 2:50 pm, edited 2 times in total.

User avatar
lotsofphil
Leader of rum ham
Posts: 4075
Joined: Mon Mar 01, 2010 3:56 pm

Re: How many pineapples does it take to change a taxidermist

Post by lotsofphil » Wed Dec 17, 2014 11:31 am

wyli romesco wrote:

Code: Select all

	if (contains_text(peepName,"AFH") || peepName == "MonocleBot" || peepName == my_name ())
You just ruined MonocleBot's Christmas.

User avatar
lightwolf
AFH
Posts: 426
Joined: Mon Feb 22, 2010 6:16 pm

Re: How many pineapples does it take to change a taxidermist

Post by lightwolf » Wed Dec 17, 2014 2:32 pm

lotsofphil wrote: You just ruined MonocleBot's Christmas.
Yay! :D

littlelolligagged
Leader of Heck
Posts: 677
Joined: Tue Aug 23, 2011 10:42 am

Re: How many pineapples does it take to change a taxidermist

Post by littlelolligagged » Wed Dec 17, 2014 2:41 pm

Poor Monocle Bot gets no hilarity until Monocle Bot starts sharing hilarity with everyone.

User avatar
wyli romesco
Spy vs. Pie
Posts: 81
Joined: Wed May 07, 2014 6:39 am

Re: How many pineapples does it take to change a taxidermist

Post by wyli romesco » Thu Dec 18, 2014 1:08 am

lotsofphil wrote:
wyli romesco wrote:

Code: Select all

	if (contains_text(peepName,"AFH") || peepName == "MonocleBot" || peepName == my_name ())
You just ruined MonocleBot's Christmas.
Pip pip cheerio!

Post Reply