Vấn đề mất Q khi bot Q :(

  • Thread starter Thread starter MrBobby
  • Ngày gửi Ngày gửi

MrBobby

Dragon Quest
Tham gia ngày
1/11/05
Bài viết
1,301
Reaction score
7
1. Khi test Q bot Tào Tháo (chỉ để chủ pt log = truebot, các mem log = alogin , và chỉ để đúng 1 lệnh SendEnd trong function NPCDialog (),còn lại không có thêm 1 lệnh SendEnd nào khác) thì đánh xong 1 trận đầu tiên, nó không đánh tiếp nữa, log vào = alogin thì thấy mất Q ::( . Theo tui nghĩ bot Q chỉ cần để 1 lệnh SendEnd() trong function NpcDialog() thôi là đủ (ở đây chỉ xét NPCDialog, không tính DialogMenu) . Nhưng khi tham khảo các script của những khác post lên thì thấy có thêm lệnh SendEnd ở những chỗ khác nữa , và có các lệnh if ( DialogId == ...) ..., Vậy các pro có thể cho biết tại sao tui lại bị mất Q không ? Và ở cái Dialog sau khi kết thúc trận chiến thì có phải làm gì khác nữa không hay chỉ cần SendEnd() thôi (chỉ tính Dialog không có Menu). Mất mấy cái Q roài, bây giờ thấy run tay quá :-s
2. Để đánh tiếp trận 2,... thì phải làm sao ? Theo tui nghĩ thì chỉ cần đặt thêm các lệnh như trong
Mã:
if (pt_count == max_count) {
.....
}
là sẽ đánh tiếp được, như vậy có đúng không ?
 
chỉ để đúng 1 lệnh SendEnd trong function NPCDialog (),
1 Lệnh SendEnd() trong đó cũng đủ để nó SendEnd hết dialog rùi, lần sau nhớ dùng hàm if .... nhá ;;)
 
chỉ để đúng 1 lệnh SendEnd trong function NPCDialog (),
1 Lệnh SendEnd() trong đó cũng đủ để nó SendEnd hết dialog rùi, lần sau nhớ dùng hàm if .... nhá ;;)
Nói tóm lại là Dialog tr'c trận thì SendEnd(), Dialog sau trện thì CLickOnNPC(id)
Mún đánh típ trận 2 thì thêm hàm Start() vào BattleStoped() là xong >:D<
 
*Jet007* nói:
1 Lệnh SendEnd() trong đó cũng đủ để nó SendEnd hết dialog rùi, lần sau nhớ dùng hàm if .... nhá ;;)
Nói tóm lại là Dialog tr'c trận thì SendEnd(), Dialog sau trện thì CLickOnNPC(id)
Mún đánh típ trận 2 thì thêm hàm Start() vào BattleStoped() là xong >:D<
Anh Jet oi cho em cai scrip bot HUA CHU duoc ko.Thank anh nhieu lam,neu duoc thi` anh sent cho em va`o hom mail nay nhe [email protected]
 
Jet oi,có thể xem dùm mình cái script của thằng Giản Dung sai chổ nào không mà sao cu trận 2,lần xuất gian dung thứ 2 là dis mặc dù mình đã thử rất nhiều lần....
var state = ""
var ghost_count = 0;
var god_count = 0;
var hpFraction = 0.9;
var spFraction = 0.9;
var warp_back = 0;
var flag_stop = 0;
var check = 0;
var turn1 = 0;
var turn2 = 0;
var counter = 0;
var time1 = 0;
var time2 = 0;
var delay1 = 1000;
var delay2 = 1000;

//my vars
//Chinh sua o duoi !!!
var mapid1 = 12013;
var mapid2 = 12521;
var warpid1 = 1;
var warpid2 = 5;
var id_chupt = 1134977;
var id_ptmem1 = 2113525;
var id_ptmem2 = 750717;
var id_ptmem3 = 440448;
var id_ptmem4 = 547818;
var id_quansu = 440722;

function MyAttack(){
ts.delay(1000);
turn1++;
if (turn1 == 1) {
//sk = SkillID("Whirlwind");
//sk = 10000;
sk = SkillID("Attack");
ts.SendAttack(
ts.Character.Row
, ts.Character.Col
, 0
, 2
, sk
)
}
if (turn1 >= 2) {

sk = SkillID("Attack");

ts.SendAttack(
ts.Character.Row
, ts.Character.Col
, 0
, 2
, sk
)
}
}

