|
Post by sjeff87 on Jul 26, 2020 4:48:51 GMT -5
I'm trying to get the total amount of followers a sims has and store it in a Python variable. So far I have no luck on finding the function or method that handles the followers.
Does anybody have an idea as to which function or class is used to retrieve this information?
A nudge in the right direction would go a long way.
Regards, Sjeff
|
|
|
Post by sigma1202 on Jul 26, 2020 8:23:37 GMT -5
The simstagram followers are a statistic, you can get them this way, this will only work if you have the playable pets mod, you have to have the pet selected import sims4.commands import services
@sims4.commands.Command('test', command_type=sims4.commands.CommandType.Live)
def testing(_connection=None): output = sims4.commands.CheatOutput(_connection) client = services.client_manager().get_first_client() sim = client.active_sim if sim is not None: for stat in sim.statistics_gen(): if "Simstagram" in str(stat): output(str(stat))
otherwise you can use this instead, its a little bit more manual import sims4.commands import services from objects import ALL_HIDDEN_REASONS
@sims4.commands.Command('test', command_type=sims4.commands.CommandType.Live) def testing(first_name='', last_name='', _connection=None): output = sims4.commands.CheatOutput(_connection) sim = services.sim_info_manager().get_sim_info_by_name(first_name, last_name) instance = sim.get_sim_instance(allow_hidden_flags=ALL_HIDDEN_REASONS) if instance is not None: for stat in instance.statistics_gen(): if "Simstagram" in str(stat): output(str(stat))
you will have to enter your pets name and surname this is the result of both methods, the 21.0 is the number of followers you will have to use regex or something similar to remove the text and get only the value
update: you can actually just change the last line where it says "output(str(stat))" to "output(str(stat._value))" this will give you the value directly, you can also remove the "str" part if you want to have a float variable
|
|
|
Post by sjeff87 on Jul 26, 2020 12:16:47 GMT -5
The simstagram followers are a statistic, you can get them this way, this will only work if you have the playable pets mod, you have to have the pet selected import sims4.commands import services
@sims4.commands.Command('test', command_type=sims4.commands.CommandType.Live)
def testing(_connection=None): output = sims4.commands.CheatOutput(_connection) client = services.client_manager().get_first_client() sim = client.active_sim if sim is not None: for stat in sim.statistics_gen(): if "Simstagram" in str(stat): output(str(stat))
otherwise you can use this instead, its a little bit more manual import sims4.commands import services from objects import ALL_HIDDEN_REASONS
@sims4.commands.Command('test', command_type=sims4.commands.CommandType.Live) def testing(first_name='', last_name='', _connection=None): output = sims4.commands.CheatOutput(_connection) sim = services.sim_info_manager().get_sim_info_by_name(first_name, last_name) instance = sim.get_sim_instance(allow_hidden_flags=ALL_HIDDEN_REASONS) if instance is not None: for stat in instance.statistics_gen(): if "Simstagram" in str(stat): output(str(stat))
you will have to enter your pets name and surname this is the result of both methods, the 21.0 is the number of followers you will have to use regex or something similar to remove the text and get only the value
update: you can actually just change the last line where it says "output(str(stat))" to "output(str(stat._value))" this will give you the value directly, you can also remove the "str" part if you want to have a float variable Thank you so much! Wasn't expecting such a detailed post with example code going with it, kudos to you Sir. Though to get the followers from social media I had to use "Computer_SocialNetwork_Followers" as can be seen from the picture. On the plus side I have access to allot more information which is nice. Anyhow adjusting the code to my needs was easy, again thank you so much. Regards, Sjeff
|
|
|
Post by imoctoberbaby on Dec 9, 2022 23:49:20 GMT -5
Hello, is this a cheat that changes your simstagram follower count? I'm trying to reset my sim completely including their follower count and I wanted to know if this is a cheat for this.
|
|