FANDOM


Forums: Yew Grove > HairyBot
Replacement filing cabinet
This page or section is an archive.
Please do not edit the contents of this page.
This thread was archived on 18 September 2012 by TyA.


This is a thread for a bot flag request.

Bot name? - HairyBot, currently an AWB bot

Semi-automated or automated? - Fully automated. Semi-automated is possible but would require a lot of work on my part, so HairyBot would only be on if I was on if this were to happen.

What is the function? - HairyBot will be in IRC, and will allow users to easily fix file links after the file is moved, (apparently similar to TLULbot). As of now, that is the only task it will do (when tested, it proved useful and reliable), but tasks can and hopefully will be added onto HairyBot if this one passes.

How do I operate it? - Just so this can be known, anyone can operate it (and anyone can be denied access from the bot too, if they abuse it ). The syntax is: +fixfile "Old file.png" "New file.png". Yes, the "s are supposed to be there and are important. The old file.png is what it looks for and new file.png is what it replaces. Say you did mess up on the new file.png (as there isn't an error message or a confirmation screen), just do +fixfile "Accidental file.png" "Real file.png".

Bugs -

  1. Currently, it looks for images in the "s, as it only splits the message up into different parts for the variables, so if a file contains a " in it, it should undergo this process, and should be fixed manually.
  2. It might do the same thing as RSWImagerenamerbot and might change the featured image template, but unlike that bot, you'd be able to identify the change easier since it's one file at a time.
  3. HairyBot can only read one request at a time. If he's moving a file and then someone says +fixfile ..., he won't process it and it won't get fixed. Right now, HairyBot only links to the special:whatlinkshere page after logging in, but then doesn't say anything when done. This can be switched though, so when HairyBot is done it'll give a link and say something as "Starting..." after he logs in, if it is a problem.

Source - No, I'm not going to provide the source. As I'm usually updating the script (making it faster, easier to read, yada yada), trying to maintain it on the wiki isn't something that I'd be able to do.

Though this doesn't seem like a big thing, but fixing file links is hard to do sometimes, and trying to get someone with an AWB account, or getting an AWB set up isn't that easy to do. Hopefully this can make it a lot easier

Discussion

Support - Please ask any questions that you have, as I'd be happy to answer. Hair 03:27, September 8, 2012 (UTC)

Comment - I think it would be better to have an out-in list rather than an opt-out list. 22px-Logo.svg.png22#.png 04:07, September 8, 2012 (UTC)

Comment - People need to be aware that a bot will never be as intelligent as a human. There will often be files hidden away through complex linking and transcluding. 222 talk 06:47, September 8, 2012 (UTC)

I don't usually get involved in the business of bot flags, but I have a question -- isn't not providing the bot's source a bad thing? It prevents others from validating the bot's programming, as well as running the bot in the event that its controller goes offline. --Andorin (Talk) (Contribs) 06:52, September 8, 2012 (UTC)

Oppose for now Weak support. Please read through the bug reports for RSW image renamer on User talk:A proofreader/Archive 2 first and answer about the bugs that were found. Namely:

  • What about files in template invocations? What about DropsLine?
  • What about files in templates transcluded by templates, common with userboxes?
  • What about files that have section names and page names under RS:RFD, RS:FIMG, etc.?
  • What if a file to be replaced is Something.png, and in a page there is a reference to Example_something.png?
For the sake of the wiki and its administrators and image maintainers, and for your sake because it's hard to modify such a complex program, I don't want to see a repeat of RSW image renamer.  a proofreader ▸  06:56, September 8, 2012 (UTC)
For your questions, if HairyBot can't find the link in the page it skips, same for userboxes. the RFD and FIMG image I do not know. The underscores will change and HairyBot gives a link to the Special:WhatLinksHere page in IRC. I tested it for a good hour and only time it doesn't save is if it was a underscore first letter in a gallery like "banana.png". It does save galleries like Fswe1's. User:Jr Mime/Signature 12:12, September 8, 2012 (UTC)
  1. In DropLines, he'll be able to replace those images. As he is looking for files such as Example.png and files in [[Brackets]], he'll be able to fix it.
  2. He'll skip over pages if he can't find the file, but he'll still fix the file in the template that it is located in.
  3. As I said in the above section, I don't know if that'll happen, possibly so though. A problem with RSW image renamer though, you could do many files at once, then 1000 edits later, it's hidden in the chaos. Hopefully, it could be identified seeing the file links before moving the file, yes it might be a hassle, but at least it can be found before a problem occurs.
  4. Most likely it'll skip over it, not exactly certain, but that's something I'll need to look into. Hair 15:20, September 8, 2012 (UTC)
