throwing a mug

oly0015

Member
Might just be my luck but I seem to hit a error trying this in the cli...

throw personalized coffee mug at Pet Rock Steve || hi

I keep getting "That item requires a message.", which in csend for example a similar syntax would work for the message. Just me screwing up?
 

jasonharper

Developer
Thrown items which require a message aren't supported yet. It would be somewhat of a pain to do so, since such item do not share a single, consistent way of specifying the message.
 

Theraze

Active member
Not sure if it would work (don't have one), but you could try this tweaked version of slyz's bricking alias.
PHP:
alias smug => ashq if(item_amount($item[personalized coffee mug])==0)abort("You don't have a personalized coffee mug to throw");string s="%%";string trim(string str){matcher m=create_matcher("[\\s]*(.+?)[\\s]*$",str);if (m.find())str=m.group(1);return str;}int i=index_of(s,",");if(i<0)abort("You need to add a message!");string n=substring(s,0,i).trim();string m=substring(s,i+1).trim();print("Throwing a personalized coffee mug at "+n+" with the following message: "+m,"purple");string r=visit_url("curse.php?action=used&whichitem=3280&targetplayer="+n+"&curse=0&message="+m);matcher ma=create_matcher("<td>(.+?)</td>",r);if (ma.find())print(ma.group(1));
 

oly0015

Member
Might be close enough, I've got a mug in my inventory so i'll give it a shot. Only change I think is instead of message its texta, textb, and textc it looks like for the input fields.
 

oly0015

Member
Thanks, I tried this as a test and it worked

PHP:
void main()
{
	string target = "oly0015";
	string message = "moo";
	string message2 = "moo2";
	string message3 = "moo3";

	if(item_amount($item[personalized coffee mug])==0)
		abort("You don't have a personalized coffee mug to throw");

	if (!is_online(target))
		abort(target + " is not online");

	if (message.length()>6)
		abort("message is too long");
	
	if (message2.length()>6)
		abort("message2 is too long");

	if (message3.length()>6)
		abort("message3 is too long");

	print("Throwing a personalized coffee mug at "+target+" with the following message:","green");
	print(message,"green");print(message2,"green");print(message3,"green");

	string url = "curse.php?action=used&whichitem=3280&targetplayer="+target+"&texta="+message+"&textb="+message2+"&textc="+message3;
	string r=visit_url(url);
}
 
Last edited:
Top