Individually they work, but together they don't.
#1
So all three of these work:

suKWclaim = [loop i $suKWCnt [ if (strstr (curserver 6) (at $suKW $i)) [setadmin 1 (at $supw (at $suKWAssoc $i)); suSuccess = 1;break  ] ] ]
suipclaim = [loop i $suipCnt [ if (strstr (curserver 1) (at $suip $i)) [setadmin 1 (at $supw (at $suipAssoc $i)); suSuccess = 1; break  ] ] ]
suipptclaim = [loop i $suipptCnt [ if (strstr (curserver 1) (concat (at $suippt_ip $i) (at $suippt_pt ))) [setadmin 1 (at $supw (at $suipptAssoc $i)); suSuccess = 1; break  ] ] ]

However, when I try to piece it together:
suSuccess = 0
.....code goes here....
sudrop = [setadmin 0]
sucmd = [sudoiter = $arg1; if ( = sudoiter 0) [suKWclaim] [if ( = sudoiter 1) [suipclaim] [ if (= sudoiter 2) [suipptclaim]]]]sudo = [if (currole) [sudrop] [ loop j 3 [echo $j; (sucmd $j); if (suSuccess) [break] ]];suSuccess = 0;]
It only works for sucmd 0. Any idea what's wrong with it?
Thanks given by:
#2
FIxed it.
Thanks given by:
#3
What was wrong?
Thanks given by:
#4
Somehow couldn't pass arguments and I think I missed a []() somewhere because I rewrote it with much the same logic and it works.
Thanks given by: