1. New to the forums? Check out our Mentorship Program!
    Our mentors will answer your questions and help you become a part of the community!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.

scms bot framework

Discussion in 'Site Projects' started by chaos, Oct 16, 2007.

  1. chaos

    chaos
    is a member of the Site Staffis a Battle Server Administratoris a Programmeris a Smogon IRC SOPis a Contributor to Smogonis an Administratoris a Tournament Director Alumnusis a Researcher Alumnus
    Owner

    Joined:
    Dec 18, 2004
    Messages:
    9,779
    I made this thread for two reasons.

    A) to warn people to not make frivolous edits that can be made with a machine

    and more importantly

    B) to show off

    so. First order of business. Don't waste time making edits like e -> é; we can do that automatically.

    Second order of business. I just made a bot that shows you the differences on the command prompt of mass edits and asks you if you want to make the changes.

    Code:
    [/home/betawww/smogon] python
    Python 2.5.1 (r251:54863, Oct 11 2007, 15:31:19)
    [GCC 3.4.4 [FreeBSD] 20050518] on freebsd6
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from smogon.tools import *
    >>> bot = botfn.askbot(lambda t: (t.replace("cool", "gay"), "shit"))
    >>> bots.revision_editor(bot)
    - <p>Though Aipom is certainly very cool, it's not very useful. That's a shame, but it's fun to use on favorites teams and the like.</p>
    ?                                   ^^^^
    
    + <p>Though Aipom is certainly very gay, it's not very useful. That's a shame, but it's fun to use on favorites teams and the like.</p>
    ?                                   ^^^
    
    Apply edit (y/n)?
    
    for those who arent coding literate, i made a bot that replaces every instance of "cool" with "gay" with the edit reason "shit". the revision editor bot goes through every current revision and shows me all the changes it would make and then asks me if i want to do them.

    thats fucking cool. im awesome.
  2. CaptKirby

    CaptKirby

    Joined:
    Nov 4, 2006
    Messages:
    7,159
    that is super awesome
  3. Jackal

    Jackal I'm not retarded I'm Canadian it's different
    is a Tournament Director Alumnusis a Site Staff Alumnusis a Super Moderator Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Dec 20, 2004
    Messages:
    6,152
    Sweet, i just started my computer programming course this year and I kind of understand whats going on there. Python looks neat.

    That will obviously be very useful.
  4. Aeolus

    Aeolus Bag
    is a Tutor Alumnusis a Tournament Director Alumnusis a Site Staff Alumnusis a Battle Server Admin Alumnusis a Smogon IRC SOp Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Sep 12, 2005
    Messages:
    3,639
    den palmadas!
  5. Mekkah

    Mekkah
    is a Super Moderatoris a Tutor Alumnusis a Site Staff Alumnusis a Smogon IRC SOp Alumnusis a CAP Contributor Alumnusis a Contributor Alumnusis a Smogon Media Contributor Alumnusis an Administrator Alumnus
    Super Moderator

    Joined:
    Feb 8, 2005
    Messages:
    14,043
  6. Altmer

    Altmer rid this world of human waste
    is a Site Staff Alumnusis a Contributor Alumnus

    Joined:
    Mar 15, 2005
    Messages:
    6,937
    sweet chaos

    read
  7. Jumpman16

    Jumpman16 np: Michael Jackson - "Mon in the Mirror" (DW mix)
    is a Smogon IRC SOPis a Site Staff Alumnusis a Team Rater Alumnusis a Battle Server Admin Alumnusis a Researcher Alumnusis a Tiering Contributor Alumnusis a Contributor Alumnusis an Administrator Alumnus

    Joined:
    Dec 19, 2004
    Messages:
    4,768
  8. Kumar

    Kumar
    is a Site Staff Alumnusis a Forum Moderator Alumnusis a Researcher Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Dec 19, 2004
    Messages:
    3,106
  9. Doomsday

    Doomsday
    is a Forum Moderator Alumnus

    Joined:
    Jan 23, 2005
    Messages:
    6,166
    i shall raise as in a hi5 gesture even though i do not receive i back because this is pretty good
  10. Atlas

    Atlas I'm the Mary!
    is a Smogon IRC AOp Alumnusis a Researcher Alumnus

    Joined:
    May 19, 2005
    Messages:
    3,496
    wait, i don't get it, your last line confusing. are you saying you're cool or gay?
  11. david stone

    david stone Fast-moving, smart, sexy and alarming.
    is a Site Staff Alumnusis a Smogon IRC AOp Alumnusis a Programmer Alumnusis a Super Moderator Alumnusis a Researcher Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Aug 3, 2005
    Messages:
    5,150
    This is pretty gay.

Users Viewing Thread (Users: 0, Guests: 0)