function MyPartnerAttack(){
turn2++;
if (turn2 == 1) {
sk = SkillID("Attack");

ts.SendAttack(
ts.CurrentPartner.Row
, ts.CurrentPartner.Col
, 0
, 2
, sk
)
}
if (turn2 >= 2) {
sk = SkillID("Attack");

ts.SendAttack(
ts.CurrentPartner.Row
, ts.CurrentPartner.Col
, 0
, 2
, sk
)
}
}

function BattleStarted(){
check = 0;
turn1 = 0;
turn2 = 0;
warp_back = 0;
flag_stop = 0;
time1 = 0;
time2 = 0;
}
function BattleStoped(){
ts.ClickOnNpc(1)
ts.ClickOnNpc(1)
ts.SendEnd();
check = 1;
SaveWarrior();
EatHP();
EatSP();
DoSendItem()
time1 = 0;
time2 = 0;
}

function EatHP(){
if (ts.Character.HP < (ts.Character.MAXHP * hpFraction)){
doEatHP(0,(ts.Character.MAXHP * hpFraction)-ts.Character.HP)
}
if (ts.CurrentPartner.HP < (ts.CurrentPartner.MAXHP * hpFraction)){
doEatHP(ts.CurrentPartner.Order,(ts.CurrentPartner.MAXHP * hpFraction)-ts.CurrentPartner.HP)
}
}

function EatSP(){
if (ts.Character.SP < (ts.Character.MAXSP * spFraction)){
doEatSP(0,(ts.Character.MAXSP * spFraction)-ts.Character.SP)
}
if (ts.CurrentPartner.SP < (ts.CurrentPartner.MAXSP * spFraction)){
doEatSP(ts.CurrentPartner.Order,(ts.CurrentPartner.MAXSP * spFraction)-ts.CurrentPartner.SP)
}
}

function SaveWarrior(){
if(ts.CurrentPartner.HP< 10){
frm.mnuEnableReconnect.Checked = false;
//ts.Disconect();
debug(" Cuu nguoi tren het! Disconnect nha! : ",0x0000FF)
}
}


function onEvilGod(){
ghost_count++
debug("E V I L G O D."+"["+ghost_count+"]",0x0000FF)
}

function onLuckyGod(){
god_count++;
debug("LUCKY G O D.",0xFF0000)
if(!QA.Exists(ts.LastQuestion)){
ts.delay(5000);
QA.Add(ts.LastQuestion,ts.LastResponseAnswer)
msg = "QA.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")"
WriteLog("QA.js",msg)
}
ts.delay(5000);
}

function onNPCAppear( npcmapid , x , y ){
debug("npcid [ " + npcmapid + "] ", 0)
if(npcmapid == 6){
ts.ClickOnNPC(npcmapid)
ts.ClickOnNPC(npcmapid)
}
}

function NpcDialogMenu(DialogId){
debug("Menu "+DialogId,0x0000FF)
if (DialogId==5) {
ts.SelectChoice(1);
ts.SendEnd();
} else ts.SendEnd();
//ts.SendEnd();
}

function NpcDialog(DialogId){
debug("Dialog "+DialogId,0x0000FF)
if(DialogId==15429){








}else if ( DialogId==10150){


ts.ClickOnNpc(4)



}


}

function FinishAnswerFuckGod(){
if(ghost_count>=3){
ts.Disconect();
}
ts.ClickOnNPC(4)
ts.SendEnd();

}

function doEatHP(order,difHp){
for(var i = 1;i<= 25 ;i++){
var oSlot = ts.MyItems.Item(i)
var oItem = ITEMS.Item(oSlot.itemid)
if (oSlot.itemid == 0){ continue; }
if(oItem.isHPItem()){
if (oItem.itemvalue > difHp){ continue; }
var eatHpAmt = (difHp - (difHp % oItem.itemvalue)) / oItem.itemvalue
if (eatHpAmt> 0){
if (eatHpAmt > oSlot.num){eatHpAmt = oSlot.num; }
ts.EatItem(i,eatHpAmt,order)
debug( "?"+oItem.itemname+" HP "+oItem.itemvalue+"at slot "+i+" decrease "+eatHpAmt+"?" ,0xC08008 )
difHp = difHp - eatHpAmt * oItem.itemvalue
}
}
}
}

