Basic script question **SOLVED**

Started by Knox, Wed 31/08/2011 16:40:52

Previous topic - Next topic

Knox

How can I simplify this code? I remember (I think) someone posting a simple way of expressing "if something is A, than make it B, if its B, make it A".

Code: ags
  if (btnCitation_Magnifier.NormalGraphic == 3289) btnCitation_Magnifier.NormalGraphic = 3291;
  else btnCitation_Magnifier.NormalGraphic = 3289;
--All that is necessary for evil to triumph is for good men to do nothing.

Khris

To alternate between two int values, subtract the current one from the sum.

Code: ags
  btnCitation_Magnifier.NormalGraphic = 6580 - btnCitation_Magnifier.NormalGraphic;

Knox

Man that's smart!

Thanks Khris :)
--All that is necessary for evil to triumph is for good men to do nothing.

SMF spam blocked by CleanTalk