Jump to content

Advice on script timing


AxlDave

Recommended Posts

So I've been working on a script to handle reputation, and I have posted the end result below. This post should explain what the script is for.

 

It works, for the most part, though there are a few bugs. What I'd like to know is, are those bugs a result of slightly off scripting, or are they to be expected when dealing with reputation / lengthy scripts?

 

As the topic title suggests, I am wondering if it is to do with the timing set up of the script. It is a Quest script, with the Processing Delay set to 0.001. Can anyone advise if the timing of the delay or the fTimer could do with adjusting?

 

Of course, any advice on improvements is welcome.

 

Script is here:

 

 

scn MyScript

short DoOnce
short Toggle

int iStage
float fTimer

float fFreesideFCount1
float fFreesideFCount2
float fFreesideFTracker
float fFreesideICount1
float fFreesideICount2
float fFreesideITracker
float fGoodspringsFCount1
float fGoodspringsFCount2
float fGoodspringsFTracker
float fGoodspringsICount1
float fGoodspringsICount2
float fGoodspringsITracker
float fNovacFCount1
float fNovacFCount2
float fNovacFTracker
float fNovacICount1
float fNovacICount2
float fNovacITracker
float fPrimmFCount1
float fPrimmFCount2
float fPrimmFTracker
float fPrimmICount1
float fPrimmICount2
float fPrimmITracker
float fTheStripFCount1
float fTheStripFCount2
float fTheStripFTracker
float fTheStripICount1
float fTheStripICount2
float fTheStripITracker

float fBoomerFCount1
float fBoomerFCount2
float fBoomerFTracker
float fBoomerICount1
float fBoomerICount2
float fBoomerITracker
float fGreatKhansFCount1
float fGreatKhansFCount2
float fGreatKhansFTracker
float fGreatKhansICount1
float fGreatKhansICount2
float fGreatKhansITracker
float fWhiteGlovesFCount1
float fWhiteGlovesFCount2
float fWhiteGlovesFTracker
float fWhiteGlovesICount1
float fWhiteGlovesICount2
float fWhiteGlovesITracker
float fPowderGangerFCount1
float fPowderGangerFCount2
float fPowderGangerFTracker
float fPowderGangerICount1
float fPowderGangerICount2
float fPowderGangerITracker

float fFollowersFCount1
float fFollowersFCount2
float fFollowersFTracker
float fFollowersICount1
float fFollowersICount2
float fFollowersITracker
float fBrotherhoodFCount1
float fBrotherhoodFCount2
float fBrotherhoodFTracker
float fBrotherhoodICount1
float fBrotherhoodICount2
float fBrotherhoodITracker
float fNCRFCount1
float fNCRFCount2
float fNCRFTracker
float fNCRICount1
float fNCRICount2
float fNCRITracker
float fCaesarsLegionFCount1
float fCaesarsLegionFCount2
float fCaesarsLegionFTracker
float fCaesarsLegionICount1
float fCaesarsLegionICount2
float fCaesarsLegionITracker

BEGIN GameMode

if ( Player.GetEquipped MyArmour == 1 )

if ( Toggle == 0 )
set fTimer to 2

Player.SetReputation RepNVFreeside 1 fFreesideFTracker
Player.SetReputation RepNVFreeside 0 fFreesideITracker
Player.SetReputation RepNVGoodsprings 1 fGoodspringsFTracker
Player.SetReputation RepNVGoodsprings 0 fGoodspringsITracker
Player.SetReputation RepNVNovac 1 fNovacFTracker
Player.SetReputation RepNVNovac 0 fNovacITracker
Player.SetReputation RepNVPrimm 1 fPrimmFTracker
Player.SetReputation RepNVPrimm 0 fPrimmITracker
Player.SetReputation RepNVTheStrip 1 fTheStripFTracker
Player.SetReputation RepNVTheStrip 0 fTheStripITracker

Player.SetReputation RepNVBoomer 1 fBoomerFTracker
Player.SetReputation RepNVBoomer 0 fBoomerITracker
Player.SetReputation RepNVGreatKhans 1 fGreatKhansFTracker
Player.SetReputation RepNVGreatKhans 0 fGreatKhansITracker
Player.SetReputation RepNVWhiteGloveSociety 1 fWhiteGlovesFTracker
Player.SetReputation RepNVWhiteGloveSociety 0 fWhiteGlovesITracker
Player.SetReputation RepNVPowderGanger 1 fPowderGangerFTracker
Player.SetReputation RepNVPowderGanger 0 fPowderGangerITracker

