Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var state = ""
var ghost_count = 0;
var god_count = 0;
var die_count = 0;
var pet_die_count = 0;
var battle_count = 0;
var DisconnectFlag = 0.3;
var HealingFlag = 0.5;
var spFraction = 0.7;
var hpFraction = 0.6;
var vi = 1;
var va = 1;
function MyAttack(){
m = findMonster()
sk = 10000;
ts.SendAttack(
ts.Character.Row
, ts.Character.Col
, m.Row
, m.Col
, sk
)
}
function MyPartnerAttack(){
m = findMonster()
sk = 10000;
ts.SendAttack(
ts.CurrentPartner.Row
, ts.CurrentPartner.Col
, m.Row
, m.Col
, sk
)
}
function CheckHP(){
if (ts.Character.HP < (ts.Character.MAXHP * hpFraction)){
doEatHP(0,ts.Character.MAXHP-ts.Character.HP)
}
if (ts.Character.SP < (ts.Character.MAXSP * spFraction)){
doEatSP(0,(ts.Character.MAXSP * spFraction)-ts.Character.SP)
}
if (ts.CurrentPartner.HP < (ts.CurrentPartner.MAXHP * hpFraction)){
doEatHP(ts.CurrentPartner.Order,ts.CurrentPartner.MAXHP-ts.CurrentPartner.HP)
}
if (ts.CurrentPartner.SP < (ts.CurrentPartner.MAXSP * spFraction)){
doEatSP(ts.CurrentPartner.Order,(ts.CurrentPartner.MAXSP * spFraction)-ts.CurrentPartner.SP)
}
}
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 || oSlot.itemid == 50001){ 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 BattleStarted(){
battle_count++;
va = 0;
}
function BattleStoped(){
/* Just safty first. for Warrior not leave you call function SaveWarrior() every end battle. */
//SaveWarrior();
//CheckDisconnect();
CheckHP();
va = 1;
ts.delay(1500);
//autoSendItem()
Start();
}
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 onEvilGod(){
ghost_count++
debug("RAT TIEC! BAN DA TRA LOI SAI. SO LAN SAI LA: "+"["+ghost_count+"]",0x0000FF)
msg = "Wrong.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")"
WriteLog("Wrong.js",msg)
}
function onLuckyGod(){
debug("CHUC MUNG BAN DA TRA LOI DUNG!",0xFF0000)
if(!QA.Exists(ts.LastQuestion)){
QA.Add(ts.LastQuestion,ts.LastResponseAnswer)
msg = "QA.Add(\""+ts.LastQuestion+"\",\""+ts.LastResponseAnswer+"\")"
WriteLog("QA.js",msg)
}
}
function NpcDialogMenu(DialogId){
debug("Menu "+DialogId,0x0000FF)
if (DialogId==6) {
ts.SelectChoice(1);
ts.SendEnd();
} else {
ts.SendEnd();
}
}
function NpcDialog(DialogId){
debug("Dialog "+DialogId,0x0000FF)
//if (DialogId==10152) {
ts.SendEnd();
//} else if (DialogId==10150) {
// ts.SendEnd();
// ts.ClickOnNPC(3);
//}
}
function FinishAnswerFuckGod(){
god_count++;
if(ghost_count>=1){
debug("So lan tra loi sai: "+ghost_count+" lan!",0x00aaaa)
//ts.Disconect();
}
ts.ClickOnNPC(2)
}
function Start() {
// no remove this function
if (va == 1) {
ts.ClickOnNPC(2)
}
}
function Stop(){
//state= "stop"
//Toado()
// no remove this function
}
function InitBot(){
frm.mnuAutoEat.Checked = false;
frm.mnuEnableReconnect.Checked = true;
Timer.Enabled = true;
}
function OnTimer(){
Start();
}
InitBot()
Dragon St.Knight nói:Trời ơi ko ai share dùm em cái script tu trúc à ... T__T
Chắc mấy pác xây thành lên trung cấp ko phải là toàn xài alogin mà lên chứ >.<
Pác nào share dùm em T_T
micral nói:đã có post đâu đó trong topic này bác chịu khó tìm lại đi
var state = ""
function NpcDialogMenu(DialogId){
debug("Menu "+DialogId,0x0000FF)
if (DialogId==7) {
ts.SelectChoice(1);
ts.SendEnd();
} else {
ts.SendEnd();
}
}
function Start(){
ts.ClickOnNPC(13);
}
function Stop(){
}
function InitBot(){
Start();
}
function OnTimer(){
}
InitBot()
^_^Angel^_^ nói:sao mình ko giải nén đc wpexp vậy .. nóa cứ báo lỗi hoài .. có nên tắt nontor kô ?? help dùm cái pác miral
function AcceptedParty(playerid){
if(getPlayerName(playerid) == "WaterPlan" ||
getPlayerName(playerid) == "FirePlan" ||
getPlayerName(playerid) == "VuaAnCap" ||
getPlayerName(playerid) == "VuaGiutDo" ||
getPlayerName(playerid) == "xxx"
){
ts.AcceptParty(playerid)
if(getPlayerName(playerid) == "VuaAnCap"){
ts.sena ( playerid )
}
}
}
function InitParty(){
SetPartyFriend("VuaAnCap");
SetSena("VuaAnCap")
}
