CCS inside a script

Pazleysox

Member
If I'm fighting in Itznotyerzits Mine, and I want to use a different skill for each dwarf, how can I script that?

I know about "combat_macro", and how to use it (I think), but how can I script a custom combat for multiple monsters?
 

Pazleysox

Member
string olfact_goth(int round, monster opp, string text) {
if(opp != $monster[Goth Giant])
return get_ccs_action(round);
if(round == 1 && have_effect($effect[On the Trail]) < 1)
return "skill transcendent olfaction";
return get_ccs_action(round - 1);
}

adventure(5 , $location[giant castle], "olfact_goth");

found this.
 

Pazleysox

Member
I'm trying to script the road to the white citadel.

I'm stuck on the choice adventure "Life Ain't Nothin But Witches and Mummies", which has a choice adventure 1st, then 2 more "choice" adventures, where the only choice is to click "ok/continue"
 

ckb

Minion
Staff member
I wrote a script for that once... here it is and here is how I did it:

PHP:
boolean WhiteCastle() {
	//set to always kick in the front door (it is quicker)
	//set_property("choiceAdventure931","3");
	
	cli_execute("create * opium grenade");
	cli_execute("conditions clear");
	
	string qgw = get_property("questG02Whitecastle");
	buffer page;
	while (qgw!="finished") {
		switch (qgw) {
		case "unstarted":
			page = visit_url("guild.php?place=paco");
			page = run_choice(1);
			break;
		case "started":
			adventure(1,$location[Whitey's Grove]);
			break;
		case "step1":
		case "step2":
		case "step3":
		case "step4":
			if (item_amount($item[opium grenade]) < 2) { buy(5,$item[opium grenade],2222); }
			adventure(1,$location[The Road to the White Citadel]);
			break;
		case "step5":
		case "step6":
			//abort("kill the witch!");
			page = visit_url("adventure.php?snarfblat=413");
			if (contains_text(page, "Playing Fetch")) { page = run_choice(1); }
			if (contains_text(page, "value=\"Kick in the front door\"")) { page = run_choice(3); }
			if (contains_text(page, "value=\"Screw it, kick in the front door\"")) { page = run_choice(1); }
			if (contains_text(page, "value=\"So much for the direct approach.\"")) { page = run_choice(1); }
			if (contains_text(page, "Combat: Round")) { page = run_combat(); }
			break;
		case "step7":
		case "step8":
			//abort("explore the chests");
			page = visit_url("adventure.php?snarfblat=413");
			if (contains_text(page, "Playing Fetch")) { page = run_choice(1); }
			if (contains_text(page, "value=\"Investigate the chests\"")) { page = run_choice(1); }
			if (contains_text(page, "value=\"Open the first chest\"")) {
				if (contains_text(page, "value=\"Leave the treasure chamber\"")) {
					page = run_choice(4);
				} else {
					page = run_choice(1);
				}
			}
			if (contains_text(page, "value=\"Examine some more chests\"")) { page = run_choice(1); }
			if (contains_text(page, "value=\"Return to the chests\"")) { page = run_choice(2); }
			if (contains_text(page, "Combat: Round")) { page = run_combat(); }
			break;
		case "step9":
			adventure(1,$location[The Road to the White Citadel]);
			break;
		case "step10":
		case "step11":
			page = visit_url("shop.php?whichshop=whitecitadel");
			page = visit_url("guild.php?place=paco");
			break;
		}
		qgw = get_property("questG02Whitecastle");
	}
	
	if (qgw=="finished") { return true; }
	return false;
	
}
 

Pazleysox

Member
I wrote a script for that once... here it is and here is how I did it:

very interesting. I'm going to take parts of your script, and see if I can meld them with mine, and try to get mine to work.

If mine doesn't work, then I'll just use yours! :) No sense in reinventing the wheel.

I do have a few tweaks in mine that I will keep in. If you haven't done the meatcar quest, it won't run the script, and it will only buy upto the needed 10 opium grenades.
 
Top