ZSR Forums

=> Everything Else => Topic started by: Jiano on June 21, 2010, 02:00:20 AM



Title: Track your segment attempts.
Post by: Jiano on June 21, 2010, 02:00:20 AM
Attempt Tracker: Keeps track of all your speed run attempts. It displays your total number of attempts, your average time, your best time, and your total time.

This is for mIRC !!!!!

Super duper updated script that uses a pretty dialog box.

http://www.mediafire.com/?7xa5277uu76atd8 (http://www.mediafire.com/?7xa5277uu76atd8)

In mIRC, go to Tools -> Scripts Editor. In there go to File -> Load and choose the ini file.

To start it just type:

/attempt

You can either use the buttons with a mouse click, or:

F5 = Start
F6 = Reset
F7 = Failed
F8 = Complete

***Your mIRC window should be the selected window for these hot keys to work. Not the attempt tracker dialog.***

The .txt files are saved in your mIRC folder. Just click on my received files to easily access it.

Here's the code. If you don't want to download the .ini, you can just copy paste this code into your remote scripts.

Code:
alias attempt { dialog -dmo attempts attempts
  if (%gamename) { did -ra attempts 36 %gamename
  }
}
dialog game {
  title "Error"
  size -1 -1 130 40
  option dbu
  text "You need to choose a game name and segment!", 1, 7 5 120 50
  button "OK", 2, 50 20 18 13, cancel
}
dialog attempts {
  title "Attempt Tracker"
  size -1 -1 145 95
  option dbu
  tab "1", 1, 1 1 143 93
  tab "2", 2
  box "Time", 20, 3 18 43 23, tab 1
  edit "00:00:00", 21, 6 26 37 10, read center tab 1
  box "Best", 22, 50 66 43 23, tab 2
  edit "00:00:00", 23, 53 74 37 10, read center tab 2
  box "Attempts", 26, 3 18 43 23, tab 2
  edit "", 27, 6 26 37 10, read center tab 2
  button "Start", 28, 3 50 28 12, tab 1
  button "Failed", 29, 3 70 28 12, disable tab 1
  button "Reset", 30, 40 50 28 12, disable tab 1
  button "Complete", 31, 40 70 28 12, disable tab 1
  box "Average", 32, 3 66 43 23, tab 2
  edit "00:00:00", 33, 6 74 37 10, read center tab 2
  box "Total", 34, 3 42 43 23, tab 2
  edit "00:00:00", 35, 6 50 37 10, read center tab 2
  box "Game", 38, 70 15 64 29
  edit "Name", 36, 72 23 60 17, multi
  box "#", 39, 105 66 21 20
  edit "", 37, 108 74 15 10, multi disable
  radio "Single Segment", 40, 85 45 50 10
  radio "Segmented", 41, 85 55 50 10
}
alias -l attempt_inc {
  hinc -m attempt time
  did -ra attempts 21 $duration($hget(attempt,time),3)
}
alias -l stats { did -ra attempts 27 $lines($remove(%gamename,$chr(32)) $+ $remove(%gamesegment,$chr(32)) $+ .txt)
  set %line 1
  while (%line <= $lines($remove(%gamename,$chr(32)) $+ $remove(%gamesegment,$chr(32)) $+ .txt)) { set %lineinfo $read($remove(%gamename,$chr(32)) $+ $remove(%gamesegment,$chr(32)) $+ .txt,%line)
    set %timetotal $calc(%timetotal + $gettok(%lineinfo,1,126))
    inc %line
  }
  set %line 1
  while (%line <= $lines($remove(%gamename,$chr(32)) $+ $remove(%gamesegment,$chr(32)) $+ .txt)) { set %lineinfo $read($remove(%gamename,$chr(32)) $+ $remove(%gamesegment,$chr(32)) $+ .txt,%line)
    if ($gettok(%lineinfo,2,126) = 2) { set %besttimes %besttimes $+ ~ $+ $gettok(%lineinfo,1,126)
    }
    inc %line
  }
  set %besttimes $sorttok(%besttimes,126,n)
  did -ra attempts 23 $duration($gettok(%besttimes,1,126),3)
  did -ra attempts 33 $duration($calc(%timetotal / $lines($remove(%gamename,$chr(32)) $+ $remove(%gamesegment,$chr(32)) $+ .txt)),3)
  did -ra attempts 35 $duration(%timetotal,3)
  unset %lineinfo
  unset %besttimes
  unset %timetotal
}
alias -l done {
  write $remove(%gamename,$chr(32)) $+ $remove(%gamesegment,$chr(32)) $+ .txt $hget(attempt,time) $+ ~ $+ %done
  did -e attempts 28
  did -b attempts 30
  unset %done
  hfree -w attempt
  .timerattempt off
  stats
}
on 1:dialog:attempts:sclick:28: {
  .timerattempt 0 1 attempt_inc
  did -ra attempts 21 00:00:00
  did -e attempts 30
  did -b attempts 28
  did -e attempts 29
  did -e attempts 31
}
on 1:dialog:attempts:sclick:29: { if ((!%gamename) || (!%gamesegment)) { dialog -dmo game game
    return
  }
  did -e attempts 28
  did -b attempts 29
  did -b attempts 30
  did -b attempts 31
  set %done 1
  done
}
on 1:dialog:attempts:sclick:30: {
  did -ra attempts 21 00:00:00
  did -e attempts 28
  did -b attempts 29
  did -b attempts 30
  did -b attempts 31
  hfree -w attempt
  .timerattempt off
}
on 1:dialog:attempts:sclick:31: { if ((!%gamename) || (!%gamesegment)) { dialog -dmo game game
    return
  }
  did -e attempts 28
  did -b attempts 29
  did -b attempts 30
  did -b attempts 31
  set %done 2
  done
}
on 1:dialog:attempts:edit:36: {
  set %gamename $did(attempts,36)
  stats
}
on 1:dialog:attempts:edit:37: {
  set %gamesegment $did(attempts,37)
  stats
}
on 1:dialog:attempts:sclick:41: {
  did -e attempts 37
}
on 1:dialog:attempts:sclick:40: {
  set %gamesegment ss
  stats
  did -r attempts 37
  did -b attempts 37
}
on 1:dialog:attempts:close:0: {
  unset %gamesegment
  .timerattempt off
  hfree -w attempt
}
alias F5 { if $dialog(attempts) { .timerattempt 0 1 attempt_inc
    did -ra attempts 21 00:00:00
    did -e attempts 30
    did -b attempts 28
    did -e attempts 29
    did -e attempts 31
  }
}
alias F6 { if $dialog(attempts) { did -ra attempts 21 00:00:00
    did -e attempts 28
    did -b attempts 29
    did -b attempts 30
    did -b attempts 31
    hfree -w attempt
    .timerattempt off
  }
}
alias F7 { if $dialog(attempts) { if ((!%gamename) || (!%gamesegment)) { dialog -dmo game game
      return
    }
    did -e attempts 28
    did -b attempts 29
    did -b attempts 30
    did -b attempts 31
    set %done 1
    done
  }
}
alias F8 { if $dialog(attempts) { if ((!%gamename) || (!%gamesegment)) { dialog -dmo game game
      return
    }
    did -e attempts 28
    did -b attempts 29
    did -b attempts 30
    did -b attempts 31
    set %done 2
    done
  }
}