Player.SetReputation RepNVFollowers 1 fFollowersFTracker
Player.SetReputation RepNVFollowers 0 fFollowersITracker
Player.SetReputation RepNVBrotherhood 1 fBrotherhoodFTracker
Player.SetReputation RepNVBrotherhood 0 fBrotherhoodITracker
Player.SetReputation RepNVNCR 1 fNCRFTracker
Player.SetReputation RepNVNCR 0 fNCRITracker
Player.SetReputation RepNVCaesarsLegion 1 fCaesarsLegionFTracker
Player.SetReputation RepNVCaesarsLegion 0 fCaesarsLegionITracker

set Toggle to 1
endif


if ( Toggle == 1 )
if ( fTimer > 0 )
set fTimer to ( fTimer - GetSecondsPassed )

elseif ( iStage == 0 )
set fFreesideFCount1 to ( Player.GetReputation RepNVFreeside 1 )
set fFreesideICount1 to ( Player.GetReputation RepNVFreeside 0 )
set fGoodspringsFCount1 to ( Player.GetReputation RepNVGoodsprings 1 )
set fGoodspringsICount1 to ( Player.GetReputation RepNVGoodsprings 0 )
set fNovacFCount1 to ( Player.GetReputation RepNVNovac 1 )
set fNovacICount1 to ( Player.GetReputation RepNVNovac 0 )
set fPrimmFCount1 to ( Player.GetReputation RepNVPrimm 1 )
set fPrimmICount1 to ( Player.GetReputation RepNVPrimm 0 )
set fTheStripFCount1 to ( Player.GetReputation RepNVTheStrip 1 )
set fTheStripICount1 to ( Player.GetReputation RepNVTheStrip 0 )

set fBoomerFCount1 to ( Player.GetReputation RepNVBoomer 1 )
set fBoomerICount1 to ( Player.GetReputation RepNVBoomer 0 )
set fGreatKhansFCount1 to ( Player.GetReputation RepNVGreatKhans 1 )
set fGreatKhansICount1 to ( Player.GetReputation RepNVGreatKhans 0 )
set fWhiteGlovesFCount1 to ( Player.GetReputation RepNVWhiteGloveSociety 1 )
set fWhiteGlovesICount1 to ( Player.GetReputation RepNVWhiteGloveSociety 0 )
set fPowderGangerFCount1 to ( Player.GetReputation RepNVPowderGanger 1 )
set fPowderGangerICount1 to ( Player.GetReputation RepNVPowderGanger 0 )

set fFollowersFCount1 to ( Player.GetReputation RepNVFollowers 1 )
set fFollowersICount1 to ( Player.GetReputation RepNVFollowers 0 )
set fBrotherhoodFCount1 to ( Player.GetReputation RepNVBrotherhood 1 )
set fBrotherhoodICount1 to ( Player.GetReputation RepNVBrotherhood 0 )
set fNCRFCount1 to ( Player.GetReputation RepNVNCR 1 )
set fNCRICount1 to ( Player.GetReputation RepNVNCR 0 )
set fCaesarsLegionFCount1 to ( Player.GetReputation RepNVCaesarsLegion 1 )
set fCaesarsLegionICount1 to ( Player.GetReputation RepNVCaesarsLegion 0 )

set iStage to 1
set fTimer to 0.01

elseif ( iStage == 1 )
set fFreesideFCount2 to ( Player.GetReputation RepNVFreeside 1 )
set fFreesideICount2 to ( Player.GetReputation RepNVFreeside 0 )
set fGoodspringsFCount2 to ( Player.GetReputation RepNVGoodsprings 1 )
set fGoodspringsICount2 to ( Player.GetReputation RepNVGoodsprings 0 )
set fNovacFCount2 to ( Player.GetReputation RepNVNovac 1 )
set fNovacICount2 to ( Player.GetReputation RepNVNovac 0 )
set fPrimmFCount2 to ( Player.GetReputation RepNVPrimm 1 )
set fPrimmICount2 to ( Player.GetReputation RepNVPrimm 0 )
set fTheStripFCount2 to ( Player.GetReputation RepNVTheStrip 1 )
set fTheStripICount2 to ( Player.GetReputation RepNVTheStrip 0 )

