help sc auto sell

hix...em bó chiếu....cái auto send ko thể nào hoạt động...mày mò suốt 1 ngày...bác nào pro thì vào hướng dẫn lại 1 tí...hay đã làm autosend được rồi thì copy lại cho anh em ...em làm theo bác TuấnLinhTTL kia mà....ko thể nào chạy được...bác có thể hướng dẫn kỹ lại được chứ...thanks
 
mỗi người sài 1 script khác nhau như tui nè đâu có xài của gamevn
nếu bạn có thể post script của mình lên đây thì có lẽ sè dễ giải quyết hơn
 
TuanLinhTTL nói:
Đó là script auto bán đồ. Con bán đồ chỉ cần common.cs và script.cs như tôi đã bảo. Và thêm nữa con bán tiệm tạp hóa phải đứng gần nhà buôn tạp hóa và từong tự tiệm thuốc dứng gần bán tiệm thuốc (Tuy nhiên ở đây là chủ tạp hóa và tiệm thuốc ở Diệp Thành).
Để auto send thì các mem trong team bạn phai có BDY và thêm nữa có script autosend. Cụ thể:
Ở common.cs cần thêm đoạn sau: thêm vào đâu cũng được và 0 cần chỉnh sửa:
PHP:
void FindItemSend(uint playerid,uint Iid,byte num)
{ 
	for(byte i=0;i< 25;i++)
	{ 
		Slot oSlot = (Slot)ts.MyItems[i]; 
		if( oSlot.itemid == 0 )
		{
			continue;
		}
		if(oSlot.itemid == Iid && oSlot.num == num)
		{
			Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
			ts.SendItemTo(playerid,oSlot.slot,num);
			debug("Send " + oItem + " to " + playerid + " amount " + num , 0xC08008); 
		}
	}
}

Ở trong script.cs của từng mem thì thêm như sau:
Ở đầu script chỗ khai bào các biến thêm:
double TimeSend = 0;
uint idsendtaphoa = xxxx; id con bán tiệm tạp hóa của bạn
uint idtiemthuoc = xxxx; id con bán tiệm thuốc của bạn

Cuối cùng thêm đoạn sau vào hàm OnTimer()

PHP:
TimeSend++;
	if (TimeSend % 120 == 0)
	{
		FindItemSend(idsendtaphoa, 26169, 50);//Mang Kho
		FindItemSend(idsendtaphoa, 26168, 50);//Ruou Vang
		FindItemSend(idtiemthuoc, 27035,50);//Nhat diem
		FindItemSend(idtiemthuoc, 27066,50);// bo huyet
		FindItemSend(idtiemthuoc, 27005,50);// Tinh nao
		FindItemSend(idtiemthuoc, 27032,50);//Luc vi
		FindItemSend(idsendtaphoa, 46033, 50);//ong mat
		FindItemSend(idsendtaphoa, 46041, 50);//Tu dong uong thuoc
		FindItemSend(idsendtaphoa, 46013, 50);//Vien Cong Kich
	}
That's all. Have fun!@
đây..em làm giống bác TuấnLinhTTL...em muốn gửi cho chủ pt sp..nên đã biến đổi cái idsendtaphoa thành id của chủ pt...
PHP:
void FindItemSend(uint playerid,uint Iid,byte num)
{ 
	for(byte i=0;i< 25;i++)
	{ 
		Slot oSlot = (Slot)ts.MyItems[i]; 
		if( oSlot.itemid == 0 )
		{
			continue;
		}
		if(oSlot.itemid == Iid && oSlot.num == num)
		{
			Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
			ts.SendItemTo(playerid,oSlot.slot,num);
			debug("Send " + oItem + " to " + playerid + " amount " + num , 0xC08008); 
		}
	}
}
<-----cái này em giữ nguyên

double TimeSend = 0;
uint idsendtaphoa = xxxx; id con bán tiệm tạp hóa của bạn <----id con tạp hóa thành id con chủ pt

