Forum

Please note that you can subscribe to the individual forums. A subscription for news only covers the news.

Bug: Unlimited time...
 
Notifications
Clear all

Bug: Unlimited times a merit can be added

5 Posts
2 Users
0 Likes
133 Views
0
Topic starter

I have found that a variable having a set number of merits can be awarded multiple times in  Report when reporting the activity is completed.

A fix should reset the variable to zero after the merits has been updated.

4 Answers
0

I don't understand the situation. Can you please explain.

VM does not, and should not, change variables after they have been used. That is your own responsibility.

If you think there is a bug, please make a short script showing the problem.

Sven

motseln motseln Topic starter 02/10/2022 9:37 pm

@admin

Say you set a variable to 100 points to add when task has been completed.

It is possible to report the task completed multiple times in a row, each time 100 points will be added. The task was done 1 time, but can be repeatedly reported as done multiple times.

Somehow the variable should set to zero or VM should not allow multiple attempts to report the same task in a short timeperiod.

0

@motseln

Exactly how do you specify that the variable is used to add merit points?

Sven

0
Topic starter
Sven
here is a snipit
 
[popup-PenisGag]
message=It is time to wear your penis gag
notif=PenisGag
notif=TooSoonPenisGag
procedure=SelectAGag
Weight=10

[flag-TooSoonPenisGag]
;Prevent too frequent use
Duration=01:00:00,02:15:00

[procedure-SelectAGag]
;select the penis gag to be worn
random#=#GagFactor,3
case=first
when=#GagFactor=1
set$=$GagColor, medium black penis gag
when=#GagFactor=2
set$=$GagColor, large black penis gag
when=#GagFactor=3
set$=$GagColor, pink penis gag
case=end
message=You will wear the {$GagColor}
ClothReport=Report wearing the {$GagColor}
Question=GagReady

[Question-GagReady]
Phrase=Is your {$GagColor} on?
?Yes=PenisGagIsIn

[procedure-PenisGagIsIn]
setflag=PenisGag
set#=#pGagStart,#zzSecondsPassed

[flag-PenisGag]
text=Keep the {$GagColor} on until you are allowed to take it off
Duration=00:20:05,00:44:00
ExpireProcedure=RemovePenisGag

[Procedure-RemovePenisGag]
set#=#pGagEnd,#zzSecondsPassed
sound=chimes.wav
set#=#seconds,#pGagEnd
subtract#=#seconds,#pGagStart
message=You can remove the {$GagColor} now.
message={$GagColor} worn {!zzduration}
ClothReport=Remove the {$GagColor}
message=Report {$GagColor} worn via reports
setflag=TooSoonPenisGag

[Report-Wore gag]
case=first
   when=#seconds<1701
      Set#=#Earned,150
   when=#seconds<2201
      Set#=#Earned,300
   when=#seconds>2200
      Set#=#Earned,600
case=end

case=first
   when=#GagFactor=1
      AddMerits=#Earned
   when=#GagFactor=2
       AddMerits=#Earned
       AddMerits=#Earned
   when=#GagFactor=3
      AddMerits=#Earned
      AddMerits=#Earned
      AddMerits=#Earned
   case=end
   Set#=#Earned,0

 
You can repeatedly report "Wore gag"  multiple times and be rewarded with merits each time.
 
Now seeing this snipit I think the answer is to set both the #seconds = 0   and #GagFactor =0.
 
Also add when=#GagFactor=0   | Set#=#Earned,0
 
 
motseln
0

You are right. It is your code, so it is you who must zero the variables.

You also might want to add this:

[Report-Wore gag]
NotIf=#GagFactor=0
case=first
etc.

That will prevent the report from be called more than once.

Sven