Results 1 to 7 of 7

Thread: Math Problem

  1. #1
    Normal User AcidAlchamy's Avatar
    Join Date
    Jul 2012
    Location
    The Labratory
    Posts
    749
    Mentioned
    16 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    10 Post(s)
    Reputation
    180
    Rep Power
    7

    Math Problem

    anyone have a script that does this

    I want a script that will move 200 spears to to backpack; but if I have 10 or 199 it will only move over the difference needed to make 200 in the backpack; Anyone got anything like this?

    Please and thank you, +Rep to person with working script

    ~Acid Alchamy~

    Follow my Activity on Facebook?
    https://www.facebook.com/AcidAlchamyPage
    Download iBot : iBot v2.3.6 - Released
    My Free Scripts :
    ★Free Scripts★ By Acid Alchamy
    Acid Alchamy Updates :
    Updates About Acid Alchamy
    All Scripts by Acid Alchamy :
    All My Posted Scripts
    Latest Thread by Acid Alchamy:
    [Tutorial] Sellers - Avoid Getting Scammed

    +Rep Everyone That Helps You, I'll ALWAYS Return A +Rep.





  2. #2
    Normal User
    Join Date
    May 2012
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    local currentspears = itemcount(spear, bpname)
    local spearstomove = (200-currentspears)
    moveitems(spears, fromBP, toBP, spearstomove)

    play with this

  3. #3
    Normal User
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,671
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    8 Post(s)
    Reputation
    132
    Rep Power
    9
    Code:
    while (itemcount("spear",tobp) < 200) do
        moveitems("spear",frombp,tobp,200 - itemcount("spear",tobp))
    end
    Last edited by soder; 09-15-2012 at 11:55 PM.

  4. #4
    Normal User
    Join Date
    May 2012
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    Quote Originally Posted by soder View Post
    Code:
    while (itemcount("spear",frombp) > 0) do
        moveitems("spear",from,to,100)
    end
    He wants to move an ammount of spears so he has exactly 200 on what you named 'to' bp, wouldnt your script move 100, even if for example its 112 bps so it'd be 212 on the 'to' bp?
    PHP Code:
    local fromBP 'Purple Backpack'
    local toBP 'Pirate Backpack'
    local currentspears itemcount(spear,toBP)
    local spearstomove = (200-currentspears)
    if (
    itemcount('spear'fromBP) > 0
    then moveitems
    (spearfromBPtoBPspearstomove)
    end 
    this is pretty much a mix between soder and mine idea, try it out

  5. #5
    Normal User
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,671
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    8 Post(s)
    Reputation
    132
    Rep Power
    9
    I updated it as you quoted me(I didnt read his full post lol), if he got 112 he will only move 100 - he need a while/for loop to move more than 100(my updated post should work)

    Also, why do people use single quotes instead of double quotes? If you edit the action in the bot and double click spear inside single quotes(') it will mark spears + atleast one single quote, it wont happen with double quotes.
    Last edited by soder; 09-15-2012 at 10:03 PM.

  6. #6
    Normal User AcidAlchamy's Avatar
    Join Date
    Jul 2012
    Location
    The Labratory
    Posts
    749
    Mentioned
    16 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    10 Post(s)
    Reputation
    180
    Rep Power
    7
    Im getting ready to test these out here in the next half hour.
    and I use Double Quotes naturally when I make my scripts lol.

    Follow my Activity on Facebook?
    https://www.facebook.com/AcidAlchamyPage
    Download iBot : iBot v2.3.6 - Released
    My Free Scripts :
    ★Free Scripts★ By Acid Alchamy
    Acid Alchamy Updates :
    Updates About Acid Alchamy
    All Scripts by Acid Alchamy :
    All My Posted Scripts
    Latest Thread by Acid Alchamy:
    [Tutorial] Sellers - Avoid Getting Scammed

    +Rep Everyone That Helps You, I'll ALWAYS Return A +Rep.





  7. #7
    Normal User
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,671
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    8 Post(s)
    Reputation
    132
    Rep Power
    9
    I meant Ithrix and everyone else whos reading my post that doesnt use double quotes
    Also updated my first post again, made a mistake in the spear counter.
    Last edited by soder; 09-15-2012 at 11:57 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
  •