PHP:
TimeSend++;
	if (TimeSend % 120 == 0)
	{
		FindItemSend(idsendtaphoa, 26169, 50);//Mang Kho
		FindItemSend(idsendtaphoa, 26168, 50);//Ruou Vang
		FindItemSend(idtiemthuoc, 27035,50);//Nhat diem
		FindItemSend(idtiemthuoc, 27066,50);// bo huyet
		FindItemSend(idtiemthuoc, 27005,50);// Tinh nao
		FindItemSend(idtiemthuoc, 27032,50);//Luc vi
		FindItemSend(idsendtaphoa, 46033, 50);//ong mat
		FindItemSend(idsendtaphoa, 46041, 50);//Tu dong uong thuoc
		FindItemSend(idsendtaphoa, 46013, 50);//Vien Cong Kich
	}
<---------mấy cái FindItemSend thì em đổi cái ID của item là ID của Sp...
=(( kết cục thảm hại....nó chả chịu gửi cho em lấy 1 lọ sp
 
ban nên goi thêm hàm nưa coi trong file script ở cái hàm sau khi kết thúc trận đấu đại loại là Void BattleStopped() {...........}
( ........... la nôi dung của hàm ) bạn kiểm tra xem nó đã gọi ra cái hàm FindItemSend(); chưa nếu chưa bạn thêm vào FindItemSend();
 
cái auto sell chi can copy de vao cs la dc hay con them gi nua ko ma sao tui vao no ko cho bo bao loi la sao tôi ko hiễu lam on giup tui di
 
Cho hỏi nếu muốn bán ở trác quận thì làm sao. mã tạp hóa ở trác quận là bao nhiêu.thank
 
cho cái script tiệm tạp hóa va hiệu thuốc ở trục quận đi mấy pác
 
sao copy vao common rồi nhưng đâu thấy nó send đâu nè giải quyết đê
{
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;
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;
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;
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;
if( oSlot.itemid == 0){ continue; }
Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
if((oSlot.itemid == 26168 ||
oSlot.itemid == 26169 ||
oSlot.itemid == 46033 ||
oSlot.itemid == 46013 ||
oSlot.itemid == 46041 )
&& oSlot.num == 50)
{ts.SendItemTo(615732,oSlot.slot,oSlot.num);} /// đây là send đồ

if((oSlot.itemid == 27066 ||
oSlot.itemid == 27005 ||
oSlot.itemid == 27035 ||
oSlot.itemid == 27032 )
&& oSlot.num == 50)
{ts.SendItemTo(614237,oSlot.slot,oSlot.num);} /// đây là send đồ

}

}
 
khùng
copy common thì phải sửa ID đi nó mới send dc
chứ 2 ID đó ở SV Điêu Thuyền của tui
ông để nguyên thì send kỉu gì?
Mã:
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((oSlot.itemid == 26168 || 
oSlot.itemid == 26169 ||
oSlot.itemid == 46033 ||
oSlot.itemid == 46013 || 
oSlot.itemid == 46041 ) 
&& oSlot.num == 50)
{ts.SendItemTo(615732,oSlot.slot,oSlot.num);} /// 615732 la ID của tui nha

if((oSlot.itemid == 27066 || 
oSlot.itemid == 27005 ||
oSlot.itemid == 27035 ||
oSlot.itemid == 27032 ) 
&& oSlot.num == 50)
{ts.SendItemTo(614237,oSlot.slot,oSlot.num);} /// 614237 cũng là id cua tui, thay đi
}

}

ID tạp hóa ở TQ là 7, tiêm thuôc là 1 thay vào sc của con bán đồ là ok
 
không phải không send mà đủ 50 cái nó mới send :P tui hem bít là vậy hì sorry tui hơi noob :P
 
mà cho hỏi pác là thay số 1 và số 7 vào đâu thế pác nói không vậy tui biết sao hix noob mà chỉ rõ ràng một chứ di :D
 
