Points and functions still don't work consistently


#1

https://community.phantombot.tv/t/inconsistent-points-functions-several-functions-dont-work/2290

So we’re a month and several streaming sessions later and in short, nothing’s changed.

There’s no errors in the logs, group commands don’t work, points dispersal isn’t happening, and everything else works tickety boo.

Everything will ‘just work’ at random intervals and then ‘just not work a moment’ later.

Could it be losing connection? Could it be corrupting cache? Could it be losing track of people somehow?

I can target people and give them points
I renamed my points to there is a singular and a separate plural (although using the points command didn’t seem disturbed by this)
I updated, and carried my database over
I have started fresh and copied my points rows in, leaving everything else behind

Is it possible for a username to have corrupted the database? Emojis in the name or some such? Any ideas, anything that you think could be a lead.


#2
  1. Version
  2. OS and now I am curious about hardware type
  3. Using another DB solution like MySQL instead of the built-in SQLite3?
  4. Are you changing scripts at all?
  5. Are you installing changes while the bot runs?
  6. Can you show me the logs/pointSystem logs?

#3

I’ve had this issue across versions. I haven’t installed the latest version, I’m one behind.
I’ve had this with stable and nightly.

Linux Mint, AMD cpu, MSI motherboard, 6 gb RAM, GeForce something or other.

Oracle Java runs PhantomBot.

I have written several scripts but have not hacked any of core.

I have worked on the bot while it’s running with the appropriate development flag turned on, but not since I reinstalled it.

Logs below (not a joke, copied straight from the file):

[11-01-2017 @ 07:00:00.542 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:01:00.542 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:02:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:03:00.543 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:04:00.543 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:05:00.543 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:06:00.543 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:07:00.543 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:08:00.542 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:09:00.543 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:10:00.542 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:11:00.543 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:12:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:13:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:14:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:15:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:16:00.543 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:17:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:18:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:19:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:20:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:21:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:22:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:23:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:24:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:25:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:26:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:27:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:28:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:29:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:30:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:31:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:32:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:33:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:34:00.544 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:35:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:36:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:37:00.546 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:38:00.545 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:39:00.546 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:40:00.546 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:41:00.546 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:42:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:43:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:44:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:45:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:46:00.546 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:47:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:48:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:49:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:50:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:51:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:52:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:53:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:54:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:55:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:56:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:57:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:58:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 07:59:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:00:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:01:00.547 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:02:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:03:00.549 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:04:00.564 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:05:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:06:00.549 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:07:00.548 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:08:00.549 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:09:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:10:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:11:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:12:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:13:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:14:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:15:00.549 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:16:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:17:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:18:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:19:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:20:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:21:00.549 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:22:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:23:00.549 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:24:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:25:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:26:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:27:00.549 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:28:00.550 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:29:00.549 GMT] Executed xp payouts. Users: none
[11-01-2017 @ 08:30:00.549 GMT] Executed xp payouts. Users: none
ad nauseum. It doesn’t change.

[11-02-2017 @ 06:55:00.665 GMT] Executed xp payouts. Users: none
[11-02-2017 @ 06:56:00.664 GMT] Executed xp payouts. Users: none
[11-02-2017 @ 06:57:00.665 GMT] Executed xp payouts. Users: none
[11-02-2017 @ 06:58:00.665 GMT] Executed xp payouts. Users: none


#4

My theory is that it’s losing track of the users and not keeping a list properly…


#5

Which specific version? There have been adjustments to the user cache trying to pull from TMI. But I need the specific version.

Working with the development flag on is bad, it essentially renders the bot in some ways unstable. It allows for data stored in the scripts to be destroyed if scripts are detected to have been touched during run time. We only use it when debugging scripts, mostly, on the development side. I can reproduce the above in development mode pretty easily. Why would you have the bot in development mode unless you are modifying scripts? Do you really have a stock version? Any custom scripts at all in your installation?


#6

2.3.9

I’m not currently running with dev flag on

The bot has my custom scripts running. I haven’t hacked core.


#7

Custom scripts can damage the data that is used to hold the user lists. The user lists are not stored in the Core, but in the scripts. At a minimum, the bot would always be present and receiving points, if even the bot is removed, then something is wiping your user list. When your bot first boots up, does it assign the bot points at least?

I notice when you previously posted, you were able to resolve the issue after a fresh install. What changed in your installation between the time it was working and when it stopped working? Also, can you reproduce in a stock 2.3.9 without any of your additional modules?


#8

I don’t know if it assigns anything to the bot, I hadn’t checked.

By core, I mean I haven’t rewritten any of the core scripts.

I don’t know what you mean by ‘the user lists are not stored in the Core, but in the scripts.’ However, yes, I can attest that something is wiping my user lists because it will work, but then not work.

What must have ‘changed’ was whatever causes the issue to take place.

Waitaminute… the users are kept in a variable… what’s that variable called?

At one point in my logic I state users = Number.parseInt(record.users)

I assume I should be name spacing? Is the userlist stored in a javascript variable called users?

K, no, the variable in question is $.users… or would I overwrite that… because I’m running my script… as part of the object…

/me facepalms

That’s my issue isn’t it, @IllusionaryOne, @ScaniaTV…?


#9

We consider the “Core” the Java Core and the scripts the “scripts/” portion. It is a little murky with the “core/” directory. It depends where you are defining users, it could be having a scope issue. Rhino has been known to do some odd things. Give it a whirl once without your script with that and see how things work, it is an easy enough check. Like I said before, at a minimum the bot should always be in users.


#10

So it turns out that that was my issue.

Word to the wise: Do NOT share variable names, even if the scope is different. This is javascript, scope is a variable in and of itself :wink:

Literally all I did was rename all occurences of ‘users’ to total_users and everything is finally working.

Thank you, @IllusionaryOne.

Remember folks: Namespace.


#11

I am glad that it is working now! I still had thought that Rhino was smarter than the average bear, but, obviously not! Sorry I had drug you around to get to the answer, if I probably just started with custom scripts, I would have saved you some time.

Cheers!


#12

If I’d have thought to test my code, I’d have saved us a all a lot of time :slight_smile:

Sincerely appreciate you guys. This bot engine is amazing :pray:


#13

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.