Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 44

Thread: acquireBuff - Get a buff from a buffbot

  1. #1
    Developer
    Join Date
    Apr 2006
    Posts
    884

    Default acquireBuff - Get a buff from a buffbot

    [requires zlib]
    [visits external servers]

    Now with svn installation:
    Code:
    svn checkout https://svn.code.sf.net/p/acquirebuff/code
    You cannot modify a setting by changing the value in script, instead type the following into the cli (change acquireBuff_max_price to the setting you wish to edit):
    Code:
    zlib acquireBuff_max_price = 1000
    This script will attempt to get you a buff from a buffbot without needing to know the price or even the bot's name. It will only attempt to send meat to each buffbot once, if they're online, and if the price of the buff is less then your 'acquireBuff_max_price'. Once a buff is requested at a certain price it will not request using that price again. Philanthropic buffs are never considered. AT buffs are no longer requested if you're can't listen to any more songs.

    Future Improvements:

    • Removing buff packs from consideration, maybe

    Fun fact: I accidentally spent 100k on empathy while writing this script and now I have 60k turns remaining.

    1.7 Probable fix for sending a price to the wrong bot
    1.6 Fix a boolean function not returning true, which would break the script in a future mafia update.
    1.5 Move "Four Songs" check out of the top level so it will get resolved every run instead of just once.
    1.4 Slyz Fixes
    1.3 Checks if you can't acquire an at buff due to song count before requesting it
    1.2 Rename jingle bells to jingle jangle jingle, maybe something else idk
    1.1 Allow requesting a buff you already have

    1.0 Initial Release
    Last edited by Rinn; 10-23-2013 at 06:15 PM. Reason: version 1.7
    Automatically download the newest daily build - Version 1.8
    Better Basement Automation
    - Version 1.??? Someone else is maintaining this
    Get an effect from a buffbot
    - Version 1.4

  2. #2
    Developer
    Join Date
    Nov 2008
    Location
    Paris, France
    Posts
    4,511

    Default

    Thanks Rinn!

    I haven't tried it out yet, but I know I generally request buffs from buffbots even when I already have turns of the effect running. Maybe you could add a variable that can be used in the while loop
    PHP Code:
    original_num_turns have_effect(e);
    while(
    have_effect(e) == original_num_turns)
    ... 
    And a small advice: on top on being able to control verbosity, vprint() was also designed to save typing in a situation when you want to return a boolean value and print a message, so you could replace
    PHP Code:
    if (!try_acquire_buff(e))
    {
       
    vprint("Unable to acquire " e.to_string(), "red"2);
       return 
    false;

    by
    PHP Code:
    if (!try_acquire_buff(e))
       return 
    vprint("Unable to acquire " e.to_string(), -2); 
    (notice the 2 became negative, to return false, so the string will be printed in red).
    Last edited by slyz; 04-26-2010 at 07:12 AM.

  3. #3

    Default

    "Future Improvements:
    AT song count checking"

    If it helps, for the script i'm working on when I wanted to check the song count I made a list of the known songs in an array and ran through them with a foreach. Then all you have to do is use a if statement with have_effect(array item) > 0 to see if that song is active. At that point just use an index variable to count this and at the end do an equip check for song total adding items such as the pendant.

    Handy script, I actually imported it for mine, when I get done with mine you might be interested in how i used your script.
    Last edited by oly0015; 06-16-2010 at 10:03 PM.

  4. #4
    Developer
    Join Date
    Aug 2009
    Posts
    2,688

    Default

    You don't actually need an equip check, as the song modifiers (additional song and 4 songs) are both boolean modifiers.

  5. #5
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,268

    Default

    As heeheehee said. This is what you need to know:

    Code:
    boolean four_songs = boolean_modifier("four songs");
    boolean extra_song = boolean_modifier("additional song");
    int max_songs = 3 + to_int(four_songs) + to_int(extra_song);
    print("You can currently hold "+ max_songs +" songs in your head at a time.");
    Last edited by Bale; 06-16-2010 at 10:37 PM.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  6. #6

    Default

    should save me a couple lines, guess i got to go fix stuff, ty

  7. #7
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,268

    Default

    Oh. And this:

    Code:
    int current_songs() {
       int total = 0;
       for skill_num from 6001 to 6040
          if(skill_num.to_skill() != $skill[none] && skill_num != 6025 && skill_num.to_effect().have_effect() > 0)
             total = total + 1;
       return total;
    }
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  8. #8

    Default

    might be just because its late, but i tried acquireBuff($effect[buff]); where buff = "ode to booze" and got
    No known buffbot is able to provide Surreally Buff
    Unable to acquire Surreally Buff

    time for some sleep then i guess i'll figure it out later

  9. #9
    Senior Member Winterbay's Avatar
    Join Date
    Feb 2010
    Posts
    5,033

    Default

    It is possible the problem is the naming. The buff is called "the ode to booze". Please bear in mind that I have no idea and have not looked at the code

  10. #10

    Default

    The skill is called The Ode to Booze, but the effect is called Ode to Booze, so the latter is what you want. It looks like you're passing "buff" to the function rather than "ode to booze", so it looks for a buff with "buff" in the name. If
    PHP Code:
    acquireBuff($effect[buff]); where buff "ode to booze" 
    is what you typed in, then that won't work, just use
    PHP Code:
    acquireBuff($effect[ode to booze]) 
    instead.

Similar Threads

  1. Feature - Rejected New Buffbot
    By EvilSpud in forum Bug Reports
    Replies: 1
    Last Post: 08-04-2012, 03:10 PM
  2. Bug - Fixed Buffbot buff casting weirdness
    By starkid in forum Bug Reports
    Replies: 23
    Last Post: 09-29-2010, 02:36 PM
  3. Buffbot - cast buff on someone besides sender
    By That FN Ninja in forum Scripting Discussion
    Replies: 3
    Last Post: 08-01-2009, 05:21 PM
  4. Add buff to buffbot not working
    By mooshotty in forum Community Support
    Replies: 8
    Last Post: 11-15-2007, 04:30 AM
  5. Add Buffbot
    By Pyro Kittens in forum Community Support
    Replies: 5
    Last Post: 01-24-2007, 11:04 PM

Posting Permissions

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