Quantcast
Channel: GSAK Forum
Viewing all articles
Browse latest Browse all 75088

BadgeGen V3 Feedback thread by kmpoppe - 2013-08-07

$
0
0
@Kai Team

I would like to suggest a small Performance and Code optimization to the macro:

CODE
BEGINSUB name=BeltRemaining
BEGINCASE
CASE $point_total >= 0 AND $point_total < 30
 $points_left = 30 - $point_total

CASE $point_total >= 30 AND $point_total < 220
 $points_left = (Int($point_total / 10)+1)*10 - $point_total

CASE $point_total >= 220 AND $point_total < 400
 $loopVal = 17
 Repeat
  $loopVal = $loopVal + 1
  If (($point_total >= ($loopVal+(1/3))*12) AND ($point_total < ($loopVal+1+(1/3))*12))
   $points_left = ($loopVal+1+(1/3))*12 - $point_total
  EndIf
 Until $loopVal = 33

CASE $point_total >= 400
 $points_left = 0

ENDCASE
ENDSUB #name=BeltRemaining


This eleminates the endless CASE-Statements for all the belt Level Points_left.
If you find this useful, i might find the time to upgrade anything else of the code, please contact me.

Regards from Germany

Kai

Viewing all articles
Browse latest Browse all 75088

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>