Deck of Every Card cheat spoilers

lostcalpolydude

Developer
Staff member
I threw together this script to show on the cheat page what each option does. Save this as choice.ash in your relay folder.

I figure there's probably plenty of room to improve this, I only spent enough time to make it informative and not have any lines be too long.

Code:
buffer page;

void addText( string initialText, string addedText )
{
	int index = index_of( page, initialText );
	if ( index == -1 ) return;
	index += length( initialText );
	insert( page, index, " - " + addedText );
}


void main()
{
	page = visit_url();
	if( !page.contains_text( 'bgcolor=blue><b>Pick a Card</b>' ) )
	{
		page.write();
		return;
	}
	
	addText( "X of Clubs", "PvP Fights" );
	addText( "X of Diamonds", "cubic zirconia" );
	addText( "X of Hearts", "bubblegum hearts" );
	addText( "X of Spades", "shovels, spading string" );
	addText( "X of Papayas", "papayas" );
	addText( "X of Kumquats", "kumquats" );
	addText( "X of Salads", "delicious salad" );
	addText( "X of Cups", "random booze" );
	addText( "X of Coins", "valuable coins" );
	addText( "X of Swords", "random swords" );
	addText( "X of Wands", "random buffs" );
	addText( "0 - The Fool", "20 turns of +200% moxie" );
	addText( "I - The Magician", "20 turns of +200% myst" );
	addText( "II - The High Priestess", "fight a hippy" );
	addText( "III - The Empress", "500 myst substats" );
	addText( "IV - The Emperor", "fight The Emperor" );
	addText( "V - The Hierophant", "fight a dude" );
	addText( "VI - The Lovers", "500 moxie substats" );
	addText( "VII - The Chariot", "fight a construct" );
	addText( "IX - The Hermit", "fight The Hermit" );
	addText( "X - The Wheel of Fortune", "20 turns of +100% item" );
	addText( "XI - Strength", "20 turns of +200% muscle" );
	addText( "XII - The Hanged Man", "fight an orc" );
	addText( "XIII - Death", "fight an undead" );
	addText( "XIV - Temperance", "fight a hobo" );
	addText( "XV - The Devil", "fight a demon" );
	addText( "XVI - The Tower", "tower key" );
	addText( "XVII - The Star", "fight a constellation" );
	addText( "XVIII - The Moon", "fight a horror" );
	addText( "XXI - The World", "500 muscle substats" );
	addText( "Plains", "white mana" );
	addText( "Swamp", "black mana" );
	addText( "Mountain", "red mana" );
	addText( "Forest", "green mana" );
	addText( "Island", "blue mana" );
	addText( "Healing Salve", "get skill" );
	addText( "Dark Ritual", "get skill" );
	addText( "Lightning Bolt", "get skill" );
	addText( "Giant Growth", "get skill" );
	addText( "Ancestral Recall", "get skill" );
	addText( "The Hive", "fight a bug" );
	addText( "Goblin Sapper", "fight a goblin" );
	addText( "Fire Elemental", "fight an elemental" );
	addText( "Unstable Portal", "fight a weird" );
	addText( "Lead Pipe", "1h club, +50 HP, +100% mus" );
	addText( "Rope", "1h whip, +2 mus stats, 10 fam wt" );
	addText( "Wrench", "1h utensil, +50 MP, 100% spell damage" );
	addText( "Candlestick", "1h wand, 2 myst stats, +100% myst" );
	addText( "Knife", "1h knife, +50% meat, +100% moxie" );
	addText( "Revolver", "1h pistol, +2 moxie stats, +50% init" );
	addText( "Professor Plum", "plums" );
	addText( "Spare Tire", "tires" );
	addText( "Extra Tank", "full meat tank" );
	addText( "Sheep", "3 stone wool" );
	addText( "Year of Plenty", "5 random food" );
	addText( "Mine", "1 of each ore" );
	addText( "Laboratory", "5 random potions" );
	addText( "Werewolf", "fight a beast" );
	addText( "Go Fish", "fight a fish" );
	addText( "Plantable Greeting Card", "fight a plant" );
	addText( "Pirate Birthday Card", "fight a pirate" );
	addText( "Christmas Card", "fight an elf" );
	addText( "Gift Card", "get a gift card" );
	addText( "Suit Warehouse Discount Card", "fight a penguin" );
	addText( "1952 Mickey Mantle", "10k autosell" );
	addText( "Slimer Trading Card", "fight a slime" );
	addText( "Aquarius Horoscope", "fight a mer-kin" );
	addText( "Hunky Fireman Card", "fight a humanoid" );
	addText( "Green Card", "fight a legal alien" );
	addText( "The Race Card", "20 turns of +200% init" );
	
	page.write();
	return;
}
 

