What have i done wrong this time

mottsy

Member
As part of my breakfast script, i was planning to ask chatbot for a few things daily.
as we all know, chatbot won't work with kmails, so i was hoping to get this working in chat.

basicly
saved as a .ash
this is what i use to send the message
chat_private( chatbot , booze )
gives me the error of Unknown variable 'chatbot' (Collect.ash, line 1)

if this isnt the right command then could someone please tell me what the right one is, or what i have done wrong
 

Bale

Minion
The problem is that chat_private will only work sending messages to clannies. There isn't currently any function that will do what you want.
 

Spiny

Member
As I understand it, from some other threads in these forums, chat_private() only works for sending messages to people in the same clan. I haven't tried using it myself, it may be that you need quotes around the strings...

maybe...
Code:
chat_private("clanniename","message");
I don't have time to test right now as I need to head to bed, good luck.

Edit: lol... ninja'd by Bale, not surprised though lol :D g'night
 

mottsy

Member
:( bummer

while i've got this thread

would creating super cocktail things be covered under create (itemname)

*feature request time*
 
Last edited:

Grotfang

Developer
I believe I am right in saying that they don't have to be a current clan member to receive messages from chat_private(), they simply need to be on a whitelist. (Just confirmed that - chatbot CAN be messaged if she is on the whitelist).

The reason your function isn't working is because (as Spiny pointed out) you aren't containing the name and message in parentheses.

And supercocktail drinks are (I think) covered by make/create/whatever, so long as you have the appropriate skill.
 

Bale

Minion
would creating super cocktail things be covered under create (itemname)

Yes it will. I do it like this in my aftercore breakfast script.

Code:
item improvement(item [item] upgrade){
	item best;
	int profit = 0;
	int test_profit;
	foreach key in upgrade {
		if(historical_age(upgrade[key])>2) mall_price(upgrade[key]);
		if(historical_age(key)>2) mall_price(key);
		test_profit = historical_price(upgrade[key]) - historical_price(key);
		if(test_profit > profit) {
			best = key;
			profit = test_profit;
		}
	}
	return best;
}

boolean improve_spirits() {
	if(my_class() != $class[disco bandit] && my_class() != $class[accordion thief]) {
		print("You're not a moxie class, so no booze refinement for you.", "blue");
		return false;
	}
	if(stills_available() == 0) {
		print("you have no uses left at the still", "#FFA500");
		return false;
	}
	item [item] upgrade;
	upgrade[$item[bottle of gin]] = $item[bottle of Calcutta Emerald];
	upgrade[$item[bottle of rum]] = $item[bottle of Lieutenant Freeman];
	upgrade[$item[bottle of tequila]] = $item[bottle of Jorge Sinsonte];
	upgrade[$item[bottle of vodka]] = $item[bottle of Definit];
	upgrade[$item[bottle of whiskey]] = $item[bottle of Domesticated Turkey];
	upgrade[$item[boxed wine]] = $item[boxed champagne];
	upgrade[$item[grapefruit]] = $item[tangerine];
	upgrade[$item[lemon]] = $item[kiwi];
	upgrade[$item[olive]] = $item[cocktail onion];
	upgrade[$item[orange]] = $item[kumquat];
	upgrade[$item[soda water]] = $item[tonic water];
	upgrade[$item[strawberry]] = $item[raspberry];
	upgrade[$item[bottle of sewage schnapps]] = $item[bottle of Ooze-O];
	upgrade[$item[bottle of sake]] = $item[bottle of Pete's Sake];
	item still = improvement(upgrade);
	print("Creating " + stills_available()+ " " +upgrade[still]+ " to sell @ "+historical_price(upgrade[still]), "blue");
	retrieve_item(stills_available(), still);
	create(stills_available(), upgrade[still]);
	cli_execute("mallsell * "+ upgrade[still]+ " @ "+ historical_price(upgrade[still]));
	return true;
}

void main() {
   improve_spirits();
}
 

mottsy

Member
Yes it will. I do it like this in my aftercore breakfast script.

Code:
item improvement(item [item] upgrade){
	item best;
	int profit = 0;
	int test_profit;
	foreach key in upgrade {
		if(historical_age(upgrade[key])>2) mall_price(upgrade[key]);
		if(historical_age(key)>2) mall_price(key);
		test_profit = historical_price(upgrade[key]) - historical_price(key);
		if(test_profit > profit) {
			best = key;
			profit = test_profit;
		}
	}
	return best;
}

boolean improve_spirits() {
	if(my_class() != $class[disco bandit] && my_class() != $class[accordion thief]) {
		print("You're not a moxie class, so no booze refinement for you.", "blue");
		return false;
	}
	if(stills_available() == 0) {
		print("you have no uses left at the still", "#FFA500");
		return false;
	}
	item [item] upgrade;
	upgrade[$item[bottle of gin]] = $item[bottle of Calcutta Emerald];
	upgrade[$item[bottle of rum]] = $item[bottle of Lieutenant Freeman];
	upgrade[$item[bottle of tequila]] = $item[bottle of Jorge Sinsonte];
	upgrade[$item[bottle of vodka]] = $item[bottle of Definit];
	upgrade[$item[bottle of whiskey]] = $item[bottle of Domesticated Turkey];
	upgrade[$item[boxed wine]] = $item[boxed champagne];
	upgrade[$item[grapefruit]] = $item[tangerine];
	upgrade[$item[lemon]] = $item[kiwi];
	upgrade[$item[olive]] = $item[cocktail onion];
	upgrade[$item[orange]] = $item[kumquat];
	upgrade[$item[soda water]] = $item[tonic water];
	upgrade[$item[strawberry]] = $item[raspberry];
	upgrade[$item[bottle of sewage schnapps]] = $item[bottle of Ooze-O];
	upgrade[$item[bottle of sake]] = $item[bottle of Pete's Sake];
	item still = improvement(upgrade);
	print("Creating " + stills_available()+ " " +upgrade[still]+ " to sell @ "+historical_price(upgrade[still]), "blue");
	retrieve_item(stills_available(), still);
	create(stills_available(), upgrade[still]);
	cli_execute("mallsell * "+ upgrade[still]+ " @ "+ historical_price(upgrade[still]));
	return true;
}

void main() {
   improve_spirits();
}

bale, if you published half the stuff you made.....

and ill try that, thanks spiny, however, how do i add someone to whitelist
 
Last edited:

Bale

Minion
bale, if you published half the stuff you made.....
If you were to count all the code I've copy-pasted into a bazillion different thread like this one, I probably do publish nearly half of it...

It's just a little tough to track it all down. :cool:
 

mottsy

Member
If you were to count all the code I've copy-pasted into a bazillion different thread like this one, I probably do publish nearly half of it...

It's just a little tough to track it all down. :cool:

with 1500 posts, i think so

bale, i want copies of your breakfast script and adventure script ect ect :)
 

Bale

Minion
Nah, too much of that stuff is awkward and lacking in universal adaptivity. In other words, some of that code needs to be manually changed based on the character and what you're doing with that. I couldn't really publish it.

Tell you what, here's a little bonus for you: An unpublished script I use when I'm in the Sea. It automatically figures out the currently cheapest sushi and infused sake. Then it eats it. Takes all the drudgery out of eating sushi.
 

Attachments

  • Eat Sushi.ash
    5.3 KB · Views: 52
Top