vấn đề về bot legn ! ! !

Thảo luận trong 'TS Online' bắt đầu bởi **Asakura Hao**, 3/4/06.

  1. **Asakura Hao**

    **Asakura Hao** C O N T R A

    Tham gia ngày:
    13/9/05
    Bài viết:
    1,820
    Nơi ở:
    Địa Ngục @_@
    các bác ơi sao em sửa cái script bot thành tuyết cổng 1 này mà ko được vậy
    sao nó đánh trược 1 trận rùi nó ngừng hà
    đây là gate sau khi đánh xong có nói chiện thì sao ạ
    các bác giúp em
    Mã:
    double DisconnectFlag = 0.3;     // Disconnect when current HP is below 30%
    
    double hpFractionEat = 0.8;    //Eat HP when current HP<= 80%
    double spFractionEat = 0.8;
    double hpFraction = 0.95;        //Eat until current HP >= 95 %
    double spFraction = 0.95;
    
    byte DisconFai = 00;        //    Faith of warrior to disconnect
    
    byte battle_count = 0;
    byte NS_count = 0;
    byte myturn = 0;
    byte peturn = 0;
    
    byte pt1 = 0;
    byte pt2 = 0;
    byte pt3 = 0;
    byte pt4 = 0;
    
    double mapid1 = 12000; 
    double mapid2 = 12421;
    byte warpid1 = 10;
    byte warpid2 = 2;
    
    /***** Chinh sua ID Member o day *****/
    
    uint idmem1 = 2105572;
    uint idmem2 = 619218;
    uint idmem3 = 2119063;
    uint idmem4_sena = 725448;
    
    /*************************************/
    
    /*********************** My Attack *************************/
    public override void MyAttack()
    {   
    myturn++;
    if (myturn == 1)
    {
    CharacterInfo MyChar = ts.Character; 
    //NPCCombatObject Monster = findMonster();    
    ts.SendAttack(MyChar.Row, MyChar.Col, 0, 1, 12003);    
    }
    if (myturn >=2)
    {
    CharacterInfo MyChar = ts.Character; 
    //NPCCombatObject Monster = findMonster();    
    ts.SendAttack(MyChar.Row, MyChar.Col, 0, 4, 10000);
    }
    }
    
    
    /******************* My Partner Attack *********************/
    public override void MyPartnerAttack()
    {
    peturn++;
    if (peturn == 1)
    {
    CharacterInfo MyWarrior = ts.CurrentPartner; 
    //NPCCombatObject Monster = findMonster();    
    ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 1, 17001);
    }
    if (peturn >= 2)
    {
    CharacterInfo MyWarrior = ts.CurrentPartner; 
    //NPCCombatObject Monster = findMonster();    
    ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 4, 17001);
    }
    }
    
    
    /********************* Battle Started **********************/
    public override void BattleStarted()
    {
    battle_count++;
    myturn = 0;
    peturn = 0;
    }
    
    
    /********************* Battle Stoped ***********************/
    public override void BattleStoped()
    {    
    AutoEatFood();
    ProcessInventoryAction();
    CheckDisconnect();    
    ViewState();
    }
    
    
    /******************* Receive Question *********************/
    public override void doRecvQuestion()
    {
    NS_count++;
    }
    
    
    /******************** Response Answer **********************/
    public override void ResponseAnswer()
    {        
    string tmp=ts.LastQuestion.Replace("=?","");
    int ans=ts.Eval(tmp);
    byte ans_index=Convert.ToByte(ts.LastAnswers[ans.ToString()]);    
    ts.Answer(ans_index);
    }
    
    
    /******************** NPC Dialog Menu **********************/
    public override void NpcDialogMenu(ushort DialogId)
    {
    debug("Dialog Menu ID = "+DialogId.ToString());
    }
    
    
    /********************* NPC Dialog ID ***********************/
    public override void NpcDialog(ushort DialogId)
    {    
    debug("Dialog ID = "+DialogId.ToString());
    }
    
    
    /********************* On NPC Appear ***********************/
    public override void onNPCAppear(ushort npcmapid, int x, int y)
    {    
    }
    
    
    /************************ On Timer *************************/
    public override void OnTimer()
    {
    if (pt1 == 0) {ts.AcceptParty(2105572);}
    if (pt2 == 0) {ts.AcceptParty(619218);}
    if (pt3 == 0) {ts.AcceptParty(2119063);}
    if (pt4 == 0) {ts.AcceptParty(725448);}
    }
    
    
    /********************* Accepted Party **********************/
    public override void AcceptedParty(uint playerid)
    {
    if (playerid == 2105572)   {debug(playerid + "  Gia nhập đội ngũ");pt1 = 1;}
    if (playerid == 619218)   {debug(playerid + "  Gia nhập đội ngũ");pt2 = 1;}
    if (playerid == 2119063)  {debug(playerid + "  Gia nhập đội ngũ");pt3 = 1;}
    if (playerid == 725448)  {debug(playerid + "  Gia nhập đội ngũ");pt4 = 1;
                                   ts.Sena(idmem4_sena);debug(playerid + "  Làm Quân Sư");}
    if (pt1 ==1 && pt2 == 1 && pt3 == 1 && pt4 == 1) {ts.SetTimerOnOff(false);ts.delay(1000);debug("Đội ngũ đã đầy -> Start");Start();}
    }
    
    
    /*********************** Party Stop ************************/
    public override void PartyStop(uint playerid)
    {
    if (playerid == 2105572) {debug(playerid+"  Rời khỏi đội ngủ -> Disconnect !!!");ts.Disconnect();}
    if (playerid == 619218) {debug(playerid+"  Rời khỏi đội ngủ -> Disconnect !!!");ts.Disconnect();}
    if (playerid == 2119063) {debug(playerid+"  Rời khỏi đội ngủ -> Disconnect !!!");ts.Disconnect();}
    if (playerid == 725448) {debug(playerid+"  Rời khỏi đội ngủ -> Disconnect !!!");ts.Disconnect();}
    }
    
    
    /********************** Warp Finish ************************/
    public override void warpFinish()
    {
    Start();
    }
    
    
    /************************* Start ***************************/
    public override void Start() 
    {  
    if (ts.Character.mapid == mapid1) {  
    ts.delay(1000);   
    ts.Warp(warpid1); 
    return; 
    } else 
    if (ts.Character.mapid == mapid2) { 
    ts.delay(1000); 
    ts.Warp(warpid2); 
    return; 
    }  
    }  
    
    
    /************************** Stop ***************************/
    public override void Stop()
    {
    }
    
    /*********************** View State ************************/
    void ViewState()
    {
    debug("**************************************************    **********************",255) ; 
    debug(" Số trận đánh : " + battle_count ,255) ;
    debug(" HP của "+ts.Character.CharName+" = " + ts.Character.HP +" "+ "/" +" "+ ts.Character.MAXHP,255);
    debug(" HP của "+ts.CurrentPartner.CharName +" = " + ts.CurrentPartner.HP + " "+"/" +" "+ ts.CurrentPartner.MAXHP +"   "+" FAI = " + ts.CurrentPartner.fai,255); 
    debug(" Số lần gặp BTQ : "+ NS_count +"  Số con ma : " + ts.Character.ghost ,255) ;
    debug("======= Script by zFantasy - Copy Right GameVN–™ =======",255) ;
    }
    
    
    /********************* Fishish Answer **********************/
    public override void FinishAnswer()
    {
    ts.delay(1000);
    Start();
    }
    
    
    /**************** Request Party Accept From ****************/
    
    //public override void RequestPartyAcceptFrom(uint playerid)
    //{
    //if (playerid == 2105572) {ts.delay(1200);ts.AcceptParty(playerid); pt1 = 1;debug(playerid + " Johned team");}
    //if (playerid == 619218) {ts.delay(1200);ts.AcceptParty(playerid); pt2 = 1;debug(playerid + " Johned team");}
    //if (playerid == 2119063) {ts.delay(1200);ts.AcceptParty(playerid); pt3 = 1;debug(playerid + " Johned team");}
    //if (playerid == 725448) {ts.delay(1200);ts.AcceptParty(playerid);ts.delay(1200);ts.Sena(playerid); pt4 = 1;debug(playerid + " Johned team, Quân Sư = "+playerid);}
    //if (pt1 == 1 && pt2 == 1 && pt3 == 1 && pt4 == 1) {debug("Party Full -> Start ");Start();}
    //}
    
    
    /************************ Init Bot *************************/
    public override void InitBot()
    {    
    ts.SetTimerOnOff(true);    
    if (ts.Character.mapid == mapid2) {ts.Warp(warpid2);}
    AddDropItemList("viênongmật");
    AddDropItemList("Dâu đỏ");
    AddDropItemList("Táo nhỏ");
    AddDropItemList("Bành Bột Mì");
    AddDropItemList("Nhị Quoa đầu");
    AddDropItemList("Mật Ý Nhân ");
    AddDropItemList("tựđ uốngthuốc");
    AddDropItemList("viên công kích");
    ViewState();
    }  
     
  2. hoanghon01

    hoanghon01 Youtube Master Race

    Tham gia ngày:
    17/3/06
    Bài viết:
    21
    sua warpid1 = 11 wapid2 = 1 va` sua cho nay` nua~

    /**************** Request Party Accept From ****************/

    //public override void RequestPartyAcceptFrom(uint playerid)
    //{
    //if (playerid == 2105572) {ts.delay(1200);ts.AcceptParty(playerid); pt1 = 1;debug(playerid + " Johned team");}
    //if (playerid == 619218) {ts.delay(1200);ts.AcceptParty(playerid); pt2 = 1;debug(playerid + " Johned team");}
    //if (playerid == 2119063) {ts.delay(1200);ts.AcceptParty(playerid); pt3 = 1;debug(playerid + " Johned team");}
    //if (playerid == 725448) {ts.delay(1200);ts.AcceptParty(playerid);ts.delay( 1200);ts.Sena(playerid); pt4 = 1;debug(playerid + " Johned team, Quân Sư = "+playerid);}
    //if (pt1 == 1 && pt2 == 1 && pt3 == 1 && pt4 == 1) {debug("Party Full -> Start ");Start();}
    //}


    vi` cho do' co' loi` 1 khoang cach' del khoang cach' doa' di la` xong
     
  3. hoanghon01

    hoanghon01 Youtube Master Race

    Tham gia ngày:
    17/3/06
    Bài viết:
    21
    ui' nham`` rui```
    bot thanh` tuyet' ah```` the' chi can` sua cho~ khoang cach' thui con` wapid thi` de nguyen
    cu' tuong bot Nha Quan cua 1
    mong sao dung` bi. tru` mp
     
  4. TheOneTS

    TheOneTS Mr & Ms Pac-Man

    Tham gia ngày:
    27/9/05
    Bài viết:
    161
    Thêm 1 cái ts.SendEnd(); vào hàm này

    PHP:
    /********************* Battle Stoped ***********************/
    public override void BattleStoped()
    {    
    AutoEatFood();
    ProcessInventoryAction();
    CheckDisconnect();    
    ViewState();
    ts.SendEnd();//cai này vừa thêm nè
    }
    Nếu chưa đánh tiếp thì thêm 1 cái nữa, cứ thế đủ là nó óanh tiếp :;)
     
  5. zantedsuken

    zantedsuken Mario & Luigi

    Tham gia ngày:
    14/12/02
    Bài viết:
    872
    Nơi ở:
    Some Where I Belong
    thiếu ts.SendEnd(); ở battleStop ()
     

Chia sẻ trang này