You are viewing the MafiaScum.net Wiki. To play the game, visit the forum.

MafiaWiki:Sysops/iMacros

From MafiaWiki
Jump to navigation Jump to search

iMacros is a browser plugin to automate certain tasks. It's been extremely useful for reducing the amount of time it takes to remove spam pages and block spammers on the wiki. It is available as a free Firefox plugin or as standalone software for Internet Explorer (trial version is free).

Here are three macros I've recorded so far (SysOp only):

Block-Spammer

VERSION BUILD=6071024 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=A ATTR=TXT:User<SP>page
TAG POS=1 TYPE=A ATTR=TXT:Edit
TAG POS=1 TYPE=TEXTAREA FORM=NAME:editform ATTR=ID:wpTextbox1 CONTENT=#NOVAR#{{blocked}}<BR>
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:editform ATTR=ID:wpSummary CONTENT=blocked<SP>automatically
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:editform ATTR=ID:wpMinoredit CONTENT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:editform ATTR=ID:wpSave
TAG POS=1 TYPE=A ATTR=TXT:Block<SP>user
TAG POS=1 TYPE=SELECT FORM=ACTION:http://www.mafiascum.net/wiki/index.php?title=Special:Blockip&action=submit ATTR=ID:wpBlockExpiry CONTENT=%infinite
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://www.mafiascum.net/wiki/index.php?title=Special:Blockip&action=submit ATTR=NAME:wpBlockReason CONTENT=spammer<SP>(automatic<SP>summary)
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:http://www.mafiascum.net/wiki/index.php?title=Special:Blockip&action=submit ATTR=ID:wpAnonOnly CONTENT=NO
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:blockip ATTR=NAME:wpBlock&&VALUE:Block<SP>this<SP>user
TAG POS=1 TYPE=A ATTR=TXT:contribs
Note: This macro is slightly inefficient at the beginning with page loads, to force it to work from either the [[User:]] or [[User_talk:]] page (some wiki users flag spammers on their talk page accidentally). If someone can figure out a clever way to get it to trap the username, please make an update to this macro.

Spam-Deletion

This macro is best used in conjunction with the above macro, to delete spam pages from the Special:Contributions page that it loads as its final act.
VERSION BUILD=6071024 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=A ATTR=TXT:Delete
TAG POS=1 TYPE=LABEL ATTR=TXT:Reason<SP>for<SP>deletion:
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:wpReason CONTENT=automated<SP>spam<SP>removal
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:deleteconfirm ATTR=ID:wpConfirmB
BACK
BACK
BACK
Note: There may be a more clever way of getting back to the Special:Contributions page than BACK/BACK/BACK, but I haven't discovered it yet. Don't accidentally delete pages that should exist with this macro; rollback works well already for pages that have been vandalized.

Version-Fix

This macro starts from the view of an 'old' revision and restores it to the active page. This is very helpful for when multiple spammers have hit the same page before it has been caught.
VERSION BUILD=6111213 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=A ATTR=TXT:Edit
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:editform ATTR=ID:wpSummary CONTENT=Automatically<SP>reverting<SP>to<SP>last<SP>good<SP>version
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:editform ATTR=ID:wpMinoredit CONTENT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:editform ATTR=ID:wpSave

Username-Redirect

This macro traps the user's name and redirects it to the 'username' that is officially linked within the forum.
VERSION BUILD=6071024 RECORDER=FX
SET !EXTRACT_TEST_POPUP NO
TAB T=1
TAG POS=1 TYPE=H1 ATTR=TXT:Editing<SP>User:*
TAG POS=R1 TYPE=B ATTR=TXT:* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=TEXTAREA FORM=NAME:editform ATTR=ID:wpTextbox1 CONTENT=#REDIRECT<SP>[[{{!VAR1}}]]
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:editform ATTR=ID:wpSummary CONTENT=redirect<SP>to<SP>username
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:editform ATTR=ID:wpMinoredit CONTENT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:editform ATTR=ID:wpPreview
Note: The last page this macro loads is a preview only; if the link shown is blue, that means the page you're redirecting to exists, and you should hit Save. If it's red, it means they haven't actually made a page for themselves yet, and the redirect won't work. Either make them a basic page or abort, at that point... maybe later I'll come up with something that can check for a redlink here and branch appropriately.