-Request- Breakfast functionality/collecting "free" items

Yup! You can string together any number of CLI commands as long as you put semi-colons between them.

Note that there are a couple of commands that cannot be followed by another. Alias for instance, for very obvious reasons. There might be another few somewhere that I never use.

The set command doesn't work either unless you include linebreaks. Pretty sure ashq gums it all up as well.
 
Well, ash or ashq work fine as long as you remember that as soon as you've invoked the new language, that's what that cli_execute will be until it's done. If you want to go back to CLI after invoking ASH, you'll need to run a new instance of cli_execute to do so. And if you started with CLI, any future CLI commands need to be spawned using cli_execute to get back.
 
Code:
ashq cli_execute( "ashq cli_execute( "ashq cli_execute( "ashq cli_execute( "ashq cli_execute( "ash print("Nested!");" );" );" );" );" );
 
Code:
ashq cli_execute( "ashq cli_execute( "ashq cli_execute( "ashq cli_execute( "ashq cli_execute( "ash print("Nested!");" );" );" );" );" );

Your quotation marks aren't escaped, so this'll throw a parsing error (expected ")", found ashq).

First few levels:
Code:
ashq cli_execute( "ashq cli_execute( \"ashq cli_execute( \\\"ashq cli_execute( \\\\\"ashq ... \\\\\" );\\\" );\" );" );
 
Oops. Thanks for fixing that!

It's interesting the way that the escape character keeps escalating.
 
Well, ultimately you need your underlying string to look like "cli_execute(\"stuff\");". One \ to escape the quotation mark so it shows up in the underlying string, then two to create a backslash. Since two backslashes are needed to create a backslash in the next layer, that quantity doubles when moving forward.
 
That's still wrong.
Code:
ashq cli_execute( "ashq cli_execute( \"ashq cli_execute( \\\"ashq cli_execute( \\\\\"ashq ... \\\\\" );\\\" );\" );" );
Will execute (each \\ becomes \ and each " becomes ", but without overlap)
Code:
ashq cli_execute( "ashq cli_execute( \"ashq cli_execute( \\"ashq ... \\" );\" );" );

Which looks fine, until you notice that the first \" fails to properly escape the ".

Working from inside:
Code:
ashq ... -- all escaping is inside the ...
ashq cli_execute( "ashq ..." );
ashq cli_execute( "ashq cli_execute( \"ashq ...\" );" ); -- 1x \ on the innermost "
ashq cli_execute( "ashq cli_execute( \"ashq cli_execute( \\\"ashq ...\\\" );\" );" ); -- 3x \ on the innermost "
ashq cli_execute( "ashq cli_execute( \"ashq cli_execute( \\\"ashq cli_execute( \\\\\\\"ashq ...\\\\\\\" );\\\" );\" );" ); -- 7x \ on the innermost "

You need to separately escape each \ and ". So it's not (previous)+2, but (previous)*2+1.
Also, this is why library functions like escape_string (not in ash) exist.

Code:
string text = "ashq ..."; // ... needs to already be correctly escaped
for (int i=10; i-->0; ) { // fortunately ash doesn't have the -- operator
    text = "ashq cli_execute( \"") + escape_string(text) + "\" );";
}
cli_execute(text);
 
LoL! Literally. A friend walked in, feeling annoyed with me, because she thought I overheard something she said in the next room.

Thanks for the lesson!
 
This looks like the right place for this question...can someone tell me how to script retrieving our daily free volcoino? Yeah, I know I'm late to this party. Thanks in advance, whomever takes pity on me! :D
 
Thanks for the reply, and I definitely don't mean to sound ungrateful, but I'm not in need of all the other features of that script. I took a look at the code, and it's way beyond my capabilities to alter without assistance. I really do appreciate the response! <3
 
This is what i am using.

PHP:
if (!get_property("_infernoDiscoVisited").to_boolean() && (get_property("_hotAirportToday").to_boolean() || get_property("hotAirportAlways").to_boolean())) {
	cli_execute("checkpoint");
	if (maximize("disco style 6 min" , false )) {
		print("Grabbing Volcoino from Inferno Disco.", "blue");	
		visit_url( "place.php?whichplace=airport_hot&action=airport4_zone1" );
		run_choice( 7 );
	}
	else print("Not enough disco style to get Volcoino.", "red");	
	outfit("checkpoint");
}
 
This is what i am using.

PHP:
if (!get_property("_infernoDiscoVisited").to_boolean() && (get_property("_hotAirportToday").to_boolean() || get_property("hotAirportAlways").to_boolean())) {
	cli_execute("checkpoint");
	if (maximize("disco style 6 min" , false )) {
		print("Grabbing Volcoino from Inferno Disco.", "blue");	
		visit_url( "place.php?whichplace=airport_hot&action=airport4_zone1" );
		run_choice( 7 );
	}
	else print("Not enough disco style to get Volcoino.", "red");	
	outfit("checkpoint");
}

That looks so much nicer than what I use. lol I think I'll update my script as soon as I get the chance! :)
 
Back
Top