Scripting question (dynamic variables) reddit / irc ---------------------------------------------------------------------- MollariDotCom · 2015-07-01 12:16 So I am brand spanking new to irc scripting and was unable to find the answer via google. I am using a dynamic variable like an array in the way that its %yada.1 etc and keeping track of the total I add to cycle through later. Is there something like foreach (php) loops that I can just cycle through the dynamic variable without needing to know %yada.1 the index .1 etc? What I would like to do is use the nicks of people as the dynamic variable after the . and that would allow me to unset if needed without going through the whole loop and checking if its there. Maybe there is a better way to do this and I just haven't found it yet. Thanks! Edit: mSl ---------------------------------------------------------------------- swtsplin · 2015-07-01 12:44 You need to specify what language are you using - mSl or what. ---------------------------------------------------------------------- MollariDotCom · 2015-07-01 12:51 Sorry mSl ---------------------------------------------------------------------- swtsplin · 2015-07-01 13:12 $var(%yada.*,0) - total number $var(%yada.*,1) - first one ---------------------------------------------------------------------- MollariDotCom · 2015-07-01 13:46 I think I explained it pretty pooly, let me try again. As of now I have it setup to to yada.1 etc and I can successfully go back through them one by one. What I am looking to do is something like %yada.nick and I am wondering if I can then cycle through them without the index being numbers (1 2 3) etc. php has http://php.net/manual/en/control- structures.foreach.php which will loop through the array regardless if the index are numbers in succession (1 2 3). Does mSl have something like that or am I stuck naming them %yada.1 %yada.2 and them going through them all everytime I want to check if a value is currently in there. What I am trying to do is add everyone who joins to %yada via %yada.1 %yada.2 etc. If they leave I want to unset them from there but without knowing the index I would have to sort through them all. I am wondering if I named them yada.nick could I still cycle through the array one index at a time even though its not .1 .2 etc. I am terrible at trying to explain this but I very much do appreciate you taking the time! ---------------------------------------------------------------------- swtsplin · 2015-07-01 13:50 $var(%yada.*,1) will return %yada.whatever if you have at least one matching "%yada.*". At least check mIRC help about $var. ---------------------------------------------------------------------- swtsplin · 2015-07-01 15:27 reddit removed \* after . - $var(%yada.\*,0) ---------------------------------------------------------------------- MollariDotCom · 2015-07-01 15:44 Appreciate the help, i have it figured out now, thanks!