XP Counter by p(Eloril) This XP counter displays a lot of information about the XP and TP you've gained in your current session. Use this only if you like all the info and don't mind the extra 3 lines of spam after killing a mob. Mind that it contains code so that if you quake and kill 12 pack horses in one room it only shows the XP Counter once. This counter is modeled after Axel's counter for the PowTTY client, and is posted with his permission. Place the following code in your .set file: #nop -- XP Counter -- #var XPCalc 0 #action {Welcome to the land of Middle Earth.} {#script XPInit} #action {Reconnecting.} {#script XPInit} #action {XPCOUNTER: %1 %2 %3 %4} {#script XPGetInfo %1,%2,%3,%4;#drop;#var XPCalc 0} #action {^You receive your share of experience.} {#if {$XPCalc=0} {info XPCOUNTER: %x %t %X %T;#var XPCalc 1}} #action {^You feel more experienced.} {#if {$XPCalc=0} {info XPCOUNTER: %x %t %X %T;#var XPCalc 1}} Paste the following code in settings\commonlib.scr: '**************************************** 'XP COUNTER by Eloril 'Records xp and tp gained during 'a single session. '**************************************** Dim SessionXP, SessionTP, OldXP, OldTP, GainedXP, GainedTP Const XPGreen = "" Const XPWhite = "" Const XPNoAtt = "" '**************************************** 'XP COUNTER: XPInit() 'Initializes XP Counter. '**************************************** Sub XPInit() SessionXP = 0 SessionTP = 0 OldXP = 0 OldTP = 0 jmc.send "info XPCOUNTER: %x %t %X %T" End Sub '**************************************** 'XP COUNTER: XPGetInfo() 'Gets XP data. '**************************************** Sub XPGetInfo(XP, TP, XPTnl, TPTnl) XPCalc XP, TP XPShow XPTnl, TPTnl End Sub '**************************************** 'XP COUNTER: XPCalc() 'Calculates gained xp and tp since 'the last kill. '**************************************** Sub XPCalc(XP, TP) GainedXP = XP - OldXP GainedTP = TP - OldTP If OldXP = 0 Then GainedXP = 0 SessionXP = 0 End If If OldTP = 0 Then GainedTP = 0 SessionTP = 0 End If SessionXP = SessionXP + GainedXP SessionTP = SessionTP + GainedTP OldXP = XP OldTP = TP End Sub '**************************************** 'XP COUNTER: XPShow(NeededXP, NeededTP) 'Displays XP Counter after kill. '**************************************** Sub XPShow(NeededXP, NeededTP) jmc.showme VBCrLf jmc.showme XPGreen & "-->" & XPNoAtt & " Gained xp: " & XPWhite & GainedXP & XPNoAtt & XPTab(GainedXP) & "tp: " & XPWhite & GainedTP & XPNoAtt jmc.showme XPGreen & "-->" & XPNoAtt & " Trip xp: " & SessionXP & XPNoAtt & XPTab(SessionXP) & "tp: " & SessionTP & XPNoAtt jmc.showme XPGreen & "-->" & XPNoAtt & " Needed xp: " & NeededXP & XPNoAtt & XPTab(NeededXP) & "tp: " & NeededTP & XPNoAtt End Sub '**************************************** 'XP COUNTER: XPGetTab(n) 'Returns a string containing a tab 'dependant on the number of digits 'in integer n. '**************************************** Function XPTab(n) Dim i, Number, Digits, Spaces, Return Number = n Do Number = Number / 10 Digits = Digits + 1 Loop Until Number < 1 Spaces = 14 - Digits For i = 0 to Spaces Return = Return & " " Next XPTab = Return End Function