Các pro xem giùm scrip của mình thử xem có sai gì không mà sao đánh 1 lúc là nó báo lỗi (Send report, don't send, Debug). Đây là đoạn scrip đánh HCDT, khi đánh chỗ khác thì ko sao,nhưng wa HC là bị lỗi ah`.
Đây là chủ pt
Đây là chủ pt
Mã:
var state = "";
var ghost_count = 0;
var die_count = 0;
var DisconnectFlag = 0.3;
var battle_count = 0;
var HealingFlag = 0.5;
var atkmode = 0
var pt_count=1;
function MyAttack(){
m = findMonster()
//m = SelectF1Target();
var n = MonsterAlive()
if( n >= 1 ){
if (ts.Character.SP > 14 ){
sk = 12003;
}
else{
sk = 10000;
}
}
else{
sk = 10000;
}
ts.SendAttack(
ts.Character.Row
, ts.Character.Col
, m.Row
, m.Col
, sk
)
}
function MyPartnerAttack(){
m = findMonster();
// m = SelectF1Target();
if (ts.CurrentPartner.SP > 14 ){
sk = 12003;
}
else{
sk = 10000;
}
ts.SendAttack(
ts.CurrentPartner.Row
, ts.CurrentPartner.Col
, m.Row
, m.Col
, sk
)
}
function ViewState(){
debug("************************************",0xFF0000)
debug(" Battle Count : " + battle_count ,0xFF0000)
debug(" Dead Count : " + die_count ,0xFF0000)
debug(" Ghost Count : " + ts.Character.Ghost ,0xFF0000)
debug(" Warrior's FAI : " + ts.CurrentPartner.CharName +" : " + ts.CurrentPartner.fai,0xFF0000)
debug("************************************",0xFF0000)
}
function SaveWarrior(){
if(ts.CurrentPartner.HP< ((0.20) * ts.CurrentPartner.MAXHP)){
ts.Disconect();
debug(" SAVE THE FAI DISCONNECT NOW! : ",0x0000FF);
}
}
function onNPCAppear( npcmapid , x , y ){
ts.ClickOnNPC(npcmapid)
ts.ClickOnNPC(npcmapid)
}
function NpcDialogMenu(DialogId){
debug("Menu "+DialogId,0x0000FF)
ts.SelectChoice(1);
debug("Í͡úººº ÊÙéâÇéÂÂ! "+DialogId,0x0000FF)
ts.SendEnd();
}
function NpcDialog(DialogId){
// debug("Dialog "+DialogId,0x0000FF)
ts.SendEnd();
}
function FinishAnswerFuckGod(){
if(ghost_count>=3){
ts.Disconect();
}
if(state=="autowarp"){
ts.delay(4000)
WarpLink( 12063 ,2 , 12301 ,1)
}
}
function CheckDisconnect(){
if(ts.Character.HP <= 0){
die_count++
}
if(die_count>3){
ts.Disconect();
}
}
function InitBot(){
state= "logon";
debug("True script. (walk cave)" , 0x00FF00 );
if (ts.Character.mapid==12301) { WarpLink( 12063 ,2 , 12301 ,1); }
}
function WaitAcceptParty(playerid){
if(playerid == 111111
|| playerid == 22222
|| playerid == 33333
|| playerid == 44444
){
// ts.AcceptParty(playerid);
}
}
function AcceptedParty(playerid){
if(playerid == 111111
|| playerid == 222222
|| playerid == 33333
|| playerid == 444444
){
ts.AcceptParty(playerid);
pt_count++;
ts.sena(111111)
if (pt_count==5) Start();
}
}
function PartyStop( playerid ){
if(playerid == 1111111
|| playerid == 222225
|| playerid == 1333
|| playerid == 4444
){
ts.Disconect();
}
}
function onPlayerWalk( uid , x , y ){
if(uid==689844 && x ==582 && y ==315 ){
}
}
var wp_x = new Array(502,582,442)
var wp_y = new Array(295,355,395)
var w_index = 0
function onWalk(x,y){
}
var onwrapok1 = false
var onwrapok2 = false
var onwrapok3 = false
function BattleStarted(){
battle_count++;
}
function BattleStarted(){
battle_count++;
turn_count=0;
}
function BattleStoped(){
/* Just safty first. for Warrior not leave you call function SaveWarrior() every end battle. */
SaveWarrior();
CheckDisconnect();
ViewState();
}
function OnTimer(){
}
function warpFinish(){
if(state=="autowarp"){
if(ts.Character.mapid == 12301){
ts.delay(4000)
WarpLink( 12063 ,2 , 12301 ,1)
}else if(ts.Character.mapid==12063){
ts.delay(4000)
ts.Walk(562,315)
WarpLink( 12063 ,2 , 12301 ,1)
}
}
}
function Start(){
state="autowarp"
// ts.Walk(2582,555)
WarpLink( 12063 ,2 , 12301 ,1)
}
function Stop(){
state=""
// ts.Walk(2982,275)
}
function onEvilGod(){
ghost_count++ ;
debug("E V I L G O D."+"["+ghost_count+"]",0x0000FF) ;
msg = "Wrong.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")" ;
WriteLog("Wrong.js",msg) ;
}
function onLuckyGod(){
debug("LUCKY G O D.",0xFF0000)
if(!QA.Exists(ts.LastQuestion)){
QA.Add(ts.LastQuestion,ts.LastResponseAnswer) ;
msg = "QA.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")" ;
WriteLog("QA.js",msg) ;
}
}
InitBot()
[\CODE]
còn đây là member
[CODE]
var state = ""
var ghost_count = 0;
var die_count = 0;
var DisconnectFlag = 0.3;
var battle_count = 0;
var SetHPMAX1 = (ts.Character.MAXHP=400);
var SetHPMAX2 = (ts.CurrentPartner.MAXHP = 300);
var SetSPMAX1 = (ts.Character.MAXSP=99);
var SetSPMAX2 = (ts.CurrentPartner.MAXSP = 59);
var turn_count=0;
function MyAttack(){
m = findMonster();
//m = SelectF1Target();
var n = MonsterAlive();
if( n >= 1 ){
if (ts.Character.SP > 14 ){
sk = 12003;
}
else{
sk = 10000;
}
}
else{
sk = 10000;
}
ts.SendAttack(
ts.Character.Row
, ts.Character.Col
, m.Row
, m.Col
, sk
);
//ts.Character.MAXHP = SetHPMAX1 ;
//ts.Character.MAXSP = SetSPMAX1 ;
}
function MyPartnerAttack(){
m = findMonster()
//m = SelectF1Target();
if (ts.CurrentPartner.SP > 14 ){
sk = 12003;
}
else{
sk = 10000;
}
ts.SendAttack(
ts.CurrentPartner.Row
, ts.CurrentPartner.Col
, m.Row
, m.Col
, sk
);
//ts.CurrentPartner.MAXHP = SetHPMAX2 ;
//ts.CurrentPartner.MAXSP = SetSPMAX2 ;
}
function BattleStarted(){
battle_count++;
turn_count=0;
}
function BattleStoped(){
CheckDisconnect();
ts.ClickOnNPC(1)
debug("************************************",0xFF0000)
debug(" Battle Count : " + battle_count ,0xFF0000)
debug(" Dead Count : " + die_count ,0xFF0000)
debug(" Ghost Count : " + ghost_count ,0xFF0000)
debug(" Warrior's FAI : " + ts.CurrentPartner.CharName +" : " + ts.CurrentPartner.fai,0xFF0000)
debug("************************************",0xFF0000)
}
function onNPCAppear( npcmapid , x , y ){
//debug(npcmapid,0);
if(npcmapid == 1 ||npcmapid == 2 || npcmapid == 3 || npcmapid == 4 || npcmapid == 5 || npcmapid == 6){ /// Change to your npcid do you want to click it.
ts.ClickOnNPC(npcmapid);
ts.ClickOnNPC(npcmapid);
}
}
function onEvilGod(){
ghost_count++
debug("E V I L G O D."+"["+ghost_count+"]",0x0000FF)
}
function onLuckyGod(){
debug("LUCKY G O D.",0xFF0000)
}
function OnTimer(){
ts.RequestParty(985947);
}
function FinishAnswerFuckGod(){
if(ghost_count>=3){
ts.Disconect();
}
}
function CheckDisconnect(){
if(ts.Character.HP <= 0){
die_count++
}
if(die_count>10){
ts.Disconect();
}
}
function Start(){
// no remove this function
}
function Stop(){
// no remove this function
}
function InitBot(){
if (ts.Character.mapid==12301) { WarpLink( 12063 ,2 , 12301 ,1); cdelay(3); }
Timer.Enabled=true;
}
function RequestPartyAcceptedFrom(uid) {
if (uid==985947) Timer.Enabled=false;
}
function PartyStop( playerid ){
if(playerid == 985947
|| playerid == 416165
|| playerid == 1412655
|| playerid == 676529
){
debug("Dis by other dis",0x0000FF);
ts.Disconect();
}
}
function onEvilGod(){
ghost_count++;
debug("E V I L G O D."+"["+ghost_count+"]",0x0000FF) ;
msg = "Wrong.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")" ;
WriteLog("Wrong.js",msg) ;
}
function onLuckyGod(){
debug("LUCKY G O D.",0xFF0000)
if(!QA.Exists(ts.LastQuestion)){
QA.Add(ts.LastQuestion,ts.LastResponseAnswer) ;
msg = "QA.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")" ;
WriteLog("QA.js",msg) ;
}
}
InitBot()
[\CODE]
Ai bít cách khắc phục lỗi trên ko ,chỉ mình với, thank rất nhiều
#