mọi người co auto đào khoáng hem , nếu có thì cho xin lun cái ID của thợ rèn nhé :D
 
void ProcessInventoryAction(){
for(byte i=0;i<25;i++){
Slot oSlot = (Slot)ts.MyItems;
if( oSlot.itemid == 0){ continue; }
Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()];
if((oSlot.itemid == 26168 ||
oSlot.itemid == 26169 ||
oSlot.itemid == 46033 ||
oSlot.itemid == 46013 ||
oSlot.itemid == 46041 )
&& oSlot.num == 50)
{ts.SendItemTo(615732,oSlot.slot,oSlot.num);} /// 615732 la ID của tui nha

if((oSlot.itemid == 27066 ||
oSlot.itemid == 27005 ||
oSlot.itemid == 27035 ||
oSlot.itemid == 27032 )
&& oSlot.num == 50)
{ts.SendItemTo(614237,oSlot.slot,oSlot.num);} /// 614237 cũng là id cua tui, thay đi
}

} nè mấy bác
 
có cách nào mà nó chạy ra chạy vào ở TQ giữa tiệm thuốc và tạp hóa ko vậy
:D :D :D :D :D
có cái này thì hay quá ta
 
sao không có ai trả lời vậy nè cho xin cái ID của thợ rèn là nhieu với cả script auto đào khoáng lun
 
Mình không biết cái này bị lỗi gì đây TuanLinh có thể cho mình biết được không?
PHP:
Dialog ID = 13041
Sell Legna_TS_Machine.Item amount 50
Sell Legna_TS_Machine.Item amount 50
Sell Legna_TS_Machine.Item amount 50
Sell Legna_TS_Machine.Item amount 50
Sell Legna_TS_Machine.Item amount 50
Sell Legna_TS_Machine.Item amount 50
Sell Legna_TS_Machine.Item amount 50
Sell Legna_TS_Machine.Item amount 50
Ngừng kết nối với máy chủ !!!
Bắt đầu tự động kết nối ...
Initialized code....done
Loading code....done
Kết nối tới máy chủ 203.113.150.21:6414
Kết nối thành công.
Dialog ID = 13041
 
script.cs
PHP:
double TimeSale = 0; 
uint idsendtaphoa = 01056257;
public override void OnTimer() 
{ 
    TimeSale++; 
    if (TimeSale % 120 == 0) 
    { 
        FindItemSale( 27047, 50); 
        FindItemSale( 26003, 50); 
        FindItemSale( 26050, 50); 
        FindItemSale( 46016, 50); 
        FindItemSale( 46013, 50); 
    } 
} 

public override void NpcDialog(ushort DialogId) 
{     
    debug("Dialog ID = "+ DialogId.ToString()); 
    ts.SendEnd(); 
} 

public override void NpcDialogMenu(ushort DialogId)  
{  
    debug("Dialog Menu ID = "+ DialogId.ToString()); 
    ts.SelectChoice(2); 
    ts.SendEnd(); 
} 

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 InitBot() 
{ 
    ts.SetTimerOnOff(true); 
    ts.ClickOnNPC(2); 
	ts.SendEnd(); 
}

common.cs :
[php]
void FindItemSale(uint Iid,byte num) 
{  
    for(byte i=0;i< 25;i++) 
    {  
        Slot oSlot = (Slot)ts.MyItems[i];  
        if( oSlot.itemid == 0 ) 
        { 
            continue; 
        } 
        if(oSlot.itemid == Iid && oSlot.num == num) 
        { 
            Item oItem = (Item)ts.ITEMS[oSlot.itemid.ToString()]; 
            ts.Sell(oSlot.slot,num); 
            debug("Sell " + oItem + " amount " + num , 0);  
        } 
    } 
}
cái common.cs mình lấy của cậu đó TuanLinhTTL
 
Back
Top