set fBoomerFCount2 to ( Player.GetReputation RepNVBoomer 1 )
set fBoomerICount2 to ( Player.GetReputation RepNVBoomer 0 )
set fGreatKhansFCount2 to ( Player.GetReputation RepNVGreatKhans 1 )
set fGreatKhansICount2 to ( Player.GetReputation RepNVGreatKhans 0 )
set fWhiteGlovesFCount2 to ( Player.GetReputation RepNVWhiteGloveSociety 1 )
set fWhiteGlovesICount2 to ( Player.GetReputation RepNVWhiteGloveSociety 0 )
set fPowderGangerFCount2 to ( Player.GetReputation RepNVPowderGanger 1 )
set fPowderGangerICount2 to ( Player.GetReputation RepNVPowderGanger 0 )

set fFollowersFCount2 to ( Player.GetReputation RepNVFollowers 1 )
set fFollowersICount2 to ( Player.GetReputation RepNVFollowers 0 )
set fBrotherhoodFCount2 to ( Player.GetReputation RepNVBrotherhood 1 )
set fBrotherhoodICount2 to ( Player.GetReputation RepNVBrotherhood 0 )
set fNCRFCount2 to ( Player.GetReputation RepNVNCR 1 )
set fNCRICount2 to ( Player.GetReputation RepNVNCR 0 )
set fCaesarsLegionFCount2 to ( Player.GetReputation RepNVCaesarsLegion 1 )
set fCaesarsLegionICount2 to ( Player.GetReputation RepNVCaesarsLegion 0 )

set iStage to 0
set fTimer to 0
endif
endif


if ( fFreesideFCount2 > fFreesideFCount1 )
set fFreesideFTracker to ( fFreesideFTracker + ( fFreesideFCount2 - fFreesideFCount1 ) )
endif
if ( fFreesideICount2 > fFreesideICount1 )
set fFreesideITracker to ( fFreesideITracker + ( fFreesideICount2 - fFreesideICount1 ) )
endif
if ( fGoodspringsFCount2 > fGoodspringsFCount1 )
set fGoodspringsFTracker to ( fGoodspringsFTracker + ( fGoodspringsFCount2 - fGoodspringsFCount1 ) )
endif
if ( fGoodspringsICount2 > fGoodspringsICount1 )
set fGoodspringsITracker to ( fGoodspringsITracker + ( fGoodspringsICount2 - fGoodspringsICount1 ) )
endif
if ( fNovacFCount2 > fNovacFCount1 )
set fNovacFTracker to ( fNovacFTracker + ( fNovacFCount2 - fNovacFCount1 ) )
endif
if ( fNovacICount2 > fNovacICount1 )
set fNovacITracker to ( fNovacITracker + ( fNovacICount2 - fNovacICount1 ) )
endif
if ( fPrimmFCount2 > fPrimmFCount1 )
set fPrimmFTracker to ( fPrimmFTracker + ( fPrimmFCount2 - fPrimmFCount1 ) )
endif
if ( fPrimmICount2 > fPrimmICount1 )
set fPrimmITracker to ( fPrimmITracker + ( fPrimmICount2 - fPrimmICount1 ) )
endif
if ( fTheStripFCount2 > fTheStripFCount1 )
set fTheStripFTracker to ( fTheStripFTracker + ( fTheStripFCount2 - fTheStripFCount1 ) )
endif
if ( fTheStripICount2 > fTheStripICount1 )
set fTheStripITracker to ( fTheStripITracker + ( fTheStripICount2 - fTheStripICount1 ) )
endif

