WTF Relay script collection

ckb

Minion
Staff member
I updated my SkillsWTF to work with the new skillz.php page. It now just puts the familiar WTF table at the top of the page, preserving the new interface below.
More might be done later, but I still like my interface and my highlighting batter than the giant ugly icons and those slow pop-up descriptions. I much prefer being able to see all my skills at one and all the pretty color-coded descriptions at once.
 
I updated my SkillsWTF to work with the new skillz.php page. It now just puts the familiar WTF table at the top of the page, preserving the new interface below.
More might be done later, but I still like my interface and my highlighting batter than the giant ugly icons and those slow pop-up descriptions. I much prefer being able to see all my skills at one and all the pretty color-coded descriptions at once.
Yay! I'm glad this skills script is back.
 

PsyMar

Member
Just tried to install shopWTF. When loading Mafia, got the following error:

shopWTF.ash could not be found (shop.ash, line 1)

Upon uninstalling and reinstalling the script, it seems the file is called "ShopWTF.ash" with a capital S, which matters on Linux (I am running Ubuntu 12.04).

I'll fix it by hand for now, but if you could fix it in your copy I think that'd help more people.

EDIT: To fix it I had to change both shop.ash and store.ash's line 1 "import".

EDIT again: Ugh, now it can't find wtf.ash. Is that in one of your other WTF scripts?
 
Last edited:

Immelan

New member
Are there plans to update this for Ed runs, being as all the items in the Everything Under the World store are quest items?
 

ckb

Minion
Staff member
Shops and Stores are updated, and this should fix the Ed store Quest item issue.
Also, all wtf related things have been updated to work with the newly modified string modifiers functions.
 

Magus_Prime

Well-known member
With the last update to shopwtf.ash I receive the following while visiting any shop, I haven't tested them all, with r15495:

Code:
shopwtf.ash could not be found (shop.ash, line 1)

What, if any, additional information would be helpful to figure out what is happening?
 
Last edited:

ckb

Minion
Staff member
With the last update to shopwtf.ash I receive the following while visiting any shop, I haven't tested them all, with r15495:
Code:
shopwtf.ash could not be found (shop.ash, line 1)
What, if any, additional information would be helpful to figure out what is happening?

I renamed a few scripts to make it easier for those with a case-sensitive OS (like unix). This might be causing issues. Try removing the script and re-installing it from the script manager. That usually fixes this type of thing.

Edit: this looks exactly like what is happening. SVN adds the new file 'shopwtf.ash', then deletes the old file 'ShopWTF.ash', but the delete happens without case sensitivity, so the new 'shopwtf.ash' also get deleted. Deleting the project and re-installing does fix it.
 
Last edited:

ckb

Minion
Staff member
A new WTF has been added (see first post): Inventory WTF. It will display WTF-style information about the items in your inventory below their name.

Also, added a note about wtf.ash. Its a nice way to get decorated modifiers of effects and items (as happens on the WTF scripts). Easy to add to your own relay script if you want to.
 
Last edited:

Bale

Minion
I'd like to report a bug and a bug fix.

When using shopWTF, in Ed's underground it will remove the "Buy" button for every item I already own one of. Because they are all quest items. Unfortunately I often want to purchase more.

I'm troubled by the fact that above you say you fix the "Ed store Quest item issue" so I am wondering if this is some local issue for me. Anyway, my fix is simply this change to line 19 of ShopWTF.ash

Code:
	if (it.quest && available_amount(it)>0 && form_field("whichshop") != "edunder_shopshop") { return true; }
 

ckb

Minion
Staff member
I'd like to report a bug and a bug fix.
... change to line 19 of ShopWTF.ash

This looks like a similar but different issue than the previous, but still ties to the fact that I renamed ShopWTF.ash to shopwtf.ash. (because my code does almost exactly what you suggest above).

Try deleting this from svn and reinstalling.
 

Bale

Minion
I'd like to make a feature request for Shops WTF.

For shops like "The Crackpot Mystic's Shed" and "Xiblaxian 5D Printer" where new items are assembled from a collection of raw materials it is troublesome to have to look at the bottom and compare the list there to the items in the purchase rows.

