Signup Now
Results 1 to 5 of 5
  1. #1
    Free User
    Join Date
    Feb 2015
    Posts
    15
    Reputation
    10
    Rep Power
    0

    eat food while mp < 200, how to do it?

    Hello Guys!

    I trying to do this

    Do while mp < 200
    eatfood()
    wait(40000)

    how can I write it? thx

  2. #2
    Free User Justx's Avatar
    Join Date
    Jun 2014
    Posts
    192
    Reputation
    19
    Rep Power
    20
    auto(500,1000)
    while
    $mp < 200 do
    eatfoodfull()
    wait(30000,45000)
    end
    Last edited by Justx; 02-08-2015 at 01:18 AM.

  3. #3
    Free User
    Join Date
    Feb 2015
    Posts
    15
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by Justx View Post
    auto(500,100)
    while
    $mp < 200 do
    eatfoodfull()
    wait(30000,45000)
    end
    Thank you!

  4. #4
    Free User Justx's Avatar
    Join Date
    Jun 2014
    Posts
    192
    Reputation
    19
    Rep Power
    20
    Quote Originally Posted by noxvia View Post
    Not to be that kinda guy, but that code was pretty damn shitty.
    First of all, why use a while when you already use auto()?
    Secondly, you can't put 500,100 in range, since 500ms is obviously higher than 100ms.

    Your code would ruin his CPU because it will run the same loop over and over, for nothing.

    This is what I would do:
    auto(30000, 60000)
    if $mp < 200 then
    eatfoodfull("brown mushroom")
    end


    This will repeat itself every 30-60 seconds.
    If you have less than 200 mana, it will eat itself full on brown mushrooms.
    You can edit that to any specific food you want.
    Or just put eatfoodfull() and it will eat all kinds of food, until you are full.
    @Zuhdatiemi @Justx
    First of all, the (500,100) thing its obviouslly a mistype, but ok ignorant people tend to do that kind of thing to think that they are better than others.
    Second, there is a while because he wants a while, I'm sorry, have I read it wrong?
    And yes, it would do the loop, thats the main point of a "while" have you ever programmed? ...
    While the condition is met it will do the action which is: eat food untill its full and wait 30~45s before it would close the loop and check again after 0,5~1s if the condition is met.
    That's where you see that it doesnt even make diference if I put 500,100 or 500,1000 because the bot will make the action of checking the "while" every now and then, so actually doesnt even need to be ramdomized, CipSoft cant possibly know when we check for a bot action.
    The code I posted does exactly what he asked and works for any kind of food, wow, if you were a little less arrogant you would see that.
    See ya.

  5. #5
    Free User Justx's Avatar
    Join Date
    Jun 2014
    Posts
    192
    Reputation
    19
    Rep Power
    20
    Quote Originally Posted by noxvia View Post
    auto() works like while, in WindBot.
    There is certainly no need for a while-loop for a code like this.
    Obviously OP is not well experienced and if he asks for a while-loop, I suggested a better option instead.

    I am not ignorant.
    Your code would literally burn his CPU after a longer period of time. That is facts.
    It would eventually freeze WindBot and cause a potential crash on his processor.
    That would not be a fun thing for OP.

    Yes, I have programmed and scripted for well over a decade now, just for your information.

    I am not being arrogant. I showed you a better piece of code, and I am not saying that in an arrogant way.
    That's just to help OP not burn his processor to death.

    Also, you should not split up the code on multiple lines like that.
    Try to do as short lines as possible, for a quicker execution of the script.

    Example:

    while
    i < 10
    do
    blabla
    end


    Should be:

    while i < 10 do
    blabla
    end


    Or even as a one-liner.
    Dude, show me how it would burn out his CPU, because what you are saying makes no sense at all, really..
    And the compiler doesnt see any difference in codes with one line or 5 lines as long its correct, its just better for people who are editting it later. omg

 

 

Posting Permissions

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