3: The latest consensus for RSW image renamer before it died was that it did one image, replaced all of its references, another image, replaced all of its references, and so on.
4. Given the answer to 1 and 2, it looks like your bot would be as permissive as mine about image names, so it would have the suffix replacement bug too. I'm changing to Weak support.  a proofreader ▸  03:12, September 9, 2012 (UTC)

Reluctant oppose - Although I think it could be useful, per Neb and the fact that you're not going to provide the bot's source. Ronan Talk 11:19, September 8, 2012 (UTC)

Support - Why would you need the source either way? The bot is helpful and atm it only skips 1 thing. Oh and it's just like an AWB bot just that it's automatic. User:Jr Mime/Signature 12:12, September 8, 2012 (UTC)

Support - Per Hairr's responses to a_proofje's questions. Of course the person who uses the command will need to check the WhatLinksHere that HairyBot links to once it is finished as confirmation. Per the matter of the source, lets not throw chocolate pudding at a fan here. If he doesn't want to share it at this time, fine. Lets look at the trials he has done with it instead. 22px-Logo.svg.png22#.png 16:43, September 8, 2012 (UTC)

Conditional support - 1. That the bot responds with a message when someone tries to send a new request whilst it is busy, or responds affirmatively when a new request is logged and is being started upon. 2. There is a blacklist for those who submit requests but refuse to check that the filenames have been changed accordingly, possibly being extended to blocking the random visitors to the channel who have yet to register a nick for themselves. I would hope such a feature would never be used, but as shown by RSW image renamer many problems were caused by files being missed and not fixed by those who submitted the request. I would be surprised if the bot shows none of the weaknesses displayed by proof's attempt at this type of task, but with these safeguards I am happy to see how it goes.  —The preceding unsigned comment was added by Cåm (talk) on 21:07, September 8, 2012‎ (UTC).

1. This is a bit of a problem, when HairyBot receives +fixfile, in proper syntax, it executes another script with the correct arguments, whilst performing this script, HairyBot is basically idling in IRC, not parsing messages and not "understanding" any messages while performing this script. This is how it performs the script:
os.system('python fixfiles.py "%s" "%s"' % (old_file, new_file))
Once it finishes the script, it'll then receive all messages during the time of executing the script. Then a problem being, it doesn't execute/parse anything once it does receive the message. I'm trying to make it to work, trust me, but as of today, it's still a thing that I'm trying to get fixed (it's one of my top priorities with HairyBot right now).
2. Yes, I can create a blacklist of users who can't use this function, both by nick and/or cloak. Currently I do have a blacklist of some sort, with it being empty as no one has abused it yet (of course Wink), but I'm planning to have the nicks "RSW-Visitor-1","RSW-Visitor-2", etc.... already blocked off as they shouldn't be trying to fix links.
And regarding everything else, errors should (hopefully) be easy to fix. I'm glad that you think this will work well Big smile! Hair 21:42, September 8, 2012 (UTC)
Look into using threading.Thread to perform your task in parallel with the IRC processing. This gives it the advantage of being able to answer +fixfile with "Busy" if there's a fix going on. For example:
from threading import Thread
 