function doEatSP(order,difSp){
for(var i = 1;i<= 25 ;i++){
var oSlot = ts.MyItems.Item(i)
var oItem = ITEMS.Item(oSlot.itemid)
if (oSlot.itemid == 0){ continue; }
if(oItem.isSPItem()){
if (oItem.itemvalue > difSp){ continue; }
var eatSpAmt = (difSp - (difSp % oItem.itemvalue)) / oItem.itemvalue
if (eatSpAmt> 0){
if (eatSpAmt > oSlot.num){eatSpAmt = oSlot.num; }
ts.EatItem(i,eatSpAmt,order)
debug( "?"+oItem.itemname+" SP "+oItem.itemvalue+"at slot "+i+" decrease "+eatSpAmt+"?" ,0xC08008 )
difSp = difSp - eatSpAmt * oItem.itemvalue
}
}
}
}

function DoSendItem() {
for(var i=1;i<=25;i++){
var oSlot = ts.MyItems(i);
if( oSlot.itemid == 0){ continue; }
var oItem = ITEMS.Item(oSlot.itemid);
var itemname = oItem.getName();
if( (itemname == "AutoAttackPill"
|| itemname == "Honey pill"
|| itemname == "AutoTonicPill"
|| itemname == "Yellow wine"
|| itemname == "Saltedshoots"
|| itemname == "ZhuoScroll"
|| itemname == "HasteScroll") && oSlot.num ==50){
ts.SendItemTo(01929392,oSlot.slot,oSlot.num);
} else { if ((itemname == "Blood tonic"
|| itemname == "6HerbPotion"
|| oSlot.itemid == 27035
|| itemname == "ZhongYuanDew"
|| itemname == "RefreshPill") && oSlot.num ==50)
{ts.SendItemTo(01929392,oSlot.slot,oSlot.num);}
}
}
}



function Start(){
flag_stop = 0;
time1 = 0;
time2 = 0;
if (ts.Character.mapid==mapid1) {ts.delay(delay1);ts.warp(warpid1);}
if (ts.Character.mapid==mapid2) {ts.delay(delay2);ts.warp(warpid2);}
}

function Stop(){
flag_stop = 1;
}

function InitBot(){

}


function OnTimer(){
counter++;
if (counter == 2) {
ts.AcceptParty(id_ptmem4);
ts.AcceptParty(id_ptmem3);
ts.AcceptParty(id_ptmem2);
ts.AcceptParty(id_ptmem1);
ts.sena(id_quansu);
ts.ClickOnNPC(1)
ts.SendEnd();

}

if (counter==1000) {counter=counter-900};
if (ts.Character.mapid==mapid2) {time1++; if (time1 == 10) {time1 = 0;flag_stop = 0;check = 1;ts.warp(warpid2);}}
if (ts.Character.mapid==mapid1) {time2++; if (time2 == 120) {time2 = 0;flag_stop = 0;check = 1;ts.warp(warpid1);}}
}

function PartyStop( playerid ){
if(playerid == id_chupt || playerid == id_ptmem1 || playerid == id_ptmem2 || playerid == id_ptmem3 || playerid == id_ptmem4){
ts.Disconect();
}
}




InitBot()
debug("Ti`nh trang hien nay: " + ts.Character.Ghost + " con ma!",0xFF9933)
 
*Jet007* nói:
1 Lệnh SendEnd() trong đó cũng đủ để nó SendEnd hết dialog rùi, lần sau nhớ dùng hàm if .... nhá ;;)
Sao lại không dùng hàm if trong đó, không dùng sao bot được TT
 
nmt_l nói:
Sao lại không dùng hàm if trong đó, không dùng sao bot được TT
Em chao` anh Tien :p ,anh share cho em scrip bot Hua Chu hoac Dien Vi voi duoc ko a.Em them` may kon do we' ma` ko bit bot nhu neo` anh giup em voi.Thank anh rat rat nhieu.
 
nói chung là dùng TB làm chủ PT để bot Q, k phải ts.Sentend(); khi k có dialog ID và dùng dc hàm if để k trả lời khi đánh xong, dùng Legna khi đánh Q xuất hiện thêm người như Bot TT dễ mất Q lắm.
 
Hix....sao hem ai cóa hồi âm cho mình hết vật ta.....*sigh*:(
dù sao cũng phải cố gắng để khỏi bị -mp chứ:p 30 charrrrrrrrrrrr
 
Back
Top