Discuss Scratch

KeliQub
Scratcher
7 posts

Help With Scripts: Cloud View Counter

I've searched a lot for how to make a view counter, but haven't found anything except for a few discussion pages, that don't give a way how to make one. Can someone help me make one?

Hi! Thanks for looking at my comment. Hope you have a good day. : )
helloworldbyeworld
Scratcher
1000+ posts

Help With Scripts: Cloud View Counter

This requires the use of an external server. The server needs to be a program that runs outside of scratch and sets a cloud variable to the view count, which can be obtained using the Scratch API. On the project, you can display that cloud variable.

You first need to have a way to host a program (like Python) in order to repeatedly set the cloud variable to the view count.

Helloworldbyeworld | 1200+ posts
Have a great day
blablablahello
Scratcher
1000+ posts

Help With Scripts: Cloud View Counter

Or, you could just do “when green flag clicked, if (variable) = 0, change (cloud variable by 1), set (variable to 1)”. and then save the project with the variable manually set to 0, this way, when they click the green flag, the variable changes to 1 and the counter goes up by 1, but if they click it again, the counter does not go up. However, it does go up when they reload the page, luckily, reloading the page DOES indeed add a view count anyways

Highlight, Hold shift, Press down arrow to scroll down


HEHEHEHAW

Everytime someone says “I did a quick search”, I question wether they meant they did a quicksearch (The algorithm) or a quick search (Quickly searching)

鸡你
实在是太美哦贝贝
实在是太美
多一眼就会爆炸
近一点会被融化
干嘛
你干嘛哈哈诶有
oh yea哈哈
多一眼就会爆炸
近一点会~融~化~~~

我个人认为,这个意大利面就应该拌四十二号混凝土,因为这个螺丝钉的长度,很容易会直接影响到挖掘机的扭矩,你知道吧,你往里砸的时候,一瞬间,他就会产生大量的高能蛋白,俗称UFO,会严重影响经济的发展,甚至对整个太平洋以及充电器,都会造成一定的核污染,你知道吧,啊,再者说根据勾股定理,你可以很容易的推断出,人工饲养的东条鹰鸡,它是可以捕获野生的三角函数的,所以说这个这个这个,你不管秦始皇的切面是否具有放射性,特朗普的n次方,是否含有沉淀物,都不应影响这个这个沃尔玛跟维尔康在南极汇合,啊!

大家好,我是练习两年半的个人练习生蔡徐坤!我喜欢唱,跳,rap,还有打篮球

早上好中国我喜欢吃冰淇凌!



















why are you down here why are you down here why are you down here




lion334
Scratcher
100+ posts

Help With Scripts: Cloud View Counter

Hi, this is lion334

I'd recommend something similar to “blablablahello”'s Idea:

1. Make a cloud variable
(☁ views)

2. Code this:
when green flag clicked
change [views] by (1)

This is the only method (which I could find) that is simple. Keep in mind that Scratch counts the users that viewed your Project, so for Scratch it wouldn't matter if a User looks at your Project 100+ Times, it wouldn't affect the Views.

From time to time, the “views” variable will be higher than the actual views of the Projects due to this mentioned above. That's why if it's nescessarly that it's the same, you'd have to code an endless long Databank with Usernames of people that viewed your Project in it. However, this is complicated and I don't recommend doing this while only being on Scratch for a month.

Sincerely, lion334

Hi, I'm Mirau or lion334

Made some cool game a while ago: You're not gonna click it though… right?


JIM-13
Scratcher
9 posts

Help With Scripts: Cloud View Counter

lion334 wrote:

Hi, this is lion334

I'd recommend something similar to “blablablahello”'s Idea:

1. Make a cloud variable
(☁ views)

2. Code this:
when green flag clicked
change [views] by (1)

This is the only method (which I could find) that is simple. Keep in mind that Scratch counts the users that viewed your Project, so for Scratch it wouldn't matter if a User looks at your Project 100+ Times, it wouldn't affect the Views.

From time to time, the “views” variable will be higher than the actual views of the Projects due to this mentioned above. That's why if it's nescessarly that it's the same, you'd have to code an endless long Databank with Usernames of people that viewed your Project in it. However, this is complicated and I don't recommend doing this while only being on Scratch for a month.

Sincerely, lion334

It dosent work for me, Please make something work!

Powered by DjangoBB