class FileFixer(Thread):
  def __init__(self, old_name, new_name, user):
    self.old_name, self.new_name, self.user = old_name, new_name, user
 
  def run(self):
    try:
      # use the values of self.old_name and self.new_name here
      self.user.notice("The replacement was successful. Check for missing replacements here: http://runescape.wikia.com/wiki/Special:Whatlinkshere/%s" % self.old_name.replace(" ", "_").replace("(", "%28").replace(")", "%29").replace("%", "%25").replace("?", "%3F"))
    except IOError, e:
      self.user.notice("An error occurred while processing your request: %s" % repr(e))
 
file_fixer = None
 
while True:
  # read from IRC
  if command.starts_with("+fixfile "):
    if file_fixer is not None and file_fixer.is_alive():
      user.notice("I am already fixing a file reference from %s to %s. Try again later!" % (file_fixer.old_name, file_fixer.new_name))
    else: # either there was no thread or it was done
      file_fixer = FileFixer(<parse arguments>)
      file_fixer.start() # spawn a second thread of execution, returning to 'while True' on the first one
 a proofreader ▸  03:24, September 9, 2012 (UTC)
I've switched to to threading (I'm in love with Thread now) and now HairyBot can do the following:
1. Able to listen to the irc whilst fixing files - as seen here...
2. Able to have a queue. - as seen here...
Hope that resolves some issues. Hair 20:42, September 9, 2012 (UTC)

Access list

As this will be an IRC bot, we will need a way to distinguish users for granting them access. What should we use?

  1. A white list of nicknames or cloaks (everyone on the list needs to be approved).
  2. A black list of nicknames or cloaks (everyone is approved, except people blocked from using it).
  3. Trying to apply the wiki's block list when IPs and @wikia/Username cloaks are visible.
  4. Voice (channel mode +v), granted to custodians, like operator (+o) is granted to sysops.
  5. A hybrid of two or more of the options (please specify).
  6. Other (please specify).
 a proofreader ▸  19:58, September 10, 2012 (UTC)
Support 1 and/or Support 4 We could chose all the admins + active custodians. If we only have a blacklist, anyone can come in IRC with a cloak and troll the bot. So, if we do a simple list (I'm missing a lot): All admins, Hairr, Jr Mime, Habblet (if he gets in IRC + cloak), Walrus, Casting Fishes^^, A proof, Michagogo and more, just a little list. But, we could also put them all in the voice channel mode maybe to make less scripting for Hair. User:Jr Mime/Signature 20:07, September 10, 2012 (UTC)
editconflictSupport 4 - Easiest way to limit it to custodians only, IMO, without requiring Hair to look at whatever page lists rights and manually figure out nicks and cloaks. Second choice 1, since I do think it needs to be limited to Custodians only and not allow anyone to a) tie up the bot and b) create hundreds or even thousands of redlinks. Michagogo (talk) 20:09, September 10, 2012 (UTC)

4 1, per apr - Most efficient. If Hairr doesn't want a specific user to be +'d, then it should be left to his discretion. Ronan Talk 20:16, September 10, 2012 (UTC)

