Turbo-C
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
터보-C 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
Lua 게시판
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C/C++ Q/A
[1908] 저기...이 함수 c꺼 맞나요??
왕초보 [klopark] 1221 읽음    2003-01-28 20:14
function main()
{
    print("loading " +charsetfile +" For " +me.name);
    include(charsetfile);
    load("bots\\PwnagePindle.d2j");
    potionloop();
}

// Dont mess with anything below here or you will die
var waitForLeech=true;

function drinkpot(type)
{
    var pot = null;
    var potType;
    switch (type.charAt(0).toLowerCase())
    {
      case "r":
      {
        if(me.hp < mymaxlife*.20 || me.mp < mymaxmana*.20)
            potType = "rvl";
        else
            potType = "rvs";
        pot = getItem(potType, 2);
        if (!pot)
        {
            if(me.hp < mymaxlife*.20 || me.mp < mymaxmana*.20)
                potType = "rvs";
            else
                potType = "rvl";
            pot = getItem(potType, 2);
        }
        break;
      }
      case "h":
      {
        for (i = 5; i > 0; i--)
        {
            potType = "hp" + i.toString();
            pot = getItem(potType, 2);
            if (pot) break;
        }
        break;
      }
      case "m":
      {
        for (i = 5; i > 0; i--)
        {
            potType = "mp" + i.toString();
            pot = getItem(potType, 2);
            if (pot) break;
        }
        break;
      }
      default:
      {
        print("Invalid argument " + type + " passed to drinkpot()");
        return -1;
      }
    }

    if (pot && pot.getParent().name == me.name)
    {
        var potgid = pot.gid;
        var tries=0;
        var limit=5;

        for (i = 1; i <= 2 && pot && pot.gid == potgid; i++)
        {
            if (me.classid == 4 && me.mode == 18)
            {
                print("Can't drink right now...");
                return -1;
            }

            if (pot && pot.gid == potgid)
                pot.interact(1);
            while (pot && pot.gid == potgid && pot.getParent().name == me.name && tries++ < limit*i)
            {
                delay(100);
                pot = getItem(potType, 2);
            }
        }

        // did we drink it?
        if (pot && pot.gid == potgid)
            return -1; // drink failed
        else
            return 1;
    }

    return 0;
}

+ -

관련 글 리스트
1908 저기...이 함수 c꺼 맞나요?? 왕초보 1221 2003/01/28
3833     Re:저기...이 함수 c꺼 맞나요?? utime->김성하 1188 2003/01/29
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.