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.
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 = 12421;
double mapid2 = 12815;
byte warpid1 = 2;
byte warpid2 = 1;
/***** Chinh sua ID Member o day *****/
uint idmem1 = 1825092;
uint idmem2 = 1596006;
uint idmem3 =02206175 ;
uint idmem4_sena =1282311;
/*************************************/
/*********************** My Attack *************************/
public override void MyAttack()
{
myturn++;
if (myturn == 1)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 3, 17001);
}
if (myturn ==2)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 4, 17001);
}
if (myturn >=3)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 3, 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, 12003);
}
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();
ts.SendEnd();
}
/******************* 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(idmem1);}
if (pt2 == 0) {ts.AcceptParty(idmem2);}
if (pt3 == 0) {ts.AcceptParty(idmem3);}
if (pt4 == 0) {ts.AcceptParty(idmem4_sena);}
}
/********************* Accepted Party **********************/
public override void AcceptedParty(uint playerid)
{
if (playerid == idmem1) {debug(playerid + " Gia nh?p d?i ngu");pt1 = 1;}
if (playerid == idmem2) {debug(playerid + " Gia nh?p d?i ngu");pt2 = 1;}
if (playerid == idmem3) {debug(playerid + " Gia nh?p d?i ngu");pt3 = 1;}
if (playerid == idmem4_sena) {debug(playerid + " Gia nh?p d?i ngu");pt4 = 1;
ts.Sena(idmem4_sena);debug(playerid + " Làm Quân Su");}
if (pt1 ==1 && pt2 == 1 && pt3 == 1 && pt4 == 1) {ts.SetTimerOnOff(false);ts.delay(1000);debug("Ð?i ngu dã d?y -> Start");Start();}
}
/*********************** Party Stop ************************/
public override void PartyStop(uint playerid)
{
if (playerid == idmem1) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();}
if (playerid == idmem2) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();}
if (playerid == idmem3) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();}
if (playerid == idmem4_sena) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();}
}
/********************** Warp Finish ************************/
public override void warpFinish()
{
Start();
}
/************************* Start ***************************/
public override void Start()
{
if (ts.Character.mapid == mapid1) {
ts.delay(600);
ts.Warp(warpid1);
return;
} else
if (ts.Character.mapid == mapid2) {
ts.Warp(warpid2);
return;
}
}
/************************** Stop ***************************/
public override void Stop()
for(byte i=0;i<25;i++){
Slot oSlot = (Slot)ts.MyItems[i];
Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
if(oSlot.itemid == 0){ continue; }
debug(oItem.itemname + " at slot " + oSlot.slot.ToString() + " with ID " + oSlot.itemid.ToString(),0);
}
}
/*********************** View State ************************/
void ViewState()
{
debug("************************************************** **********************",255) ;
debug(" S? tr?n dá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 TiêuPhong - Ð?ng_K?ng_S?n =======",255) ;
}
/********************* Fishish Answer **********************/
public override void FinishAnswer()
{
ts.delay(2000);
Start();
}
/************************ Init Bot *************************/
public override void InitBot()
{
ts.SetTimerOnOff(true);
ts.SetReconnectTime(2);
AddDropItemList("viênongmật");
AddDropItemList("Dâu đỏ");
AddDropItemList("Táo nhỏ");
AddDropItemList("Bành Bột Mì");
AddDropItemList("tựđ uốngthuốc");
AddDropItemList("viên công kích");
ViewState();
}
nếu 1 gà 2 tôn trọng thì max là 500 + , tính sao cho các mage bán cung sao cho sắp die triệu hoành còn 40 giọt đổi xuống thì con mage cuối cùng agi thấp nhất sẻ dứt điểm ( con mage kết thúc này inter sao củng dc ) ăn thua set damage mấy con mage kia sao cho phù hợp bán cung sắp die triệu hoành ! Set như thế thì 1 trận sẽ 480 - 500 EXPchimcu nói:ai help mình cái agi bot 2 ton trong và 1 gà ko? mình để mọi agi rồi mà ko tài nào lên điểm được, 1 gà 1 tt là 400+ mà 1 gà 2 tt vẫn là 400+ chẳng hơn được điểm exp j cả. ai chỉ rùm với nha