Title: Re: Track your segment attempts.
Post by: SD2 on June 21, 2010, 11:47:46 AM
Ugh, i gotta download mIRC?

But yeah, I'm one of the people who requested this, so good shit.


Title: Re: Track your segment attempts.
Post by: Elminster on June 21, 2010, 03:03:02 PM
I tested it for a few seconds and it glitched, saying that my 1st attempt at segment 1 took 2 days and 6 hours. I tested it twice more and it worked fine, though.

Anyway, where does it write the .txt file to? I need to delete it so I can reset it.


Title: Re: Track your segment attempts.
Post by: Jiano on June 22, 2010, 02:15:43 AM
I tested it for a few seconds and it glitched, saying that my 1st attempt at segment 1 took 2 days and 6 hours. I tested it twice more and it worked fine, though.

Anyway, where does it write the .txt file to? I need to delete it so I can reset it.

Only thing I can think of is either your system clock was messed up(this is where it gets the timing) or you already had used one of the variables before.


Title: Re: Track your segment attempts.
Post by: SD2 on July 07, 2010, 05:55:30 PM
As a warning to everyone, do not use /count while a timer is running, it will mess up the timer quite badly.


Title: Re: Track your segment attempts.
Post by: Jiano on July 09, 2010, 02:06:03 AM
As a warning to everyone, do not use /count while a timer is running, it will mess up the timer quite badly.

This is weird because it works fine for me.


Title: Re: Track your segment attempts.
Post by: SD2 on July 09, 2010, 02:37:34 AM
Odd...  You did /count with the same segment that had a timer running, i assume?


Title: Re: Track your segment attempts.
Post by: Jiano on July 09, 2010, 03:25:22 AM
Odd...  You did /count with the same segment that had a timer running, i assume?

Yes.


Title: Re: Track your segment attempts.
Post by: mzxrules on July 09, 2010, 10:04:18 PM
the /count glitch occurs if the minutes of your clock is greater than 0 if you have a segment running.


Title: Re: Track your segment attempts.
Post by: Jiano on September 03, 2010, 10:09:44 PM
Much more pro version of this in the first post. It is approximately 348903290x better than the old script.