User:ReplyBot
This bot is unapproved by BAG. It is being made by User:A930913. When the bot is working, I shall submit it for approval. Until then, I shall test it on my own page, and pages like the sandbox, and perhaps some other users with their permission.
This bot reads Template:A930913Test1 for messages and places the message on the talk page using Template:A930913Test2
Emergency bot shutoff button
Administrators: Use this button if the bot is malfunctioning. (direct link)
Non-administrators can a malfunctioning bot to Wikipedia:Administrators' noticeboard/Incidents.
Code
<?php
include("botclasses.php"); // Botclasses.php was written by User:Chris_G and is available under the GNU General Public License
include("loginfo.php");
echo "Logging in...";
$objwiki = new wikipedia();
$objwiki->login($username, $password);
$transcludes = $objwiki->getTransclusions("Template:A930913Test1");
for ($i = 0; $i < count($transcludes); $i++) {
$contents = $objwiki->getpage($transcludes[$i]);
preg_match_all("/{{2}A930913Test1\|(?!notified=1\|)(.*?)\|(.*?)\|(.*?)}{2}/", $contents, $m);
foreach($m as $message){
if (ord($message[0])== 123){
$startuserpos=strpos($message[0],"{{A930913Test1|")+15;
$enduserpos=strpos($message[0],"|",$startuserpos);
$startmessagepos=$enduserpos+1;
$endmessagepos=strpos($message[0],"|",$startmessagepos);
$startsigpos=$endmessagepos+1;
$endsigpos=strpos($message[0],"}}");
$tempuser=substr($message[0],$startuserpos,$enduserpos-$startuserpos);
$tempmessage=substr($message[0],$startmessagepos,$endmessagepos-$startmessagepos);
$tempsig=substr($message[0],$startsigpos,$endsigpos-$startsigpos);
if($objwiki->nobots("User_talk:".$tempuser,$user)){
$objwiki->addtext("User_talk:".$tempuser,
"{{A930913Test2|".$tempmessage."|".$tempsig."|".$transcludes[$i]."|~~~~}}",
"Message Notification",false,true);
}}}
if($contents!=preg_replace("/{{A930913Test1\|(?!notified=1\|)/","{{A930913Test1|notified=1|",$contents))
{$objwiki->edit($transcludes[$i],preg_replace("/{{A930913Test1\|(?!notified=1\|)/","{{A930913Test1|notified=1|",$contents),"Marking template notified",true,true);
}
?>
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.