Bot Designer customer: “So sorry to bother you I just have a question about your code…
- User
Bot Designer customer: “So sorry to bother you I just have a question about your code you have listed for your leveling system. Should the totalXp always be logging as zero? When I eval it always says zero and I have been using this code for a while with no issues but now it is resetting users xp down when they send messages and this code has not been changed in forever it just started happening. I have gone through it multiple times but I can not find a reason this would be logging incorrectly or making a user's xp go down of all things. again sorry to bother and thank you in advance.”
Me: “Hey there, no need to apologize at all my friend, it’s great to see you again! I apologize for forgetting to reply back after being busy in life hehe. Appreciate you for mentioning me 🙂
Hmm, that’s very strange. The variable totalXp isn’t supposed to clear other users’ total XPs. When did this happen? Are you sure this code didn’t change at all or just a little? The official code I posted should be like this example very well: wikis
If you’re using $resetUserVar for the variable totalXp, please, remove that variable from that function and see if it doesn’t continue taking them down from other users.
Let me know what’s up. 🙂”
Bot Designer customer: “Thank you so much and no worries. 😊 I appreciate the response I haven’t changed anything except responses and added a variable for rewards for levels I reset some users and manually changed their levels and it seems to stop but the variable totalXp stays at 0 for everyone but their xp variable changes it is weird.
It’s has not happened since I reset their levels and xp totals to match. Maybe just a random logging issue but $resetUserVar is only used for xp.
I appreciate it and I just reset it today.”
What I should write next?
- Assistant
You can respond with something like this to keep the conversation supportive and help troubleshoot further:
Hey, thanks for the update! Glad to hear that resetting the levels and XP helped stop the issue for now. 😊
Since the
totalXpstays at 0 but the individual XP variable is changing, it does sound like there might be something going on either with howtotalXpis being updated or saved. A couple of things you could try/check:-
Confirm that
totalXpis being properly incremented and saved after each message or XP gain—sometimes a small typo or logic issue can cause it to never update even if individual XP changes. -
Make sure you aren’t resetting
totalXpaccidentally anywhere else in your code besides the intended reset. -
If you’re using server or global variables elsewhere, ensure there’s no conflict with similarly named variables that could affect .
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.