3 cards of your choice = 1 random card in Script Requests Posted July 4, 2020 · Edited July 4, 2020 by noteeee prontera,150,150,6 script Sample 100,{ getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { if (getiteminfo(@inventorylist_id[.@i], 2) == 6) { .@menu$ = .@menu$ + "- " + getitemname(@inventorylist_id[.@i]) + " x"+@inventorylist_amount[.@i]+":"; .@cards[getarraysize(.@cards)] = @inventorylist_id[.@i]; } } .@i = 0; mes "Please select 3 cards..."; while (.@i < 3) { if (getarraysize(.@c)) { mes "> 1x " + getitemname(.@c[.@j]); .@j++; } .@s = select(.@menu$) - 1; .@c[getarraysize(.@c)] = .@cards[.@s]; .@i++; } mes "> 1x " + getitemname(.@c[.@j]); next; mes "Are you sure you want to trade these cards?"; if (select("~ Yes:~ No") & 2) end; for (.@i = 0; .@i < getarraysize(.@c); .@i++) delitem .@c[.@i], 1; set @Rand,rand(4001,4699); next; getitem @Rand,1; mes"Congratulations!!.... you received"; mes "^CC99CC"+getitemname(@Rand)+"^000000"; close; } I have a little bit of customization, you try this. thx @Patskie
3 cards of your choice = 1 random card
in Script Requests
Posted · Edited by noteeee
prontera,150,150,6 script Sample 100,{ getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { if (getiteminfo(@inventorylist_id[.@i], 2) == 6) { .@menu$ = .@menu$ + "- " + getitemname(@inventorylist_id[.@i]) + " x"+@inventorylist_amount[.@i]+":"; .@cards[getarraysize(.@cards)] = @inventorylist_id[.@i]; } } .@i = 0; mes "Please select 3 cards..."; while (.@i < 3) { if (getarraysize(.@c)) { mes "> 1x " + getitemname(.@c[.@j]); .@j++; } .@s = select(.@menu$) - 1; .@c[getarraysize(.@c)] = .@cards[.@s]; .@i++; } mes "> 1x " + getitemname(.@c[.@j]); next; mes "Are you sure you want to trade these cards?"; if (select("~ Yes:~ No") & 2) end; for (.@i = 0; .@i < getarraysize(.@c); .@i++) delitem .@c[.@i], 1; set @Rand,rand(4001,4699); next; getitem @Rand,1; mes"Congratulations!!.... you received"; mes "^CC99CC"+getitemname(@Rand)+"^000000"; close; }
I have a little bit of customization, you try this.
thx @Patskie