if ( fBoomerFCount2 > fBoomerFCount1 )
set fBoomerFTracker to ( fBoomerFTracker + ( fBoomerFCount2 - fBoomerFCount1 ) )
endif
if ( fBoomerICount2 > fBoomerICount1 )
set fBoomerITracker to ( fBoomerITracker + ( fBoomerICount2 - fBoomerICount1 ) )
ShowMessage AXL1
ShowMessage AXL2
endif
if ( fGreatKhansFCount2 > fGreatKhansFCount1 )
set fGreatKhansFTracker to ( fGreatKhansFTracker + ( fGreatKhansFCount2 - fGreatKhansFCount1 ) )
endif
if ( fGreatKhansICount2 > fGreatKhansICount1 )
set fGreatKhansITracker to ( fGreatKhansITracker + ( fGreatKhansICount2 - fGreatKhansICount1 ) )
endif
if ( fWhiteGlovesFCount2 > fWhiteGlovesFCount1 )
set fWhiteGlovesFTracker to ( fWhiteGlovesFTracker + ( fWhiteGlovesFCount2 - fWhiteGlovesFCount1 ) )
endif
if ( fWhiteGlovesICount2 > fWhiteGlovesICount1 )
set fWhiteGlovesITracker to ( fWhiteGlovesITracker + ( fWhiteGlovesICount2 - fWhiteGlovesICount1 ) )
endif
if ( fPowderGangerFCount2 > fPowderGangerFCount1 )
set fPowderGangerFTracker to ( fPowderGangerFTracker + ( fPowderGangerFCount2 - fPowderGangerFCount1 ) )
endif
if ( fPowderGangerICount2 > fPowderGangerICount1 )
set fPowderGangerITracker to ( fPowderGangerITracker + ( fPowderGangerICount2 - fPowderGangerICount1 ) )
endif

if ( fFollowersFCount2 > fFollowersFCount1 )
set fFollowersFTracker to ( fFollowersFTracker + ( fFollowersFCount2 - fFollowersFCount1 ) )
endif
if ( fFollowersICount2 > fFollowersICount1 )
set fFollowersITracker to ( fFollowersITracker + ( fFollowersICount2 - fFollowersICount1 ) )
endif
if ( fBrotherhoodFCount2 > fBrotherhoodFCount1 )
set fBrotherhoodFTracker to ( fBrotherhoodFTracker + ( fBrotherhoodFCount2 - fBrotherhoodFCount1 ) )
endif
if ( fBrotherhoodICount2 > fBrotherhoodICount1 )
set fBrotherhoodITracker to ( fBrotherhoodITracker + ( fBrotherhoodICount2 - fBrotherhoodICount1 ) )
endif
if ( fNCRFCount2 > fNCRFCount1 )
set fNCRFTracker to ( fNCRFTracker + ( fNCRFCount2 - fNCRFCount1 ) )
endif
if ( fNCRICount2 > fNCRICount1 )
set fNCRITracker to ( fNCRITracker + ( fNCRICount2 - fNCRICount1 ) )
endif
if ( fCaesarsLegionFCount2 > fCaesarsLegionFCount1 )
set fCaesarsLegionFTracker to ( fCaesarsLegionFTracker + ( fCaesarsLegionFCount2 - fCaesarsLegionFCount1 ) )
endif
if ( fCaesarsLegionICount2 > fCaesarsLegionICount1 )
set fCaesarsLegionITracker to ( fCaesarsLegionITracker + ( fCaesarsLegionICount2 - fCaesarsLegionICount1 ) )
endif


if ( DoOnce == 0 ) || ( DoOnce == 2 )
if ( Player.GetAV Karma >= 500 )

set iStage to 2

if ( DoOnce == 2 )
Player.SetReputation RepNVFreeside 0 fFreesideITracker
Player.SetReputation RepNVGoodsprings 0 fGoodspringsITracker
Player.SetReputation RepNVNovac 0 fNovacITracker
Player.SetReputation RepNVPrimm 0 fPrimmITracker
Player.SetReputation RepNVTheStrip 0 fTheStripITracker

Player.SetReputation RepNVBoomer 1 fBoomerFTracker
Player.SetReputation RepNVBoomer 0 fBoomerITracker
Player.SetReputation RepNVGreatKhans 1 fGreatKhansFTracker
Player.SetReputation RepNVGreatKhans 0 fGreatKhansITracker
Player.SetReputation RepNVWhiteGloveSociety 1 fWhiteGlovesFTracker
Player.SetReputation RepNVWhiteGloveSociety 0 fWhiteGlovesITracker
Player.SetReputation RepNVPowderGanger 1 fPowderGangerFTracker

Player.SetReputation RepNVFollowers 0 fFollowersITracker
Player.SetReputation RepNVBrotherhood 0 fBrotherhoodITracker
Player.SetReputation RepNVNCR 0 fNCRITracker
Player.SetReputation RepNVCaesarsLegion 1 fCaesarsLegionFTracker
endif

