LordRevenge
Youtube Master Race
Không hiểu sao mình bot TG mà mỗi lần gặp BTQ là con chủPT dis làm ăn ma liên tục. Mọi người coi giùm xem script của mình có sai chỗ nào không. Chứ fải đi giải ma hoài mệt wá.
Mã:
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 songuoi = 00;
byte DisconFai = 00;
byte battle_count = 00;
byte myturn = 0;
byte peturn = 0;
byte NS_count = 00;
uint maxpt=5;
uint idchupt=555203;
/*********Member*********/
uint idMem1=75850;
uint idMem2=1341278;
uint idMem3=1341268;
uint idMem4=533046;
public override void MyAttack()
{
if (myturn == 1)
{
CharacterInfo MyChar = ts.Character;
ts.SendAttack(MyChar.Row, MyChar.Col, 0, 2, 12003);
}
if (myturn > 1)
{
CharacterInfo MyChar = ts.Character;
ts.SendAttack(MyChar.Row, MyChar.Col, 1, 2, 17001);
}
}
public override void MyPartnerAttack()
{
if (peturn == 1)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 0, 2, 10000);
}
if (peturn > 1)
{
CharacterInfo MyWarrior = ts.CurrentPartner;
ts.SendAttack(MyWarrior.Row, MyWarrior.Col, 1, 2, 17001);
}
}
public override void BattleStarted()
{
myturn = 1;
peturn = 1;
ts.delay(1);
}
public override void BattleStopped()
{
ts.delay(300);
{
ts.ClickOnNPC(50);
ts.SendEnd();
AutoEatFood();
ProcessInventoryAction();
battle_count++;
viewState();
Start();
}
}
public override void doRecvQuestion()
{
NS_count++;
}
public override void ResponseAnswer()
{
int dtime=0;
debug("Delay "+dtime.ToString()+" before answer.");
ts.delay(dtime*0);
string tmp=ts.LastQuestion.Replace("=?","");
int ans=ts.Eval(tmp);
byte ans_index=Convert.ToByte(ts.LastAnswers[ans.ToString()]);
debug("Answer choice:"+ans_index.ToString());
ts.Answer(ans_index);
}
public override void NpcDialogMenu(ushort DialogId)
{
debug("Dialog Menu ID="+DialogId.ToString());
}
public override void NpcDialog(ushort DialogId)
{
debug("Dialog ID="+DialogId.ToString());
if(DialogId == 10183) {ts.SendEnd();}
else if(DialogId == 12249) {ts.SendEnd();}
else if(DialogId == 10140) {ts.SendEnd();}
else if(DialogId == 12215) {ts.SendEnd();}
else if(DialogId == 12119) {ts.SendEnd();}
}
void TruongGiac(){
if(songuoi==4){
ts.ClickOnNPC(50);
ts.SendEnd();
ts.delay(1);
}
}
public override void RequestPartyAcceptFrom(uint PlayerId)
{
if(PlayerId == idMem1 || PlayerId == idMem2 || PlayerId == idMem3 || PlayerId == idMem4)
{
ts.AcceptParty(PlayerId);
ts.delay(1);
songuoi++;
if (songuoi == 4)
{
ts.AcceptParty(PlayerId);
ts.delay(1);
}
ts.Sena(idMem1);
TruongGiac();
}
}
public override void PartyStop(uint PlayerId)
{
if(PlayerId == idMem1 || PlayerId == idMem2 || PlayerId == idMem3 || PlayerId == idMem4)
{
ts.Disconnect();
}
}
public override void Start()
{
ts.ClickOnNPC(50);
ts.SendEnd();
ts.delay(1);
}
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);
}
}
public override void onPlayerWalk(uint uid, ushort x, ushort y)
{
if ((x < 0) && (y < 0))
{
debug("Co nguoi");
ts.Disconnect();
}
}
public override void PlayerOnline(uint playerid,ushort mapid)
{
if(playerid>101 && playerid<10000)
{
debug("Game Master Online");
}
}
public override void FinishAnswer()
{
Start();
}
public override void InitBot()
{
ts.SetReconnectTime(3);
ts.SetTimerOnOff(true);
}
