|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: Wed Jan 28, 2009 4:12 am
Additem %remove |
#additem CardList {%remove(%item(@CardList2,%random(1,%numitems(@CardList2))),@CardList2)}
I don't know why that doesn't work.
Can someone tell me why it doesn't work? Thank you! |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Jan 28, 2009 5:48 am |
What exactly isn't working? What's the value of @CardList2?
I'm not 100% but I think you really want to be using %delitem(s,list) instead of %remove. |
|
_________________ Asati di tempari! |
|
|
|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: Wed Jan 28, 2009 5:55 am |
Yeah I tried that first, It seems to be not working with just: %delitem(%item(@CardList2,%random(1,%numitems(@CardList2))),@CardList2) being considered.
It acts much differently if you replace %delitem with %additem
My fifty-second post, and I'm talking about cards.. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Jan 28, 2009 8:11 am |
If you are trying to remove it from one list and it to the other you may need to do it several steps.
Code: |
#VAR Temp %item(@CardList2,%random(1,%numitems(@CardList2))),@CardList2)
#ADDITEM CardList {@Temp}
#CALL %delitem (@Temp, @CardList2) |
Try that. |
|
_________________ Asati di tempari! |
|
|
|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: Thu Jan 29, 2009 6:39 am |
Yes that'll work.
But do you know the first trigger does not work? I have somewhat of an idea. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Thu Jan 29, 2009 7:16 am |
because #delitem returns the new value of the variable expanded... this|that|theother
if you pass that to #ADDITEM in thinks its all one string entry of "this|that|theother" |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: Thu Jan 29, 2009 7:46 pm |
It does it to this line too shalimar
%delitem(%item(@CardList2,%random(1,%numitems(@CardList2))),@CardList2)
But it does think it is all one string.. |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Sat Jan 31, 2009 3:52 pm |
If I really needed to have that as one function, I would try to work with %exec() or %eval() or %number(), but I wouldn't know which or suppose why just now.
|
|
|
|
|
|