Player.AddReputationExact RepNVFreeside 1 70
Player.AddReputationExact RepNVGoodsprings 1 15
Player.AddReputationExact RepNVNovac 1 20
Player.AddReputationExact RepNVPrimm 1 30
Player.AddReputationExact RepNVTheStrip 1 40

Player.AddReputationExact RepNVBoomer 1 8
Player.AddReputationExact RepNVBoomer 0 8
Player.AddReputationExact RepNVGreatKhans 1 5
Player.AddReputationExact RepNVGreatKhans 0 5
Player.AddReputationExact RepNVWhiteGloveSociety 1 2
Player.AddReputationExact RepNVWhiteGloveSociety 0 5
Player.AddReputationExact RepNVPowderGanger 0 15

Player.AddReputationExact RepNVFollowers 1 25
Player.AddReputationExact RepNVBrotherhood 1 10
Player.AddReputationExact RepNVBrotherhood 0 10
Player.AddReputationExact RepNVNCR 1 40
Player.AddReputationExact RepNVNCR 0 12
Player.RemoveReputationExact RepNVCaesarsLegion 1 100
Player.AddReputationExact RepNVCaesarsLegion 0 100

set DoOnce to 1
set iStage to 0
ShowMessage AXL1
endif
endif


if ( DoOnce == 0 ) || ( DoOnce == 1 )
if ( Player.GetAV Karma <= -500 )

set iStage to 2

if ( DoOnce == 1 )
Player.SetReputation RepNVFreeside 1 fFreesideFTracker
Player.SetReputation RepNVGoodsprings 1 fGoodspringsFTracker
Player.SetReputation RepNVNovac 1 fNovacFTracker
Player.SetReputation RepNVPrimm 1 fPrimmFTracker
Player.SetReputation RepNVTheStrip 1 fTheStripFTracker

Player.SetReputation RepNVBoomer 1 fBoomerFTracker
Player.SetReputation RepNVBoomer 0 fBoomerITracker
Player.SetReputation RepNVGreatKhans 1 fGreatKhansFTracker
Player.SetReputation RepNVGreatKhans 0 fGreatKhansITracker
Player.SetReputation RepNVWhiteGloveSociety 1 fWhiteGlovesFTracker
Player.SetReputation RepNVWhiteGloveSociety 0 fWhiteGlovesITracker
Player.SetReputation RepNVPowderGanger 0 fPowderGangerITracker

Player.SetReputation RepNVFollowers 1 fFollowersFTracker
Player.SetReputation RepNVBrotherhood 1 fBrotherhoodFTracker
Player.SetReputation RepNVBrotherhood 0 fBrotherhoodITracker
Player.SetReputation RepNVNCR 1 fNCRFTracker
Player.SetReputation RepNVNCR 0 fNCRITracker
Player.SetReputation RepNVCaesarsLegion 0 fCaesarsLegionITracker
endif

Player.AddReputationExact RepNVFreeside 0 70
Player.AddReputationExact RepNVGoodsprings 0 15
Player.AddReputationExact RepNVNovac 0 20
Player.AddReputationExact RepNVPrimm 0 30
Player.AddReputationExact RepNVTheStrip 0 40

Player.AddReputationExact RepNVBoomer 1 8
Player.AddReputationExact RepNVBoomer 0 8
Player.AddReputationExact RepNVGreatKhans 1 5
Player.AddReputationExact RepNVGreatKhans 0 5
Player.AddReputationExact RepNVWhiteGloveSociety 1 5
Player.AddReputationExact RepNVWhiteGloveSociety 0 2
Player.AddReputationExact RepNVPowderGanger 1 30

Player.AddReputationExact RepNVFollowers 0 25
Player.AddReputationExact RepNVBrotherhood 0 10
Player.AddReputationExact RepNVNCR 0 80
Player.AddReputationExact RepNVCaesarsLegion 1 100
Player.RemoveReputationExact RepNVCaesarsLegion 0 100

set DoOnce to 2
set iStage to 0
ShowMessage AXL2
endif
endif


elseif ( Player.GetEquipped MyArmour == 0 )
set DoOnce to 0
set Toggle to 0
endif

END

 

 

 

Thanks in advance.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...