hye, i need to request on how can i minimize my current script, @Akkarin did teach me using function but it seems a bit diffrent from my previus request of HERE
this script have a need of lots of tools or tool type, reapting the script over and over again might not be a wise way, but i really had no idea how to simplfy or minimize this script, could someone help me?
Spoiler
- script WorkTable FAKE_NPC,{.@wrkb_id= atoi(strnpcinfo(2));if($wrkb_crafting_state[.@wrkb_id]==1){
soundeffect "menu.wav",0;
mes "Please wait until the process is finished. ";
close;}if($wrkb_crafting_state[.@wrkb_id]==2){
soundeffect "menu.wav",0;
mes "Here are your crafted items.";for(.@i=0;.@i< getarraysize(getd("$wrkb_"+.@wrkb_id+"_products"));.@i+=2)
getitem(getd("$wrkb_"+.@wrkb_id+"_products["+.@i+"]"), getd("$wrkb_"+.@wrkb_id+"_products["+(.@i+1)+"]"));
delwaitingroom;
$wrkb_crafting_state[.@wrkb_id]=0;
close;}
soundeffect "menu.wav",0;
mes "==============================";
mes "^ff0000 Any item created unattended by using the Work Table can be stolen by other players !! ";
mes "==============================";
mes "Private Work Table are shared with those who have acsess only !!^000000";
mes "==============================";
next;
soundeffect "menu.wav",0;
mes "Select";switch(select("- Processing:- Weapons Crafting:- Cancel")){case1:
next;
soundeffect "menu.wav",0;
mes "Select";switch(select("- Material Processing:- Parts Processing:- Cancel")){case1:
next;
soundeffect "menu.wav",0;
mes "Select";switch(select("- Ore Powder:- Cancel")){case1:goto ore_powder;case2:goto cancel;}case2:
next;
soundeffect "menu.wav",0;
mes "Select";switch(select("- Fine Rope:- Fine Handle:- Bone Knife Head:- Bone Tang:- Sturdy Handle:- Long Rope:- Long Stick:- Fine Wooden Blade:-Craved Stone:- Leather:- Heat Resistant Barrel:- Cancel")){case1:goto fine_rope;case2:
next;
soundeffect "menu.wav",0;
mes "Select tools";switch(select("- Makeshift Axe:- Cancel")){case1:goto mkshffine_handle;case2:goto cancel;}case3:
next;
soundeffect "menu.wav",0;
mes "Select tools";switch(select("- Stone Knife:- Cancel")){case1:goto skboneknifehead;case2:goto cancel;}case4:goto msh_bonetang;case5:gotoSturdy_Handle;case6:goto long_rope;case7:goto long_stick;case8:goto finewodblade;case9:gotoCravedStone;case10:goto leather;case11:gotoHeatResistantBarrel;case12:goto cancel;}case3:goto cancel;}case2:
next;
soundeffect "menu.wav",0;
mes "Select Weapon:";switch(select("- Dagger Class:- Sword Class:- Spear Class:- Axe Class:- Hammer Class:- Staff Class:- Bow Class:- Knuckle:- Katar:- Gun:- Cancel")){case1:
next;
soundeffect "menu.wav",0;
mes "Select Dagger:";switch(select("- Improvise Dagger:- Cancel")){case1:goto impro_dag;case2:goto cancel;}case2:
next;
soundeffect "menu.wav",0;
mes "Select Sword:";switch(select("- Improvise Wooden Sword:- Cancel")){case1:goto impro_wodsword;case2:goto cancel;}case3:
next;
soundeffect "menu.wav",0;
mes "Select Spear:";switch(select("- Improvise Spear:- Cancel")){case1:goto impro_spear;case2:goto cancel;}case4:
next;
soundeffect "menu.wav",0;
mes "Select Axe:";switch(select("- Improvise Axe:- Cancel")){case1:goto impro_axe;case2:goto cancel;}case5:
next;
soundeffect "menu.wav",0;
mes "Select Hammer:";switch(select("- Improvise Hammer:- Cancel")){case1:goto impro_hammer;case2:goto cancel;}case6:
next;
soundeffect "menu.wav",0;
mes "Select Staff:";switch(select("- Improvise Staff:- Cancel")){case1:goto impro_staff;case2:goto cancel;}case7:
next;
soundeffect "menu.wav",0;
mes "Select Bow:";switch(select("- Improvise Bow:- Cancel")){case1:goto impro_bow;case2:goto cancel;}case8:
next;
soundeffect "menu.wav",0;
mes "Select Knuckle:";switch(select("- Improvise Knuckle:- Cancel")){case1:goto impro_Knuckle;case2:goto cancel;}case9:
next;
soundeffect "menu.wav",0;
mes "Select Katar:";switch(select("- Improvise Katar:- Cancel")){case1:goto impro_katar;case2:goto cancel;}case10:
next;
soundeffect "menu.wav",0;
mes "Select Gun:";switch(select("- Improvise Gun:- Cancel")){case1:goto impro_gun;case2:goto cancel;}case11:goto cancel;}case3:goto cancel;}
end;//=====================================================// Config//=====================================================HeatResistantBarrel:if(countitem(40191)<1|| countitem(40084)<1|| countitem(40085)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Heat Resistant Jelly";
mes "- 1 Long Rope";
mes "- 1 Long Stick ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Heat Resistant Jelly";
mes "- 1 Long Rope";
mes "- 1 Long Stick ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40191,1;
delitem 40084,1;
delitem 40085,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40189,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40191,1;
delitem 40084,1;
delitem 40085,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40189,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_gun:if(countitem(40066)<1|| countitem(40067)<4|| countitem(40071)<1|| countitem(40189)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Sturdy Handle";
mes "- 4 Fine Rope";
mes "- 1 Bone Tang";
mes "- 1 Fine Wooden Blade ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Sturdy Handle";
mes "- 4 Fine Rope";
mes "- 1 Bone Tang";
mes "- 1 Heat Resistant Barrel ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40066,1;
delitem 40067,4;
delitem 40071,1;
delitem 40189,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40177,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40066,1;
delitem 40067,4;
delitem 40071,1;
delitem 40189,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40177,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_katar:if(countitem(40066)<1|| countitem(40067)<4|| countitem(40071)<1|| countitem(40110)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Sturdy Handle";
mes "- 4 Fine Rope";
mes "- 1 Bone Tang";
mes "- 1 Fine Wooden Blade ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Sturdy Handle";
mes "- 4 Fine Rope";
mes "- 1 Bone Tang";
mes "- 1 Fine Wooden Blade ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40066,1;
delitem 40067,4;
delitem 40071,1;
delitem 40110,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40177,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40066,1;
delitem 40067,4;
delitem 40071,1;
delitem 40110,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40177,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
leather:if(countitem(40165)<1|| countitem(40010)<2){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Pond Water";
mes "- 2 Monster Skin ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Pond Water";
mes "- 2 Monster Skin ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40165,1;
delitem 40010,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40166,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40165,1;
delitem 40010,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40166,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_Knuckle:if(countitem(40166)<1|| countitem(40071)<5|| countitem(40067)<2){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Leather";
mes "- 5 Bone Tang";
mes "- 2 Fine Rope ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Long Stick";
mes "- 2 Fine Rope ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40166,1;
delitem 40071,5;
delitem 40067,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40164,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40166,1;
delitem 40071,5;
delitem 40067,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40164,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_staff:if(countitem(40066)<1|| countitem(40085)<1|| countitem(40067)<2){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Long Stick";
mes "- 2 Fine Rope ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Long Stick";
mes "- 2 Fine Rope ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40066,1;
delitem 40085,1;
delitem 40067,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40153,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40066,1;
delitem 40085,1;
delitem 40067,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40153,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================CravedStone:if(countitem(40024)<2){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 2 Big Boulder ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 2 Big Boulder ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40024,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40142,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40024,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40142,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_hammer:if(countitem(40066)<1|| countitem(40085)<1|| countitem(40067)<2|| countitem(40142)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Long Stick";
mes "- 2 Fine Rope ";
mes "- 1 Craved Stone. ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Long Stick";
mes "- 2 Fine Rope ";
mes "- 1 Craved Stone. ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40066,1;
delitem 40085,1;
delitem 40067,2;
delitem 40142,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40130,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40066,1;
delitem 40085,1;
delitem 40067,2;
delitem 40142,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40130,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_axe:if(countitem(40066)<1|| countitem(40085)<1|| countitem(40067)<2|| countitem(40070)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Long Stick";
mes "- 2 Fine Rope ";
mes "- 1 Bone Knife Head. ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Long Stick";
mes "- 2 Fine Rope ";
mes "- 1 Bone Knife Head. ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40066,1;
delitem 40085,1;
delitem 40067,2;
delitem 40070,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40130,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40066,1;
delitem 40085,1;
delitem 40067,2;
delitem 40070,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40130,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_spear:if(countitem(40066)<1|| countitem(40085)<1|| countitem(40067)<2|| countitem(40070)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Long Stick";
mes "- 2 Fine Rope ";
mes "- 1 Bone Knife Head. ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Long Stick";
mes "- 2 Fine Rope ";
mes "- 1 Bone Knife Head. ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40066,1;
delitem 40085,1;
delitem 40067,2;
delitem 40070,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40100,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40066,1;
delitem 40085,1;
delitem 40067,2;
delitem 40070,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40100,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_wodsword:if(countitem(40110)<2|| countitem(40066)<1|| countitem(40067)<2){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 2 Fine Wooden Blade";
mes "- 1 Sturdy Handle";
mes "- 2 Fine Rope. ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 2 Fine Wooden Blade";
mes "- 1 Sturdy Handle";
mes "- 2 Fine Rope. ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40110,2;
delitem 40066,1;
delitem 40067,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40098,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40110,2;
delitem 40066,1;
delitem 40067,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40098,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
finewodblade:if(countitem(40027)<2){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 2 Green Tree Log. ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 2 Green Tree Log. ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40027,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40110,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40085,2;
delitem 40084,2;
delitem 40066,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40110,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_bow:if(countitem(40085)<2|| countitem(40084)<2|| countitem(40066)<2){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 2 Long Stick";
mes "- 2 Long Rope";
mes "- 2 Sturdy Handle. ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 2 Long Stick";
mes "- 2 Long Rope";
mes "- 2 Sturdy Handle. ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40085,2;
delitem 40084,2;
delitem 40066,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40096,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40085,2;
delitem 40084,2;
delitem 40066,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40096,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
long_stick:if(countitem(40027)<2){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 2 Green Tree Log ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 4 Fine Rope ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40027,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40085,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40027,2;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40085,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
long_rope:if(countitem(40067)<4){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 4 Fine Rope ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 4 Fine Rope ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40067,4;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40084,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40067,4;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40084,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================Sturdy_Handle:if(countitem(40067)<2|| countitem(40068)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 2 Fine Rope";
mes "- 1 Fine Handle. ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 2 Fine Rope";
mes "- 1 Fine Handle. ^000000";
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40067,2;
delitem 40068,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40066,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40067,2;
delitem 40068,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40066,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
impro_dag:if(countitem(40066)<1|| countitem(40070)<1|| countitem(40071)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Bone Knife Head";
mes "- 1 Bone Tang. ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Sturdy Handle";
mes "- 1 Bone Knife Head";
mes "- 1 Bone Tang. ^000000";
next;
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem 40066,1;
delitem 40070,1;
delitem 40071,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40072,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem 40066,1;
delitem 40070,1;
delitem 40071,1;
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40072,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
msh_bonetang:if(countitem(40069)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Big Bone ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Big Bone ^000000";
next;
soundeffect "menu.wav",0;switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem(40069,1);
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40071,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem(40069,1);
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40071,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
skboneknifehead:if(countitem(40069)<1|| rentalcountitem(40005)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Big Bone ";
mes "- Stone Knife ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Big Bone ";
mes "- Stone Knife ^000000";switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem(40069,1);
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40070,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem(40069,1);
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40070,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
mkshffine_handle:if(countitem(40027)<1|| rentalcountitem(40029)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 2 Green Tree Log";
mes "- 1 Makeshift Axe ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 2 Green Tree Log";
mes "- 1 Makeshift Axe ^000000";switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem(40027,2);
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40068,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem(40027,2);
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40068,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
fine_rope:if(countitem(40031)<4){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 4 Green Stalk ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 4 Green Stalk ^000000";switch(select("- Start:- Cancel")){case1:if(countitem(40007)==1){
delitem(40031,4);
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40067,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;}
delitem(40031,4);
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40067,1);gotoOnCraftingStart;case2:goto cancel;}//=====================================================
ore_powder:if(countitem(40032)<1|| rentalcountitem(40042)<1){
next;
soundeffect "menu.wav",0;
mes "^ff0000 Require";
mes "- 1 Ore";
mes "- 1 Mortar ^000000";
close;}
next;
soundeffect "menu.wav",0;
mes "^8fce00 Require";
mes "- 1 Ore";
mes "- 1 Mortar ^000000";switch(select("- Start:- Cancel")){case1:
delitem(40032,1);
setarray(getd("$wrkb_"+.@wrkb_id+"_products"),40037,1);
process_points +=1;
dispbottom "Gain +1 Processing Points";gotoOnCraftingStart;case2:goto cancel;}//=====================================================
cancel:
next;
soundeffect "menu.wav",0;
mes "Process Cancel";
close;OnCraftingStart:
$wrkb_crafting_state[.@wrkb_id]=1;
waitingroom("CRAFTING...",0);
initnpctimer;
end;OnTimer60000:
$wrkb_crafting_state[atoi(strnpcinfo(2))]=2;
delwaitingroom;
waitingroom("COMPLETED!",0);
end;OnInit:.@wrkb_id= atoi(strnpcinfo(2));if(.@wrkb_id<1) end;if($wrkb_crafting_state[.@wrkb_id]==1)gotoOnCraftingStart;}//veil//=====================================================
veil,30,195,6 duplicate(WorkTable)PublicWorkTable#7000 11004
veil,30,189,6 duplicate(WorkTable)PublicWorkTable#7001 11004
veil,30,183,6 duplicate(WorkTable)PublicWorkTable#7002 11004
veil,30,177,6 duplicate(WorkTable)PublicWorkTable#7003 11004
veil,30,171,6 duplicate(WorkTable)PublicWorkTable#7004 11004
veil,30,165,6 duplicate(WorkTable)PublicWorkTable#7005 11004
veil,30,159,6 duplicate(WorkTable)PublicWorkTable#7006 11004
veil,30,153,6 duplicate(WorkTable)PublicWorkTable#7007 11004
veil,30,147,6 duplicate(WorkTable)PublicWorkTable#7008 11004
veil,30,141,6 duplicate(WorkTable)PublicWorkTable#7009 11004
veil,30,135,6 duplicate(WorkTable)PublicWorkTable#7010 11004
veil,30,129,6 duplicate(WorkTable)PublicWorkTable#7011 11004
veil,21,195,6 duplicate(WorkTable)PublicWorkTable#7012 11004
veil,21,189,6 duplicate(WorkTable)PublicWorkTable#7013 11004
veil,21,183,6 duplicate(WorkTable)PublicWorkTable#7014 11004
veil,21,177,6 duplicate(WorkTable)PublicWorkTable#7015 11004
veil,21,171,6 duplicate(WorkTable)PublicWorkTable#7016 11004
veil,21,165,6 duplicate(WorkTable)PublicWorkTable#7017 11004
veil,21,159,6 duplicate(WorkTable)PublicWorkTable#7018 11004
veil,21,153,6 duplicate(WorkTable)PublicWorkTable#7019 11004
veil,21,147,6 duplicate(WorkTable)PublicWorkTable#7020 11004
veil,21,141,6 duplicate(WorkTable)PublicWorkTable#7021 11004
veil,21,135,6 duplicate(WorkTable)PublicWorkTable#7022 11004
veil,21,129,6 duplicate(WorkTable)PublicWorkTable#7023 11004
as you can see on the part crafting there are tools requirement ( Select Tools ), and each part crafting have diffrent option of tools to select, and that was the idea, but after a while i notice if im gone use a diffrent tools for the same part crafting, means i might need to repeat the same cmd over and over again for each tools, while all it needs was changing type of tools,
example :
crafting sword require a hammer, and there are serval type of hammer ( hammer A, Hammer B, Hammer C, etc ) but at the end all the tools are rquire to craft the same sword.
please send help to minimize and simplify my current script.
Question
Dolphin86
hye, i need to request on how can i minimize my current script, @Akkarin did teach me using function but it seems a bit diffrent from my previus request of HERE
this script have a need of lots of tools or tool type, reapting the script over and over again might not be a wise way, but i really had no idea how to simplfy or minimize this script, could someone help me?
as you can see on the part crafting there are tools requirement ( Select Tools ), and each part crafting have diffrent option of tools to select, and that was the idea, but after a while i notice if im gone use a diffrent tools for the same part crafting, means i might need to repeat the same cmd over and over again for each tools, while all it needs was changing type of tools,
example :
crafting sword require a hammer, and there are serval type of hammer ( hammer A, Hammer B, Hammer C, etc ) but at the end all the tools are rquire to craft the same sword.
please send help to minimize and simplify my current script.
thanks...
Edited by Dolphin86Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.