Jump to content

Recommended Posts

Posted (edited)

You should check if the player has any skill that make the sell price higher.

Beside this, great script :)

Althought, there is a lot of repetead code that you could eliminate using getd and setd.

Edited by Moriarty
  • 3 weeks later...
Posted (edited)

Jasc Hello, I would like some help on the command @ autosell

I put the script on my server but how do I work

 

Added the npc and added in scripts_custom.conf 

 
I tried using @ autosell, autosellid @, @ autoselling and none worked please help me
Edited by Worst
Posted


- script autosellid -1,{

OnInit:

bindatcmd "autosellidoff",strnpcinfo(3)+"::Onoff";

bindatcmd "autosellid1",strnpcinfo(3)+"::Onauto1";

bindatcmd "autosellid2",strnpcinfo(3)+"::Onauto2";

bindatcmd "autosellid3",strnpcinfo(3)+"::Onauto3";

bindatcmd "autosellid4",strnpcinfo(3)+"::Onauto4";

bindatcmd "autosellid5",strnpcinfo(3)+"::Onauto5";

end;

Onauto1:

set autosellid, 1;

if(autosellid == 1) {set autosellid,1; dispbottom "Input itemid number.";

input .@itemid; set autosellidnum,.@itemid;

dispbottom "Now AutoSelling item: "+getitemname(.@itemid)+" ID: "+.@itemid+"";

dispbottom "Auto Sell Slot 1";

end;

}

Onauto2:

set autosellid2, 1;

if(autosellid2 == 1) {set autosellid2,1; dispbottom "Input itemid number.";

input .@itemid; set autosellidnum2,.@itemid;

dispbottom "Now AutoSelling item: "+getitemname(.@itemid)+" ID: "+.@itemid+"";

dispbottom "Auto Sell Slot 2";

end;

}

Onauto3:

set autosellid3, 1;

if(autosellid3 == 1) {set autosellid3,1; dispbottom "Input itemid number.";

input .@itemid; set autosellidnum3,.@itemid;

dispbottom "Now AutoSelling item: "+getitemname(.@itemid)+" ID: "+.@itemid+"";

dispbottom "Auto Sell Slot 3";

end;

}

Onauto4:

set autosellid4, 1;

if(autosellid4 == 1) {set autosellid4,1; dispbottom "Input itemid number.";

input .@itemid; set autosellidnum4,.@itemid;

dispbottom "Now AutoSelling item: "+getitemname(.@itemid)+" ID: "+.@itemid+"";

dispbottom "Auto Sell Slot 4";

end;

}

Onauto5:

set autosellid5, 1;

if(autosellid5 == 1) {set autosellid5,1; dispbottom "Input itemid number.";

input .@itemid; set autosellidnum5,.@itemid;

dispbottom "Now AutoSelling item: "+getitemname(.@itemid)+" ID: "+.@itemid+"";

dispbottom "Auto Sell Slot 5";

end;

}

Onoff:

set autosellid, 0;

set autosellid2, 0;

set autosellid3, 0;

set autosellid4, 0;

set autosellid5, 0;

dispbottom "Autosellid is now off for all slots.";

end;

Onauto6:

set autosellr, 0;

dispbottom "Autosellrate is now off.";

end;

}

- script autosell1 -1,{

OnNPCKillEvent:

if (autosellid != 1 && autosellid2 != 1 && autosellid3 != 1 && autosellid4 != 1 && autosellid5 != 1){end;}

getinventorylist;

if (autosellid == 1) callfunc "LootIDCheck1";

end;

}

- script autosell12 -1,{

OnNPCKillEvent:

if (autosellid != 1 && autosellid2 != 1 && autosellid3 != 1 && autosellid4 != 1 && autosellid5 != 1){end;}

getinventorylist;

if (autosellid2 == 1) callfunc "LootIDCheck2";

end;

}

- script autosell3 -1,{

OnNPCKillEvent:

if (autosellid != 1 && autosellid2 != 1 && autosellid3 != 1 && autosellid4 != 1 && autosellid5 != 1){end;}

getinventorylist;

if (autosellid3 == 1) callfunc "LootIDCheck3";

end;

}

- script autosell4 -1,{

OnNPCKillEvent:

if (autosellid != 1 && autosellid2 != 1 && autosellid3 != 1 && autosellid4 != 1 && autosellid5 != 1){end;}

getinventorylist;

if (autosellid4 == 1) callfunc "LootIDCheck4";

end;

}

- script autosell5 -1,{

OnNPCKillEvent:

if (autosellid != 1 && autosellid2 != 1 && autosellid3 != 1 && autosellid4 != 1 && autosellid5 != 1){end;}

getinventorylist;

if (autosellid5 == 1) callfunc "LootIDCheck5";

end;

}

function script LootIDCheck1 {

for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1)

{if(@inventorylist_id[.@i] == autosellidnum && @inventorylist_amount[.@i] >= 1)

{set .@a,getiteminfo(autosellidnum,1);

set zeny,zeny + .@a*@inventorylist_amount[.@i];

delitem @inventorylist_id[.@i],@inventorylist_amount[.@i];}}

end;

}

function script LootIDCheck2 {

for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1)

{if(@inventorylist_id[.@i] == autosellidnum2 && @inventorylist_amount[.@i] >= 1)

{set .@a,getiteminfo(autosellidnum2,1);

set zeny,zeny + .@a*@inventorylist_amount[.@i];

delitem @inventorylist_id[.@i],@inventorylist_amount[.@i];}}

end;

}

function script LootIDCheck3 {

for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1)

{if(@inventorylist_id[.@i] == autosellidnum3 && @inventorylist_amount[.@i] >= 1)

{set .@a,getiteminfo(autosellidnum3,1);

set zeny,zeny + .@a*@inventorylist_amount[.@i];

delitem @inventorylist_id[.@i],@inventorylist_amount[.@i];}}

end;

}

function script LootIDCheck4 {

for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1)

{if(@inventorylist_id[.@i] == autosellidnum4 && @inventorylist_amount[.@i] >= 1)

{set .@a,getiteminfo(autosellidnum4,1);

set zeny,zeny + .@a*@inventorylist_amount[.@i];

delitem @inventorylist_id[.@i],@inventorylist_amount[.@i];}}

end;

}

function script LootIDCheck5 {

for(set .@i,0; .@i<@inventorylist_count; set .@i,.@i+1)

{if(@inventorylist_id[.@i] == autosellidnum5 && @inventorylist_amount[.@i] >= 1)

{set .@a,getiteminfo(autosellidnum5,1);

set zeny,zeny + .@a*@inventorylist_amount[.@i];

delitem @inventorylist_id[.@i],@inventorylist_amount[.@i];}}

end;

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...