Page 2 of 4 FirstFirst 1234 LastLast
Results 21 to 40 of 66

Thread: MafiaBot Github

  1. #21
    Banned
    Join Date
    Jul 2017
    Location
    collapsing the matrix
    Posts
    741
    Steam ID
    let's just take a walk then
    Me too.

  2. #22
    Beyond Grantlike ironstove.'s Avatar
    Join Date
    Feb 2012
    Location
    Los Angeles
    Posts
    8,559
    Steam ID
    ironstove_
    Did any one give this thing a shot or was it too high level for you ppl to run a script? Lol
    YOU SO
    FUCKIN'
    PRECIOUS
    WHEN YOU

  3. #23
    Holy Shit yns's Avatar
    Join Date
    Jun 2017
    Posts
    6,038
    Quote Originally Posted by divine View Post
    all in one file
    I saw this and then decided against doing anything with it.

  4. #24
    I need to focus on some other things now. No one has been using it anyways. I'll refactor it eventually but not for a while

  5. #25
    Beyond Grantlike ironstove.'s Avatar
    Join Date
    Feb 2012
    Location
    Los Angeles
    Posts
    8,559
    Steam ID
    ironstove_
    God you lazy boy. I'll do it then.

    It's only got like 15 methods at most lol
    YOU SO
    FUCKIN'
    PRECIOUS
    WHEN YOU

  6. #26
    Beyond Grantlike ironstove.'s Avatar
    Join Date
    Feb 2012
    Location
    Los Angeles
    Posts
    8,559
    Steam ID
    ironstove_
    I need to update the repo with some code changes.

    Changes:
    -Fixed an issue with the bot not being able to deal with multiple bold tags within the OP post to read the playerlist
    -Fixed the initialization function to deal with cases where the thread has just opened i.e. less than 4 pages (No 'lastpage' element was being created within the thread which caused the bot to fail. The workaround was to start the bot once 4+ pages have been created, which was working fine because people were not getting lynched by page 3).
    YOU SO
    FUCKIN'
    PRECIOUS
    WHEN YOU

  7. #27
    Beyond Grantlike ironstove.'s Avatar
    Join Date
    Feb 2012
    Location
    Los Angeles
    Posts
    8,559
    Steam ID
    ironstove_
    On another note, I'm in the thought process of implementing a few features on the bot:

    ISO command - Player types something like ISO ironstove and the bot collects every post made by the player in the game thread and creates a post placing each one in 'quotes'.




    Example:

    Requested ISO generated for Ironstove.

    Last indexed post is #2 of Game Thread: Testing Mafia #1

    Quote Originally Posted by ironstove View Post
    Quote Originally Posted by tester View Post
    Post directed at Ironstove
    This is my reply to your post.




    I'm thinking there should be an 'ISO dump thread' in the mafia forum for the bot to throw all of this content in there and the bot can or can not reply back within the game thread to reference the creation of the ISO.

    I've also discovered this bot is pretty difficult to run LOL. Not a straightforward double click a file and gracefully execute. I'm begun to restructure all of the code... It's still a mess...


    Events:
    I was thinking about adding notable events to the [b]votecount[b] command, but I'm not sure if this is would be interfering with the game.... Also rerunning the bot from a blank slate would recycle the events summary and make a giant ass post in a huge game... Unless I just referenced the last actions of a player taken. Hmm. Anyway, just shower thoughts.
    YOU SO
    FUCKIN'
    PRECIOUS
    WHEN YOU

  8. #28
    Wicked Sick Nmagane's Avatar
    Join Date
    Feb 2018
    Posts
    1,320
    You could have the quotes in spoiler tags.
    Spoiler
    “A man of genius makes no mistakes. His errors are volitional and are the portals of discovery.”

    “Her antiquity in preceding and surviving succeeding tellurian generations: her nocturnal predominance: her satellitic dependence: her luminary reflection: her constancy under all her phases, rising and setting by her appointed times, waxing and waning: the forced invariability of her aspect"

  9. #29
    omae wa mou shindeiru Lucky Artist's Avatar
    Join Date
    Jul 2016
    Posts
    12,056
    Quote Originally Posted by Nmagane View Post
    You could have the quotes in spoiler tags.
    Spoiler
    Quote Originally Posted by Haxity View Post
    i dont really know me either, does anyone ever truly know themselves?
    #philosophyPHD

  10. #30
    Beyond Grantlike ironstove.'s Avatar
    Join Date
    Feb 2012
    Location
    Los Angeles
    Posts
    8,559
    Steam ID
    ironstove_
    Here's my proposed restructuring of the code.

    I'm not sure if this is the best way to do it, but my hope is that it will be a little more organized and readable after the changes.

    Currently all of the functions are bundled and mixed around 1 file, so I'm hoping to categorize the functions into different classes and move the classes to a separate library that I'll import in the main function.

    The main will do the usual looping and operate as usual.

    PHP Code:
    Player OBJECT
        NAME
        VOTE
        isHOST
        
    Votes 
    Class
        
    initVotes
        saveLynch
        removeLynch
        getLynch
        
    wDriver 
    Class
        
    initBot
        loginBot
        scrapePosts
        postToForum 
        getNextPage
        findMafiaGame
        
    Post 
    Class
        
    postVotes
        postHammer
        postISO

    Record 
    Class
        
    initConfig
        write2Config
        unWrite2Config
        save2ConfigFile
        savePost
        doesPostExist
        clearLynches

    Analyze 
    Class
        
    check4Bold
        check4Command
            

    Commands 
    Class
        
    isCommand
        LYNCH
        UNLYNCH
        NIGHTBEGINS
        DAYBEGINS
        VOTECOUNT
        WASKILLED
        KILL
        ADD
        ISO
        ENDDAY 
    YOU SO
    FUCKIN'
    PRECIOUS
    WHEN YOU

  11. #31
    I mean this looks fine, iirc my complaint was that the code was very hard to follow in the main thing you're talking about.

  12. #32
    Maybe you should check out transitions and put it to use there

  13. #33
    Beyond Grantlike ironstove.'s Avatar
    Join Date
    Feb 2012
    Location
    Los Angeles
    Posts
    8,559
    Steam ID
    ironstove_
    Quote Originally Posted by divine View Post
    Maybe you should check out transitions and put it to use there
    I couldn't find anything on google regarding 'transitions' for coding. Can you link me?
    YOU SO
    FUCKIN'
    PRECIOUS
    WHEN YOU

  14. #34
    I was talking about the state machine library for python

  15. #35
    Beyond Grantlike ironstove.'s Avatar
    Join Date
    Feb 2012
    Location
    Los Angeles
    Posts
    8,559
    Steam ID
    ironstove_
    Ok, I see what you mean now when you say you had trouble following the code.
    YOU SO
    FUCKIN'
    PRECIOUS
    WHEN YOU

  16. #36
    I'm sorry I didn't help more when you first made this post, I can't help much now but it would be fun to get this project to the point where people with no tech chops can spin it up so that hosting becomes less of a responsibility for the host in question.

    @ewiz fsm sounds like a really good fit for this kind of project right?

  17. #37
    Holy Shit yns's Avatar
    Join Date
    Jun 2017
    Posts
    6,038
    If you want, it'd work. There's a shitload of different ways you could do this stuff

  18. #38
    It'd be better than what I remember the codebase looking like

  19. #39
    Holy Shit yns's Avatar
    Join Date
    Jun 2017
    Posts
    6,038
    Why's it in Python?

  20. #40
    Beyond Grantlike ironstove.'s Avatar
    Join Date
    Feb 2012
    Location
    Los Angeles
    Posts
    8,559
    Steam ID
    ironstove_
    Because python is a great language?
    YOU SO
    FUCKIN'
    PRECIOUS
    WHEN YOU

Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •