mIRC Home    About    Download    Register    News    Help

Print Thread
#175172 18/04/07 04:21 PM
Joined: Feb 2007
Posts: 10
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Feb 2007
Posts: 10
Okay, I've got this script but when it is used it doesn't print out commas, I was wondering if someone here could edit the code so that when it gives the numbers out it'll do it with commas smile

Code:
on 1:TEXT:!funds *:#:{ 

  if ($7 == ticks || $7 == tick) { 

    /set %funds $calc($calc($calc( $2 * 189209 )+$calc( $3 * 322454 )+$calc( $4 * 245034 )+$calc( $5 * 397838 )) * $6) | /msg $chan Spring: You will earn  %funds in $6 $7  | /set %funds2 $calc($calc($calc( $2 * 189209 )+$calc( $3 * 322454 )+$calc( $4 * 358224 )+$calc( $5 * 261974 )) * $6) | /msg $chan Summer: You will earn  %funds2 in $6 $7 | /set %funds3 $calc($calc($calc( $2 * 360321 )+$calc( $3 * 322454 )+$calc( $4 * 245034 )+$calc( $5 * 261974 )) * $6) | /msg $chan Autumn: You will earn  %funds3 in $6 $7 | /msg $chan Winter: You will earn  %funds3 in $6 $7 

  }

  elseif ($7 == hours || $7 == hour) { 

    /set %ticks $calc( $6 * 6 ) | /set %funds $calc($calc($calc( $2 * 189209 )+$calc( $3 * 322454 )+$calc( $4 * 245034 )+$calc( $5 * 397838 )) * %ticks) | /msg $chan Spring: You will earn  %funds in $6 $7  | /set %funds2 $calc($calc($calc( $2 * 189209 )+$calc( $3 * 322454 )+$calc( $4 * 358224 )+$calc( $5 * 261974 )) * %ticks) | /msg $chan Summer: You will earn  %funds2 in $6 $7 | /set %funds3 $calc($calc($calc( $2 * 360321 )+$calc( $3 * 322454 )+$calc( $4 * 245034 )+$calc( $5 * 261974 )) * %ticks) | /msg $chan Autumn: You will earn  %funds3 in $6 $7 | /msg $chan Winter: You will earn  %funds3 in $6 $7 

  }

  elseif ($7 == days || $7 == day) { 

    /set %ticks $calc( $6 * 144 ) | /set %funds $calc($calc($calc( $2 * 189209 )+$calc( $3 * 322454 )+$calc( $4 * 245034 )+$calc( $5 * 397838 )) * %ticks) | /msg $chan Spring: You will earn  %funds in $6 $7  | /set %funds2 $calc($calc($calc( $2 * 189209 )+$calc( $3 * 322454 )+$calc( $4 * 358224 )+$calc( $5 * 261974 )) * %ticks) | /msg $chan Summer: You will earn  %funds2 in $6 $7 | /set %funds3 $calc($calc($calc( $2 * 360321 )+$calc( $3 * 322454 )+$calc( $4 * 245034 )+$calc( $5 * 261974 )) * %ticks) | /msg $chan Autumn: You will earn  %funds3 in $6 $7 | /msg $chan Winter: You will earn  %funds3 in $6 $7 

  }

  elseif ($7 == funds || $7 == fund) {

    /set %funds $calc($calc( $2 * 189209 )+$calc( $3 * 322454 )+$calc( $4 * 245034 )+$calc( $5 * 397838 )) | /set %ticks $round($calc( $6 / %funds ),0) | /set %hours $round($calc( %ticks / 6 ),1) | /set %days $round($calc( %ticks / 144 ),1) | /msg $chan Funds: It will take you %ticks Ticks or %hours Hours or %days Days to earn $6

  }

  elseif ($2 == help) {

    /notice $nick Type !funds [tree acres] [bush acres] [flower acres] [grass acres] ([number] [tick/hour/day]), this will tell you how many funds you earn in the time you give in the brackets, leaving the brackets blank will show you how much per tick. | /notice $nick if you wish to find out how long to get to a certain funds type the following:!funds [tree acres] [bush acres] [flower acres] [grass acres] [target funds] funds | /notice $nick edit the text in the square brackets, leave comma's out of your funds/land etc

  }

  elseif ($7 == $null) {

    /set %funds $calc($calc( $2 * 189209 )+$calc( $3 * 322454 )+$calc( $4 * 245034 )+$calc( $5 * 397838 )) | /msg $chan Spring: You will earn  %funds a tick  | /set %funds2 $calc($calc( $2 * 189209 )+$calc( $3 * 322454 )+$calc( $4 * 358224 )+$calc( $5 * 261974 )) | /msg $chan Summer: You will earn  %funds2 a tick | /set %funds3 $calc($calc( $2 * 360321 )+$calc( $3 * 322454 )+$calc( $4 * 245034 )+$calc( $5 * 261974 )) | /msg $chan Autumn: You will earn  %funds3 a tick | /msg $chan Winter: You will earn  %funds3 a tick 

  }

  else { 

    .notice $nick you've done something wrong, you type your four types of land then the time (ticks, hours, days or leave blank for 1 tick) eg. !funds 100 200 300 400 12 ticks 

  }

}


Joined: Dec 2002
Posts: 2,028
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,028
/echo -a 12345 <--
12345 <--

//echo -a $bytes(12345,b) <--
12,345 <--

RoCk #175186 18/04/07 06:08 PM
Joined: Feb 2007
Posts: 10
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Feb 2007
Posts: 10
Okay, How will I get this to use commas...

Code:
on *:text:!calc*:#: {
  msg $chan The answer is:  $calc($2- )
}

Joined: Dec 2002
Posts: 2,028
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,028
$bytes($calc($2-),b)

RoCk #175190 18/04/07 06:57 PM
Joined: Feb 2007
Posts: 10
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Feb 2007
Posts: 10
thank you smile

RoCk #175193 18/04/07 07:36 PM
Joined: Mar 2007
Posts: 60
S
Babel fish
Offline
Babel fish
S
Joined: Mar 2007
Posts: 60
Actually that wont retain decimal points. So 4.3455 in $bytes with just the b switch would return 4. To fix this add the d switch

Code:
$bytes($calc($2-),db)


Is what your looking for.


"In order to succeed, your desire for success should be greater than your fear of failure."

Link Copied to Clipboard