var state = "" var ghost_count = 0; var god_count = 0; var hpFraction = 1; var spFraction = 0.95; var warp_back = 0; var flag_stop = 0; var turn1 = 0; var turn2 = 0; var time = 0; //my vars //Chinh sua o duoi !!! var mapid1 = 12013; var mapid2 = 12521; var warpid1 = 1; var warpid2 = 5; var id_chupt = 507931; var id_ptmem1 = 2007405; var id_ptmem2 = 2007492; var id_ptmem3 = 188399; var id_ptmem4 = 490338; var id_quansu = 490338; {ID4 là quân su) function MyAttack(){ turn1++; if (turn1 == 1) { sk = 10000("Attack"); ts.SendAttack( ts.Character.Row , ts.Character.Col , 0 , 3 , sk ) } if (turn1 >= 2) { sk = 18001("Escape "); ts.SendAttack( ts.Character.Row , ts.Character.Col , ts.Character.Row , ts.Character.Col , sk ) } } function MyPartnerAttack(){ turn2++; if (turn2 == 1) { sk = 10000("attack"); ts.SendAttack( ts.CurrentPartner.Row , ts.CurrentPartner.Col , 0 , 3 , sk ) } if (turn2 >= 2) { sk = 17001("Defend"); ts.SendAttack( ts.CurrentPartner.Row , ts.CurrentPartner.Col , ts.CurrentPartner.Row , ts.CurrentPartner.Col , sk ) } } function BattleStarted(){ turn1 = 0; turn2 = 0; warp_back = 0; flag_stop = 0; time = 0; } function BattleStoped(){ SaveWarrior(); EatHP(); EatSP(); DoSendItem() } 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) } function FinishAnswerFuckGod(){ if(ghost_count>=2){ debug("2 con ma rui! Disconnect thoi!",0x00aaaa) ts.Disconect(); } } 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 == "ZhuoScroll" || itemname == "HasteScroll") && oSlot.num ==50){ ts.SendItemTo(IDsenddo1,oSlot.slot,oSlot.num); } else { if ((itemname == "Blood tonic" || oSlot.itemid == 27035 || itemname == "ZhongYuanDew" || itemname == "RefreshPill") && oSlot.num ==50) {ts.SendItemTo(IDsenddo2,oSlot.slot,oSlot.num);} } } } function PlayerOnline( playerid ){ if (playerid == 507931) { if (ts.Character.mapid==12012) {ts.Warp(2);} if (ts.Character.mapid==mapid2) {ts.warp(warpid2);} } } function Start(){ debug("Moving to battlefield...",0); ts.Walk(1522,195); WarpLink( 12013 ,1 , 12521 ,5); } function Stop(){ } function InitBot(){ debug("login okie", 0x00FF00) EatHP(); EatSP(); if (ts.Character.mapid==12012) {ts.Warp(2);} if (ts.Character.mapid==mapid2) {ts.warp(warpid2);} frm.mnuAutoEat.Checked = false; Timer.Enabled = true; } function OnTimer(){ if (ts.Character.mapid==12012) {time++; if (time ==5) {time = 0; ts.Warp(2);}} if (ts.Character.mapid==mapid2) {time++; if (time ==5) {time = 0; ts.Warp(warpid2);}} } function warpFinish(){ if (ts.Character.mapid==10952) {ts.Walk(902,875);ts.delay(1000);ts.delay(1000);ts.warp(1);} } InitBot() debug("Ti`nh trang hien nay: " +ghost_count+ " con ma!",0xFF9933) may bac cho em hoi cai script nay co van de gi the
em ga ko bit ah vo day cau bài luôn hehehehehehe zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di zo di
Muốn người ta test sc thì làm ơn nói rõ khi xài sc đó rồim bị cái gì ? chứ đâu có ai rảnh muh debug từng câu cho bạn đâu
Đây la script lev1 dao tẩu full trên diễn đàn KP7 hả? Script này lỗi ở chỗ đề sai warpid và mapid. Sửa như sau: Thứ nhất mình nghĩ phần Playeronline là không cần thiết. Thứ hai là ở phần WarpFinish quan trọng nhất phải như sau: function warpFinish() //dùng để ra vào động { if (ts.Character.mapid == mapid1) { ts.Walk(1522,195); WarpLink( 12013 ,1 , 12521 ,5); } if (ts.Character.mapid == mapid2) { WarpLink( 12521 ,5, 12013 ,1); } } Tuy nhiên, theo script này thi sau khi trả lời BTQ sẽ bị dừng lại và không chạy tiếp. Bởi sau khi trả lời BTQ thì nó sẽ coi là kết thúc Battle chứ không phải kết thúc warp. Do đó bạn cần thêm đoạn nêu trên vao FinishAnswerFuckGod() hoặc đơn giản chỉ cần cho như sau: function BattleStoped() // hàm chạy khi kết thúc trận đánh { SaveWarrior(); EatHP(); EatSP(); DoSendItem() if (ts.Character.mapid == mapid1) { ts.Walk(1522,195); WarpLink( 12013 ,1 , 12521 ,5); } if (ts.Character.mapid == mapid2) { WarpLink( 12521 ,5, 12013 ,1); } } Chúc các bạn vui vẻ và còn nhiều người ở lại với TS. hix. Giờ buồn quá. Chú ý là hàm WarpLink chỉ có trogn file common.js của TB VN do Micral sửa thôi. Các bạn nếu dung bản TB khác bản trên Gamevn này thì nên down bản TB trên này về để lấy hàm WarpLink trogn đó. Nếu có sai sót mong các bạn chỉ bảo thêm. Noob ở server Tôn Quyền
Cần Script cho lv 1 đào tẩu hả em cho nè : var state = "" var battle_count = 0; var mapid1 = 12815; var mapid2 = 12421; var warpid1 = 1; var warpid2 = 2; var warp_pos_x = 662; var warp_pos_y = 475; var myParty = new Array(id,id,id,id,id); pt_leader = myParty[0]; //id chu pt function MyAttack(){ turn1++; if (turn1 == 1) { sk = SkillID("Attack"); ts.SendAttack( ts.Character.Row , ts.Character.Col , 0 , 2 , sk ) } if (turn1 >= 2) { sk =18001; ts.SendAttack( ts.Character.Row , ts.Character.Col , ts.Character.Row , ts.Character.Col , 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 = 18001; ts.SendAttack( ts.CurrentPartner.Row , ts.CurrentPartner.Col , ts.CurrentPartner.Row , ts.CurrentPartner.Col , sk ) } } function BattleStarted(){ turn1 = 0; turn2 = 0; } function BattleStoped(){ debug(" Ghost Count : " + ts.Character.Ghost ,0xFF0000); } function onEvilGod(){ ghost_count++ debug("E V I L G O D."+"["+ghost_count+"]",0x0000FF) } function onLuckyGod(){ debug("LUCKY G O D.",0xFF0000) } function FinishAnswerFuckGod(){ } function CheckDisconnect(){ if(ts.Character.HP <= 0){ die_count++ } if(die_count>3){ ts.Disconect(); } } function InitBot() { if (ts.Character.mapid==mapid1) WarpLink(mapid1,warpid1,mapid2,warpid2); if (ts.Character.uid!=1752669) Timer.Enabled=true; } function OnTimer(){ ts.RequestParty(pt_leader); } function PartyStop( playerid ){ for (var i=0; i<myParty.length;i++) { if (playerid == myParty) { InitBot(); } } } InitBot() debug("So con ma " + ts.Character.Ghost,0x0000FF) Vì TB bây giờ bị 1 số hạn chế nên mnihf đã lược bỏ 1 số thứ. Chúc các bạn không bị đi bóc lịch.
Script này có thể đánh được sao ? Thứ 1: đã là gà lv1 thì cần gì phải warp ? Thứ 2: đã là gà lv1 thì cần gì phải set pt 5 người ? chưa kể lỗi sơ đẳng nhất khi viết sc là không khai báo biến turn1, turn2 muh đem ra xài thế muh cũng share cho người khác được sao ?
Sai rồi bạn ơi. Hết BTQ không phải là hêt battle muh phải dùng trong FinishAnswerFuckGod(). Nhưng thật không hiểu diễn đàn KP7 ra sao, và ngay cả bạn TuanLinhTTL lại nghĩ sao ? warp thì chỉ cần một chủ pt ? tại sao phải warp cho cả lv1 ? có phải mình đang tự làm khổ mình chăng ? 1 lúc 5 acc warp hỏi sao đánh lâu...
hix. Xin lỗi! Luc đó không nhìn kỹ. Tưởng là chủ pt ^^. Thông cảm nhé. Còn mình cũng dùng FinishAnswerFuckGod cho ban script cua minh hoac la dung o BattleStop() ^^. Do nhin voi qua. Tai thay hoi sao khogn ra vao duoc ^^