{\rtf1\mac\ansicpg10000\cocoartf\nisusversion50300 {\*\nisusorigapp Cocoa}{\*\nisusorigdate\yr2023\mo12\dy3\hr14\min15 }{\*\nisussysvers 14.1.2}\deff0 {\*\fonttbl {\f0\fswiss\fcharset77 Helvetica;} {\f1\fswiss\fcharset77 Helvetica-Bold{\*\falt Helvetica};} {\f2\fmodern\fcharset77 Menlo-Regular{\*\falt Menlo};}} {\colortbl ;} {\*\nisustoctable {\nisustoc\tcf68 {\nisustocname Default TOC}{\*\nisustoctabrep }{\*\nisustocretrep }{\nisustoclevelstyle TOC 1}{\nisustoclevelstyle TOC 2}{\nisustoclevelstyle TOC 3}{\nisustoclevelstyle TOC 4}{\nisustoclevelstyle TOC 5}{\nisustoclevelstyle TOC 6}{\nisustoclevelstyle TOC 7}{\nisustoclevelstyle TOC 8}{\nisustoclevelstyle TOC 9}}\nisusactivetoc68 } {\*\nisusxetable {\nisusxe\xef68 {\nisusxename Default Index}{\nisusxeheaderstyle Index Heading}{\nisusxelevelstyle Index 1}{\nisusxelevelstyle Index 2}{\nisusxelevelstyle Index 3}{\nisusxelevelstyle Index 4}{\nisusxelevelstyle Index 5}{\nisusxelevelstyle Index 6}{\nisusxelevelstyle Index 7}{\nisusxelevelstyle Index 8}{\nisusxelevelstyle Index 9}{\*\fldinst INDEX \\k ". " \\g \endash \\e "\tab " \\l ", " \\f D}}\nisusactivexe68 } {\stylesheet {\s104\snext104 \ltrpar\pardirnatural\ql\widctlpar\sb0\sa0\sl240\slmult1\hyphpar1\li0\lin0\fi0\ri0\rin0 Header;} {\s105\snext105 \ltrpar\pardirnatural\ql\widctlpar\sb0\sa0\sl240\slmult1\hyphpar1\li0\lin0\fi0\ri0\rin0 Footer;}} \defformat {\*\generator Nisus Writer Express 4.3 [0503.0004.01]}{\info {\*\nisusgmtoffset -5:00}{\author Admin}{\creatim\yr2021\mo2\dy5\hr17\min6 }{\revtim\yr2023\mo12\dy3\hr14\min16 }} {\*\userprops }\nisusrulerunits0\nisusstatusbar1\nisusareaid1\viewkind4\viewscale100\nisusviewruler1\nisusviewrulerh1\nisusviewrulerv0\nisusviewtoolbar1\nisusviewtooldrawer0\nisusviewtoolswidth0\nisusviewpagenumtype1\nisusviewrulericons0\donotshowcomments1 {\*\nisusviewsettings\viewkind4\viewscale100 {\nisusnavsettings {\*\visible 0}{\*\width 160}{\*\isOnRightSide 0}{\*\mode toc}{\*\sort location}}{\nisuscommentsettings {\*\visible 0}{\*\showPane 1}{\*\isOnRightSide 0}{\*\width 180}{\*\titlebarInfo 2}{\*\showTextHighlighting 1}{\*\showGutterIcons 1}}{\nisusrevisionsettings {\*\visible 0}{\*\showPane 1}{\*\isOnRightSide 1}{\*\width 180}{\*\titlebarInfo 4}{\*\showTextHighlighting 1}{\*\showGutterIcons 1}}} {\*\nisusviewsettings\viewkind1\viewscale100 {\nisusnavsettings {\*\visible 0}{\*\width 160}{\*\isOnRightSide 0}{\*\mode toc}{\*\sort location}}{\nisuscommentsettings {\*\visible 0}{\*\showPane 1}{\*\isOnRightSide 0}{\*\width 180}{\*\titlebarInfo 2}{\*\showTextHighlighting 1}{\*\showGutterIcons 1}}{\nisusrevisionsettings {\*\visible 0}{\*\showPane 1}{\*\isOnRightSide 1}{\*\width 180}{\*\titlebarInfo 4}{\*\showTextHighlighting 1}{\*\showGutterIcons 1}}} \nisusareasplitv0 {\*\nisuswindow\x128\y132\w613\actualw613\h631 } \nshwinv0\nshwpg1\nisusinlinespell0\nisushyphnone\spltpgpar\nisusselectstart1204\nisusselectlength0\fet2\ftnbj\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\pgnstart1\nocolbal \f0 \sectd\endnhere\cols1\ltrsect\colbalsxn0\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1440\margbsxn1440\guttersxn0\headery720\footery360\pgncont\pgndec\sxnstarts1\sxnrestart\sxndec {\header\plain\pard\s104\ltrpar\pardirnatural\ql\widctlpar\f0\fs28 } {\footer\plain\pard\s105\ltrpar\pardirnatural\ql\widctlpar\f0\fs28 } \deftab720 {\*\nisusscroll\nisusarea1\xoffset0\yoffset2 }{\pard\ltrpar\pardirnatural\qc {\f1\fs28\b Advice and Commands for Pywikibot}{\fs28 \par based on https://www.mediawiki.org/wiki/Manual:Pywikibot/Scripts\par }} {\pard\ltrpar\pardirnatural\ql {\fs28 \par {\ul Logging in\par } If the bot isn't logged into the wiki with a designated bot user account, run:\par \f2\fs24 python pwb.py login{\f0\fs28\ul \par \par Throttling a script}\f0\fs28 \par For safety's sake and to not overload the wiki, you should limit the rate of your API calls. Bot scripts will automatically throttle themselves according to the value of "put_throttle" in user-config.py, but if you are performing an operation by calling a bot script multiple times then you must implement your own external throttle. For working examples, see my Bash scripts.\par \par {\ul Running a script}\par See "Read-me.rtf".\par \par {\ul Category renaming}\par {\f2\fs24 python pwb.py category move -from:"Art by Okita" -to:"Art by Alex Okita"}\par \par {\ul General text replacement}\par {\f2\fs24 python pwb.py replace -page:pagetitle "old text" "new text" -summary:"something"}\par Use "-simulate" to perform a dry-run.\par Add "-always" to save edit without prompting. {\ul Not} using this will allow a -simulate run to show you what changes will actually be made. For working examples of how to use "replace", see my Bash scripts.\par \par {\ul Batch uploading}\par \f2\fs24 python pwb.py upload -keep -noverify -abortonwarn /folder/with/imgs/ "[[Category:Some image cat]]"{\f0\fs28\nisusselectcaret \par } \f0\fs28 \par {\ul Page scope arguments}\par There are a ton of ways to select pages on which to run a Pywikibot script on besides specifying a single page with "-page". Not only are there -cat and -catr (all pages recursively under that cat), but also -ns, -grep, -subpage, -titleregex, -wantedpages, -transcludes, -start (proceeds from that point alphabetically), -imagesused (on a given page), -links (to other pages from a given page), -filelinks (image links on given page), and much more. See "Generator and replace options.txt" for details.\par }} }