mIRC Home    About    Download    Register    News    Help

Print Thread
#249664 10/12/14 01:26 PM
Joined: Jun 2014
Posts: 248
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
So I want to have the jackpot increase by 1/10th the amount a player loses every time they lose.

For some reason the variable is always == 0.

I assume the reason is me..this is the line I'm using to increase the variable
Code:
    if (%total < 0) { set %jackpot. $+ $chan $floor($calc($calc($($+(%,jackpot.,$chan),2) + $calc(0 - %total)) / 10)) }


While I'm sure there are multiple reason why this is poor coding and I'm happy to hear those reasons, what is the right construction for this?

Belhifet #249665 10/12/14 01:37 PM
Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
Let's suppose A = %jackpot.<$chan> and B = %total

You want A + B / 10 implying A + (B / 10)
you have (A - B) / 10


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #249666 10/12/14 01:41 PM
Joined: Jun 2014
Posts: 248
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
drool...

ok thanks ha. This is what happens when I stare at my own ugly code too long. I get dumber. Ty.


Link Copied to Clipboard