Mod cho vao code giùm cái vì em ko bít cho vào như thế nàoNghĩa là con mage cuối cùng ko combo hả ban????KEN_BALAMO nói:nếu 1 gà 2 tôn trọng thì max là 500 + , tính sao cho các mage bán cung sao cho sắp die triệu hoành còn 40 giọt đổi xuống thì con mage cuối cùng agi thấp nhất sẻ dứt điểm ( con mage kết thúc này inter sao củng dc ) ăn thua set damage mấy con mage kia sao cho phù hợp bán cung sắp die triệu hoành ! Set như thế thì 1 trận sẽ 480 - 500 EXP![]()
Ai giúp tui vớiNuub nói:đây là cái hàm tui ghi thêm để nó dò id của đồ nhưng nó báo lỗiMã: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 = 12421; double mapid2 = 12815; byte warpid1 = 2; byte warpid2 = 1; /***** Chinh sua ID Member o day *****/ uint idmem1 = 1825092; uint idmem2 = 1596006; uint idmem3 =02206175 ; uint idmem4_sena =1282311; /*************************************/ /*********************** My Attack *************************/ public override void MyAttack() { myturn++; if (myturn == 1) { CharacterInfo MyChar = ts.Character; //NPCCombatObject Monster = findMonster(); ts.SendAttack(MyChar.Row, MyChar.Col, 0, 3, 17001); } if (myturn ==2) { CharacterInfo MyChar = ts.Character; //NPCCombatObject Monster = findMonster(); ts.SendAttack(MyChar.Row, MyChar.Col, 0, 4, 17001); } if (myturn >=3) { CharacterInfo MyChar = ts.Character; //NPCCombatObject Monster = findMonster(); ts.SendAttack(MyChar.Row, MyChar.Col, 0, 3, 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, 12003); } 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(); ts.SendEnd(); } /******************* 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(idmem1);} if (pt2 == 0) {ts.AcceptParty(idmem2);} if (pt3 == 0) {ts.AcceptParty(idmem3);} if (pt4 == 0) {ts.AcceptParty(idmem4_sena);} } /********************* Accepted Party **********************/ public override void AcceptedParty(uint playerid) { if (playerid == idmem1) {debug(playerid + " Gia nh?p d?i ngu");pt1 = 1;} if (playerid == idmem2) {debug(playerid + " Gia nh?p d?i ngu");pt2 = 1;} if (playerid == idmem3) {debug(playerid + " Gia nh?p d?i ngu");pt3 = 1;} if (playerid == idmem4_sena) {debug(playerid + " Gia nh?p d?i ngu");pt4 = 1; ts.Sena(idmem4_sena);debug(playerid + " Làm Quân Su");} if (pt1 ==1 && pt2 == 1 && pt3 == 1 && pt4 == 1) {ts.SetTimerOnOff(false);ts.delay(1000);debug("Ð?i ngu dã d?y -> Start");Start();} } /*********************** Party Stop ************************/ public override void PartyStop(uint playerid) { if (playerid == idmem1) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();} if (playerid == idmem2) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();} if (playerid == idmem3) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();} if (playerid == idmem4_sena) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();} } /********************** Warp Finish ************************/ public override void warpFinish() { Start(); } /************************* Start ***************************/ public override void Start() { if (ts.Character.mapid == mapid1) { ts.delay(600); ts.Warp(warpid1); return; } else if (ts.Character.mapid == mapid2) { ts.Warp(warpid2); return; } } /************************** Stop ***************************/ public override void Stop() for(byte i=0;i<25;i++){ Slot oSlot = (Slot)ts.MyItems[i]; Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()]; if(oSlot.itemid == 0){ continue; } debug(oItem.itemname + " at slot " + oSlot.slot.ToString() + " with ID " + oSlot.itemid.ToString(),0); } } /*********************** View State ************************/ void ViewState() { debug("************************************************** **********************",255) ; debug(" S? tr?n dá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 TiêuPhong - Ð?ng_K?ng_S?n =======",255) ; } /********************* Fishish Answer **********************/ public override void FinishAnswer() { ts.delay(2000); Start(); } /************************ Init Bot *************************/ public override void InitBot() { ts.SetTimerOnOff(true); ts.SetReconnectTime(2); AddDropItemList("viênongmật"); AddDropItemList("Dâu đỏ"); AddDropItemList("Táo nhỏ"); AddDropItemList("Bành Bột Mì"); AddDropItemList("tựđ uốngthuốc"); AddDropItemList("viên công kích"); ViewState(); }
invald token "for" in class, struct, or interface member declaration
Type expected
invald token "25" in class, struct, or interface member declaration
invald token "++" in class, struct, or interface member declaration
invald token "if" in class, struct, or interface member declaration
invald token "==" in class, struct, or interface member declaration
class, stucrt, or interface method must have a return type
identifier expected
invald token "(" in class, struct, or interface member declaration
a name space does not directly contain members such as fields or methods
Ai chỉ giùm cái
Chỗ "Stop" thiếu dấu "{".Nuub nói:Ai giúp tui với
tui cần rất gấp á
thanks
ai giúp em nó dùm cái điyugioh! nói:ai có cái script nèo mà trả lời bắc tinh quân up lên cho em dới, ăn ma điên cuồng đi giải phê quá![]()
, nàm ơn nàm ơn nàm nàm ơn -,-"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 pt4 = 0;
double mapid1 = 12000;
double mapid2 = 11000;
byte warpid1 = 30;
byte warpid2 = 1;
/***** Chinh sua ID Member o day *****/
uint idmem1 = 2205226;
uint idmem4_sena = 2097059;
/*************************************/
/*********************** My Attack *************************/
public override void MyAttack()
{
myturn++;
if (myturn == 1)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 12003);
}
if (myturn >=2)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 2, 2, 12003);
}
}
/*
public override void MyPartnerAttack()
{
peturn++;
if (peturn == 1)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 2, 10000);
}
if (peturn >= 2)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 2, 2, 17001);
}
}*/
/********************* Battle Started **********************/
public override void BattleStarted()
{
battle_count++;
myturn = 0;
peturn = 0;
}
/********************* Battle Stoped ***********************/
public override void BattleStoped()
{
ts.delay(200);
AutoEatFood();
ProcessInventoryAction();
CheckDisconnect();
ViewState();
ts.SendEnd();
ts.SendEnd();
}
/******************* 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)
{
}
/********************* 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(idmem1);}
if (pt4 == 0) {ts.AcceptParty(idmem4_sena);}
}
/********************* Accepted Party **********************/
public override void AcceptedParty(uint playerid)
{
if (playerid == idmem1) {debug(playerid + " Gia nh?p d?i ngu");pt1 = 1;}
if (playerid == idmem4_sena) {debug(playerid + " Gia nh?p d?i ngu");pt4 = 1;
ts.Sena(idmem4_sena);debug(playerid + " Làm Quân Su");}
if (pt1 ==1 && pt4 == 1) {ts.SetTimerOnOff(false);ts.delay(1000);debug("Ð?i ngu dã d?y -> Start");Start();}
}
/*********************** Party Stop ************************/
public override void PartyStop(uint playerid)
{
if (playerid == idmem1) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();}
if (playerid == idmem4_sena) {debug(playerid+" R?i kh?i d?i ng? -> Disconnect !!!");ts.Disconnect();}
}
/********************** Warp Finish ************************/
public override void warpFinish()
{
Start();
}
/************************* Start ***************************/
public override void Start()
{
if (ts.Character.mapid == 12000) {
ts.Walk(1262,2475);
ts.delay(200);
ts.Warp(30);
ts.SendEnd();
return;
} else
if (ts.Character.mapid == 11000) {
ts.Warp(1);
return;
}
}
/************************** Stop ***************************/
public override void Stop()
{
}
/*********************** View State ************************/
void ViewState()
{
debug("************************************************** **********************",255) ;
debug(" S? tr?n dá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 Jet007 - Copy Right GameVN–™ =======",255) ;
}
/********************* Fishish Answer **********************/
public override void FinishAnswer()
{
ts.delay(2000);
Start();
}
/**************** Request Party Accept From ****************/
//public override void RequestPartyAcceptFrom(uint playerid)
//{
//if (playerid == idmem1) {ts.delay(500);ts.AcceptParty(playerid); pt1 = 1;debug(playerid + " Johned team");}
//if (playerid == idmem4_sena) {ts.delay(500);ts.AcceptParty(playerid);ts.delay(5 00);ts.Sena(playerid); pt4 = 1;debug(playerid + " Johned team, Quân Su = "+playerid);}
//if (pt1 == 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("t?d u?ngthu?c");
AddDropItemList("viên công kích");
ViewState();
}
public override void MyAttack()
{
turna++;
if (turna == 1)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 12003);
}
if (turna >=2)
{
CharacterInfo MyChar = ts.Character;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 4, 10000);
}
}
public override void MyPartnerAttack()
{
turnb++;
if (turnb == 1)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 2, 12003);
}
if (turnb >= 2)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
//NPCCombatObject Monster = findMonster();
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 4, 10000);
}
}
NPCCombatObject findMonster()
{
int maxhp = 0;
string mi = "";
foreach (NPCCombatObject onpc in ts.oNPCCombat.Values)
{
if (onpc.HP > 0)
{
if (onpc.MAXHP > maxhp)
{
maxhp = onpc.MAXHP;
mi = onpc.Row.ToString() + onpc.Col.ToString();
}
}
}
return ts.oNPCCombat[mi] as NPCCombatObject;
}
void doEatSP(ushort order,int difSp){
for(byte i = 0;i< 25 ;i++){
Slot oSlot = (Slot)ts.MyItems[i];
if (oSlot.itemid == 0) { continue; }
Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
if(oItem.isSPItem()){
int itemvalue=oItem.getSPValue();
if (itemvalue > difSp){ continue; }
byte eatSpAmt = (byte)((difSp - (difSp % itemvalue)) / itemvalue);
if (eatSpAmt> 0){
if (eatSpAmt > oSlot.num){
eatSpAmt = oSlot.num;
}
ts.EatItem((byte)(i+1),eatSpAmt,order) ;
debug(oItem.itemname+" SP "+itemvalue+" at slot "+((byte)(i+1)).ToString()+" decrease"+eatSpAmt ,0xC08008 );
difSp = difSp - eatSpAmt * itemvalue ;
}
}
}
ts.delay(500);
}
void doEatHP(ushort order,int difHp){
for(byte i = 0;i< 25 ;i++){
Slot oSlot = (Slot)ts.MyItems[i];
if (oSlot.itemid == 0) { continue; }
Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
if(oItem.isHPItem()){
int itemvalue=oItem.getHPValue();
if (itemvalue > difHp){ continue; }
byte eatHpAmt = (byte)((difHp - (difHp % itemvalue)) / itemvalue );
if (eatHpAmt> 0){
if (eatHpAmt > oSlot.num){
eatHpAmt = oSlot.num;
}
ts.EatItem((byte)(i+1),eatHpAmt,order);
debug(oItem.itemname + " HP " + itemvalue.ToString() + " at slot " + ((byte)(i+1)).ToString() + " decrease " + eatHpAmt.ToString() ,0xC08008 );
difHp = difHp - eatHpAmt * itemvalue ;
}
}
}
ts.delay(500);
}
void FindItemContribute(string ItemName){
Slot s = FindItemInSlot(ItemName);
if(s != null){
ts.Contribute(s.slot);
}
}
void FindItemDrop(string ItemName){
Slot s = FindItemInSlot(ItemName);
if(s != null){
ts.DropItem(s.slot,s.num);
}
}
Slot FindItemInSlot(string ItemName){
for(byte i=0;i<25;i++){
Slot oSlot = (Slot)ts.MyItems[i];
if( oSlot.itemid == 0){ continue; }
Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
if(oItem.itemname == ItemName){
return oSlot;
}
}
return null;
}
void AutoEatFood(){
if (ts.Character.HP < (ts.Character.MAXHP * hpFractionEat)){
doEatHP(0,(int)((ts.Character.MAXHP * hpFraction)-ts.Character.HP));
}
if (ts.Character.SP < (ts.Character.MAXSP * spFractionEat)){
doEatSP(0,(int)((ts.Character.MAXSP * spFraction)-ts.Character.SP));
}
if (ts.CurrentPartner.HP < (ts.CurrentPartner.MAXHP * hpFractionEat)){
doEatHP((ushort)ts.CurrentPartner.Order,(int)((ts.CurrentPartner.MAXHP * hpFraction)-ts.CurrentPartner.HP));
}
if (ts.CurrentPartner.SP < (ts.CurrentPartner.MAXSP * spFractionEat)){
doEatSP((ushort)ts.CurrentPartner.Order,(int)((ts.CurrentPartner.MAXSP * spFraction)-ts.CurrentPartner.SP));
}
}
int get_random(int min,int max)
{
System.Random rd=new System.Random();
int ranNum= rd.Next(min,max);
return ranNum;
}
void Disconnect(string msg) {
debug(msg,0x0000FF);
ts.Disconnect();
}
void CheckDisconnect(){
if(ts.Character.HP< (DisconnectFlag * ts.Character.MAXHP)){
Disconnect("Disconnected : Character HP is low !!");
}
if(ts.CurrentPartner.HP< (DisconnectFlag * ts.CurrentPartner.MAXHP)){
Disconnect("Disconnected : Warrior HP is low !!");
}
if(ts.CurrentPartner.fai < DisconFai){
Disconnect("Disconnected : Warrior faith is below faith flag !!");
}
}
System.Collections.ArrayList DropItemList = new System.Collections.ArrayList();
System.Collections.ArrayList ContributeItemList = new System.Collections.ArrayList();
void AddDropItemList(string itemname) {
if (!DropItemList.Contains(itemname)) {
DropItemList.Add(itemname);
}
}
bool InDropItemList(string itemname) {
if (DropItemList.Contains(itemname))
return true;
else
return false;
}
void AddContributeItemList(string itemname) {
if (!ContributeItemList.Contains(itemname)) {
ContributeItemList.Add(itemname);
}
}
bool InContributeItemList(string itemname) {
if (ContributeItemList.Contains(itemname))
return true;
else
return false;
}
void ProcessInventoryAction(){
for(byte i=0;i<25;i++){
Slot oSlot = (Slot)ts.MyItems[i];
if( oSlot.itemid == 0){ continue; }
Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
if (InDropItemList(oItem.itemname)) ts.DropItem(oSlot.slot,oSlot.num);
if (InContributeItemList(oItem.itemname)) ts.Contribute(oSlot.slot);
if((
oSlot.itemid == 26168 ||
oSlot.itemid == 27066 ||
oSlot.itemid == 27032 ||
oSlot.itemid == 46013 ||
oSlot.itemid == 46041 ||
oSlot.itemid == 46033 ||
oSlot.itemid == 26169 ||
oSlot.itemid == 27035 )&& oSlot.num >= 1) {ts.DropItem(oSlot.slot,oSlot.num);} // Day la Drop
if((oSlot.itemid == 27005 )&& oSlot.num == 50) {ts.DropItem(oSlot.slot,oSlot.num);}
}
}