Jump to content

User:GeorgeMoneyBot-status

From Wikipedia, the free encyclopedia

GeorgeMoneyBot-status (BRFA · contribs · actions log · block log · flag log · user rights)

Function

[edit]

This bot updates status changers. Simple as that.

Info

[edit]

For more info, see the BRFA: Wikipedia:Bots/Requests for approval/GeorgeMoneyBot-status

It is written in PHP using GM Wikipedia Bot framework.

  • It changes the status of a user, who has a status-changer, based on what they do on irc.
  • For example:
    • If I am GeorgeMoney and I change nicks to GeorgeMoney|Away, it sets User:GeorgeMoney/status to 'away'.
    • If I am GeorgeMoney|Away and change my nick to [[link]] (a nick that is not set within the bot), it will set me to 'here'
    • If I am GeorgeMoney and change nick to GeorgeMoney|here nothing happens and an edit is not made (because the status is the same). This prevents from making null edits.
    • If I am GeorgeMoney and I join #GeorgeMoney-status, it sets me to 'here'.
    • If I am GeorgeMoney|Away and I join, it sets me to 'away'
    • If I am anything at all and i QUIT or PART the channel, it sets me to 'out'
    • If I am GeorgeMoney but have not spoken for 30 minutes, it sets me to 'idle'
  • Note that all of these statuses and nicks are set in the config for each user.
  • If someone types !status foo it sets their status to 'foo'. If someone types !status %var(foo), it sets their status to whatever they have set for the nick 'foo'.

How to register

[edit]
  • Create a subpage of yours called User:YOURNAME/StatusConfig
  • The contents should be something similar to (I know it looks long and confusing, but if you actually look it through, it is really simple):
{{User:GeorgeMoneyBot-status/Register}}

<pre><nowiki>
#dont forget that you must be in #GeorgeMoney-status for anything to work
#remember to replace all instances of GeorgeMoney with your nick
#nicks
GeorgeMoney=here
GeorgeMoney_=%var(GeorgeMoney)
GeorgeMoney|away=away
georgemoney|busy=<span style="color: red;">I am busy right now.</span>
#for a more details on the format for %time, see http://php.net/date
georgemoney|readyForChat=I am online with the nick %nick. I have been online since %time(F d, Y; h:i a)

#if the nick to which you change is not set in the config:
#for example a nick like "GeorgeMoney|randomLinkedNickIJustMade"
*=%var(GeorgeMoney)

#if you leave the channel or quit irc
exit=<b>out</b>

#if you join on a nick that is not set above.
join=I am <span style="color:green">here</span>

#what to set if you've gone idle?
#all times are UTC
idle=I have been idle since %time(F d, Y; h:i a)

#what is the threshold till you become idle?
#it can be a value like 10m for 10 minutes, or 10h for 10 hours, or 10d for 10 days
#if you don't want idle detection enabled, make the value just plain '0'
idle_time = 30m

#nicks that are allowed to be set idle
#this is because you dont want foo|away to be set idle
idle_allowed=georgemoney georgemoney_ georgemoney|readyForChat

#your irc hostname
#make sure you spell it correctly.
host=wikipedia/georgemoney

#page to update status
#must be in your userspace
page=User:GeorgeMoney/status
</nowiki></pre>
  • You can type !status foo in #GeorgeMoney-status to override any of this.
  • You can use any mix of wikicode, parser functions, html, and bot variables (%time(), %var(), and %nick) inside the statuses. %time(timeformat) is a time format based on http://php.net/date. %var(variablename) where variablename is anything before the equals sign specified in the config. %nick is the current nick.
  • The page to update status (variable name is 'page') should be a blank page where the status will go. A suggestion is to have the page to update status (variable name is 'page') included by a switch statement. The switch will determine your status from there. If you have no idea what any of that means, copy User:GeorgeMoney/status, User:GeorgeMoney/status/template, and User:GeorgeMoney/status/div to your userspace. Then just replace all instances of 'GeorgeMoney' with your username inside the wikicode of each of those pages.
  • When you're ready to go, just join #GeorgeMoney-status on freenode.

BRFA status

[edit]

Approved.