sumano Posted November 28, 2012 Posted November 28, 2012 my itemdb first time low and middle gear have slot and now i edit itemdb low and middle gear to non-slot who can help me to make script auto removecard from low and middle thanks sorry for my bad english and can i remove refine in item ? ex +4 glasses to +0 glasses Quote
Ajjwidjdneidjenw Posted November 28, 2012 Posted November 28, 2012 (edited) Not tested yet - script Card remover -,{ OnPCLoginEvent: getinventorylist; for(.@i = 0; .@i < @inventorylist_count; .@i++){ if((Getiteminfo(@inventorylist_id[.@i],5) == 512 || Getiteminfo(@inventorylist_id[.@i],5) == 1) && @inventorylist_card1[.@i]) { delitem @inventorylist_id[.@i],1; getitem @inventorylist_id[.@i],1; getitem @inventorylist_card1[.@i],1; } } end; } Edited November 28, 2012 by garet999 1 Quote
AnnieRuru Posted November 28, 2012 Posted November 28, 2012 (edited) wow nice one there but why not just use *successremovecards ? *successremovecards <equipment slot>;This command will remove all cards from the item found in the specified equipment slot of the invoking character, create new card items and give them to the character. If any cards were removed in this manner, it will also show a success effect. Edited November 28, 2012 by AnnieRuru Quote
Ajjwidjdneidjenw Posted November 28, 2012 Posted November 28, 2012 (edited) wow nice one there but why not just use *successremovecards ? *successremovecards <equipment slot>;This command will remove all cards from the item found in the specified equipment slot of the invoking character, create new card items and give them to the character. If any cards were removed in this manner, it will also show a success effect. He wanted the refine rate to reset itself, also this gets all the items in the inventory whereas 'successremovecards' only splits the item that is equipped. Edited November 28, 2012 by garet999 1 Quote
Aleos Posted November 28, 2012 Posted November 28, 2012 You'll want to also check for value 513 for middle and lower headgear combinations. Quote
Ajjwidjdneidjenw Posted November 28, 2012 Posted November 28, 2012 (edited) There aren't any mid+lower slotted items, unless this was customly added by the topic starter. Edited November 28, 2012 by garet999 Quote
AnnieRuru Posted November 28, 2012 Posted November 28, 2012 (edited) AHAHA !! I suddenly feel myself noob now gives you rep up xD - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && @inventorylist_card1[.@i] > 500 ) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; getitem @inventorylist_card1[.@i], @inventorylist_amount[.@i]; getitem @inventorylist_card2[.@i], @inventorylist_amount[.@i]; getitem @inventorylist_card3[.@i], @inventorylist_amount[.@i]; getitem @inventorylist_card4[.@i], @inventorylist_amount[.@i]; } } end; } I also want my script to be criticize ~ btw, card1 field can be in 255 or 254 if it is a signed item http://www.eathena.w...howtopic=156949 EDIT: There aren't any mid+lower slotted items, unless this was customly added by the topic starter. yeah, it is custom slotted by topic starter, he said his server previously has all headgear with slotted items Edited November 28, 2012 by AnnieRuru Quote
Ajjwidjdneidjenw Posted November 28, 2012 Posted November 28, 2012 (edited) Yay my first rep, and that by a script mod <3 wouldn't the below work? - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && @inventorylist_card1[.@i] > 500 ) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j < 5; .@j++ ) getitem @inventorylist_card(.@j)[.@i], @inventorylist_amount[.@i]; } } end; } Edit, What just crossed my mind as well, if we remove multiple items at once, it deletes it and re-adds it multiple times, hence I used '1' when deleting/adding a item, beucase it would come across the others anyway. Why was delitem2 used again ? Edited November 28, 2012 by garet999 1 Quote
AnnieRuru Posted November 28, 2012 Posted November 28, 2012 (edited) LOL xD you just reminded me I made the same mistakes here should use getd - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && @inventorylist_card1[.@i] > 500 ) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j <= 4; .@j++ ) getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; } } end; } can't believe I'm doing script showdown with you xD EDIT to your EDIT hahaha you fell into the trap ! equipments are non-stackable items and they are always @inventorylist_amount[.@i] == 1 only stackable items like potions or usable items can only return @inventorylist_amount[.@i] > 1 @sumano ouch ! Edited November 28, 2012 by AnnieRuru 1 Quote
sumano Posted November 28, 2012 Author Posted November 28, 2012 (edited) Yay my first rep, and that by a script mod <3 wouldn't the below work? - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && @inventorylist_card1[.@i] > 500 ) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j < 5; .@j++ ) getitem @inventorylist_card(.@j)[.@i], @inventorylist_amount[.@i]; } } end; } Edit, What just crossed my mind as well, if we remove multiple items at once, it deletes it and re-adds it multiple times, hence I used '1' when deleting/adding a item, beucase it would come across the others anyway. Why was delitem2 used again ? ar now i see my problem this work only have card but item have refine +1 => is not work ex. work : Sunglasses [carat card] work : +7 Sunglasses [carat card] no work : +7 Sunglasses [non-card] Edited November 28, 2012 by sumano Quote
Ajjwidjdneidjenw Posted November 28, 2012 Posted November 28, 2012 (edited) LOL xD you just reminded me I made the same mistakes here should use getd - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && @inventorylist_card1[.@i] > 500 ) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j <= 4; .@j++ ) getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; } } end; } can't believe I'm doing script showdown with you xD EDIT to your EDIT hahaha you fell into the trap ! equipments are non-stackable items and they are always @inventorylist_amount[.@i] == 1 only stackable items like potions or usable items can only return @inventorylist_amount[.@i] > 1 @sumano ouch ! +rep You're right @ Getd & the stackable item, still though, as all the item are equipment it might as well be a 1 instead of a variable, not that it would make any difference . I see why delitem2 was used, it was to prevent the wrong item from getting deleted or duped. Edit: quote: can't believe I'm doing script showdown with you xD Hey, we need to have a little fun here, right ? @ sumario try this: - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && (@inventorylist_card1[.@i] > 500 || !@inventorylist_refine[.@i])) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j <= 4; .@j++ ) getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; } } end; } Edited November 28, 2012 by garet999 1 Quote
sumano Posted November 28, 2012 Author Posted November 28, 2012 - script Card remover -1,{OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && (@inventorylist_card1[.@i] > 500 || !@inventorylist_refine[.@i])) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j <= 4; .@j++ ) getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; } } end; } bug refine 0 and no card is remove auto big thanks for AnnieRuru and garet999 2 script is work but have 1 problem ex. work : Sunglasses [carat card] work : +7 Sunglasses [carat card] no work : +7 Sunglasses [non-card] Quote
Ajjwidjdneidjenw Posted November 28, 2012 Posted November 28, 2012 (edited) use this - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && (@inventorylist_refine[.@i] != 0 || @inventorylist_card1[.@i] > 500 )) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j <= 4; .@j++ ) { if (!getd("@inventorylist_card"+ .@j +"["+ .@i +"]")) break; getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; } } } end; } @annie for ( .@j = 1; .@j <= 4; .@j++ ) getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; this part will return errors if the items don't exist. Changing to... for ( .@j = 1; .@j <= 4; .@j++ ) { if (!getd("@inventorylist_card"+ .@j +"["+ .@i +"]")) break; getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; } We should do this more often Edited November 28, 2012 by garet999 1 Quote
AnnieRuru Posted November 28, 2012 Posted November 28, 2012 (edited) oh ... **** [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) forgot to check my map-server damn ... I somehow become noob >_< - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && ( @inventorylist_refine[.@i] || @inventorylist_card1[.@i] > 500 || @inventorylist_card4[.@i] > 500 ) ) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j <= 4; .@j++ ) if ( getd("@inventorylist_card"+ .@j +"["+ .@i +"]") ) getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; } } end; } again XD though your script already useful lol --offtopic-- We should do this more often we call this script showdown, a word made by @KeiKun in this topicusually me, @ToastOfDoom and @KeyWorld and a few others are the ones likes to do this kind of stuffs last year there are already a few topics like this in the past most recent -> http://rathena.org/board/topic/74630-help-array/ http://www.eathena.ws/board/index.php?showtopic=237976&hl= http://www.eathena.ws/board/index.php?showtopic=269819&hl= http://www.eathena.ws/board/index.php?showtopic=242008 http://www.eathena.ws/board/index.php?showtopic=180080 mostly involved algorithm though yeah its damn fun to do something like this ... learn a lot of stuffs in the process EDIT: I should've refer back to my itemlist script and getitemname2 script ... Edited November 28, 2012 by AnnieRuru Quote
sumano Posted November 29, 2012 Author Posted November 29, 2012 oh ... **** [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) forgot to check my map-server damn ... I somehow become noob >_< - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && ( @inventorylist_refine[.@i] || @inventorylist_card1[.@i] > 500 || @inventorylist_card4[.@i] > 500 ) ) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j <= 4; .@j++ ) if ( getd("@inventorylist_card"+ .@j +"["+ .@i +"]") ) getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; } } end; } again XD though your script already useful lol --offtopic-- We should do this more often we call this script showdown, a word made by @KeiKun in this topicusually me, @ToastOfDoom and @KeyWorld and a few others are the ones likes to do this kind of stuffs last year there are already a few topics like this in the past most recent -> http://rathena.org/b...630-help-array/ http://www.eathena.w...opic=237976&hl= http://www.eathena.w...opic=269819&hl= http://www.eathena.w...howtopic=242008 http://www.eathena.w...howtopic=180080 mostly involved algorithm though yeah its damn fun to do something like this ... learn a lot of stuffs in the process EDIT: I should've refer back to my itemlist script and getitemname2 script ... perfect it work !. thanks Quote
eJay Posted June 3, 2013 Posted June 3, 2013 (edited) oh ... **** [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map) [Error]: buildin_getitem: Nonexistant item 0 requested. [Debug]: Source (NPC): Card remover (invisible/not on a map)forgot to check my map-serverdamn ... I somehow become noob >_< - script Card remover -1,{ OnPCLoginEvent: getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) { if ( !( getiteminfo( @inventorylist_id[.@i], 5 ) & 256 ) && getiteminfo( @inventorylist_id[.@i], 5 ) & 513 && ( @inventorylist_refine[.@i] || @inventorylist_card1[.@i] > 500 || @inventorylist_card4[.@i] > 500 ) ) { delitem2 @inventorylist_id[.@i], @inventorylist_amount[.@i], @inventorylist_identify[.@i], @inventorylist_refine[.@i], @inventorylist_attribute[.@i], @inventorylist_card1[.@i], @inventorylist_card2[.@i], @inventorylist_card3[.@i], @inventorylist_card4[.@i]; getitem @inventorylist_id[.@i], @inventorylist_amount[.@i]; for ( .@j = 1; .@j <= 4; .@j++ ) if ( getd("@inventorylist_card"+ .@j +"["+ .@i +"]") ) getitem getd("@inventorylist_card"+ .@j +"["+ .@i +"]"), @inventorylist_amount[.@i]; } } end; }again XDthough your script already useful lol --offtopic-- We should do this more often we call this script showdown, a word made by @KeiKun in this topicusually me, @ToastOfDoom and @KeyWorld and a few others are the ones likes to do this kind of stuffs last year there are already a few topics like this in the past most recent -> http://rathena.org/board/topic/74630-help-array/ http://www.eathena.ws/board/index.php?showtopic=237976&hl= http://www.eathena.ws/board/index.php?showtopic=269819&hl= http://www.eathena.ws/board/index.php?showtopic=242008 http://www.eathena.ws/board/index.php?showtopic=180080 mostly involved algorithm though yeah its damn fun to do something like this ... learn a lot of stuffs in the process EDIT: I should've refer back to my itemlist script and getitemname2 script ... YES! I FOUND THIS TOPIC I REALLY NEED THIS! Thanks But how to delete refine they go to +0 if login and how to make to all equip will remove card cuz the headgear top not removed (256) and i don't tested yet the other stuff if the same i tried one for middle gear and it work Added: Can u edit this i want to add certain items because they all item remove cards Edited June 3, 2013 by eJay Quote
Question
sumano
my itemdb first time low and middle gear have slot
and now i edit itemdb low and middle gear to non-slot
who can help me to make script auto removecard from low and middle
thanks
sorry for my bad english
and can i remove refine in item ?
ex +4 glasses to +0 glasses
16 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.