mIRC Home    About    Download    Register    News    Help

Print Thread
#206614 18/11/08 08:02 PM
Joined: Mar 2008
Posts: 47
N
nok Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Mar 2008
Posts: 47
How could optimize the following code?
Code:
if $read(scores/Journal.txt,s,$nick) { write -s $nick scores/Journal.txt $nick $calc($v1 + %points) }
  else { write -s $nick scores/Journal.txt $nick %points }
  if $read(scores/Weekly.txt,s,$nick) { write -s $nick scores/Weekly.txt $nick $calc($v1 + %points) }
  else { write -s $nick scores/Weekly.txt $nick %points }

nok #206615 18/11/08 08:18 PM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Code:
write -s $nick scores/Journal.txt $nick $calc($read(scores/Journal.txt,s,$nick) + %points)
write -s $nick scores/Weekly.txt $nick $calc($read(scores/Weekly.txt,s,$nick) + %points) 
smile


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard