Page 2 of 3

Posted: Tue Jul 13, 2004 5:20 am
by magictiger
Not updated every fight because it's using the old events system. It's real easy to convert over. There's a post in the macro depot that should explain all of it. (or at least there used to be)

Posted: Tue Jul 13, 2004 5:26 pm
by hiipii
to update the events all you need to do is change
#Event GainExp "You gain"
#Event GainExp "You regain some experience from resurrection"
#Event LoseExp "You have been slain"
to

Code: Select all

#Event GainExp "#*#You gain#*#" 
#Event GainExp "#*#You regain some experience from resurrection#*#" 
#Event LoseExp "#*#You have been slain#*#"
that *should* make it update correctly

Posted: Tue Jul 13, 2004 11:04 pm
by aChallenged1
Thanks, I've made the change and will try it out asap!

Posted: Sun Jul 18, 2004 6:29 am
by A Troll
ok thanks, works now perfectly

but got another question now :-)
is there a way to change the script to schow the exp changes like 1,31% instead of 1%

Posted: Sun Jul 18, 2004 6:40 am
by aChallenged1
It should be easy. I don't know the coding for it but the Integers would have to be changed to a 2place decimal so that it could give you n.xy

Might find the code in one of the HUD or UI posts. I'll have to look that up as I like the decimals as well so I can see exactly what I am getting.

Posted: Sun Jul 18, 2004 6:41 am
by Drumstix42
I'm really tired but it's something like
/declare Current int local ${Me.PctExp}
changing it to float or something like that <yawn>

Posted: Sun Jul 18, 2004 6:48 am
by aChallenged1
Thanks Drumstix, that looks close to what I found in my UI that showed percent with decimal to 2 places.

Edit: that is already in there. Must be something within the math that needs to be changed. I'm starting to see how things work a little at a time, but honestly the math sections always drive me out of my skull.

Posted: Sun Jul 18, 2004 6:59 am
by aChallenged1

Code: Select all

|** 
  ExpReport.inc written by Preocts. Updated last: 05/01/2004 
  Modified for post on 07/18/04 from info posted by hiipii to make it compatible
  with the recent changes in coding for Events.

  This file tracks exp information. It is dependant on ini information. That 
  information is stored in ${IniFileName} under keys [ExpTrack] and [Settings] 
  *Should handle Exp, AA, Leadership, and RaidLeadership equally as well. 
  [ExpTrack] is self creating. 
  [Settings] is not required. Optional ValueNames include: 
    Noise=0[default] no /echos to screen. 1 /echos to screen each kill 

  REQUIRED OUTER VAR: IniFileName 
  Should easy to understand what to set this to. 

**| 

#Event GainExp "#*#You gain#*#" 
#Event GainExp "#*#You regain some experience from resurrection#*#" 
#Event LoseExp "#*#You have been slain#*#" 

Sub StartExpTrack 
  |/declare IniFileName string outer whatever.ini 
  |Update the ini with current Exp and AAexp 
  /ini "${IniFileName}" "ExpTrack" "PastExp" "${Me.PctExp}" 
  /ini "${IniFileName}" "ExpTrack" "PastAA" "${Me.PctAAExp}" 
  /ini "${IniFileName}" "ExpTrack" "PastLeader" "${Me.PctGroupLeaderExp}" 
  /ini "${IniFileName}" "ExpTrack" "PastRaid" "${Me.PctRaidLeaderExp}" 
/return 

Sub Event_GainExp 
| If nothing has changed: miscall, leave. 
  /if (${Ini[${IniFileName},ExpTrack,PastExp,0]}==${CurrentExp} && ${Ini[${IniFileName},ExpTrack,PastAA,0]}==${CurrentAA}) /return 

| This sub is just all math logic for calc'ing EXP gains. Gains, not loses. 
| Thanks to Lax's new ${} phrasing this is done with ONE loop! Rock on your bad self Lax! 
  /declare Past int local 
  /declare Current int local ${Me.PctExp} 
  /declare Count int local 
  /declare Total int local 
  /declare Change int local 0 
  /declare ExpType string local Exp 

  :FourLoop 
    /varset Past ${Ini[${IniFileName},ExpTrack,Past${ExpType},0]} 
    /varset Count ${Ini[${IniFileName},ExpTrack,${ExpType}Count,0]} 
    /varset Total ${Ini[${IniFileName},ExpTrack,${ExpType}Total,0]} 
    /if (${Past}!=${Current}) { 
      /if (${Past}<${Current}) { 
        /varcalc Change ${Current}-${Past} 
      } else { 
        /if (${Current}) { 
          /varcalc Change (${Current}+100)-${Past} 
        } else { 
          /varcalc Change 100-${Past} 
        } 
      } 
      /varcalc Count ${Count}+1 
      /varcalc Total ${Total}+${Change} 
      /if (${Ini[${IniFileName},Settings,Echo,0]}) { 
        /echo You have gained ${Change}% ${ExpType} experience on that kill. 
        /echo Total ${ExpType} changes: ${Count}, Total ${ExpType} Gained: ${Total}, Average per change: ${Math.Calc[${Total}/${Count}]}% ${ExpType} Exp 
      } 
    } 
    /ini "${IniFileName}" "ExpTrack" "Past${ExpType}" ${Current} 
    /ini "${IniFileName}" "ExpTrack" "${ExpType}Count" ${Count} 
    /ini "${IniFileName}" "ExpTrack" "${ExpType}Total" ${Total} 
    /if (${ExpType.Equal[Exp]}) { 
      /varset ExpType AA 
      /varset Current ${Me.PctAAExp} 
      /varset Change 0 
      /goto :FourLoop 
    } 
    /if (${ExpType.Equal[AA]}) { 
      /varset ExpType Leader 
      /varset Current ${Me.PctGroupLeaderExp} 
      /varset Change 0 
      /goto :FourLoop 
    } 
    /if (${ExpType.Equal[Leader]}) { 
      /varset ExpType Raid 
      /varset Current ${Me.PctRaidLeaderExp} 
      /varset Change 0 
      /goto :FourLoop 
    } 
/return 

Sub Event_LoseExp 
| More math, this time with EXP lose due to death. 
  /declare PastExp int local ${Ini[${IniFileName},ExpTrack,PastExp,0]} 
  /declare CurrentExp int local ${Me.PctExp} 
  /declare ExpCount int local ${Ini[${IniFileName},ExpTrack,ExpCount,0]} 
  /declare ExpTotal int local ${Ini[${IniFileName},ExpTrack,ExpTotal,0]} 
  /declare ExpChange int local 0 
  
| If nothing has changed: miscall, leave. 
  /if (${PastExp}==${CurrentExp}) /return 
  /if (${PastExp}>${CurrentExp}) { 
    /varcalc ExpChange ${PastExp}-${CurrentExp} 
  } else { 
    /varcalc ExpChange (${PastExp}+100)-${CurrentExp} 
  } 
  /varcalc ExpTotal ${ExpTotal}-${ExpChange} 
  /varcalc ExpCount ${ExpCount} + 1 
  /if (${Ini[${IniFileName},Settings,Echo,0]}) { 
    /echo Ouch, You have lost ${ExpChange}% experience because of death. 
    /echo Total Exp Changes: ${ExpCount}, Total Exp Gained: ${ExpTotal}, Average per change: ${Math.Calc[${ExpTotal}/${ExpCount}]}% Exp 
  } 
  /ini "${IniFileName}" "ExpTrack" "PastExp" ${CurrentExp} 
  /ini "${IniFileName}" "ExpTrack" "ExpCount" ${ExpCount} 
  /ini "${IniFileName}" "ExpTrack" "ExpTotal" ${ExpTotal} 
/return
This incorperates the changes posted by hiipii to make it function properly again.
It does not show decimal, only whole numbers in calculations shown upon XP gained/lost.

Posted: Sun Jul 18, 2004 5:10 pm
by Drumstix42
aChallenged1 wrote:Thanks Drumstix, that looks close to what I found in my UI that showed percent with decimal to 2 places.

Edit: that is already in there. Must be something within the math that needs to be changed. I'm starting to see how things work a little at a time, but honestly the math sections always drive me out of my skull.
Where's it already in there?

Posted: Sun Jul 18, 2004 7:15 pm
by aChallenged1
| This sub is just all math logic for calc'ing EXP gains. Gains, not loses.
| Thanks to Lax's new ${} phrasing this is done with ONE loop! Rock on your bad self Lax!
/declare Past int local

/declare Current int local ${Me.PctExp} // <==This line here!
/declare Count int local
/declare Total int local
/declare Change int local 0
/declare ExpType string local Exp

Posted: Mon Jul 19, 2004 12:28 am
by Drumstix42
Did you even read my post from before. go read it again.

Posted: Mon Jul 19, 2004 1:45 am
by zanomo
From the manual:

Code: Select all

character (inherits spawn)  
  
Members  
 int ID Spawn ID 
 string Name First name 
 int Level  Level 
 int Exp  Experience (of 330) 
 float PctExp Experience as a % 
PctExp is already a float...

so:

Code: Select all

/declare Current float local ${Me.PctExp}
and changing all the other variables associated with this calculation would give you a float result.

(sorry for my bad English...)

Posted: Mon Jul 19, 2004 9:03 am
by aChallenged1
Sorry Drumstix, I'm so used to having the example posted that I misunderstood what you were telling me.

Thinking about it now, I should have understood. Int is always a whole number so that original line could not have given anything but a whole number.

Posted: Mon Jul 19, 2004 5:43 pm
by Drumstix42
Bingo.

Posted: Thu Jul 22, 2004 2:27 pm
by A Troll
Works now , thanks for the help :-)