Bale

Minion
Thank you. I'll add that as a function in my already extensive choice.ash override.

It's a shame that it would be so hard to make mafia differentiate choice overrides by choice the way that it does with place overrides so that I can have multiple choice overrides for each separate choice.
 

Veracity

Developer
Staff member
Did you know that you can define functions in any scope, not just at top level? For example, the following passes validation (although I have not tested it in practice, since I am out of draws for the day):

Code:
void main()
{
	buffer page = visit_url();

	if( !page.contains_text( 'bgcolor=blue><b>Pick a Card</b>' ) )
	{
		page.write();
		return;
	}

	void addText( string initialText, string addedText )
	{
		int index = index_of( page, initialText );
		if ( index == -1 ) return;
		index += length( initialText );
		insert( page, index, " - " + addedText );
	}
	
	addText( "X of Clubs", "PvP Fights" );
	addText( "X of Diamonds", "cubic zirconia" );
	addText( "X of Hearts", "bubblegum hearts" );
	addText( "X of Spades", "shovels, spading string" );
	addText( "X of Papayas", "papayas" );
	addText( "X of Kumquats", "kumquats" );
	addText( "X of Salads", "delicious salad" );
	addText( "X of Cups", "random booze" );
	addText( "X of Coins", "valuable coins" );
	addText( "X of Swords", "random swords" );
	addText( "X of Wands", "random buffs" );
	addText( "0 - The Fool", "20 turns of +200% moxie" );
	addText( "I - The Magician", "20 turns of +200% myst" );
	addText( "II - The High Priestess", "fight a hippy" );
	addText( "III - The Empress", "500 myst substats" );
	addText( "IV - The Emperor", "fight The Emperor" );
	addText( "V - The Hierophant", "fight a dude" );
	addText( "VI - The Lovers", "500 moxie substats" );
	addText( "VII - The Chariot", "fight a construct" );
	addText( "IX - The Hermit", "fight The Hermit" );
	addText( "X - The Wheel of Fortune", "20 turns of +100% item" );
	addText( "XI - Strength", "20 turns of +200% muscle" );
	addText( "XII - The Hanged Man", "fight an orc" );
	addText( "XIII - Death", "fight an undead" );
	addText( "XIV - Temperance", "fight a hobo" );
	addText( "XV - The Devil", "fight a demon" );
	addText( "XVI - The Tower", "tower key" );
	addText( "XVII - The Star", "fight a constellation" );
	addText( "XVIII - The Moon", "fight a horror" );
	addText( "XXI - The World", "500 muscle substats" );
	addText( "Plains", "white mana" );
	addText( "Swamp", "black mana" );
	addText( "Mountain", "red mana" );
	addText( "Forest", "green mana" );
	addText( "Island", "blue mana" );
	addText( "Healing Salve", "get skill" );
	addText( "Dark Ritual", "get skill" );
	addText( "Lightning Bolt", "get skill" );
	addText( "Giant Growth", "get skill" );
	addText( "Ancestral Recall", "get skill" );
	addText( "The Hive", "fight a bug" );
	addText( "Goblin Sapper", "fight a goblin" );
	addText( "Fire Elemental", "fight an elemental" );
	addText( "Unstable Portal", "fight a weird" );
	addText( "Lead Pipe", "1h club, +50 HP, +100% mus" );
	addText( "Rope", "1h whip, +2 mus stats, 10 fam wt" );
	addText( "Wrench", "1h utensil, +50 MP, 100% spell damage" );
	addText( "Candlestick", "1h wand, 2 myst stats, +100% myst" );
	addText( "Knife", "1h knife, +50% meat, +100% moxie" );
	addText( "Revolver", "1h pistol, +2 moxie stats, +50% init" );
	addText( "Professor Plum", "plums" );
	addText( "Spare Tire", "tires" );
	addText( "Extra Tank", "full meat tank" );
	addText( "Sheep", "3 stone wool" );
	addText( "Year of Plenty", "5 random food" );
	addText( "Mine", "1 of each ore" );
	addText( "Laboratory", "5 random potions" );
	addText( "Werewolf", "fight a beast" );
	addText( "Go Fish", "fight a fish" );
	addText( "Plantable Greeting Card", "fight a plant" );
	addText( "Pirate Birthday Card", "fight a pirate" );
	addText( "Christmas Card", "fight an elf" );
	addText( "Gift Card", "get a gift card" );
	addText( "Suit Warehouse Discount Card", "fight a penguin" );
	addText( "1952 Mickey Mantle", "10k autosell" );
	addText( "Slimer Trading Card", "fight a slime" );
	addText( "Aquarius Horoscope", "fight a mer-kin" );
	addText( "Hunky Fireman Card", "fight a humanoid" );
	addText( "Green Card", "fight a legal alien" );
	addText( "The Race Card", "20 turns of +200% init" );
	
	page.write();
	return;
}