I don't like that idea of me being able to choose who can and who can't be voiced. If this were to happen though (suggestion #4), I'd rather have administrators decide who can and can't operate HairyBot, similar to blocking them from the wiki. If they do seem to be causing problems though, then I might ask for removal of their +v.Hair 21:15, September 10, 2012 (UTC)

1 - It is the only one that makes any form of sense. 4 is just silly. 22px-Logo.svg.png22#.png 20:49, September 10, 2012 (UTC)

4 - As it was my idea :p. Haidro (talk) 20:52, September 10, 2012 (UTC)

Or 1, per all. Hairr has made it already, so this would probably be easier to implement. Haidro (talk) 21:33, September 14, 2012 (UTC)
1 - If our use of the bot warrants moving it to a channel like ##hairybot, requiring voice in the current channel would be a hindrance. I can see that happening already: there would be lots of +fixfile invocations in a short time. (Make sure the bot supports private messages, Hair! Wink)  a proofreader ▸  21:12, September 10, 2012 (UTC)
Make sure the bot does not support private messages. There should always be someone else able to see fixfile requests without having to show bots in the RecentChanges. This was why TLULbot didn't reply to fixfile commands outside #wikia-runescape. I think it's okay to have the bot in a seperate channel, but it should not allow PMs. JOEYTJE50TALKpull my finger 09:12, September 11, 2012 (UTC)
Very well. However, HairyBot gives 2 channel messages per file fixed, "Starting..." and "Check any links I missed <Special:WhatLinksHere link here>". Wouldn't this get spammy for large requests? Perhaps the "check links" message could be sent privately.  a proofreader ▸  22:20, September 12, 2012 (UTC)
What if the requester has left the channel before the request is complete due to timing out, etc.? cqm 08:27,15/9/2012 (UTC)

1 - Personally, I find this the best way to easily identify a user without any mishap. Though I do understand why number 4 is a popular choice (just a simple +V then they can operate it), but I think there has been enough IRC voicing problems, this shouldn't be another one. I do think that this should the way to go with HairyBot. This was brought up in IRC today when I logged on, relating to what if that user doesn't have a cloak.. I'm just going to point this out now, before it becomes an idea or before there is any controversy or requests. If they don't have a cloak, then they're telling me they don't want to operate it. I personally don't want to spend the extra hours of my time trying to make it so HairyBot can make sure that @webchat/freenode/29.225.64.89/other-things is that person. They need to simply go to #freenode and request a cloak, takes about 5 minutes and all problems are solved. Besides that, this is very easy to implement into the system. If HairyBot needs a request page of some sort (User:HairyBot/Access?) or if it's a: Are you a custodian or not and can I trust you? thing so a whitelist can be created, please let me know. Hair 21:15, September 10, 2012 (UTC)

Comment - I have a whitelist implemented already and have already tested it withen the IRC. I think this will work much better than trying to track channel modes since it much easier to look for the cloak in the line. Unless someone has something to say against this, a whitelist will be used for HairyBot. Hair 01:52, September 11, 2012 (UTC)

Support 1 - Prevents any issues caused by integrating IRC with the bot. Perhaps another list of users can be given permission to add users to the whitelist (i.e. administrators). After all, access will be restricted to custodians and above? 222 talk 08:24, September 11, 2012 (UTC)

Support 1 - Makes sense. I think admins should be able to add and remove users to/from the list. For example, when someone is abusing the bot, there should be a way to stop him without blocking the bot, even if Hairrr is not available. Also, why are we voting on how the bot will work as if there are no problems? I still see a couple of problems mentioned there (templated images etc), so I'd like to know what the status on those problems is. Are they fixed? Will users get a message saying there are X unfixed files? I think posting a link to a WhatLinksHere page that lists 500 pages, of which there are 10 pages that actually still need to be fixed, will solve the problem. People will just assume the bot got all of them, and those are all in templates, while they can't be sure. Please explain how you're going to try fixing these things. JOEYTJE50TALKpull my finger 09:12, September 11, 2012 (UTC)

Just a little thing, we're voting on how the bot will determine access rights to itself because that will be needed regardless of the presence or absence of problems. Also, you seem to be running off in multiple directions with the rest of your comment, after "why are we voting...?".  a proofreader ▸  18:25, September 15, 2012 (UTC)

Support 1 - Automatically add all custodians and admins to the whitelist, with admins able to edit the whitelist should the need arise (new custodians, taking a user off, change of cloak). Since only custodians+ are able to move files in the first place I see little use for others to have access to the bot unless they have a history of fixing Special:WantedFiles. As for templated files, there is no way around waiting for the cache to update as far as I know, unless the bot can note where it fixes templates in it's contributions for easier reference when checking all files have been fixed. cqm 10:32,11/9/2012 (UTC)

Closed - User:HairyBot will be allowed to run in #rswiki. It will be allowed to run a file link fixer after the trigger has been used by someone on the whitelist. By default, all admins and custodians will be on the whitelist, with changes allowed at the discretion of Hairr and administrators, as they'll both be allowed to modify the whitelist. Any user who uses the command must check the WhatLinksHere page linked from HairyBot, or risk removal from the bot's whitelist. 22px-Logo.svg.png22#.png 02:25, September 18, 2012 (UTC)