What would be better is if there was a final item row titled "Available Quantity" (without a buy button obviously) which just listed the quantities of that item. That way I could scan down and below the list of how many "chunks of Xiblaxian circuitry" I need to make an item is the number of chunks of Xiblaxian circuitry that I actually possess. Then next will be my quanitity of Xiblaxian polymer and so forth.

Is that clear?
 

heeheehee

Developer
Staff member
I think I understand what you were saying, Bale. I didn't like how KoL structures shop.php fundamentally (as it makes this more complicated to deal with), so I made some changes of my own to the table layout. Proof of concept if ckb wants to steal, with attached screenshot:
Code:
void main()
{
    buffer page;
    page.append(visit_url());
    matcher m = create_matcher("<p><b>You have:</b>(.*?</table>)", page);
    string [item] ingredients;
    string [int] rows;
    if (m.find()) {
	page = page.replace_string(m.group(0), "");
	string table = m.group(1);
	m = create_matcher("<td><img.*? title=\"(.*?)\"></td>", table);
	while (m.find() && m.group(1).to_item() != $item[none]) {
	    ingredients[m.group(1).to_item()] = m.group(0);
	}
	m = create_matcher("<input type=hidden name=action value=buyitem><br>(<table.*?</table>)", page);
	if (m.find()) {
	    table = m.group(1);
	    buffer newtable;
	    newtable.append(table.substring(0,table.index_of("<tr rel")));
	    newtable.append("<tr><td colspan=3></td>");
	    foreach it in ingredients {
		newtable.append(ingredients[it]);
	    }
	    newtable.append("</tr>");
	    newtable.append("<tr><td colspan=3><b>You have:</b></td>");
	    foreach it in ingredients {
		newtable.append("<td><b>" + item_amount(it) + "</b></td>");
	    }
	    newtable.append("</tr>");

	    m = create_matcher("(<tr rel.*?    </a></td>)(.*?)(<td valign=center><input class=\"button doit.*?</tr>)", table);
	    while (m.find()) {
		int [item] ingred_count;
		newtable.append(m.group(1));
		matcher thing = create_matcher("title=\"(.*?)\"></td><td><b>(\\d+)</b>", m.group(2));
		while (thing.find() && thing.group(1).to_item() != $item[none]) {
		    ingred_count[thing.group(1).to_item()] = thing.group(2).to_int();
		}
		foreach it in ingredients {
		    newtable.append("<td><b>" + ingred_count[it] + "</b></td>");
		}
		newtable.append(m.group(3));
	    }
	    newtable.append("</table>");
	    page.replace_string(table, newtable).write();
	}
    }
}
http://i.imgur.com/satmQS6.png

edit: it is a bit finicky for shops that sell things for meat. I spent some more time messing around with this.
 
Last edited:

Bale

Minion
Yes! That is what I was talking about! Putting the available quantity of each currency in the column with its cost is much more intuitive and saves a lot of troublesome table referencing, especially when the two things are in different orders. (For the 5D printer the columns are in a different order than the quantity listing at the bottom and it was driving me crazy!)
 

heeheehee

Developer
Staff member
(last threadjack, promise!)

I spun off a SVN script based off of the above, but somewhat cleaner aesthetically, I think.
Code:
svn checkout http://svn.code.sf.net/p/mafiashopoverride/code
 

Magus_Prime

Well-known member
ShopWTF throws an error in the gCLI after purchasing from the Mayo Clinic.

Code:
buy 1 Mayo Minder™ for 4750 each from The Mayo Clinic
You spent 94 Meat
You acquire an item: Mayo Minder™
> Shop WTF: item "Only 1 left in stock!" not found.

use 1 Mayo Minder™
Took choice 1076/6: unknown
choice.php?pwd&whichchoice=1076&option=6

buy 1 miracle whip for 9500 each from The Mayo Clinic
You spent 9,500 Meat
You acquire an item: miracle whip

It may be cosmetic but I wanted to mention it.
 
Top