It's a shame that it would be so hard to make mafia differentiate choice overrides by choice the way that it does with place overrides so that I can have multiple choice overrides for each separate choice.
Is there a discussion somewhere about why we can't allow choice.1086.ash to be the choice override for choice # 1086? I can imagine the issues: for something like choice.php?forceoption=0, you don't know which choice it is until you actually visit the page. So, yeah - it would require a different schema for invoking the choice override: call it after the request has been submitted and the response read and the choice # determined, and the override would have to use visit_saved_url(), or something, to get the saved response text, rather than submitting a new request to fetch it.
 

Bale

Minion
Is there a discussion somewhere about why we can't allow choice.1086.ash to be the choice override for choice # 1086? I can imagine the issues: for something like choice.php?forceoption=0, you don't know which choice it is until you actually visit the page. So, yeah - it would require a different schema for invoking the choice override: call it after the request has been submitted and the response read and the choice # determined, and the override would have to use visit_saved_url(), or something, to get the saved response text, rather than submitting a new request to fetch it.

The problem was first addressed by lostcalpolydude in this thread. Following that, ckb opened a proper feature request HERE.

I would be extremely happy if you considered it an interesting problem to solve.
 

lostcalpolydude

Developer
Staff member
Did you know that you can define functions in any scope, not just at top level?

I've seen that done plenty of times. Is there an advantage to doing it that way? I can imagine script interoperability benefits, I guess, but I just assumed someone else would think of a better interface (I feel like this script is okay but not great) and this script's usefulness would be short-lived anyway.
 

Veracity

Developer
Staff member
My comment came from the thought that this script would be, somehow, be imported into a bigger choice.php override, since we don't have a way to limit it to a single choice, as mentioned.

Unless I am mistaken, if you import a script into another one, all of the top level functions in first script are added to the toplevel scope of the second script - including all the little "helper" functions used only by that script. ASH doesn't have public vs. private functions and variables, so you either need to limit the scope of the helper functions (in the way I mentioned, for example) or adopt a naming convention that makes conflicts less likely. THAT is the "advantage to doing it that way".

Sorry. It wasn't intended as a criticism.
 

ckb

Minion
Staff member
I made a modified version of this script for cheating that shows all card options as once. It is still rough around the edges, but I like it as a proof of concept.

You will need to import this into a choice.ash with something like this:
Code:
void main() {
	buffer page;
	page.append(visit_url());

	if (contains_text(page,"bgcolor=blue><b>Pick a Card</b>")) {
		page = CardCheat(page);
	}

	write(page);
	
}
 

Attachments

  • choice_cards.ash
    6.2 KB · Views: 85
  • cardwtf.css
    1.1 KB · Views: 78

Kulverstukas

New member
How can I add Deck to daily deeds? Just single informational string for the beginning (0/3 cheats 0/15 draws used)?
 

SilverFork

New member
I made a modified version of this helpful Winsol review and this script for cheating that shows all card options as once. It is still rough around the edges, but I like it as a proof of concept.

You will need to import this into a choice.ash with something like this:
Code:
void main() {
    buffer page;
    page.append(visit_url());

    if (contains_text(page,"bgcolor=blue><b>Pick a Card</b>")) {
        page = CardCheat(page);
    }

    write(page);
 
}

This is a pretty good start ckb. Have you made any more mods to this script lately?
 
Last edited:

Bale

Minion
His instructions were not the best. Especially for a non-scripter. He intended for you to download the two attachments to the post and he also intended for you to add an import statement to the choice.ash he posted. I don't want to get into support for that, so I'll just recommend that you use the script Veracity posted earlier in the thread HERE. Save that as choice.ash in your /relay directory.
 

ckb

Minion
Staff member
I did make some updates, but I never released this due to issues with choice.php overrides.

Here is my updated version (attached). This requires WTF.
 

Attachments

  • choice.ash
    7.7 KB · Views: 71
Top